From f39025df53aa23795aff8f114298c7706358fd26 Mon Sep 17 00:00:00 2001 From: hatim boufnichel Date: Sun, 6 Nov 2022 20:26:14 +0100 Subject: [PATCH] wip --- .gitignore | 3 +- example.env | 5 + package-lock.json | 217 + package.json | 10 +- proto/CODEGEN.md | 2 + proto/autogenerated/debug.txt | 617 +- proto/autogenerated/ts/express_server.ts | 5 +- proto/autogenerated/ts/http_client.ts | 4 +- proto/autogenerated/ts/types.ts | 433 +- proto/lnd/invoices.client.ts | 24 +- proto/lnd/invoices.ts | 229 +- .../{rpc.client.ts => lightning.client.ts} | 496 +- proto/lnd/{rpc.ts => lightning.ts} | 4978 ++++++++++++++--- proto/lnd/router.client.ts | 64 +- proto/lnd/router.ts | 628 ++- proto/others/invoices.proto | 61 +- proto/others/{rpc.proto => lightning.proto} | 846 ++- proto/others/router.proto | 74 +- proto/service/methods.proto | 2 +- proto/service/structs.proto | 15 +- src/auth.ts | 16 +- src/index.spec.ts | 54 +- src/index.ts | 12 +- src/server.ts | 4 - src/services/lnd/addInvoiceReq.ts | 34 + src/services/lnd/index.spec.ts | 36 + src/services/lnd/index.ts | 208 +- src/services/lnd/openChannelReq.ts | 32 + src/services/lnd/payInvoiceReq.ts | 30 + src/services/main/index.ts | 94 +- src/services/serverMethods/index.ts | 12 +- src/services/storage/db.ts | 31 +- .../storage/entity/AddressTransaction.ts | 23 + src/services/storage/entity/User.ts | 4 +- src/services/storage/entity/UserAddress.ts | 19 + src/services/storage/entity/UserInvoice.ts | 25 + src/services/storage/entity/UserPayment.ts | 19 + src/services/storage/index.ts | 95 +- tsconfig.json | 2 +- 39 files changed, 7571 insertions(+), 1892 deletions(-) create mode 100644 example.env create mode 100644 proto/CODEGEN.md rename proto/lnd/{rpc.client.ts => lightning.client.ts} (81%) rename proto/lnd/{rpc.ts => lightning.ts} (80%) rename proto/others/{rpc.proto => lightning.proto} (80%) delete mode 100644 src/server.ts create mode 100644 src/services/lnd/addInvoiceReq.ts create mode 100644 src/services/lnd/index.spec.ts create mode 100644 src/services/lnd/openChannelReq.ts create mode 100644 src/services/lnd/payInvoiceReq.ts create mode 100644 src/services/storage/entity/AddressTransaction.ts create mode 100644 src/services/storage/entity/UserAddress.ts create mode 100644 src/services/storage/entity/UserInvoice.ts create mode 100644 src/services/storage/entity/UserPayment.ts diff --git a/.gitignore b/.gitignore index 045918c3..ab360761 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ tmp/ temp/ .env build/ -db.sqlite \ No newline at end of file +db.sqlite +.key/ \ No newline at end of file diff --git a/example.env b/example.env new file mode 100644 index 00000000..be980418 --- /dev/null +++ b/example.env @@ -0,0 +1,5 @@ +LND_ADDRESS= +LND_CERT_PATH= +LND_MACAROON_PATH= +DATABASE_FILE=db.sqlite +JWT_SECRET=bigsecrethere \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 98dfc8ed..f22f0f0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "eccrypto": "^1.1.6", "express": "^4.18.1", "grpc-tools": "^1.11.2", + "jsonwebtoken": "^8.5.1", "lodash": "^4.17.21", "pg": "^8.4.0", "reflect-metadata": "^0.1.13", @@ -39,6 +40,7 @@ "devDependencies": { "@types/cors": "^2.8.12", "@types/eccrypto": "^1.1.3", + "@types/jsonwebtoken": "^8.5.9", "@types/lodash": "^4.14.182", "@types/node": "^16.11.10", "@types/uuid": "^8.3.4", @@ -386,6 +388,15 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, + "node_modules/@types/jsonwebtoken": { + "version": "8.5.9", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", + "integrity": "sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/lodash": { "version": "4.14.182", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz", @@ -807,6 +818,11 @@ "ieee754": "^1.2.1" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -1242,6 +1258,14 @@ "node": ">=4.0.0" } }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -1886,6 +1910,59 @@ "json5": "lib/cli.js" } }, + "node_modules/jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=4", + "npm": ">=1.4.28" + } + }, + "node_modules/jsonwebtoken/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/jsonwebtoken/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -1896,6 +1973,41 @@ "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "node_modules/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", @@ -4010,6 +4122,15 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, + "@types/jsonwebtoken": { + "version": "8.5.9", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", + "integrity": "sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/lodash": { "version": "4.14.182", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.182.tgz", @@ -4344,6 +4465,11 @@ "ieee754": "^1.2.1" } }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -4680,6 +4806,14 @@ } } }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -5184,6 +5318,54 @@ "minimist": "^1.2.0" } }, + "jsonwebtoken": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + "requires": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^5.6.0" + }, + "dependencies": { + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -5194,6 +5376,41 @@ "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", diff --git a/package.json b/package.json index edf745ea..f2279693 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,9 @@ "eccrypto": "^1.1.6", "express": "^4.18.1", "grpc-tools": "^1.11.2", + "jsonwebtoken": "^8.5.1", "lodash": "^4.17.21", + "pg": "^8.4.0", "reflect-metadata": "^0.1.13", "rimraf": "^3.0.2", "rxjs": "^7.5.5", @@ -46,17 +48,17 @@ "ts-proto": "^1.112.1", "typeorm": "0.3.10", "typescript": "^4.6.4", - "uuid": "^8.3.2", - "pg": "^8.4.0" + "uuid": "^8.3.2" }, "devDependencies": { "@types/cors": "^2.8.12", "@types/eccrypto": "^1.1.3", + "@types/jsonwebtoken": "^8.5.9", "@types/lodash": "^4.14.182", + "@types/node": "^16.11.10", "@types/uuid": "^8.3.4", "testyts": "^1.5.0", "ts-node": "10.7.0", - "@types/node": "^16.11.10", "typescript": "4.5.2" } -} \ No newline at end of file +} diff --git a/proto/CODEGEN.md b/proto/CODEGEN.md new file mode 100644 index 00000000..82f63fb1 --- /dev/null +++ b/proto/CODEGEN.md @@ -0,0 +1,2 @@ +create lnd classes: `npx protoc -I ./others --ts_out=./lnd others/*` +create server classes: `npx protoc -I ./service --pub_out=. service/*` \ No newline at end of file diff --git a/proto/autogenerated/debug.txt b/proto/autogenerated/debug.txt index deef9c2a..538bc2c2 100644 --- a/proto/autogenerated/debug.txt +++ b/proto/autogenerated/debug.txt @@ -1,5 +1,5 @@ ([]*main.Method) (len=11 cap=16) { - (*main.Method)(0xc0002b6730)({ + (*main.Method)(0xc0002886e0)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -9,8 +9,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0003f2480)({ - authType: (*main.supportedAuth)(0xc0003c3dd0)({ + opts: (*main.methodOptions)(0xc0003cc420)({ + authType: (*main.supportedAuth)(0xc000379fb0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -25,7 +25,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002b6780)({ + (*main.Method)(0xc000288730)({ in: (main.MethodMessage) { name: (string) (len=25) "EncryptionExchangeRequest", hasZeroFields: (bool) false @@ -35,8 +35,8 @@ name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - opts: (*main.methodOptions)(0xc0003f2600)({ - authType: (*main.supportedAuth)(0xc0003c3ec0)({ + opts: (*main.methodOptions)(0xc0003cc5a0)({ + authType: (*main.supportedAuth)(0xc0003d60c0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -51,7 +51,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002b67d0)({ + (*main.Method)(0xc000288780)({ in: (main.MethodMessage) { name: (string) (len=17) "LndGetInfoRequest", hasZeroFields: (bool) false @@ -61,8 +61,8 @@ name: (string) (len=18) "LndGetInfoResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0003f2780)({ - authType: (*main.supportedAuth)(0xc0003c3f80)({ + opts: (*main.methodOptions)(0xc0003cc720)({ + authType: (*main.supportedAuth)(0xc0003d6180)({ id: (string) (len=5) "admin", name: (string) (len=5) "Admin", encrypted: (bool) true, @@ -78,7 +78,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002b6820)({ + (*main.Method)(0xc0002887d0)({ in: (main.MethodMessage) { name: (string) (len=14) "AddUserRequest", hasZeroFields: (bool) false @@ -88,8 +88,8 @@ name: (string) (len=15) "AddUserResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0003f2900)({ - authType: (*main.supportedAuth)(0xc0003fe060)({ + opts: (*main.methodOptions)(0xc0003cc8a0)({ + authType: (*main.supportedAuth)(0xc0003d6240)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -104,7 +104,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002b6870)({ + (*main.Method)(0xc000288820)({ in: (main.MethodMessage) { name: (string) (len=15) "AuthUserRequest", hasZeroFields: (bool) false @@ -114,8 +114,8 @@ name: (string) (len=16) "AuthUserResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0003f2a80)({ - authType: (*main.supportedAuth)(0xc0003fe120)({ + opts: (*main.methodOptions)(0xc0003cca20)({ + authType: (*main.supportedAuth)(0xc0003d6300)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -130,18 +130,18 @@ query: ([]string) }) }), - (*main.Method)(0xc0002b6910)({ + (*main.Method)(0xc0002888c0)({ in: (main.MethodMessage) { - name: (string) (len=5) "Empty", - hasZeroFields: (bool) true + name: (string) (len=17) "NewAddressRequest", + hasZeroFields: (bool) false }, name: (string) (len=10) "NewAddress", out: (main.MethodMessage) { name: (string) (len=18) "NewAddressResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0003f2c00)({ - authType: (*main.supportedAuth)(0xc0003fe1e0)({ + opts: (*main.methodOptions)(0xc0003ccba0)({ + authType: (*main.supportedAuth)(0xc0003d63c0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -157,7 +157,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002b69b0)({ + (*main.Method)(0xc000288960)({ in: (main.MethodMessage) { name: (string) (len=17) "PayAddressRequest", hasZeroFields: (bool) false @@ -167,8 +167,8 @@ name: (string) (len=18) "PayAddressResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0003f2d80)({ - authType: (*main.supportedAuth)(0xc0003fe2a0)({ + opts: (*main.methodOptions)(0xc0003ccd20)({ + authType: (*main.supportedAuth)(0xc0003d6480)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -184,7 +184,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002b6a50)({ + (*main.Method)(0xc000288a00)({ in: (main.MethodMessage) { name: (string) (len=17) "NewInvoiceRequest", hasZeroFields: (bool) false @@ -194,8 +194,8 @@ name: (string) (len=18) "NewInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0003f2f00)({ - authType: (*main.supportedAuth)(0xc0003fe360)({ + opts: (*main.methodOptions)(0xc0003ccea0)({ + authType: (*main.supportedAuth)(0xc0003d6540)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -211,7 +211,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002b6af0)({ + (*main.Method)(0xc000288aa0)({ in: (main.MethodMessage) { name: (string) (len=17) "PayInvoiceRequest", hasZeroFields: (bool) false @@ -221,8 +221,8 @@ name: (string) (len=18) "PayInvoiceResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0003f3080)({ - authType: (*main.supportedAuth)(0xc0003fe420)({ + opts: (*main.methodOptions)(0xc0003cd020)({ + authType: (*main.supportedAuth)(0xc0003d6600)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -238,7 +238,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002b6b90)({ + (*main.Method)(0xc000288b40)({ in: (main.MethodMessage) { name: (string) (len=18) "OpenChannelRequest", hasZeroFields: (bool) false @@ -248,8 +248,8 @@ name: (string) (len=19) "OpenChannelResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0003f3200)({ - authType: (*main.supportedAuth)(0xc0003fe4e0)({ + opts: (*main.methodOptions)(0xc0003cd1a0)({ + authType: (*main.supportedAuth)(0xc0003d66c0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -265,7 +265,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002b6be0)({ + (*main.Method)(0xc000288b90)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true @@ -275,8 +275,8 @@ name: (string) (len=27) "GetOpenChannelLNURLResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0003f3380)({ - authType: (*main.supportedAuth)(0xc0003fe5a0)({ + opts: (*main.methodOptions)(0xc0003cd320)({ + authType: (*main.supportedAuth)(0xc0003d6780)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -294,83 +294,32 @@ }) } -([]*main.Enum) +([]*main.Enum) (len=1 cap=1) { + (*main.Enum)(0xc000379860)({ + name: (string) (len=11) "AddressType", + values: ([]main.EnumValue) (len=3 cap=4) { + (main.EnumValue) { + number: (int64) 0, + name: (string) (len=19) "WITNESS_PUBKEY_HASH" + }, + (main.EnumValue) { + number: (int64) 1, + name: (string) (len=18) "NESTED_PUBKEY_HASH" + }, + (main.EnumValue) { + number: (int64) 2, + name: (string) (len=14) "TAPROOT_PUBKEY" + } + } + }) +} -(map[string]*main.Message) (len=18) { - (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc0002470c0)({ - fullName: (string) (len=18) "LndGetInfoResponse", - name: (string) (len=18) "LndGetInfoResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003c3260)({ - name: (string) (len=5) "alias", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000247200)({ - fullName: (string) (len=18) "NewInvoiceResponse", - name: (string) (len=18) "NewInvoiceResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003c3380)({ - name: (string) (len=7) "invoice", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000247240)({ - fullName: (string) (len=17) "PayInvoiceRequest", - name: (string) (len=17) "PayInvoiceRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003c33b0)({ - name: (string) (len=6) "invoce", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc000247040)({ - fullName: (string) (len=25) "EncryptionExchangeRequest", - name: (string) (len=25) "EncryptionExchangeRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003c31d0)({ - name: (string) (len=10) "public_key", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0003c3200)({ - name: (string) (len=9) "device_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc000247080)({ +(map[string]*main.Message) (len=19) { + (string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc000215140)({ fullName: (string) (len=17) "LndGetInfoRequest", name: (string) (len=17) "LndGetInfoRequest", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003c3230)({ + (*main.Field)(0xc000379320)({ name: (string) (len=7) "node_id", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -381,12 +330,12 @@ }) } }), - (string) (len=18) "NewAddressResponse": (*main.Message)(0xc000247100)({ - fullName: (string) (len=18) "NewAddressResponse", - name: (string) (len=18) "NewAddressResponse", + (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc000215180)({ + fullName: (string) (len=18) "LndGetInfoResponse", + name: (string) (len=18) "LndGetInfoResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003c3290)({ - name: (string) (len=7) "address", + (*main.Field)(0xc000379350)({ + name: (string) (len=5) "alias", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -396,11 +345,26 @@ }) } }), - (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc0002471c0)({ + (string) (len=17) "NewAddressRequest": (*main.Message)(0xc0002151c0)({ + fullName: (string) (len=17) "NewAddressRequest", + name: (string) (len=17) "NewAddressRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc000379380)({ + name: (string) (len=12) "address_type", + kind: (string) (len=11) "AddressType", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) true, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc0002152c0)({ fullName: (string) (len=17) "NewInvoiceRequest", name: (string) (len=17) "NewInvoiceRequest", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003c3350)({ + (*main.Field)(0xc000379470)({ name: (string) (len=11) "amount_sats", kind: (string) (len=5) "int64", isMap: (bool) false, @@ -411,169 +375,11 @@ }) } }), - (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc0002472c0)({ - fullName: (string) (len=18) "OpenChannelRequest", - name: (string) (len=18) "OpenChannelRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0003c3410)({ - name: (string) (len=11) "destination", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0003c3440)({ - name: (string) (len=15) "channel_balance", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0003c3470)({ - name: (string) (len=11) "push_amount", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=14) "AddUserRequest": (*main.Message)(0xc000247380)({ - fullName: (string) (len=14) "AddUserRequest", - name: (string) (len=14) "AddUserRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0003c3500)({ - name: (string) (len=12) "callback_url", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0003c3530)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0003c3560)({ - name: (string) (len=6) "secret", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=15) "AuthUserRequest": (*main.Message)(0xc000247400)({ - fullName: (string) (len=15) "AuthUserRequest", - name: (string) (len=15) "AuthUserRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003c35f0)({ - name: (string) (len=4) "name", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0003c3620)({ - name: (string) (len=6) "secret", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=17) "PayAddressRequest": (*main.Message)(0xc000247140)({ - fullName: (string) (len=17) "PayAddressRequest", - name: (string) (len=17) "PayAddressRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003c32c0)({ - name: (string) (len=7) "address", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0003c32f0)({ - name: (string) (len=10) "amout_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "PayAddressResponse": (*main.Message)(0xc000247180)({ - fullName: (string) (len=18) "PayAddressResponse", - name: (string) (len=18) "PayAddressResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003c3320)({ - name: (string) (len=5) "tx_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=16) "AuthUserResponse": (*main.Message)(0xc000247440)({ - fullName: (string) (len=16) "AuthUserResponse", - name: (string) (len=16) "AuthUserResponse", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003c3650)({ - name: (string) (len=7) "user_id", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }), - (*main.Field)(0xc0003c3680)({ - name: (string) (len=10) "auth_token", - kind: (string) (len=6) "string", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=5) "Empty": (*main.Message)(0xc000247000)({ - fullName: (string) (len=5) "Empty", - name: (string) (len=5) "Empty", - fields: ([]*main.Field) - }), - (string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc000247280)({ + (string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc000215380)({ fullName: (string) (len=18) "PayInvoiceResponse", name: (string) (len=18) "PayInvoiceResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003c33e0)({ + (*main.Field)(0xc000379530)({ name: (string) (len=8) "preimage", kind: (string) (len=6) "string", isMap: (bool) false, @@ -584,11 +390,11 @@ }) } }), - (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000247300)({ + (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000215400)({ fullName: (string) (len=19) "OpenChannelResponse", name: (string) (len=19) "OpenChannelResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003c34a0)({ + (*main.Field)(0xc000379620)({ name: (string) (len=10) "channel_id", kind: (string) (len=6) "string", isMap: (bool) false, @@ -599,11 +405,89 @@ }) } }), - (string) (len=27) "GetOpenChannelLNURLResponse": (*main.Message)(0xc000247340)({ + (string) (len=18) "PayAddressResponse": (*main.Message)(0xc000215280)({ + fullName: (string) (len=18) "PayAddressResponse", + name: (string) (len=18) "PayAddressResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc000379440)({ + name: (string) (len=5) "tx_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000215340)({ + fullName: (string) (len=17) "PayInvoiceRequest", + name: (string) (len=17) "PayInvoiceRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0003794d0)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000379500)({ + name: (string) (len=6) "amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc000215100)({ + fullName: (string) (len=25) "EncryptionExchangeRequest", + name: (string) (len=25) "EncryptionExchangeRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0003792c0)({ + name: (string) (len=10) "public_key", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003792f0)({ + name: (string) (len=9) "device_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "NewAddressResponse": (*main.Message)(0xc000215200)({ + fullName: (string) (len=18) "NewAddressResponse", + name: (string) (len=18) "NewAddressResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0003793b0)({ + name: (string) (len=7) "address", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=27) "GetOpenChannelLNURLResponse": (*main.Message)(0xc000215440)({ fullName: (string) (len=27) "GetOpenChannelLNURLResponse", name: (string) (len=27) "GetOpenChannelLNURLResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003c34d0)({ + (*main.Field)(0xc000379650)({ name: (string) (len=5) "lnurl", kind: (string) (len=6) "string", isMap: (bool) false, @@ -614,11 +498,44 @@ }) } }), - (string) (len=15) "AddUserResponse": (*main.Message)(0xc0002473c0)({ + (string) (len=14) "AddUserRequest": (*main.Message)(0xc000215480)({ + fullName: (string) (len=14) "AddUserRequest", + name: (string) (len=14) "AddUserRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc000379680)({ + name: (string) (len=12) "callback_url", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003796b0)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003796e0)({ + name: (string) (len=6) "secret", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=15) "AddUserResponse": (*main.Message)(0xc0002154c0)({ fullName: (string) (len=15) "AddUserResponse", name: (string) (len=15) "AddUserResponse", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003c3590)({ + (*main.Field)(0xc000379710)({ name: (string) (len=7) "user_id", kind: (string) (len=6) "string", isMap: (bool) false, @@ -627,7 +544,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0003c35c0)({ + (*main.Field)(0xc000379740)({ name: (string) (len=10) "auth_token", kind: (string) (len=6) "string", isMap: (bool) false, @@ -637,10 +554,144 @@ isOptional: (bool) false }) } + }), + (string) (len=15) "AuthUserRequest": (*main.Message)(0xc000215500)({ + fullName: (string) (len=15) "AuthUserRequest", + name: (string) (len=15) "AuthUserRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc000379770)({ + name: (string) (len=4) "name", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003797a0)({ + name: (string) (len=6) "secret", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=16) "AuthUserResponse": (*main.Message)(0xc000215540)({ + fullName: (string) (len=16) "AuthUserResponse", + name: (string) (len=16) "AuthUserResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0003797d0)({ + name: (string) (len=7) "user_id", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000379800)({ + name: (string) (len=10) "auth_token", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=5) "Empty": (*main.Message)(0xc0002150c0)({ + fullName: (string) (len=5) "Empty", + name: (string) (len=5) "Empty", + fields: ([]*main.Field) + }), + (string) (len=17) "PayAddressRequest": (*main.Message)(0xc000215240)({ + fullName: (string) (len=17) "PayAddressRequest", + name: (string) (len=17) "PayAddressRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0003793e0)({ + name: (string) (len=7) "address", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000379410)({ + name: (string) (len=10) "amout_sats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000215300)({ + fullName: (string) (len=18) "NewInvoiceResponse", + name: (string) (len=18) "NewInvoiceResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0003794a0)({ + name: (string) (len=7) "invoice", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc0002153c0)({ + fullName: (string) (len=18) "OpenChannelRequest", + name: (string) (len=18) "OpenChannelRequest", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc000379560)({ + name: (string) (len=11) "destination", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc000379590)({ + name: (string) (len=14) "funding_amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003795c0)({ + name: (string) (len=11) "push_amount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003795f0)({ + name: (string) (len=13) "close_address", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } }) } -parsing file: structs 18 +parsing file: structs 19 parsing file: methods 2 -> [{guest Guest false map[]} {user User false map[user_id:string]} {admin Admin true map[admin_id:string]}] diff --git a/proto/autogenerated/ts/express_server.ts b/proto/autogenerated/ts/express_server.ts index f8f135d1..1a05a05c 100644 --- a/proto/autogenerated/ts/express_server.ts +++ b/proto/autogenerated/ts/express_server.ts @@ -99,9 +99,12 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { try { if (!methods.NewAddress) throw new Error('method: NewAddress is not implemented') const authContext = await opts.UserAuthGuard(req.headers['authorization']) + const request = req.body + const error = Types.NewAddressRequestValidate(request) + if (error !== null) return logErrorAndReturnResponse(error, 'invalid request body', res, logger) const query = req.query const params = req.params - const response = await methods.NewAddress({ ...authContext, ...query, ...params }) + const response = await methods.NewAddress({ ...authContext, ...query, ...params }, request) res.json({status: 'OK', result: response}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) diff --git a/proto/autogenerated/ts/http_client.ts b/proto/autogenerated/ts/http_client.ts index 4f6ec8aa..668d1b6e 100644 --- a/proto/autogenerated/ts/http_client.ts +++ b/proto/autogenerated/ts/http_client.ts @@ -74,11 +74,11 @@ export default (params: ClientParams) => ({ } return { status: 'ERROR', reason: 'invalid response' } }, - NewAddress: async (): Promise => { + NewAddress: async (request: Types.NewAddressRequest): Promise => { const auth = await params.retrieveUserAuth() if (auth === null) throw new Error('retrieveUserAuth() returned null') let finalRoute = '/api/user/chain/new' - const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) + const { data } = await axios.post(params.baseUrl + finalRoute, request, { headers: { 'authorization': auth } }) if (data.status === 'ERROR' && typeof data.reason === 'string') return data if (data.status === 'OK') { const result = data.result diff --git a/proto/autogenerated/ts/types.ts b/proto/autogenerated/ts/types.ts index 9a8be344..50480939 100644 --- a/proto/autogenerated/ts/types.ts +++ b/proto/autogenerated/ts/types.ts @@ -71,7 +71,7 @@ export type ServerMethods = { LndGetInfo?: (ctx: LndGetInfo_Context, req: LndGetInfoRequest) => Promise AddUser?: (ctx: AddUser_Context, req: AddUserRequest) => Promise AuthUser?: (ctx: AuthUser_Context, req: AuthUserRequest) => Promise - NewAddress?: (ctx: NewAddress_Context) => Promise + NewAddress?: (ctx: NewAddress_Context, req: NewAddressRequest) => Promise PayAddress?: (ctx: PayAddress_Context, req: PayAddressRequest) => Promise NewInvoice?: (ctx: NewInvoice_Context, req: NewInvoiceRequest) => Promise PayInvoice?: (ctx: PayInvoice_Context, req: PayInvoiceRequest) => Promise @@ -79,31 +79,30 @@ export type ServerMethods = { GetOpenChannelLNURL?: (ctx: GetOpenChannelLNURL_Context) => Promise } +export enum AddressType { + WITNESS_PUBKEY_HASH = 'WITNESS_PUBKEY_HASH', + NESTED_PUBKEY_HASH = 'NESTED_PUBKEY_HASH', + TAPROOT_PUBKEY = 'TAPROOT_PUBKEY', +} +const enumCheckAddressType = (e?: AddressType): boolean => { + for (const v in AddressType) if (e === v) return true + return false +} export type OptionsBaseMessage = { allOptionalsAreSet?: true } -export type AuthUserResponse = { - user_id: string - auth_token: string +export type Empty = { } -export const AuthUserResponseOptionalFields: [] = [] -export type AuthUserResponseOptions = OptionsBaseMessage & { +export const EmptyOptionalFields: [] = [] +export type EmptyOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - user_id_CustomCheck?: (v: string) => boolean - auth_token_CustomCheck?: (v: string) => boolean } -export const AuthUserResponseValidate = (o?: AuthUserResponse, opts: AuthUserResponseOptions = {}, path: string = 'AuthUserResponse::root.'): Error | null => { +export const EmptyValidate = (o?: Empty, opts: EmptyOptions = {}, path: string = 'Empty::root.'): Error | null => { if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - if (typeof o.user_id !== 'string') return new Error(`${path}.user_id: is not a string`) - if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`) - - if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`) - if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`) - return null } @@ -130,20 +129,53 @@ export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddres return null } -export type PayAddressResponse = { - tx_id: string +export type NewInvoiceResponse = { + invoice: string } -export const PayAddressResponseOptionalFields: [] = [] -export type PayAddressResponseOptions = OptionsBaseMessage & { +export const NewInvoiceResponseOptionalFields: [] = [] +export type NewInvoiceResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - tx_id_CustomCheck?: (v: string) => boolean + invoice_CustomCheck?: (v: string) => boolean } -export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => { +export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvoiceResponseOptions = {}, path: string = 'NewInvoiceResponse::root.'): Error | null => { if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - if (typeof o.tx_id !== 'string') return new Error(`${path}.tx_id: is not a string`) - if (opts.tx_id_CustomCheck && !opts.tx_id_CustomCheck(o.tx_id)) return new Error(`${path}.tx_id: custom check failed`) + if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + return null +} + +export type OpenChannelRequest = { + destination: string + funding_amount: number + push_amount: number + close_address: string +} +export const OpenChannelRequestOptionalFields: [] = [] +export type OpenChannelRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + destination_CustomCheck?: (v: string) => boolean + funding_amount_CustomCheck?: (v: number) => boolean + push_amount_CustomCheck?: (v: number) => boolean + close_address_CustomCheck?: (v: string) => boolean +} +export const OpenChannelRequestValidate = (o?: OpenChannelRequest, opts: OpenChannelRequestOptions = {}, path: string = 'OpenChannelRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.destination !== 'string') return new Error(`${path}.destination: is not a string`) + if (opts.destination_CustomCheck && !opts.destination_CustomCheck(o.destination)) return new Error(`${path}.destination: custom check failed`) + + if (typeof o.funding_amount !== 'number') return new Error(`${path}.funding_amount: is not a number`) + if (opts.funding_amount_CustomCheck && !opts.funding_amount_CustomCheck(o.funding_amount)) return new Error(`${path}.funding_amount: custom check failed`) + + if (typeof o.push_amount !== 'number') return new Error(`${path}.push_amount: is not a number`) + if (opts.push_amount_CustomCheck && !opts.push_amount_CustomCheck(o.push_amount)) return new Error(`${path}.push_amount: custom check failed`) + + if (typeof o.close_address !== 'string') return new Error(`${path}.close_address: is not a string`) + if (opts.close_address_CustomCheck && !opts.close_address_CustomCheck(o.close_address)) return new Error(`${path}.close_address: custom check failed`) return null } @@ -166,92 +198,20 @@ export const OpenChannelResponseValidate = (o?: OpenChannelResponse, opts: OpenC return null } -export type GetOpenChannelLNURLResponse = { - lnurl: string +export type LndGetInfoRequest = { + node_id: number } -export const GetOpenChannelLNURLResponseOptionalFields: [] = [] -export type GetOpenChannelLNURLResponseOptions = OptionsBaseMessage & { +export const LndGetInfoRequestOptionalFields: [] = [] +export type LndGetInfoRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - lnurl_CustomCheck?: (v: string) => boolean + node_id_CustomCheck?: (v: number) => boolean } -export const GetOpenChannelLNURLResponseValidate = (o?: GetOpenChannelLNURLResponse, opts: GetOpenChannelLNURLResponseOptions = {}, path: string = 'GetOpenChannelLNURLResponse::root.'): Error | null => { +export const LndGetInfoRequestValidate = (o?: LndGetInfoRequest, opts: LndGetInfoRequestOptions = {}, path: string = 'LndGetInfoRequest::root.'): Error | null => { if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - if (typeof o.lnurl !== 'string') return new Error(`${path}.lnurl: is not a string`) - if (opts.lnurl_CustomCheck && !opts.lnurl_CustomCheck(o.lnurl)) return new Error(`${path}.lnurl: custom check failed`) - - return null -} - -export type AddUserResponse = { - user_id: string - auth_token: string -} -export const AddUserResponseOptionalFields: [] = [] -export type AddUserResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - user_id_CustomCheck?: (v: string) => boolean - auth_token_CustomCheck?: (v: string) => boolean -} -export const AddUserResponseValidate = (o?: AddUserResponse, opts: AddUserResponseOptions = {}, path: string = 'AddUserResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.user_id !== 'string') return new Error(`${path}.user_id: is not a string`) - if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`) - - if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`) - if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`) - - return null -} - -export type Empty = { -} -export const EmptyOptionalFields: [] = [] -export type EmptyOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] -} -export const EmptyValidate = (o?: Empty, opts: EmptyOptions = {}, path: string = 'Empty::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - return null -} - -export type PayInvoiceResponse = { - preimage: string -} -export const PayInvoiceResponseOptionalFields: [] = [] -export type PayInvoiceResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - preimage_CustomCheck?: (v: string) => boolean -} -export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.preimage !== 'string') return new Error(`${path}.preimage: is not a string`) - if (opts.preimage_CustomCheck && !opts.preimage_CustomCheck(o.preimage)) return new Error(`${path}.preimage: custom check failed`) - - return null -} - -export type PayInvoiceRequest = { - invoce: string -} -export const PayInvoiceRequestOptionalFields: [] = [] -export type PayInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - invoce_CustomCheck?: (v: string) => boolean -} -export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoiceRequestOptions = {}, path: string = 'PayInvoiceRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.invoce !== 'string') return new Error(`${path}.invoce: is not a string`) - if (opts.invoce_CustomCheck && !opts.invoce_CustomCheck(o.invoce)) return new Error(`${path}.invoce: custom check failed`) + if (typeof o.node_id !== 'number') return new Error(`${path}.node_id: is not a number`) + if (opts.node_id_CustomCheck && !opts.node_id_CustomCheck(o.node_id)) return new Error(`${path}.node_id: custom check failed`) return null } @@ -274,38 +234,20 @@ export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetI return null } -export type NewInvoiceResponse = { - invoice: string +export type NewAddressRequest = { + address_type: AddressType } -export const NewInvoiceResponseOptionalFields: [] = [] -export type NewInvoiceResponseOptions = OptionsBaseMessage & { +export const NewAddressRequestOptionalFields: [] = [] +export type NewAddressRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - invoice_CustomCheck?: (v: string) => boolean + address_type_CustomCheck?: (v: AddressType) => boolean } -export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvoiceResponseOptions = {}, path: string = 'NewInvoiceResponse::root.'): Error | null => { +export const NewAddressRequestValidate = (o?: NewAddressRequest, opts: NewAddressRequestOptions = {}, path: string = 'NewAddressRequest::root.'): Error | null => { if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) - if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) - - return null -} - -export type NewAddressResponse = { - address: string -} -export const NewAddressResponseOptionalFields: [] = [] -export type NewAddressResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - address_CustomCheck?: (v: string) => boolean -} -export const NewAddressResponseValidate = (o?: NewAddressResponse, opts: NewAddressResponseOptions = {}, path: string = 'NewAddressResponse::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.address !== 'string') return new Error(`${path}.address: is not a string`) - if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) + if (!enumCheckAddressType(o.address_type)) return new Error(`${path}.address_type: is not a valid AddressType`) + if (opts.address_type_CustomCheck && !opts.address_type_CustomCheck(o.address_type)) return new Error(`${path}.address_type: custom check failed`) return null } @@ -328,30 +270,166 @@ export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoic return null } -export type OpenChannelRequest = { - destination: string - channel_balance: number - push_amount: number +export type PayInvoiceResponse = { + preimage: string } -export const OpenChannelRequestOptionalFields: [] = [] -export type OpenChannelRequestOptions = OptionsBaseMessage & { +export const PayInvoiceResponseOptionalFields: [] = [] +export type PayInvoiceResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - destination_CustomCheck?: (v: string) => boolean - channel_balance_CustomCheck?: (v: number) => boolean - push_amount_CustomCheck?: (v: number) => boolean + preimage_CustomCheck?: (v: string) => boolean } -export const OpenChannelRequestValidate = (o?: OpenChannelRequest, opts: OpenChannelRequestOptions = {}, path: string = 'OpenChannelRequest::root.'): Error | null => { +export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => { if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - if (typeof o.destination !== 'string') return new Error(`${path}.destination: is not a string`) - if (opts.destination_CustomCheck && !opts.destination_CustomCheck(o.destination)) return new Error(`${path}.destination: custom check failed`) + if (typeof o.preimage !== 'string') return new Error(`${path}.preimage: is not a string`) + if (opts.preimage_CustomCheck && !opts.preimage_CustomCheck(o.preimage)) return new Error(`${path}.preimage: custom check failed`) - if (typeof o.channel_balance !== 'number') return new Error(`${path}.channel_balance: is not a number`) - if (opts.channel_balance_CustomCheck && !opts.channel_balance_CustomCheck(o.channel_balance)) return new Error(`${path}.channel_balance: custom check failed`) + return null +} - if (typeof o.push_amount !== 'number') return new Error(`${path}.push_amount: is not a number`) - if (opts.push_amount_CustomCheck && !opts.push_amount_CustomCheck(o.push_amount)) return new Error(`${path}.push_amount: custom check failed`) +export type PayAddressResponse = { + tx_id: string +} +export const PayAddressResponseOptionalFields: [] = [] +export type PayAddressResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + tx_id_CustomCheck?: (v: string) => boolean +} +export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.tx_id !== 'string') return new Error(`${path}.tx_id: is not a string`) + if (opts.tx_id_CustomCheck && !opts.tx_id_CustomCheck(o.tx_id)) return new Error(`${path}.tx_id: custom check failed`) + + return null +} + +export type PayInvoiceRequest = { + invoice: string + amount: number +} +export const PayInvoiceRequestOptionalFields: [] = [] +export type PayInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + invoice_CustomCheck?: (v: string) => boolean + amount_CustomCheck?: (v: number) => boolean +} +export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoiceRequestOptions = {}, path: string = 'PayInvoiceRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.invoice !== 'string') return new Error(`${path}.invoice: is not a string`) + if (opts.invoice_CustomCheck && !opts.invoice_CustomCheck(o.invoice)) return new Error(`${path}.invoice: custom check failed`) + + if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`) + if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`) + + return null +} + +export type AuthUserRequest = { + name: string + secret: string +} +export const AuthUserRequestOptionalFields: [] = [] +export type AuthUserRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + name_CustomCheck?: (v: string) => boolean + secret_CustomCheck?: (v: string) => boolean +} +export const AuthUserRequestValidate = (o?: AuthUserRequest, opts: AuthUserRequestOptions = {}, path: string = 'AuthUserRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) + if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + + if (typeof o.secret !== 'string') return new Error(`${path}.secret: is not a string`) + if (opts.secret_CustomCheck && !opts.secret_CustomCheck(o.secret)) return new Error(`${path}.secret: custom check failed`) + + return null +} + +export type AuthUserResponse = { + user_id: string + auth_token: string +} +export const AuthUserResponseOptionalFields: [] = [] +export type AuthUserResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + user_id_CustomCheck?: (v: string) => boolean + auth_token_CustomCheck?: (v: string) => boolean +} +export const AuthUserResponseValidate = (o?: AuthUserResponse, opts: AuthUserResponseOptions = {}, path: string = 'AuthUserResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.user_id !== 'string') return new Error(`${path}.user_id: is not a string`) + if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`) + + if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`) + if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`) + + return null +} + +export type EncryptionExchangeRequest = { + public_key: string + device_id: string +} +export const EncryptionExchangeRequestOptionalFields: [] = [] +export type EncryptionExchangeRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + public_key_CustomCheck?: (v: string) => boolean + device_id_CustomCheck?: (v: string) => boolean +} +export const EncryptionExchangeRequestValidate = (o?: EncryptionExchangeRequest, opts: EncryptionExchangeRequestOptions = {}, path: string = 'EncryptionExchangeRequest::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.public_key !== 'string') return new Error(`${path}.public_key: is not a string`) + if (opts.public_key_CustomCheck && !opts.public_key_CustomCheck(o.public_key)) return new Error(`${path}.public_key: custom check failed`) + + if (typeof o.device_id !== 'string') return new Error(`${path}.device_id: is not a string`) + if (opts.device_id_CustomCheck && !opts.device_id_CustomCheck(o.device_id)) return new Error(`${path}.device_id: custom check failed`) + + return null +} + +export type NewAddressResponse = { + address: string +} +export const NewAddressResponseOptionalFields: [] = [] +export type NewAddressResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + address_CustomCheck?: (v: string) => boolean +} +export const NewAddressResponseValidate = (o?: NewAddressResponse, opts: NewAddressResponseOptions = {}, path: string = 'NewAddressResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.address !== 'string') return new Error(`${path}.address: is not a string`) + if (opts.address_CustomCheck && !opts.address_CustomCheck(o.address)) return new Error(`${path}.address: custom check failed`) + + return null +} + +export type GetOpenChannelLNURLResponse = { + lnurl: string +} +export const GetOpenChannelLNURLResponseOptionalFields: [] = [] +export type GetOpenChannelLNURLResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + lnurl_CustomCheck?: (v: string) => boolean +} +export const GetOpenChannelLNURLResponseValidate = (o?: GetOpenChannelLNURLResponse, opts: GetOpenChannelLNURLResponseOptions = {}, path: string = 'GetOpenChannelLNURLResponse::root.'): Error | null => { + if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') + if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') + + if (typeof o.lnurl !== 'string') return new Error(`${path}.lnurl: is not a string`) + if (opts.lnurl_CustomCheck && !opts.lnurl_CustomCheck(o.lnurl)) return new Error(`${path}.lnurl: custom check failed`) return null } @@ -384,66 +462,25 @@ export const AddUserRequestValidate = (o?: AddUserRequest, opts: AddUserRequestO return null } -export type AuthUserRequest = { - name: string - secret: string +export type AddUserResponse = { + user_id: string + auth_token: string } -export const AuthUserRequestOptionalFields: [] = [] -export type AuthUserRequestOptions = OptionsBaseMessage & { +export const AddUserResponseOptionalFields: [] = [] +export type AddUserResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - name_CustomCheck?: (v: string) => boolean - secret_CustomCheck?: (v: string) => boolean + user_id_CustomCheck?: (v: string) => boolean + auth_token_CustomCheck?: (v: string) => boolean } -export const AuthUserRequestValidate = (o?: AuthUserRequest, opts: AuthUserRequestOptions = {}, path: string = 'AuthUserRequest::root.'): Error | null => { +export const AddUserResponseValidate = (o?: AddUserResponse, opts: AddUserResponseOptions = {}, path: string = 'AddUserResponse::root.'): Error | null => { if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - if (typeof o.name !== 'string') return new Error(`${path}.name: is not a string`) - if (opts.name_CustomCheck && !opts.name_CustomCheck(o.name)) return new Error(`${path}.name: custom check failed`) + if (typeof o.user_id !== 'string') return new Error(`${path}.user_id: is not a string`) + if (opts.user_id_CustomCheck && !opts.user_id_CustomCheck(o.user_id)) return new Error(`${path}.user_id: custom check failed`) - if (typeof o.secret !== 'string') return new Error(`${path}.secret: is not a string`) - if (opts.secret_CustomCheck && !opts.secret_CustomCheck(o.secret)) return new Error(`${path}.secret: custom check failed`) - - return null -} - -export type EncryptionExchangeRequest = { - public_key: string - device_id: string -} -export const EncryptionExchangeRequestOptionalFields: [] = [] -export type EncryptionExchangeRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - public_key_CustomCheck?: (v: string) => boolean - device_id_CustomCheck?: (v: string) => boolean -} -export const EncryptionExchangeRequestValidate = (o?: EncryptionExchangeRequest, opts: EncryptionExchangeRequestOptions = {}, path: string = 'EncryptionExchangeRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.public_key !== 'string') return new Error(`${path}.public_key: is not a string`) - if (opts.public_key_CustomCheck && !opts.public_key_CustomCheck(o.public_key)) return new Error(`${path}.public_key: custom check failed`) - - if (typeof o.device_id !== 'string') return new Error(`${path}.device_id: is not a string`) - if (opts.device_id_CustomCheck && !opts.device_id_CustomCheck(o.device_id)) return new Error(`${path}.device_id: custom check failed`) - - return null -} - -export type LndGetInfoRequest = { - node_id: number -} -export const LndGetInfoRequestOptionalFields: [] = [] -export type LndGetInfoRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - node_id_CustomCheck?: (v: number) => boolean -} -export const LndGetInfoRequestValidate = (o?: LndGetInfoRequest, opts: LndGetInfoRequestOptions = {}, path: string = 'LndGetInfoRequest::root.'): Error | null => { - if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') - if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null') - - if (typeof o.node_id !== 'number') return new Error(`${path}.node_id: is not a number`) - if (opts.node_id_CustomCheck && !opts.node_id_CustomCheck(o.node_id)) return new Error(`${path}.node_id: custom check failed`) + if (typeof o.auth_token !== 'string') return new Error(`${path}.auth_token: is not a string`) + if (opts.auth_token_CustomCheck && !opts.auth_token_CustomCheck(o.auth_token)) return new Error(`${path}.auth_token: custom check failed`) return null } diff --git a/proto/lnd/invoices.client.ts b/proto/lnd/invoices.client.ts index 3d87d7e9..098e44a0 100644 --- a/proto/lnd/invoices.client.ts +++ b/proto/lnd/invoices.client.ts @@ -1,9 +1,10 @@ -// @generated by protobuf-ts 2.5.0 with parameter long_type_string +// @generated by protobuf-ts 2.5.0 // @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) // tslint:disable import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; import { Invoices } from "./invoices"; +import type { LookupInvoiceMsg } from "./invoices"; import type { SettleInvoiceResp } from "./invoices"; import type { SettleInvoiceMsg } from "./invoices"; import type { AddHoldInvoiceResp } from "./invoices"; @@ -12,7 +13,7 @@ import type { CancelInvoiceResp } from "./invoices"; import type { CancelInvoiceMsg } from "./invoices"; import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -import type { Invoice } from "./rpc"; +import type { Invoice } from "./lightning"; import type { SubscribeSingleInvoiceRequest } from "./invoices"; import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; @@ -57,6 +58,14 @@ export interface IInvoicesClient { * @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp); */ settleInvoice(input: SettleInvoiceMsg, options?: RpcOptions): UnaryCall; + /** + * + * LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced + * using either its payment hash, payment address, or set ID. + * + * @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice); + */ + lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall; } /** * Invoices is a service that can be used to create, accept, settle and cancel @@ -116,4 +125,15 @@ export class InvoicesClient implements IInvoicesClient, ServiceInfo { const method = this.methods[3], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } + /** + * + * LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced + * using either its payment hash, payment address, or set ID. + * + * @generated from protobuf rpc: LookupInvoiceV2(invoicesrpc.LookupInvoiceMsg) returns (lnrpc.Invoice); + */ + lookupInvoiceV2(input: LookupInvoiceMsg, options?: RpcOptions): UnaryCall { + const method = this.methods[4], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } } diff --git a/proto/lnd/invoices.ts b/proto/lnd/invoices.ts index 297d5ce7..6e16f352 100644 --- a/proto/lnd/invoices.ts +++ b/proto/lnd/invoices.ts @@ -1,7 +1,7 @@ -// @generated by protobuf-ts 2.5.0 with parameter long_type_string +// @generated by protobuf-ts 2.5.0 // @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) // tslint:disable -import { Invoice } from "./rpc"; +import { Invoice } from "./lightning"; import { ServiceType } from "@protobuf-ts/runtime-rpc"; import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; import type { IBinaryWriter } from "@protobuf-ts/runtime"; @@ -13,13 +13,14 @@ import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; -import { RouteHint } from "./rpc"; +import { RouteHint } from "./lightning"; /** * @generated from protobuf message invoicesrpc.CancelInvoiceMsg */ export interface CancelInvoiceMsg { /** - * Hash corresponding to the (hold) invoice to cancel. + * Hash corresponding to the (hold) invoice to cancel. When using + * REST, this field must be encoded as base64. * * @generated from protobuf field: bytes payment_hash = 1; */ @@ -58,7 +59,7 @@ export interface AddHoldInvoiceRequest { * * @generated from protobuf field: int64 value = 3; */ - value: string; + value: bigint; /** * * The value of this invoice in millisatoshis @@ -67,7 +68,7 @@ export interface AddHoldInvoiceRequest { * * @generated from protobuf field: int64 value_msat = 10; */ - valueMsat: string; + valueMsat: bigint; /** * * Hash (SHA-256) of a description of the payment. Used if the description of @@ -82,7 +83,7 @@ export interface AddHoldInvoiceRequest { * * @generated from protobuf field: int64 expiry = 5; */ - expiry: string; + expiry: bigint; /** * Fallback on-chain address. * @@ -94,7 +95,7 @@ export interface AddHoldInvoiceRequest { * * @generated from protobuf field: uint64 cltv_expiry = 7; */ - cltvExpiry: string; + cltvExpiry: bigint; /** * * Route hints that can each be individually used to assist in reaching the @@ -116,13 +117,32 @@ export interface AddHoldInvoiceRequest { export interface AddHoldInvoiceResp { /** * - * A bare-bones invoice for a payment within the Lightning Network. With the + * A bare-bones invoice for a payment within the Lightning Network. With the * details of the invoice, the sender has all the data necessary to send a * payment to the recipient. * * @generated from protobuf field: string payment_request = 1; */ paymentRequest: string; + /** + * + * The "add" index of this invoice. Each newly created invoice will increment + * this index making it monotonically increasing. Callers to the + * SubscribeInvoices call can use this to instantly get notified of all added + * invoices with an add_index greater than this one. + * + * @generated from protobuf field: uint64 add_index = 2; + */ + addIndex: bigint; + /** + * + * The payment address of the generated invoice. This value should be used + * in all payments for this invoice as we require it for end to end + * security. + * + * @generated from protobuf field: bytes payment_addr = 3; + */ + paymentAddr: Uint8Array; } /** * @generated from protobuf message invoicesrpc.SettleInvoiceMsg @@ -146,12 +166,77 @@ export interface SettleInvoiceResp { */ export interface SubscribeSingleInvoiceRequest { /** - * Hash corresponding to the (hold) invoice to subscribe to. + * Hash corresponding to the (hold) invoice to subscribe to. When using + * REST, this field must be encoded as base64url. * * @generated from protobuf field: bytes r_hash = 2; */ rHash: Uint8Array; } +/** + * @generated from protobuf message invoicesrpc.LookupInvoiceMsg + */ +export interface LookupInvoiceMsg { + /** + * @generated from protobuf oneof: invoice_ref + */ + invoiceRef: { + oneofKind: "paymentHash"; + /** + * When using REST, this field must be encoded as base64. + * + * @generated from protobuf field: bytes payment_hash = 1; + */ + paymentHash: Uint8Array; + } | { + oneofKind: "paymentAddr"; + /** + * @generated from protobuf field: bytes payment_addr = 2; + */ + paymentAddr: Uint8Array; + } | { + oneofKind: "setId"; + /** + * @generated from protobuf field: bytes set_id = 3; + */ + setId: Uint8Array; + } | { + oneofKind: undefined; + }; + /** + * @generated from protobuf field: invoicesrpc.LookupModifier lookup_modifier = 4; + */ + lookupModifier: LookupModifier; +} +/** + * @generated from protobuf enum invoicesrpc.LookupModifier + */ +export enum LookupModifier { + /** + * The default look up modifier, no look up behavior is changed. + * + * @generated from protobuf enum value: DEFAULT = 0; + */ + DEFAULT = 0, + /** + * + * Indicates that when a look up is done based on a set_id, then only that set + * of HTLCs related to that set ID should be returned. + * + * @generated from protobuf enum value: HTLC_SET_ONLY = 1; + */ + HTLC_SET_ONLY = 1, + /** + * + * Indicates that when a look up is done using a payment_addr, then no HTLCs + * related to the payment_addr should be returned. This is useful when one + * wants to be able to obtain the set of associated setIDs with a given + * invoice, then look up the sub-invoices "projected" by that set ID. + * + * @generated from protobuf enum value: HTLC_SET_BLANK = 2; + */ + HTLC_SET_BLANK = 2 +} // @generated message type with reflection information, may provide speed optimized methods class CancelInvoiceMsg$Type extends MessageType { constructor() { @@ -231,18 +316,18 @@ class AddHoldInvoiceRequest$Type extends MessageType { super("invoicesrpc.AddHoldInvoiceRequest", [ { no: 1, name: "memo", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 10, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 3, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "description_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 6, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 7, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 8, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, { no: 9, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): AddHoldInvoiceRequest { - const message = { memo: "", hash: new Uint8Array(0), value: "0", valueMsat: "0", descriptionHash: new Uint8Array(0), expiry: "0", fallbackAddr: "", cltvExpiry: "0", routeHints: [], private: false }; + const message = { memo: "", hash: new Uint8Array(0), value: 0n, valueMsat: 0n, descriptionHash: new Uint8Array(0), expiry: 0n, fallbackAddr: "", cltvExpiry: 0n, routeHints: [], private: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -260,22 +345,22 @@ class AddHoldInvoiceRequest$Type extends MessageType { message.hash = reader.bytes(); break; case /* int64 value */ 3: - message.value = reader.int64().toString(); + message.value = reader.int64().toBigInt(); break; case /* int64 value_msat */ 10: - message.valueMsat = reader.int64().toString(); + message.valueMsat = reader.int64().toBigInt(); break; case /* bytes description_hash */ 4: message.descriptionHash = reader.bytes(); break; case /* int64 expiry */ 5: - message.expiry = reader.int64().toString(); + message.expiry = reader.int64().toBigInt(); break; case /* string fallback_addr */ 6: message.fallbackAddr = reader.string(); break; case /* uint64 cltv_expiry */ 7: - message.cltvExpiry = reader.uint64().toString(); + message.cltvExpiry = reader.uint64().toBigInt(); break; case /* repeated lnrpc.RouteHint route_hints */ 8: message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); @@ -302,22 +387,22 @@ class AddHoldInvoiceRequest$Type extends MessageType { if (message.hash.length) writer.tag(2, WireType.LengthDelimited).bytes(message.hash); /* int64 value = 3; */ - if (message.value !== "0") + if (message.value !== 0n) writer.tag(3, WireType.Varint).int64(message.value); /* int64 value_msat = 10; */ - if (message.valueMsat !== "0") + if (message.valueMsat !== 0n) writer.tag(10, WireType.Varint).int64(message.valueMsat); /* bytes description_hash = 4; */ if (message.descriptionHash.length) writer.tag(4, WireType.LengthDelimited).bytes(message.descriptionHash); /* int64 expiry = 5; */ - if (message.expiry !== "0") + if (message.expiry !== 0n) writer.tag(5, WireType.Varint).int64(message.expiry); /* string fallback_addr = 6; */ if (message.fallbackAddr !== "") writer.tag(6, WireType.LengthDelimited).string(message.fallbackAddr); /* uint64 cltv_expiry = 7; */ - if (message.cltvExpiry !== "0") + if (message.cltvExpiry !== 0n) writer.tag(7, WireType.Varint).uint64(message.cltvExpiry); /* repeated lnrpc.RouteHint route_hints = 8; */ for (let i = 0; i < message.routeHints.length; i++) @@ -339,11 +424,13 @@ export const AddHoldInvoiceRequest = new AddHoldInvoiceRequest$Type(); class AddHoldInvoiceResp$Type extends MessageType { constructor() { super("invoicesrpc.AddHoldInvoiceResp", [ - { no: 1, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + { no: 1, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } ]); } create(value?: PartialMessage): AddHoldInvoiceResp { - const message = { paymentRequest: "" }; + const message = { paymentRequest: "", addIndex: 0n, paymentAddr: new Uint8Array(0) }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -357,6 +444,12 @@ class AddHoldInvoiceResp$Type extends MessageType { case /* string payment_request */ 1: message.paymentRequest = reader.string(); break; + case /* uint64 add_index */ 2: + message.addIndex = reader.uint64().toBigInt(); + break; + case /* bytes payment_addr */ 3: + message.paymentAddr = reader.bytes(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -372,6 +465,12 @@ class AddHoldInvoiceResp$Type extends MessageType { /* string payment_request = 1; */ if (message.paymentRequest !== "") writer.tag(1, WireType.LengthDelimited).string(message.paymentRequest); + /* uint64 add_index = 2; */ + if (message.addIndex !== 0n) + writer.tag(2, WireType.Varint).uint64(message.addIndex); + /* bytes payment_addr = 3; */ + if (message.paymentAddr.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.paymentAddr); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -502,6 +601,83 @@ class SubscribeSingleInvoiceRequest$Type extends MessageType { + constructor() { + super("invoicesrpc.LookupInvoiceMsg", [ + { no: 1, name: "payment_hash", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "payment_addr", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "set_id", kind: "scalar", oneof: "invoiceRef", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "lookup_modifier", kind: "enum", T: () => ["invoicesrpc.LookupModifier", LookupModifier] } + ]); + } + create(value?: PartialMessage): LookupInvoiceMsg { + const message = { invoiceRef: { oneofKind: undefined }, lookupModifier: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupInvoiceMsg): LookupInvoiceMsg { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes payment_hash */ 1: + message.invoiceRef = { + oneofKind: "paymentHash", + paymentHash: reader.bytes() + }; + break; + case /* bytes payment_addr */ 2: + message.invoiceRef = { + oneofKind: "paymentAddr", + paymentAddr: reader.bytes() + }; + break; + case /* bytes set_id */ 3: + message.invoiceRef = { + oneofKind: "setId", + setId: reader.bytes() + }; + break; + case /* invoicesrpc.LookupModifier lookup_modifier */ 4: + message.lookupModifier = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: LookupInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes payment_hash = 1; */ + if (message.invoiceRef.oneofKind === "paymentHash") + writer.tag(1, WireType.LengthDelimited).bytes(message.invoiceRef.paymentHash); + /* bytes payment_addr = 2; */ + if (message.invoiceRef.oneofKind === "paymentAddr") + writer.tag(2, WireType.LengthDelimited).bytes(message.invoiceRef.paymentAddr); + /* bytes set_id = 3; */ + if (message.invoiceRef.oneofKind === "setId") + writer.tag(3, WireType.LengthDelimited).bytes(message.invoiceRef.setId); + /* invoicesrpc.LookupModifier lookup_modifier = 4; */ + if (message.lookupModifier !== 0) + writer.tag(4, WireType.Varint).int32(message.lookupModifier); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message invoicesrpc.LookupInvoiceMsg + */ +export const LookupInvoiceMsg = new LookupInvoiceMsg$Type(); /** * @generated ServiceType for protobuf service invoicesrpc.Invoices */ @@ -509,5 +685,6 @@ export const Invoices = new ServiceType("invoicesrpc.Invoices", [ { name: "SubscribeSingleInvoice", serverStreaming: true, options: {}, I: SubscribeSingleInvoiceRequest, O: Invoice }, { name: "CancelInvoice", options: {}, I: CancelInvoiceMsg, O: CancelInvoiceResp }, { name: "AddHoldInvoice", options: {}, I: AddHoldInvoiceRequest, O: AddHoldInvoiceResp }, - { name: "SettleInvoice", options: {}, I: SettleInvoiceMsg, O: SettleInvoiceResp } + { name: "SettleInvoice", options: {}, I: SettleInvoiceMsg, O: SettleInvoiceResp }, + { name: "LookupInvoiceV2", options: {}, I: LookupInvoiceMsg, O: Invoice } ]); diff --git a/proto/lnd/rpc.client.ts b/proto/lnd/lightning.client.ts similarity index 81% rename from proto/lnd/rpc.client.ts rename to proto/lnd/lightning.client.ts index 896e43ee..2577acfc 100644 --- a/proto/lnd/rpc.client.ts +++ b/proto/lnd/lightning.client.ts @@ -1,119 +1,135 @@ -// @generated by protobuf-ts 2.5.0 with parameter long_type_string -// @generated from protobuf file "rpc.proto" (package "lnrpc", syntax proto3) +// @generated by protobuf-ts 2.5.0 +// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3) // tslint:disable import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import { Lightning } from "./rpc"; -import type { ListPermissionsResponse } from "./rpc"; -import type { ListPermissionsRequest } from "./rpc"; -import type { DeleteMacaroonIDResponse } from "./rpc"; -import type { DeleteMacaroonIDRequest } from "./rpc"; -import type { ListMacaroonIDsResponse } from "./rpc"; -import type { ListMacaroonIDsRequest } from "./rpc"; -import type { BakeMacaroonResponse } from "./rpc"; -import type { BakeMacaroonRequest } from "./rpc"; -import type { ChannelBackupSubscription } from "./rpc"; -import type { RestoreBackupResponse } from "./rpc"; -import type { RestoreChanBackupRequest } from "./rpc"; -import type { VerifyChanBackupResponse } from "./rpc"; -import type { ChanBackupSnapshot } from "./rpc"; -import type { ChanBackupExportRequest } from "./rpc"; -import type { ChannelBackup } from "./rpc"; -import type { ExportChannelBackupRequest } from "./rpc"; -import type { ForwardingHistoryResponse } from "./rpc"; -import type { ForwardingHistoryRequest } from "./rpc"; -import type { PolicyUpdateResponse } from "./rpc"; -import type { PolicyUpdateRequest } from "./rpc"; -import type { FeeReportResponse } from "./rpc"; -import type { FeeReportRequest } from "./rpc"; -import type { DebugLevelResponse } from "./rpc"; -import type { DebugLevelRequest } from "./rpc"; -import type { GraphTopologyUpdate } from "./rpc"; -import type { GraphTopologySubscription } from "./rpc"; -import type { StopResponse } from "./rpc"; -import type { StopRequest } from "./rpc"; -import type { NetworkInfo } from "./rpc"; -import type { NetworkInfoRequest } from "./rpc"; -import type { QueryRoutesResponse } from "./rpc"; -import type { QueryRoutesRequest } from "./rpc"; -import type { NodeInfo } from "./rpc"; -import type { NodeInfoRequest } from "./rpc"; -import type { ChannelEdge } from "./rpc"; -import type { ChanInfoRequest } from "./rpc"; -import type { NodeMetricsResponse } from "./rpc"; -import type { NodeMetricsRequest } from "./rpc"; -import type { ChannelGraph } from "./rpc"; -import type { ChannelGraphRequest } from "./rpc"; -import type { DeleteAllPaymentsResponse } from "./rpc"; -import type { DeleteAllPaymentsRequest } from "./rpc"; -import type { ListPaymentsResponse } from "./rpc"; -import type { ListPaymentsRequest } from "./rpc"; -import type { PayReq } from "./rpc"; -import type { PayReqString } from "./rpc"; -import type { InvoiceSubscription } from "./rpc"; -import type { PaymentHash } from "./rpc"; -import type { ListInvoiceResponse } from "./rpc"; -import type { ListInvoiceRequest } from "./rpc"; -import type { AddInvoiceResponse } from "./rpc"; -import type { Invoice } from "./rpc"; -import type { SendToRouteRequest } from "./rpc"; -import type { SendResponse } from "./rpc"; -import type { SendRequest } from "./rpc"; -import type { AbandonChannelResponse } from "./rpc"; -import type { AbandonChannelRequest } from "./rpc"; -import type { CloseStatusUpdate } from "./rpc"; -import type { CloseChannelRequest } from "./rpc"; -import type { ChannelAcceptRequest } from "./rpc"; -import type { ChannelAcceptResponse } from "./rpc"; +import { Lightning } from "./lightning"; +import type { LookupHtlcResponse } from "./lightning"; +import type { LookupHtlcRequest } from "./lightning"; +import type { ListAliasesResponse } from "./lightning"; +import type { ListAliasesRequest } from "./lightning"; +import type { CustomMessage } from "./lightning"; +import type { SubscribeCustomMessagesRequest } from "./lightning"; +import type { SendCustomMessageResponse } from "./lightning"; +import type { SendCustomMessageRequest } from "./lightning"; +import type { RPCMiddlewareRequest } from "./lightning"; +import type { RPCMiddlewareResponse } from "./lightning"; +import type { CheckMacPermResponse } from "./lightning"; +import type { CheckMacPermRequest } from "./lightning"; +import type { ListPermissionsResponse } from "./lightning"; +import type { ListPermissionsRequest } from "./lightning"; +import type { DeleteMacaroonIDResponse } from "./lightning"; +import type { DeleteMacaroonIDRequest } from "./lightning"; +import type { ListMacaroonIDsResponse } from "./lightning"; +import type { ListMacaroonIDsRequest } from "./lightning"; +import type { BakeMacaroonResponse } from "./lightning"; +import type { BakeMacaroonRequest } from "./lightning"; +import type { ChannelBackupSubscription } from "./lightning"; +import type { RestoreBackupResponse } from "./lightning"; +import type { RestoreChanBackupRequest } from "./lightning"; +import type { VerifyChanBackupResponse } from "./lightning"; +import type { ChanBackupSnapshot } from "./lightning"; +import type { ChanBackupExportRequest } from "./lightning"; +import type { ChannelBackup } from "./lightning"; +import type { ExportChannelBackupRequest } from "./lightning"; +import type { ForwardingHistoryResponse } from "./lightning"; +import type { ForwardingHistoryRequest } from "./lightning"; +import type { PolicyUpdateResponse } from "./lightning"; +import type { PolicyUpdateRequest } from "./lightning"; +import type { FeeReportResponse } from "./lightning"; +import type { FeeReportRequest } from "./lightning"; +import type { DebugLevelResponse } from "./lightning"; +import type { DebugLevelRequest } from "./lightning"; +import type { GraphTopologyUpdate } from "./lightning"; +import type { GraphTopologySubscription } from "./lightning"; +import type { StopResponse } from "./lightning"; +import type { StopRequest } from "./lightning"; +import type { NetworkInfo } from "./lightning"; +import type { NetworkInfoRequest } from "./lightning"; +import type { QueryRoutesResponse } from "./lightning"; +import type { QueryRoutesRequest } from "./lightning"; +import type { NodeInfo } from "./lightning"; +import type { NodeInfoRequest } from "./lightning"; +import type { ChannelEdge } from "./lightning"; +import type { ChanInfoRequest } from "./lightning"; +import type { NodeMetricsResponse } from "./lightning"; +import type { NodeMetricsRequest } from "./lightning"; +import type { ChannelGraph } from "./lightning"; +import type { ChannelGraphRequest } from "./lightning"; +import type { DeleteAllPaymentsResponse } from "./lightning"; +import type { DeleteAllPaymentsRequest } from "./lightning"; +import type { DeletePaymentResponse } from "./lightning"; +import type { DeletePaymentRequest } from "./lightning"; +import type { ListPaymentsResponse } from "./lightning"; +import type { ListPaymentsRequest } from "./lightning"; +import type { PayReq } from "./lightning"; +import type { PayReqString } from "./lightning"; +import type { InvoiceSubscription } from "./lightning"; +import type { PaymentHash } from "./lightning"; +import type { ListInvoiceResponse } from "./lightning"; +import type { ListInvoiceRequest } from "./lightning"; +import type { AddInvoiceResponse } from "./lightning"; +import type { Invoice } from "./lightning"; +import type { SendToRouteRequest } from "./lightning"; +import type { SendResponse } from "./lightning"; +import type { SendRequest } from "./lightning"; +import type { AbandonChannelResponse } from "./lightning"; +import type { AbandonChannelRequest } from "./lightning"; +import type { CloseStatusUpdate } from "./lightning"; +import type { CloseChannelRequest } from "./lightning"; +import type { ChannelAcceptRequest } from "./lightning"; +import type { ChannelAcceptResponse } from "./lightning"; import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc"; -import type { FundingStateStepResp } from "./rpc"; -import type { FundingTransitionMsg } from "./rpc"; -import type { OpenStatusUpdate } from "./rpc"; -import type { ChannelPoint } from "./rpc"; -import type { OpenChannelRequest } from "./rpc"; -import type { ClosedChannelsResponse } from "./rpc"; -import type { ClosedChannelsRequest } from "./rpc"; -import type { ChannelEventUpdate } from "./rpc"; -import type { ChannelEventSubscription } from "./rpc"; -import type { ListChannelsResponse } from "./rpc"; -import type { ListChannelsRequest } from "./rpc"; -import type { PendingChannelsResponse } from "./rpc"; -import type { PendingChannelsRequest } from "./rpc"; -import type { GetRecoveryInfoResponse } from "./rpc"; -import type { GetRecoveryInfoRequest } from "./rpc"; -import type { GetInfoResponse } from "./rpc"; -import type { GetInfoRequest } from "./rpc"; -import type { PeerEvent } from "./rpc"; -import type { PeerEventSubscription } from "./rpc"; -import type { ListPeersResponse } from "./rpc"; -import type { ListPeersRequest } from "./rpc"; -import type { DisconnectPeerResponse } from "./rpc"; -import type { DisconnectPeerRequest } from "./rpc"; -import type { ConnectPeerResponse } from "./rpc"; -import type { ConnectPeerRequest } from "./rpc"; -import type { VerifyMessageResponse } from "./rpc"; -import type { VerifyMessageRequest } from "./rpc"; -import type { SignMessageResponse } from "./rpc"; -import type { SignMessageRequest } from "./rpc"; -import type { NewAddressResponse } from "./rpc"; -import type { NewAddressRequest } from "./rpc"; -import type { SendManyResponse } from "./rpc"; -import type { SendManyRequest } from "./rpc"; -import type { Transaction } from "./rpc"; +import type { FundingStateStepResp } from "./lightning"; +import type { FundingTransitionMsg } from "./lightning"; +import type { BatchOpenChannelResponse } from "./lightning"; +import type { BatchOpenChannelRequest } from "./lightning"; +import type { OpenStatusUpdate } from "./lightning"; +import type { ChannelPoint } from "./lightning"; +import type { OpenChannelRequest } from "./lightning"; +import type { ClosedChannelsResponse } from "./lightning"; +import type { ClosedChannelsRequest } from "./lightning"; +import type { ChannelEventUpdate } from "./lightning"; +import type { ChannelEventSubscription } from "./lightning"; +import type { ListChannelsResponse } from "./lightning"; +import type { ListChannelsRequest } from "./lightning"; +import type { PendingChannelsResponse } from "./lightning"; +import type { PendingChannelsRequest } from "./lightning"; +import type { GetRecoveryInfoResponse } from "./lightning"; +import type { GetRecoveryInfoRequest } from "./lightning"; +import type { GetInfoResponse } from "./lightning"; +import type { GetInfoRequest } from "./lightning"; +import type { PeerEvent } from "./lightning"; +import type { PeerEventSubscription } from "./lightning"; +import type { ListPeersResponse } from "./lightning"; +import type { ListPeersRequest } from "./lightning"; +import type { DisconnectPeerResponse } from "./lightning"; +import type { DisconnectPeerRequest } from "./lightning"; +import type { ConnectPeerResponse } from "./lightning"; +import type { ConnectPeerRequest } from "./lightning"; +import type { VerifyMessageResponse } from "./lightning"; +import type { VerifyMessageRequest } from "./lightning"; +import type { SignMessageResponse } from "./lightning"; +import type { SignMessageRequest } from "./lightning"; +import type { NewAddressResponse } from "./lightning"; +import type { NewAddressRequest } from "./lightning"; +import type { SendManyResponse } from "./lightning"; +import type { SendManyRequest } from "./lightning"; +import type { Transaction } from "./lightning"; import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; -import type { ListUnspentResponse } from "./rpc"; -import type { ListUnspentRequest } from "./rpc"; -import type { SendCoinsResponse } from "./rpc"; -import type { SendCoinsRequest } from "./rpc"; -import type { EstimateFeeResponse } from "./rpc"; -import type { EstimateFeeRequest } from "./rpc"; -import type { TransactionDetails } from "./rpc"; -import type { GetTransactionsRequest } from "./rpc"; -import type { ChannelBalanceResponse } from "./rpc"; -import type { ChannelBalanceRequest } from "./rpc"; +import type { ListUnspentResponse } from "./lightning"; +import type { ListUnspentRequest } from "./lightning"; +import type { SendCoinsResponse } from "./lightning"; +import type { SendCoinsRequest } from "./lightning"; +import type { EstimateFeeResponse } from "./lightning"; +import type { EstimateFeeRequest } from "./lightning"; +import type { TransactionDetails } from "./lightning"; +import type { GetTransactionsRequest } from "./lightning"; +import type { ChannelBalanceResponse } from "./lightning"; +import type { ChannelBalanceRequest } from "./lightning"; import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -import type { WalletBalanceResponse } from "./rpc"; -import type { WalletBalanceRequest } from "./rpc"; +import type { WalletBalanceResponse } from "./lightning"; +import type { WalletBalanceRequest } from "./lightning"; import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; // @@ -358,6 +374,17 @@ export interface ILightningClient { * @generated from protobuf rpc: OpenChannel(lnrpc.OpenChannelRequest) returns (stream lnrpc.OpenStatusUpdate); */ openChannel(input: OpenChannelRequest, options?: RpcOptions): ServerStreamingCall; + /** + * lncli: `batchopenchannel` + * BatchOpenChannel attempts to open multiple single-funded channels in a + * single transaction in an atomic way. This means either all channel open + * requests succeed at once or all attempts are aborted if any of them fail. + * This is the safer variant of using PSBTs to manually fund a batch of + * channels through the OpenChannel RPC. + * + * @generated from protobuf rpc: BatchOpenChannel(lnrpc.BatchOpenChannelRequest) returns (lnrpc.BatchOpenChannelResponse); + */ + batchOpenChannel(input: BatchOpenChannelRequest, options?: RpcOptions): UnaryCall; /** * * FundingStateStep is an advanced funding related call that allows the caller @@ -514,7 +541,16 @@ export interface ILightningClient { listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall; /** * - * DeleteAllPayments deletes all outgoing payments from DB. + * DeletePayment deletes an outgoing payment from DB. Note that it will not + * attempt to delete an In-Flight payment, since that would be unsafe. + * + * @generated from protobuf rpc: DeletePayment(lnrpc.DeletePaymentRequest) returns (lnrpc.DeletePaymentResponse); + */ + deletePayment(input: DeletePaymentRequest, options?: RpcOptions): UnaryCall; + /** + * + * DeleteAllPayments deletes all outgoing payments from DB. Note that it will + * not attempt to delete In-Flight payments, since that would be unsafe. * * @generated from protobuf rpc: DeleteAllPayments(lnrpc.DeleteAllPaymentsRequest) returns (lnrpc.DeleteAllPaymentsResponse); */ @@ -631,8 +667,9 @@ export interface ILightningClient { * lncli: `fwdinghistory` * ForwardingHistory allows the caller to query the htlcswitch for a record of * all HTLCs forwarded within the target time range, and integer offset - * within that time range. If no time-range is specified, then the first chunk - * of the past 24 hrs of forwarding history are returned. + * within that time range, for a maximum number of events. If no maximum number + * of events is specified, up to 100 events will be returned. If no time-range + * is specified, then events will be returned in the order that they occured. * * A list of forwarding events are returned. The size of each forwarding event * is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. @@ -730,6 +767,61 @@ export interface ILightningClient { * @generated from protobuf rpc: ListPermissions(lnrpc.ListPermissionsRequest) returns (lnrpc.ListPermissionsResponse); */ listPermissions(input: ListPermissionsRequest, options?: RpcOptions): UnaryCall; + /** + * + * CheckMacaroonPermissions checks whether a request follows the constraints + * imposed on the macaroon and that the macaroon is authorized to follow the + * provided permissions. + * + * @generated from protobuf rpc: CheckMacaroonPermissions(lnrpc.CheckMacPermRequest) returns (lnrpc.CheckMacPermResponse); + */ + checkMacaroonPermissions(input: CheckMacPermRequest, options?: RpcOptions): UnaryCall; + /** + * + * RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A + * gRPC middleware is software component external to lnd that aims to add + * additional business logic to lnd by observing/intercepting/validating + * incoming gRPC client requests and (if needed) replacing/overwriting outgoing + * messages before they're sent to the client. When registering the middleware + * must identify itself and indicate what custom macaroon caveats it wants to + * be responsible for. Only requests that contain a macaroon with that specific + * custom caveat are then sent to the middleware for inspection. The other + * option is to register for the read-only mode in which all requests/responses + * are forwarded for interception to the middleware but the middleware is not + * allowed to modify any responses. As a security measure, _no_ middleware can + * modify responses for requests made with _unencumbered_ macaroons! + * + * @generated from protobuf rpc: RegisterRPCMiddleware(stream lnrpc.RPCMiddlewareResponse) returns (stream lnrpc.RPCMiddlewareRequest); + */ + registerRPCMiddleware(options?: RpcOptions): DuplexStreamingCall; + /** + * lncli: `sendcustom` + * SendCustomMessage sends a custom peer message. + * + * @generated from protobuf rpc: SendCustomMessage(lnrpc.SendCustomMessageRequest) returns (lnrpc.SendCustomMessageResponse); + */ + sendCustomMessage(input: SendCustomMessageRequest, options?: RpcOptions): UnaryCall; + /** + * lncli: `subscribecustom` + * SubscribeCustomMessages subscribes to a stream of incoming custom peer + * messages. + * + * @generated from protobuf rpc: SubscribeCustomMessages(lnrpc.SubscribeCustomMessagesRequest) returns (stream lnrpc.CustomMessage); + */ + subscribeCustomMessages(input: SubscribeCustomMessagesRequest, options?: RpcOptions): ServerStreamingCall; + /** + * lncli: `listaliases` + * ListAliases returns the set of all aliases that have ever existed with + * their confirmed SCID (if it exists) and/or the base SCID (in the case of + * zero conf). + * + * @generated from protobuf rpc: ListAliases(lnrpc.ListAliasesRequest) returns (lnrpc.ListAliasesResponse); + */ + listAliases(input: ListAliasesRequest, options?: RpcOptions): UnaryCall; + /** + * @generated from protobuf rpc: LookupHtlc(lnrpc.LookupHtlcRequest) returns (lnrpc.LookupHtlcResponse); + */ + lookupHtlc(input: LookupHtlcRequest, options?: RpcOptions): UnaryCall; } // // Comments in this file will be directly parsed into the API @@ -1047,6 +1139,20 @@ export class LightningClient implements ILightningClient, ServiceInfo { const method = this.methods[22], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } + /** + * lncli: `batchopenchannel` + * BatchOpenChannel attempts to open multiple single-funded channels in a + * single transaction in an atomic way. This means either all channel open + * requests succeed at once or all attempts are aborted if any of them fail. + * This is the safer variant of using PSBTs to manually fund a batch of + * channels through the OpenChannel RPC. + * + * @generated from protobuf rpc: BatchOpenChannel(lnrpc.BatchOpenChannelRequest) returns (lnrpc.BatchOpenChannelResponse); + */ + batchOpenChannel(input: BatchOpenChannelRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[23], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } /** * * FundingStateStep is an advanced funding related call that allows the caller @@ -1061,7 +1167,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: FundingStateStep(lnrpc.FundingTransitionMsg) returns (lnrpc.FundingStateStepResp); */ fundingStateStep(input: FundingTransitionMsg, options?: RpcOptions): UnaryCall { - const method = this.methods[23], opt = this._transport.mergeOptions(options); + const method = this.methods[24], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1075,7 +1181,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: ChannelAcceptor(stream lnrpc.ChannelAcceptResponse) returns (stream lnrpc.ChannelAcceptRequest); */ channelAcceptor(options?: RpcOptions): DuplexStreamingCall { - const method = this.methods[24], opt = this._transport.mergeOptions(options); + const method = this.methods[25], opt = this._transport.mergeOptions(options); return stackIntercept("duplex", this._transport, method, opt); } /** @@ -1091,7 +1197,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: CloseChannel(lnrpc.CloseChannelRequest) returns (stream lnrpc.CloseStatusUpdate); */ closeChannel(input: CloseChannelRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[25], opt = this._transport.mergeOptions(options); + const method = this.methods[26], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } /** @@ -1106,7 +1212,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: AbandonChannel(lnrpc.AbandonChannelRequest) returns (lnrpc.AbandonChannelResponse); */ abandonChannel(input: AbandonChannelRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[26], opt = this._transport.mergeOptions(options); + const method = this.methods[27], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1121,7 +1227,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: SendPayment(stream lnrpc.SendRequest) returns (stream lnrpc.SendResponse); */ sendPayment(options?: RpcOptions): DuplexStreamingCall { - const method = this.methods[27], opt = this._transport.mergeOptions(options); + const method = this.methods[28], opt = this._transport.mergeOptions(options); return stackIntercept("duplex", this._transport, method, opt); } /** @@ -1134,7 +1240,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: SendPaymentSync(lnrpc.SendRequest) returns (lnrpc.SendResponse); */ sendPaymentSync(input: SendRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[28], opt = this._transport.mergeOptions(options); + const method = this.methods[29], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1149,7 +1255,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: SendToRoute(stream lnrpc.SendToRouteRequest) returns (stream lnrpc.SendResponse); */ sendToRoute(options?: RpcOptions): DuplexStreamingCall { - const method = this.methods[29], opt = this._transport.mergeOptions(options); + const method = this.methods[30], opt = this._transport.mergeOptions(options); return stackIntercept("duplex", this._transport, method, opt); } /** @@ -1160,7 +1266,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: SendToRouteSync(lnrpc.SendToRouteRequest) returns (lnrpc.SendResponse); */ sendToRouteSync(input: SendToRouteRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[30], opt = this._transport.mergeOptions(options); + const method = this.methods[31], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1172,7 +1278,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: AddInvoice(lnrpc.Invoice) returns (lnrpc.AddInvoiceResponse); */ addInvoice(input: Invoice, options?: RpcOptions): UnaryCall { - const method = this.methods[31], opt = this._transport.mergeOptions(options); + const method = this.methods[32], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1188,7 +1294,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: ListInvoices(lnrpc.ListInvoiceRequest) returns (lnrpc.ListInvoiceResponse); */ listInvoices(input: ListInvoiceRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[32], opt = this._transport.mergeOptions(options); + const method = this.methods[33], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1200,7 +1306,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: LookupInvoice(lnrpc.PaymentHash) returns (lnrpc.Invoice); */ lookupInvoice(input: PaymentHash, options?: RpcOptions): UnaryCall { - const method = this.methods[33], opt = this._transport.mergeOptions(options); + const method = this.methods[34], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1218,7 +1324,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: SubscribeInvoices(lnrpc.InvoiceSubscription) returns (stream lnrpc.Invoice); */ subscribeInvoices(input: InvoiceSubscription, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[34], opt = this._transport.mergeOptions(options); + const method = this.methods[35], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } /** @@ -1230,7 +1336,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: DecodePayReq(lnrpc.PayReqString) returns (lnrpc.PayReq); */ decodePayReq(input: PayReqString, options?: RpcOptions): UnaryCall { - const method = this.methods[35], opt = this._transport.mergeOptions(options); + const method = this.methods[36], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1240,17 +1346,29 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: ListPayments(lnrpc.ListPaymentsRequest) returns (lnrpc.ListPaymentsResponse); */ listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[36], opt = this._transport.mergeOptions(options); + const method = this.methods[37], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** * - * DeleteAllPayments deletes all outgoing payments from DB. + * DeletePayment deletes an outgoing payment from DB. Note that it will not + * attempt to delete an In-Flight payment, since that would be unsafe. + * + * @generated from protobuf rpc: DeletePayment(lnrpc.DeletePaymentRequest) returns (lnrpc.DeletePaymentResponse); + */ + deletePayment(input: DeletePaymentRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[38], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * DeleteAllPayments deletes all outgoing payments from DB. Note that it will + * not attempt to delete In-Flight payments, since that would be unsafe. * * @generated from protobuf rpc: DeleteAllPayments(lnrpc.DeleteAllPaymentsRequest) returns (lnrpc.DeleteAllPaymentsResponse); */ deleteAllPayments(input: DeleteAllPaymentsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[37], opt = this._transport.mergeOptions(options); + const method = this.methods[39], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1265,7 +1383,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: DescribeGraph(lnrpc.ChannelGraphRequest) returns (lnrpc.ChannelGraph); */ describeGraph(input: ChannelGraphRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[38], opt = this._transport.mergeOptions(options); + const method = this.methods[40], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1276,7 +1394,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: GetNodeMetrics(lnrpc.NodeMetricsRequest) returns (lnrpc.NodeMetricsResponse); */ getNodeMetrics(input: NodeMetricsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[39], opt = this._transport.mergeOptions(options); + const method = this.methods[41], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1289,7 +1407,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: GetChanInfo(lnrpc.ChanInfoRequest) returns (lnrpc.ChannelEdge); */ getChanInfo(input: ChanInfoRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[40], opt = this._transport.mergeOptions(options); + const method = this.methods[42], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1300,7 +1418,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: GetNodeInfo(lnrpc.NodeInfoRequest) returns (lnrpc.NodeInfo); */ getNodeInfo(input: NodeInfoRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[41], opt = this._transport.mergeOptions(options); + const method = this.methods[43], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1319,7 +1437,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: QueryRoutes(lnrpc.QueryRoutesRequest) returns (lnrpc.QueryRoutesResponse); */ queryRoutes(input: QueryRoutesRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[42], opt = this._transport.mergeOptions(options); + const method = this.methods[44], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1330,7 +1448,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: GetNetworkInfo(lnrpc.NetworkInfoRequest) returns (lnrpc.NetworkInfo); */ getNetworkInfo(input: NetworkInfoRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[43], opt = this._transport.mergeOptions(options); + const method = this.methods[45], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1341,7 +1459,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: StopDaemon(lnrpc.StopRequest) returns (lnrpc.StopResponse); */ stopDaemon(input: StopRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[44], opt = this._transport.mergeOptions(options); + const method = this.methods[46], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1356,7 +1474,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: SubscribeChannelGraph(lnrpc.GraphTopologySubscription) returns (stream lnrpc.GraphTopologyUpdate); */ subscribeChannelGraph(input: GraphTopologySubscription, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[45], opt = this._transport.mergeOptions(options); + const method = this.methods[47], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } /** @@ -1369,7 +1487,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: DebugLevel(lnrpc.DebugLevelRequest) returns (lnrpc.DebugLevelResponse); */ debugLevel(input: DebugLevelRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[46], opt = this._transport.mergeOptions(options); + const method = this.methods[48], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1380,7 +1498,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: FeeReport(lnrpc.FeeReportRequest) returns (lnrpc.FeeReportResponse); */ feeReport(input: FeeReportRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[47], opt = this._transport.mergeOptions(options); + const method = this.methods[49], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1391,15 +1509,16 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: UpdateChannelPolicy(lnrpc.PolicyUpdateRequest) returns (lnrpc.PolicyUpdateResponse); */ updateChannelPolicy(input: PolicyUpdateRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[48], opt = this._transport.mergeOptions(options); + const method = this.methods[50], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** * lncli: `fwdinghistory` * ForwardingHistory allows the caller to query the htlcswitch for a record of * all HTLCs forwarded within the target time range, and integer offset - * within that time range. If no time-range is specified, then the first chunk - * of the past 24 hrs of forwarding history are returned. + * within that time range, for a maximum number of events. If no maximum number + * of events is specified, up to 100 events will be returned. If no time-range + * is specified, then events will be returned in the order that they occured. * * A list of forwarding events are returned. The size of each forwarding event * is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. @@ -1410,7 +1529,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: ForwardingHistory(lnrpc.ForwardingHistoryRequest) returns (lnrpc.ForwardingHistoryResponse); */ forwardingHistory(input: ForwardingHistoryRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[49], opt = this._transport.mergeOptions(options); + const method = this.methods[51], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1425,7 +1544,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: ExportChannelBackup(lnrpc.ExportChannelBackupRequest) returns (lnrpc.ChannelBackup); */ exportChannelBackup(input: ExportChannelBackupRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[50], opt = this._transport.mergeOptions(options); + const method = this.methods[52], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1439,7 +1558,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: ExportAllChannelBackups(lnrpc.ChanBackupExportRequest) returns (lnrpc.ChanBackupSnapshot); */ exportAllChannelBackups(input: ChanBackupExportRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[51], opt = this._transport.mergeOptions(options); + const method = this.methods[53], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1451,7 +1570,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: VerifyChanBackup(lnrpc.ChanBackupSnapshot) returns (lnrpc.VerifyChanBackupResponse); */ verifyChanBackup(input: ChanBackupSnapshot, options?: RpcOptions): UnaryCall { - const method = this.methods[52], opt = this._transport.mergeOptions(options); + const method = this.methods[54], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1464,7 +1583,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: RestoreChannelBackups(lnrpc.RestoreChanBackupRequest) returns (lnrpc.RestoreBackupResponse); */ restoreChannelBackups(input: RestoreChanBackupRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[53], opt = this._transport.mergeOptions(options); + const method = this.methods[55], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1480,7 +1599,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: SubscribeChannelBackups(lnrpc.ChannelBackupSubscription) returns (stream lnrpc.ChanBackupSnapshot); */ subscribeChannelBackups(input: ChannelBackupSubscription, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[54], opt = this._transport.mergeOptions(options); + const method = this.methods[56], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } /** @@ -1492,7 +1611,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: BakeMacaroon(lnrpc.BakeMacaroonRequest) returns (lnrpc.BakeMacaroonResponse); */ bakeMacaroon(input: BakeMacaroonRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[55], opt = this._transport.mergeOptions(options); + const method = this.methods[57], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1502,7 +1621,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: ListMacaroonIDs(lnrpc.ListMacaroonIDsRequest) returns (lnrpc.ListMacaroonIDsResponse); */ listMacaroonIDs(input: ListMacaroonIDsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[56], opt = this._transport.mergeOptions(options); + const method = this.methods[58], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1513,7 +1632,7 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: DeleteMacaroonID(lnrpc.DeleteMacaroonIDRequest) returns (lnrpc.DeleteMacaroonIDResponse); */ deleteMacaroonID(input: DeleteMacaroonIDRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[57], opt = this._transport.mergeOptions(options); + const method = this.methods[59], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -1524,7 +1643,80 @@ export class LightningClient implements ILightningClient, ServiceInfo { * @generated from protobuf rpc: ListPermissions(lnrpc.ListPermissionsRequest) returns (lnrpc.ListPermissionsResponse); */ listPermissions(input: ListPermissionsRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[58], opt = this._transport.mergeOptions(options); + const method = this.methods[60], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } + /** + * + * CheckMacaroonPermissions checks whether a request follows the constraints + * imposed on the macaroon and that the macaroon is authorized to follow the + * provided permissions. + * + * @generated from protobuf rpc: CheckMacaroonPermissions(lnrpc.CheckMacPermRequest) returns (lnrpc.CheckMacPermResponse); + */ + checkMacaroonPermissions(input: CheckMacPermRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[61], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * + * RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A + * gRPC middleware is software component external to lnd that aims to add + * additional business logic to lnd by observing/intercepting/validating + * incoming gRPC client requests and (if needed) replacing/overwriting outgoing + * messages before they're sent to the client. When registering the middleware + * must identify itself and indicate what custom macaroon caveats it wants to + * be responsible for. Only requests that contain a macaroon with that specific + * custom caveat are then sent to the middleware for inspection. The other + * option is to register for the read-only mode in which all requests/responses + * are forwarded for interception to the middleware but the middleware is not + * allowed to modify any responses. As a security measure, _no_ middleware can + * modify responses for requests made with _unencumbered_ macaroons! + * + * @generated from protobuf rpc: RegisterRPCMiddleware(stream lnrpc.RPCMiddlewareResponse) returns (stream lnrpc.RPCMiddlewareRequest); + */ + registerRPCMiddleware(options?: RpcOptions): DuplexStreamingCall { + const method = this.methods[62], opt = this._transport.mergeOptions(options); + return stackIntercept("duplex", this._transport, method, opt); + } + /** + * lncli: `sendcustom` + * SendCustomMessage sends a custom peer message. + * + * @generated from protobuf rpc: SendCustomMessage(lnrpc.SendCustomMessageRequest) returns (lnrpc.SendCustomMessageResponse); + */ + sendCustomMessage(input: SendCustomMessageRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[63], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * lncli: `subscribecustom` + * SubscribeCustomMessages subscribes to a stream of incoming custom peer + * messages. + * + * @generated from protobuf rpc: SubscribeCustomMessages(lnrpc.SubscribeCustomMessagesRequest) returns (stream lnrpc.CustomMessage); + */ + subscribeCustomMessages(input: SubscribeCustomMessagesRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[64], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } + /** + * lncli: `listaliases` + * ListAliases returns the set of all aliases that have ever existed with + * their confirmed SCID (if it exists) and/or the base SCID (in the case of + * zero conf). + * + * @generated from protobuf rpc: ListAliases(lnrpc.ListAliasesRequest) returns (lnrpc.ListAliasesResponse); + */ + listAliases(input: ListAliasesRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[65], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } + /** + * @generated from protobuf rpc: LookupHtlc(lnrpc.LookupHtlcRequest) returns (lnrpc.LookupHtlcResponse); + */ + lookupHtlc(input: LookupHtlcRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[66], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } } diff --git a/proto/lnd/rpc.ts b/proto/lnd/lightning.ts similarity index 80% rename from proto/lnd/rpc.ts rename to proto/lnd/lightning.ts index 55d7326d..f8a8587a 100644 --- a/proto/lnd/rpc.ts +++ b/proto/lnd/lightning.ts @@ -1,5 +1,5 @@ -// @generated by protobuf-ts 2.5.0 with parameter long_type_string -// @generated from protobuf file "rpc.proto" (package "lnrpc", syntax proto3) +// @generated by protobuf-ts 2.5.0 +// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3) // tslint:disable import { ServiceType } from "@protobuf-ts/runtime-rpc"; import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; @@ -12,6 +12,88 @@ import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; +/** + * @generated from protobuf message lnrpc.LookupHtlcRequest + */ +export interface LookupHtlcRequest { + /** + * @generated from protobuf field: uint64 chan_id = 1; + */ + chanId: bigint; + /** + * @generated from protobuf field: uint64 htlc_index = 2; + */ + htlcIndex: bigint; +} +/** + * @generated from protobuf message lnrpc.LookupHtlcResponse + */ +export interface LookupHtlcResponse { + /** + * @generated from protobuf field: bool settled = 1; + */ + settled: boolean; + /** + * @generated from protobuf field: bool offchain = 2; + */ + offchain: boolean; +} +/** + * @generated from protobuf message lnrpc.SubscribeCustomMessagesRequest + */ +export interface SubscribeCustomMessagesRequest { +} +/** + * @generated from protobuf message lnrpc.CustomMessage + */ +export interface CustomMessage { + /** + * Peer from which the message originates + * + * @generated from protobuf field: bytes peer = 1; + */ + peer: Uint8Array; + /** + * Message type. This value will be in the custom range (>= 32768). + * + * @generated from protobuf field: uint32 type = 2; + */ + type: number; + /** + * Raw message data + * + * @generated from protobuf field: bytes data = 3; + */ + data: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.SendCustomMessageRequest + */ +export interface SendCustomMessageRequest { + /** + * Peer to send the message to + * + * @generated from protobuf field: bytes peer = 1; + */ + peer: Uint8Array; + /** + * Message type. This value needs to be in the custom range (>= 32768). + * + * @generated from protobuf field: uint32 type = 2; + */ + type: number; + /** + * Raw message data. + * + * @generated from protobuf field: bytes data = 3; + */ + data: Uint8Array; +} +/** + * @generated from protobuf message lnrpc.SendCustomMessageResponse + */ +export interface SendCustomMessageResponse { +} /** * @generated from protobuf message lnrpc.Utxo */ @@ -33,7 +115,7 @@ export interface Utxo { * * @generated from protobuf field: int64 amount_sat = 3; */ - amountSat: string; + amountSat: bigint; /** * The pkscript in hex * @@ -51,7 +133,48 @@ export interface Utxo { * * @generated from protobuf field: int64 confirmations = 6; */ - confirmations: string; + confirmations: bigint; +} +/** + * @generated from protobuf message lnrpc.OutputDetail + */ +export interface OutputDetail { + /** + * The type of the output + * + * @generated from protobuf field: lnrpc.OutputScriptType output_type = 1; + */ + outputType: OutputScriptType; + /** + * The address + * + * @generated from protobuf field: string address = 2; + */ + address: string; + /** + * The pkscript in hex + * + * @generated from protobuf field: string pk_script = 3; + */ + pkScript: string; + /** + * The output index used in the raw transaction + * + * @generated from protobuf field: int64 output_index = 4; + */ + outputIndex: bigint; + /** + * The value of the output coin in satoshis + * + * @generated from protobuf field: int64 amount = 5; + */ + amount: bigint; + /** + * Denotes if the output is controlled by the internal wallet + * + * @generated from protobuf field: bool is_our_address = 6; + */ + isOurAddress: boolean; } /** * @generated from protobuf message lnrpc.Transaction @@ -68,7 +191,7 @@ export interface Transaction { * * @generated from protobuf field: int64 amount = 2; */ - amount: string; + amount: bigint; /** * The number of confirmations * @@ -92,19 +215,27 @@ export interface Transaction { * * @generated from protobuf field: int64 time_stamp = 6; */ - timeStamp: string; + timeStamp: bigint; /** * Fees paid for this transaction * * @generated from protobuf field: int64 total_fees = 7; */ - totalFees: string; + totalFees: bigint; /** - * Addresses that received funds for this transaction + * Addresses that received funds for this transaction. Deprecated as it is + * now incorporated in the output_details field. * - * @generated from protobuf field: repeated string dest_addresses = 8; + * @deprecated + * @generated from protobuf field: repeated string dest_addresses = 8 [deprecated = true]; */ destAddresses: string[]; + /** + * Outputs that received funds for this transaction + * + * @generated from protobuf field: repeated lnrpc.OutputDetail output_details = 11; + */ + outputDetails: OutputDetail[]; /** * The raw transaction hex. * @@ -117,6 +248,12 @@ export interface Transaction { * @generated from protobuf field: string label = 10; */ label: string; + /** + * PreviousOutpoints/Inputs of this transaction. + * + * @generated from protobuf field: repeated lnrpc.PreviousOutPoint previous_outpoints = 12; + */ + previousOutpoints: PreviousOutPoint[]; } /** * @generated from protobuf message lnrpc.GetTransactionsRequest @@ -176,7 +313,7 @@ export interface FeeLimit { * * @generated from protobuf field: int64 fixed = 1; */ - fixed: string; + fixed: bigint; } | { oneofKind: "fixedMsat"; /** @@ -187,7 +324,7 @@ export interface FeeLimit { * * @generated from protobuf field: int64 fixed_msat = 3; */ - fixedMsat: string; + fixedMsat: bigint; } | { oneofKind: "percent"; /** @@ -195,7 +332,7 @@ export interface FeeLimit { * * @generated from protobuf field: int64 percent = 2; */ - percent: string; + percent: bigint; } | { oneofKind: undefined; }; @@ -229,7 +366,7 @@ export interface SendRequest { * * @generated from protobuf field: int64 amt = 3; */ - amt: string; + amt: bigint; /** * * The amount to send expressed in millisatoshis. @@ -238,7 +375,7 @@ export interface SendRequest { * * @generated from protobuf field: int64 amt_msat = 12; */ - amtMsat: string; + amtMsat: bigint; /** * * The hash to use within the payment's HTLC. When using REST, this field @@ -278,7 +415,8 @@ export interface SendRequest { * The maximum number of satoshis that will be paid as a fee of the payment. * This value can be represented either as a percentage of the amount being * sent, or as a fixed amount of the maximum fee the user is willing the pay to - * send the payment. + * send the payment. If not specified, lnd will use a default value of 100% + * fees for small amounts (<=1k sat) or 5% fees for larger amounts. * * @generated from protobuf field: lnrpc.FeeLimit fee_limit = 8; */ @@ -422,46 +560,46 @@ export interface ChannelAcceptRequest { * * @generated from protobuf field: uint64 funding_amt = 4; */ - fundingAmt: string; + fundingAmt: bigint; /** * The push amount of the proposed channel in millisatoshis. * * @generated from protobuf field: uint64 push_amt = 5; */ - pushAmt: string; + pushAmt: bigint; /** * The dust limit of the initiator's commitment tx. * * @generated from protobuf field: uint64 dust_limit = 6; */ - dustLimit: string; + dustLimit: bigint; /** * The maximum amount of coins in millisatoshis that can be pending in this * channel. * * @generated from protobuf field: uint64 max_value_in_flight = 7; */ - maxValueInFlight: string; + maxValueInFlight: bigint; /** * The minimum amount of satoshis the initiator requires us to have at all * times. * * @generated from protobuf field: uint64 channel_reserve = 8; */ - channelReserve: string; + channelReserve: bigint; /** * The smallest HTLC in millisatoshis that the initiator will accept. * * @generated from protobuf field: uint64 min_htlc = 9; */ - minHtlc: string; + minHtlc: bigint; /** * The initial fee rate that the initiator suggests for both commitment * transactions. * * @generated from protobuf field: uint64 fee_per_kw = 10; */ - feePerKw: string; + feePerKw: bigint; /** * * The number of blocks to use for the relative time lock in the pay-to-self @@ -483,6 +621,26 @@ export interface ChannelAcceptRequest { * @generated from protobuf field: uint32 channel_flags = 13; */ channelFlags: number; + /** + * The commitment type the initiator wishes to use for the proposed channel. + * + * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 14; + */ + commitmentType: CommitmentType; + /** + * Whether the initiator wants to open a zero-conf channel via the channel + * type. + * + * @generated from protobuf field: bool wants_zero_conf = 15; + */ + wantsZeroConf: boolean; + /** + * Whether the initiator wants to use the scid-alias channel type. This is + * separate from the feature bit. + * + * @generated from protobuf field: bool wants_scid_alias = 16; + */ + wantsScidAlias: boolean; } /** * @generated from protobuf message lnrpc.ChannelAcceptResponse @@ -538,7 +696,7 @@ export interface ChannelAcceptResponse { * * @generated from protobuf field: uint64 reserve_sat = 6; */ - reserveSat: string; + reserveSat: bigint; /** * * The maximum amount of funds in millisatoshis that we allow the remote peer @@ -546,7 +704,7 @@ export interface ChannelAcceptResponse { * * @generated from protobuf field: uint64 in_flight_max_msat = 7; */ - inFlightMaxMsat: string; + inFlightMaxMsat: bigint; /** * * The maximum number of htlcs that the remote peer can offer us. @@ -560,7 +718,7 @@ export interface ChannelAcceptResponse { * * @generated from protobuf field: uint64 min_htlc_in = 9; */ - minHtlcIn: string; + minHtlcIn: bigint; /** * * The number of confirmations we require before we consider the channel open. @@ -568,6 +726,15 @@ export interface ChannelAcceptResponse { * @generated from protobuf field: uint32 min_accept_depth = 10; */ minAcceptDepth: number; + /** + * + * Whether the responder wants this to be a zero-conf channel. This will fail + * if either side does not have the scid-alias feature bit set. The minimum + * depth field must be zero if this is true. + * + * @generated from protobuf field: bool zero_conf = 11; + */ + zeroConf: boolean; } /** * @generated from protobuf message lnrpc.ChannelPoint @@ -629,19 +796,37 @@ export interface OutPoint { */ outputIndex: number; } +/** + * @generated from protobuf message lnrpc.PreviousOutPoint + */ +export interface PreviousOutPoint { + /** + * The outpoint in format txid:n. + * + * @generated from protobuf field: string outpoint = 1; + */ + outpoint: string; + /** + * Denotes if the outpoint is controlled by the internal wallet. + * The flag will only detect p2wkh, np2wkh and p2tr inputs as its own. + * + * @generated from protobuf field: bool is_our_output = 2; + */ + isOurOutput: boolean; +} /** * @generated from protobuf message lnrpc.LightningAddress */ export interface LightningAddress { /** - * The identity pubkey of the Lightning node + * The identity pubkey of the Lightning node. * * @generated from protobuf field: string pubkey = 1; */ pubkey: string; /** * The network location of the lightning node, e.g. `69.69.69.69:1337` or - * `localhost:10011` + * `localhost:10011`. * * @generated from protobuf field: string host = 2; */ @@ -657,7 +842,7 @@ export interface EstimateFeeRequest { * @generated from protobuf field: map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ addrToAmount: { - [key: string]: string; + [key: string]: bigint; }; /** * The target number of blocks that this transaction should be confirmed @@ -689,7 +874,7 @@ export interface EstimateFeeResponse { * * @generated from protobuf field: int64 fee_sat = 1; */ - feeSat: string; + feeSat: bigint; /** * Deprecated, use sat_per_vbyte. * The fee rate in satoshi/vbyte. @@ -697,13 +882,13 @@ export interface EstimateFeeResponse { * @deprecated * @generated from protobuf field: int64 feerate_sat_per_byte = 2 [deprecated = true]; */ - feerateSatPerByte: string; + feerateSatPerByte: bigint; /** * The fee rate in satoshi/vbyte. * * @generated from protobuf field: uint64 sat_per_vbyte = 3; */ - satPerVbyte: string; + satPerVbyte: bigint; } /** * @generated from protobuf message lnrpc.SendManyRequest @@ -715,7 +900,7 @@ export interface SendManyRequest { * @generated from protobuf field: map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ addrToAmount: { - [key: string]: string; + [key: string]: bigint; }; /** * The target number of blocks that this transaction should be confirmed @@ -730,7 +915,7 @@ export interface SendManyRequest { * * @generated from protobuf field: uint64 sat_per_vbyte = 4; */ - satPerVbyte: string; + satPerVbyte: bigint; /** * Deprecated, use sat_per_vbyte. * A manual fee rate set in sat/vbyte that should be used when crafting the @@ -739,7 +924,7 @@ export interface SendManyRequest { * @deprecated * @generated from protobuf field: int64 sat_per_byte = 5 [deprecated = true]; */ - satPerByte: string; + satPerByte: bigint; /** * An optional label for the transaction, limited to 500 characters. * @@ -786,7 +971,7 @@ export interface SendCoinsRequest { * * @generated from protobuf field: int64 amount = 2; */ - amount: string; + amount: bigint; /** * The target number of blocks that this transaction should be confirmed * by. @@ -800,7 +985,7 @@ export interface SendCoinsRequest { * * @generated from protobuf field: uint64 sat_per_vbyte = 4; */ - satPerVbyte: string; + satPerVbyte: bigint; /** * Deprecated, use sat_per_vbyte. * A manual fee rate set in sat/vbyte that should be used when crafting the @@ -809,7 +994,7 @@ export interface SendCoinsRequest { * @deprecated * @generated from protobuf field: int64 sat_per_byte = 5 [deprecated = true]; */ - satPerByte: string; + satPerByte: bigint; /** * * If set, then the amount field will be ignored, and lnd will attempt to @@ -926,6 +1111,14 @@ export interface SignMessageRequest { * @generated from protobuf field: bytes msg = 1; */ msg: Uint8Array; + /** + * + * Instead of the default double-SHA256 hashing of the message before signing, + * only use one round of hashing instead. + * + * @generated from protobuf field: bool single_hash = 2; + */ + singleHash: boolean; } /** * @generated from protobuf message lnrpc.SignMessageResponse @@ -979,12 +1172,14 @@ export interface VerifyMessageResponse { */ export interface ConnectPeerRequest { /** - * Lightning address of the peer, in the format `@host` + * + * Lightning address of the peer to connect to. * * @generated from protobuf field: lnrpc.LightningAddress addr = 1; */ addr?: LightningAddress; /** + * * If set, the daemon will attempt to persistently connect to the target * peer. Otherwise, the call will be synchronous. * @@ -998,7 +1193,7 @@ export interface ConnectPeerRequest { * * @generated from protobuf field: uint64 timeout = 3; */ - timeout: string; + timeout: bigint; } /** * @generated from protobuf message lnrpc.ConnectPeerResponse @@ -1032,7 +1227,7 @@ export interface HTLC { /** * @generated from protobuf field: int64 amount = 2; */ - amount: string; + amount: bigint; /** * @generated from protobuf field: bytes hash_lock = 3; */ @@ -1046,7 +1241,7 @@ export interface HTLC { * * @generated from protobuf field: uint64 htlc_index = 5; */ - htlcIndex: string; + htlcIndex: bigint; /** * If this HTLC is involved in a forwarding operation, this field indicates * the forwarding channel. For an outgoing htlc, it is the incoming channel. @@ -1058,13 +1253,13 @@ export interface HTLC { * * @generated from protobuf field: uint64 forwarding_channel = 6; */ - forwardingChannel: string; + forwardingChannel: bigint; /** * Index identifying the htlc on the forwarding channel. * * @generated from protobuf field: uint64 forwarding_htlc_index = 7; */ - forwardingHtlcIndex: string; + forwardingHtlcIndex: bigint; } /** * @generated from protobuf message lnrpc.ChannelConstraints @@ -1083,26 +1278,26 @@ export interface ChannelConstraints { * * @generated from protobuf field: uint64 chan_reserve_sat = 2; */ - chanReserveSat: string; + chanReserveSat: bigint; /** * The dust limit (in satoshis) of the initiator's commitment tx. * * @generated from protobuf field: uint64 dust_limit_sat = 3; */ - dustLimitSat: string; + dustLimitSat: bigint; /** * The maximum amount of coins in millisatoshis that can be pending in this * channel. * * @generated from protobuf field: uint64 max_pending_amt_msat = 4; */ - maxPendingAmtMsat: string; + maxPendingAmtMsat: bigint; /** * The smallest HTLC in millisatoshis that the initiator will accept. * * @generated from protobuf field: uint64 min_htlc_msat = 5; */ - minHtlcMsat: string; + minHtlcMsat: bigint; /** * The total number of incoming HTLC's that the initiator will accept. * @@ -1149,19 +1344,19 @@ export interface Channel { * * @generated from protobuf field: int64 capacity = 5; */ - capacity: string; + capacity: bigint; /** * This node's current balance in this channel * * @generated from protobuf field: int64 local_balance = 6; */ - localBalance: string; + localBalance: bigint; /** * The counterparty's current balance in this channel * * @generated from protobuf field: int64 remote_balance = 7; */ - remoteBalance: string; + remoteBalance: bigint; /** * * The amount calculated to be paid in fees for the current set of commitment @@ -1171,13 +1366,13 @@ export interface Channel { * * @generated from protobuf field: int64 commit_fee = 8; */ - commitFee: string; + commitFee: bigint; /** * The weight of the commitment transaction * * @generated from protobuf field: int64 commit_weight = 9; */ - commitWeight: string; + commitWeight: bigint; /** * * The required number of satoshis per kilo-weight that the requester will pay @@ -1186,34 +1381,34 @@ export interface Channel { * * @generated from protobuf field: int64 fee_per_kw = 10; */ - feePerKw: string; + feePerKw: bigint; /** * The unsettled balance in this channel * * @generated from protobuf field: int64 unsettled_balance = 11; */ - unsettledBalance: string; + unsettledBalance: bigint; /** * * The total number of satoshis we've sent within this channel. * * @generated from protobuf field: int64 total_satoshis_sent = 12; */ - totalSatoshisSent: string; + totalSatoshisSent: bigint; /** * * The total number of satoshis we've received within this channel. * * @generated from protobuf field: int64 total_satoshis_received = 13; */ - totalSatoshisReceived: string; + totalSatoshisReceived: bigint; /** * * The total number of updates conducted within this channel. * * @generated from protobuf field: uint64 num_updates = 14; */ - numUpdates: string; + numUpdates: bigint; /** * * The list of active, uncleared HTLCs currently pending within the channel. @@ -1256,7 +1451,7 @@ export interface Channel { * @deprecated * @generated from protobuf field: int64 local_chan_reserve_sat = 20 [deprecated = true]; */ - localChanReserveSat: string; + localChanReserveSat: bigint; /** * * Deprecated. The minimum satoshis the other node is required to reserve in @@ -1265,7 +1460,7 @@ export interface Channel { * @deprecated * @generated from protobuf field: int64 remote_chan_reserve_sat = 21 [deprecated = true]; */ - remoteChanReserveSat: string; + remoteChanReserveSat: bigint; /** * Deprecated. Use commitment_type. * @@ -1287,7 +1482,7 @@ export interface Channel { * * @generated from protobuf field: int64 lifetime = 23; */ - lifetime: string; + lifetime: bigint; /** * * The number of seconds that the remote peer has been observed as being online @@ -1296,7 +1491,7 @@ export interface Channel { * * @generated from protobuf field: int64 uptime = 24; */ - uptime: string; + uptime: bigint; /** * * Close address is the address that we will enforce payout to on cooperative @@ -1318,7 +1513,7 @@ export interface Channel { * * @generated from protobuf field: uint64 push_amount_sat = 27; */ - pushAmountSat: string; + pushAmountSat: bigint; /** * * This uint32 indicates if this channel is to be considered 'frozen'. A @@ -1344,6 +1539,26 @@ export interface Channel { * @generated from protobuf field: lnrpc.ChannelConstraints remote_constraints = 30; */ remoteConstraints?: ChannelConstraints; + /** + * + * This lists out the set of alias short channel ids that exist for a channel. + * This may be empty. + * + * @generated from protobuf field: repeated uint64 alias_scids = 31; + */ + aliasScids: bigint[]; + /** + * Whether or not this is a zero-conf channel. + * + * @generated from protobuf field: bool zero_conf = 32; + */ + zeroConf: boolean; + /** + * This is the confirmed / on-chain zero-conf SCID. + * + * @generated from protobuf field: uint64 zero_conf_confirmed_scid = 33; + */ + zeroConfConfirmedScid: bigint; } /** * @generated from protobuf message lnrpc.ListChannelsRequest @@ -1385,6 +1600,39 @@ export interface ListChannelsResponse { */ channels: Channel[]; } +/** + * @generated from protobuf message lnrpc.AliasMap + */ +export interface AliasMap { + /** + * + * For non-zero-conf channels, this is the confirmed SCID. Otherwise, this is + * the first assigned "base" alias. + * + * @generated from protobuf field: uint64 base_scid = 1; + */ + baseScid: bigint; + /** + * The set of all aliases stored for the base SCID. + * + * @generated from protobuf field: repeated uint64 aliases = 2; + */ + aliases: bigint[]; +} +/** + * @generated from protobuf message lnrpc.ListAliasesRequest + */ +export interface ListAliasesRequest { +} +/** + * @generated from protobuf message lnrpc.ListAliasesResponse + */ +export interface ListAliasesResponse { + /** + * @generated from protobuf field: repeated lnrpc.AliasMap alias_maps = 1; + */ + aliasMaps: AliasMap[]; +} /** * @generated from protobuf message lnrpc.ChannelCloseSummary */ @@ -1424,7 +1672,7 @@ export interface ChannelCloseSummary { * * @generated from protobuf field: int64 capacity = 6; */ - capacity: string; + capacity: bigint; /** * Height at which the funding transaction was spent. * @@ -1436,13 +1684,13 @@ export interface ChannelCloseSummary { * * @generated from protobuf field: int64 settled_balance = 8; */ - settledBalance: string; + settledBalance: bigint; /** * The sum of all the time-locked outputs at the time of channel closure * * @generated from protobuf field: int64 time_locked_balance = 9; */ - timeLockedBalance: string; + timeLockedBalance: bigint; /** * Details on how the channel was closed. * @@ -1473,6 +1721,20 @@ export interface ChannelCloseSummary { * @generated from protobuf field: repeated lnrpc.Resolution resolutions = 13; */ resolutions: Resolution[]; + /** + * + * This lists out the set of alias short channel ids that existed for the + * closed channel. This may be empty. + * + * @generated from protobuf field: repeated uint64 alias_scids = 14; + */ + aliasScids: bigint[]; + /** + * The confirmed SCID for a zero-conf channel. + * + * @generated from protobuf field: uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING]; + */ + zeroConfConfirmedScid: string; } /** * @generated from protobuf enum lnrpc.ChannelCloseSummary.ClosureType @@ -1530,7 +1792,7 @@ export interface Resolution { * * @generated from protobuf field: uint64 amount_sat = 4; */ - amountSat: string; + amountSat: bigint; /** * The hex-encoded transaction ID of the sweep transaction that spent the * output. @@ -1598,25 +1860,25 @@ export interface Peer { * * @generated from protobuf field: uint64 bytes_sent = 4; */ - bytesSent: string; + bytesSent: bigint; /** * Bytes of data transmitted from this peer * * @generated from protobuf field: uint64 bytes_recv = 5; */ - bytesRecv: string; + bytesRecv: bigint; /** * Satoshis sent to this peer * * @generated from protobuf field: int64 sat_sent = 6; */ - satSent: string; + satSent: bigint; /** * Satoshis received from this peer * * @generated from protobuf field: int64 sat_recv = 7; */ - satRecv: string; + satRecv: bigint; /** * A channel is inbound if the counterparty initiated the channel * @@ -1628,7 +1890,7 @@ export interface Peer { * * @generated from protobuf field: int64 ping_time = 9; */ - pingTime: string; + pingTime: bigint; /** * The type of sync we are currently performing with this peer. * @@ -1671,7 +1933,14 @@ export interface Peer { * * @generated from protobuf field: int64 last_flap_ns = 14; */ - lastFlapNs: string; + lastFlapNs: bigint; + /** + * + * The last ping payload the peer has sent to us. + * + * @generated from protobuf field: bytes last_ping_payload = 15; + */ + lastPingPayload: Uint8Array; } /** * @generated from protobuf enum lnrpc.Peer.SyncType @@ -1715,7 +1984,7 @@ export interface TimestampedError { * * @generated from protobuf field: uint64 timestamp = 1; */ - timestamp: string; + timestamp: bigint; /** * The string representation of the error sent by our peer. * @@ -1861,7 +2130,7 @@ export interface GetInfoResponse { * * @generated from protobuf field: int64 best_header_timestamp = 13; */ - bestHeaderTimestamp: string; + bestHeaderTimestamp: bigint; /** * Whether the wallet's view is synced to the main chain * @@ -1905,6 +2174,13 @@ export interface GetInfoResponse { features: { [key: number]: Feature; }; + /** + * + * Indicates whether the HTLC interceptor API is in always-on mode. + * + * @generated from protobuf field: bool require_htlc_interceptor = 21; + */ + requireHtlcInterceptor: boolean; } /** * @generated from protobuf message lnrpc.GetRecoveryInfoRequest @@ -2025,7 +2301,7 @@ export interface CloseChannelRequest { * @deprecated * @generated from protobuf field: int64 sat_per_byte = 4 [deprecated = true]; */ - satPerByte: string; + satPerByte: bigint; /** * * An optional address to send funds to in the case of a cooperative close. @@ -2042,7 +2318,15 @@ export interface CloseChannelRequest { * * @generated from protobuf field: uint64 sat_per_vbyte = 6; */ - satPerVbyte: string; + satPerVbyte: bigint; + /** + * The maximum fee rate the closer is willing to pay. + * + * NOTE: This field is only respected if we're the initiator of the channel. + * + * @generated from protobuf field: uint64 max_fee_per_vbyte = 7; + */ + maxFeePerVbyte: bigint; } /** * @generated from protobuf message lnrpc.CloseStatusUpdate @@ -2099,7 +2383,7 @@ export interface ReadyForPsbtFunding { * * @generated from protobuf field: int64 funding_amount = 2; */ - fundingAmount: string; + fundingAmount: bigint; /** * * A raw PSBT that contains the pending channel output. If a base PSBT was @@ -2111,6 +2395,137 @@ export interface ReadyForPsbtFunding { */ psbt: Uint8Array; } +/** + * @generated from protobuf message lnrpc.BatchOpenChannelRequest + */ +export interface BatchOpenChannelRequest { + /** + * The list of channels to open. + * + * @generated from protobuf field: repeated lnrpc.BatchOpenChannel channels = 1; + */ + channels: BatchOpenChannel[]; + /** + * The target number of blocks that the funding transaction should be + * confirmed by. + * + * @generated from protobuf field: int32 target_conf = 2; + */ + targetConf: number; + /** + * A manual fee rate set in sat/vByte that should be used when crafting the + * funding transaction. + * + * @generated from protobuf field: int64 sat_per_vbyte = 3; + */ + satPerVbyte: bigint; + /** + * The minimum number of confirmations each one of your outputs used for + * the funding transaction must satisfy. + * + * @generated from protobuf field: int32 min_confs = 4; + */ + minConfs: number; + /** + * Whether unconfirmed outputs should be used as inputs for the funding + * transaction. + * + * @generated from protobuf field: bool spend_unconfirmed = 5; + */ + spendUnconfirmed: boolean; + /** + * An optional label for the batch transaction, limited to 500 characters. + * + * @generated from protobuf field: string label = 6; + */ + label: string; +} +/** + * @generated from protobuf message lnrpc.BatchOpenChannel + */ +export interface BatchOpenChannel { + /** + * The pubkey of the node to open a channel with. When using REST, this + * field must be encoded as base64. + * + * @generated from protobuf field: bytes node_pubkey = 1; + */ + nodePubkey: Uint8Array; + /** + * The number of satoshis the wallet should commit to the channel. + * + * @generated from protobuf field: int64 local_funding_amount = 2; + */ + localFundingAmount: bigint; + /** + * The number of satoshis to push to the remote side as part of the initial + * commitment state. + * + * @generated from protobuf field: int64 push_sat = 3; + */ + pushSat: bigint; + /** + * Whether this channel should be private, not announced to the greater + * network. + * + * @generated from protobuf field: bool private = 4; + */ + private: boolean; + /** + * The minimum value in millisatoshi we will require for incoming HTLCs on + * the channel. + * + * @generated from protobuf field: int64 min_htlc_msat = 5; + */ + minHtlcMsat: bigint; + /** + * The delay we require on the remote's commitment transaction. If this is + * not set, it will be scaled automatically with the channel size. + * + * @generated from protobuf field: uint32 remote_csv_delay = 6; + */ + remoteCsvDelay: number; + /** + * + * Close address is an optional address which specifies the address to which + * funds should be paid out to upon cooperative close. This field may only be + * set if the peer supports the option upfront feature bit (call listpeers + * to check). The remote peer will only accept cooperative closes to this + * address if it is set. + * + * Note: If this value is set on channel creation, you will *not* be able to + * cooperatively close out to a different address. + * + * @generated from protobuf field: string close_address = 7; + */ + closeAddress: string; + /** + * + * An optional, unique identifier of 32 random bytes that will be used as the + * pending channel ID to identify the channel while it is in the pre-pending + * state. + * + * @generated from protobuf field: bytes pending_chan_id = 8; + */ + pendingChanId: Uint8Array; + /** + * + * The explicit commitment type to use. Note this field will only be used if + * the remote peer supports explicit channel negotiation. + * + * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 9; + */ + commitmentType: CommitmentType; +} +/** + * @generated from protobuf message lnrpc.BatchOpenChannelResponse + */ +export interface BatchOpenChannelResponse { + /** + * @generated from protobuf field: repeated lnrpc.PendingUpdate pending_channels = 1; + */ + pendingChannels: PendingUpdate[]; +} /** * @generated from protobuf message lnrpc.OpenChannelRequest */ @@ -2121,7 +2536,7 @@ export interface OpenChannelRequest { * * @generated from protobuf field: uint64 sat_per_vbyte = 1; */ - satPerVbyte: string; + satPerVbyte: bigint; /** * * The pubkey of the node to open a channel with. When using REST, this field @@ -2144,14 +2559,14 @@ export interface OpenChannelRequest { * * @generated from protobuf field: int64 local_funding_amount = 4; */ - localFundingAmount: string; + localFundingAmount: bigint; /** * The number of satoshis to push to the remote side as part of the initial * commitment state * * @generated from protobuf field: int64 push_sat = 5; */ - pushSat: string; + pushSat: bigint; /** * The target number of blocks that the funding transaction should be * confirmed by. @@ -2167,7 +2582,7 @@ export interface OpenChannelRequest { * @deprecated * @generated from protobuf field: int64 sat_per_byte = 7 [deprecated = true]; */ - satPerByte: string; + satPerByte: bigint; /** * Whether this channel should be private, not announced to the greater * network. @@ -2181,7 +2596,7 @@ export interface OpenChannelRequest { * * @generated from protobuf field: int64 min_htlc_msat = 9; */ - minHtlcMsat: string; + minHtlcMsat: bigint; /** * The delay we require on the remote's commitment transaction. If this is * not set, it will be scaled automatically with the channel size. @@ -2235,7 +2650,7 @@ export interface OpenChannelRequest { * * @generated from protobuf field: uint64 remote_max_value_in_flight_msat = 15; */ - remoteMaxValueInFlightMsat: string; + remoteMaxValueInFlightMsat: bigint; /** * * The maximum number of concurrent HTLCs we will allow the remote party to add @@ -2252,6 +2667,73 @@ export interface OpenChannelRequest { * @generated from protobuf field: uint32 max_local_csv = 17; */ maxLocalCsv: number; + /** + * + * The explicit commitment type to use. Note this field will only be used if + * the remote peer supports explicit channel negotiation. + * + * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 18; + */ + commitmentType: CommitmentType; + /** + * + * If this is true, then a zero-conf channel open will be attempted. + * + * @generated from protobuf field: bool zero_conf = 19; + */ + zeroConf: boolean; + /** + * + * If this is true, then an option-scid-alias channel-type open will be + * attempted. + * + * @generated from protobuf field: bool scid_alias = 20; + */ + scidAlias: boolean; + /** + * + * The base fee charged regardless of the number of milli-satoshis sent. + * + * @generated from protobuf field: uint64 base_fee = 21; + */ + baseFee: bigint; + /** + * + * The fee rate in ppm (parts per million) that will be charged in + * proportion of the value of each forwarded HTLC. + * + * @generated from protobuf field: uint64 fee_rate = 22; + */ + feeRate: bigint; + /** + * + * If use_base_fee is true the open channel announcement will update the + * channel base fee with the value specified in base_fee. In the case of + * a base_fee of 0 use_base_fee is needed downstream to distinguish whether + * to use the default base fee value specified in the config or 0. + * + * @generated from protobuf field: bool use_base_fee = 23; + */ + useBaseFee: boolean; + /** + * + * If use_fee_rate is true the open channel announcement will update the + * channel fee rate with the value specified in fee_rate. In the case of + * a fee_rate of 0 use_fee_rate is needed downstream to distinguish whether + * to use the default fee rate value specified in the config or 0. + * + * @generated from protobuf field: bool use_fee_rate = 24; + */ + useFeeRate: boolean; + /** + * + * The number of satoshis we require the remote peer to reserve. This value, + * if specified, must be above the dust limit and below 20% of the channel + * capacity. + * + * @generated from protobuf field: uint64 remote_chan_reserve_sat = 25; + */ + remoteChanReserveSat: bigint; } /** * @generated from protobuf message lnrpc.OpenStatusUpdate @@ -2349,7 +2831,7 @@ export interface ChanPointShim { * * @generated from protobuf field: int64 amt = 1; */ - amt: string; + amt: bigint; /** * The target channel point to refrence in created commitment transactions. * @@ -2485,6 +2967,22 @@ export interface FundingPsbtVerify { * @generated from protobuf field: bytes pending_chan_id = 2; */ pendingChanId: Uint8Array; + /** + * + * Can only be used if the no_publish flag was set to true in the OpenChannel + * call meaning that the caller is solely responsible for publishing the final + * funding transaction. If skip_finalize is set to true then lnd will not wait + * for a FundingPsbtFinalize state step and instead assumes that a transaction + * with the same TXID as the passed in PSBT will eventually confirm. + * IT IS ABSOLUTELY IMPERATIVE that the TXID of the transaction that is + * eventually published does have the _same TXID_ as the verified PSBT. That + * means no inputs or outputs can change, only signatures can be added. If the + * TXID changes between this call and the publish step then the channel will + * never be created and the funds will be in limbo. + * + * @generated from protobuf field: bool skip_finalize = 3; + */ + skipFinalize: boolean; } /** * @generated from protobuf message lnrpc.FundingPsbtFinalize @@ -2588,7 +3086,7 @@ export interface PendingHTLC { * * @generated from protobuf field: int64 amount = 2; */ - amount: string; + amount: bigint; /** * The final output to be swept back to the user's wallet * @@ -2631,7 +3129,7 @@ export interface PendingChannelsResponse { * * @generated from protobuf field: int64 total_limbo_balance = 1; */ - totalLimboBalance: string; + totalLimboBalance: bigint; /** * Channels pending opening * @@ -2676,22 +3174,22 @@ export interface PendingChannelsResponse_PendingChannel { /** * @generated from protobuf field: int64 capacity = 3; */ - capacity: string; + capacity: bigint; /** * @generated from protobuf field: int64 local_balance = 4; */ - localBalance: string; + localBalance: bigint; /** * @generated from protobuf field: int64 remote_balance = 5; */ - remoteBalance: string; + remoteBalance: bigint; /** * The minimum satoshis this node is required to reserve in its * balance. * * @generated from protobuf field: int64 local_chan_reserve_sat = 6; */ - localChanReserveSat: string; + localChanReserveSat: bigint; /** * * The minimum satoshis the other node is required to reserve in its @@ -2699,7 +3197,7 @@ export interface PendingChannelsResponse_PendingChannel { * * @generated from protobuf field: int64 remote_chan_reserve_sat = 7; */ - remoteChanReserveSat: string; + remoteChanReserveSat: bigint; /** * The party that initiated opening the channel. * @@ -2712,6 +3210,24 @@ export interface PendingChannelsResponse_PendingChannel { * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 9; */ commitmentType: CommitmentType; + /** + * Total number of forwarding packages created in this channel. + * + * @generated from protobuf field: int64 num_forwarding_packages = 10; + */ + numForwardingPackages: bigint; + /** + * A set of flags showing the current state of the channel. + * + * @generated from protobuf field: string chan_status_flags = 11; + */ + chanStatusFlags: string; + /** + * Whether this channel is advertised to the network or not. + * + * @generated from protobuf field: bool private = 12; + */ + private: boolean; } /** * @generated from protobuf message lnrpc.PendingChannelsResponse.PendingOpenChannel @@ -2723,12 +3239,6 @@ export interface PendingChannelsResponse_PendingOpenChannel { * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ channel?: PendingChannelsResponse_PendingChannel; - /** - * The height at which this channel will be confirmed - * - * @generated from protobuf field: uint32 confirmation_height = 2; - */ - confirmationHeight: number; /** * * The amount calculated to be paid in fees for the current set of @@ -2739,13 +3249,13 @@ export interface PendingChannelsResponse_PendingOpenChannel { * * @generated from protobuf field: int64 commit_fee = 4; */ - commitFee: string; + commitFee: bigint; /** * The weight of the commitment transaction * * @generated from protobuf field: int64 commit_weight = 5; */ - commitWeight: string; + commitWeight: bigint; /** * * The required number of satoshis per kilo-weight that the requester will @@ -2754,7 +3264,7 @@ export interface PendingChannelsResponse_PendingOpenChannel { * * @generated from protobuf field: int64 fee_per_kw = 6; */ - feePerKw: string; + feePerKw: bigint; } /** * @generated from protobuf message lnrpc.PendingChannelsResponse.WaitingCloseChannel @@ -2771,7 +3281,7 @@ export interface PendingChannelsResponse_WaitingCloseChannel { * * @generated from protobuf field: int64 limbo_balance = 2; */ - limboBalance: string; + limboBalance: bigint; /** * * A list of valid commitment transactions. Any of these can confirm at @@ -2780,6 +3290,12 @@ export interface PendingChannelsResponse_WaitingCloseChannel { * @generated from protobuf field: lnrpc.PendingChannelsResponse.Commitments commitments = 3; */ commitments?: PendingChannelsResponse_Commitments; + /** + * The transaction id of the closing transaction + * + * @generated from protobuf field: string closing_txid = 4; + */ + closingTxid: string; } /** * @generated from protobuf message lnrpc.PendingChannelsResponse.Commitments @@ -2810,7 +3326,7 @@ export interface PendingChannelsResponse_Commitments { * * @generated from protobuf field: uint64 local_commit_fee_sat = 4; */ - localCommitFeeSat: string; + localCommitFeeSat: bigint; /** * * The amount in satoshis calculated to be paid in fees for the remote @@ -2818,7 +3334,7 @@ export interface PendingChannelsResponse_Commitments { * * @generated from protobuf field: uint64 remote_commit_fee_sat = 5; */ - remoteCommitFeeSat: string; + remoteCommitFeeSat: bigint; /** * * The amount in satoshis calculated to be paid in fees for the remote @@ -2826,7 +3342,7 @@ export interface PendingChannelsResponse_Commitments { * * @generated from protobuf field: uint64 remote_pending_commit_fee_sat = 6; */ - remotePendingCommitFeeSat: string; + remotePendingCommitFeeSat: bigint; } /** * @generated from protobuf message lnrpc.PendingChannelsResponse.ClosedChannel @@ -2866,7 +3382,7 @@ export interface PendingChannelsResponse_ForceClosedChannel { * * @generated from protobuf field: int64 limbo_balance = 3; */ - limboBalance: string; + limboBalance: bigint; /** * The height at which funds can be swept into the wallet * @@ -2887,7 +3403,7 @@ export interface PendingChannelsResponse_ForceClosedChannel { * * @generated from protobuf field: int64 recovered_balance = 6; */ - recoveredBalance: string; + recoveredBalance: bigint; /** * @generated from protobuf field: repeated lnrpc.PendingHTLC pending_htlcs = 8; */ @@ -2898,18 +3414,29 @@ export interface PendingChannelsResponse_ForceClosedChannel { anchor: PendingChannelsResponse_ForceClosedChannel_AnchorState; } /** + * + * There are three resolution states for the anchor: + * limbo, lost and recovered. Derive the current state + * from the limbo and recovered balances. + * * @generated from protobuf enum lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState */ export enum PendingChannelsResponse_ForceClosedChannel_AnchorState { /** + * The recovered_balance is zero and limbo_balance is non-zero. + * * @generated from protobuf enum value: LIMBO = 0; */ LIMBO = 0, /** + * The recovered_balance is non-zero. + * * @generated from protobuf enum value: RECOVERED = 1; */ RECOVERED = 1, /** + * A state that is neither LIMBO nor RECOVERED. + * * @generated from protobuf enum value: LOST = 2; */ LOST = 2 @@ -2956,6 +3483,12 @@ export interface ChannelEventUpdate { * @generated from protobuf field: lnrpc.PendingUpdate pending_open_channel = 6; */ pendingOpenChannel: PendingUpdate; + } | { + oneofKind: "fullyResolvedChannel"; + /** + * @generated from protobuf field: lnrpc.ChannelPoint fully_resolved_channel = 7; + */ + fullyResolvedChannel: ChannelPoint; } | { oneofKind: undefined; }; @@ -2987,7 +3520,11 @@ export enum ChannelEventUpdate_UpdateType { /** * @generated from protobuf enum value: PENDING_OPEN_CHANNEL = 4; */ - PENDING_OPEN_CHANNEL = 4 + PENDING_OPEN_CHANNEL = 4, + /** + * @generated from protobuf enum value: FULLY_RESOLVED_CHANNEL = 5; + */ + FULLY_RESOLVED_CHANNEL = 5 } /** * @generated from protobuf message lnrpc.WalletAccountBalance @@ -2998,13 +3535,13 @@ export interface WalletAccountBalance { * * @generated from protobuf field: int64 confirmed_balance = 1; */ - confirmedBalance: string; + confirmedBalance: bigint; /** * The unconfirmed balance of the account (with 0 confirmations). * * @generated from protobuf field: int64 unconfirmed_balance = 2; */ - unconfirmedBalance: string; + unconfirmedBalance: bigint; } /** * @generated from protobuf message lnrpc.WalletBalanceRequest @@ -3020,19 +3557,32 @@ export interface WalletBalanceResponse { * * @generated from protobuf field: int64 total_balance = 1; */ - totalBalance: string; + totalBalance: bigint; /** * The confirmed balance of a wallet(with >= 1 confirmations) * * @generated from protobuf field: int64 confirmed_balance = 2; */ - confirmedBalance: string; + confirmedBalance: bigint; /** * The unconfirmed balance of a wallet(with 0 confirmations) * * @generated from protobuf field: int64 unconfirmed_balance = 3; */ - unconfirmedBalance: string; + unconfirmedBalance: bigint; + /** + * The total amount of wallet UTXOs held in outputs that are locked for + * other usage. + * + * @generated from protobuf field: int64 locked_balance = 5; + */ + lockedBalance: bigint; + /** + * The amount of reserve required. + * + * @generated from protobuf field: int64 reserved_balance_anchor_chan = 6; + */ + reservedBalanceAnchorChan: bigint; /** * A mapping of each wallet account's name to its balance. * @@ -3051,13 +3601,13 @@ export interface Amount { * * @generated from protobuf field: uint64 sat = 1; */ - sat: string; + sat: bigint; /** * Value denominated in milli-satoshis. * * @generated from protobuf field: uint64 msat = 2; */ - msat: string; + msat: bigint; } /** * @generated from protobuf message lnrpc.ChannelBalanceRequest @@ -3074,14 +3624,14 @@ export interface ChannelBalanceResponse { * @deprecated * @generated from protobuf field: int64 balance = 1 [deprecated = true]; */ - balance: string; + balance: bigint; /** * Deprecated. Sum of channels pending balances denominated in satoshis * * @deprecated * @generated from protobuf field: int64 pending_open_balance = 2 [deprecated = true]; */ - pendingOpenBalance: string; + pendingOpenBalance: bigint; /** * Sum of channels local balances. * @@ -3137,7 +3687,7 @@ export interface QueryRoutesRequest { * * @generated from protobuf field: int64 amt = 2; */ - amt: string; + amt: bigint; /** * * The amount to send expressed in millisatoshis. @@ -3146,7 +3696,7 @@ export interface QueryRoutesRequest { * * @generated from protobuf field: int64 amt_msat = 12; */ - amtMsat: string; + amtMsat: bigint; /** * * An optional CLTV delta from the current height that should be used for the @@ -3163,7 +3713,8 @@ export interface QueryRoutesRequest { * The maximum number of satoshis that will be paid as a fee of the payment. * This value can be represented either as a percentage of the amount being * sent, or as a fixed amount of the maximum fee the user is willing the pay to - * send the payment. + * send the payment. If not specified, lnd will use a default value of 100% + * fees for small amounts (<=1k sat) or 5% fees for larger amounts. * * @generated from protobuf field: lnrpc.FeeLimit fee_limit = 5; */ @@ -3221,7 +3772,7 @@ export interface QueryRoutesRequest { * An optional field that can be used to pass an arbitrary set of TLV records * to a peer which understands the new records. This can be used to pass * application specific data during the payment attempt. If the destination - * does not support the specified recrods, and error will be returned. + * does not support the specified records, an error will be returned. * Record types are required to be in the custom range >= 65536. When using * REST, the values must be encoded as base64. * @@ -3263,6 +3814,14 @@ export interface QueryRoutesRequest { * @generated from protobuf field: repeated lnrpc.FeatureBit dest_features = 17; */ destFeatures: FeatureBit[]; + /** + * + * The time preference for this payment. Set to -1 to optimize for fees + * only, to 1 to optimize for reliability only or a value inbetween for a mix. + * + * @generated from protobuf field: double time_pref = 18; + */ + timePref: number; } /** * @generated from protobuf message lnrpc.NodePair @@ -3344,17 +3903,17 @@ export interface Hop { * @deprecated * @generated from protobuf field: int64 chan_capacity = 2 [deprecated = true]; */ - chanCapacity: string; + chanCapacity: bigint; /** * @deprecated * @generated from protobuf field: int64 amt_to_forward = 3 [deprecated = true]; */ - amtToForward: string; + amtToForward: bigint; /** * @deprecated * @generated from protobuf field: int64 fee = 4 [deprecated = true]; */ - fee: string; + fee: bigint; /** * @generated from protobuf field: uint32 expiry = 5; */ @@ -3362,11 +3921,11 @@ export interface Hop { /** * @generated from protobuf field: int64 amt_to_forward_msat = 6; */ - amtToForwardMsat: string; + amtToForwardMsat: bigint; /** * @generated from protobuf field: int64 fee_msat = 7; */ - feeMsat: string; + feeMsat: bigint; /** * * An optional public key of the hop. If the public key is given, the payment @@ -3381,7 +3940,8 @@ export interface Hop { * TLV format. Note that if any custom tlv_records below are specified, then * this field MUST be set to true for them to be encoded properly. * - * @generated from protobuf field: bool tlv_payload = 9; + * @deprecated + * @generated from protobuf field: bool tlv_payload = 9 [deprecated = true]; */ tlvPayload: boolean; /** @@ -3417,6 +3977,12 @@ export interface Hop { customRecords: { [key: string]: Uint8Array; }; + /** + * The payment metadata to send along with the payment to the payee. + * + * @generated from protobuf field: bytes metadata = 13; + */ + metadata: Uint8Array; } /** * @generated from protobuf message lnrpc.MPPRecord @@ -3441,7 +4007,7 @@ export interface MPPRecord { * * @generated from protobuf field: int64 total_amt_msat = 10; */ - totalAmtMsat: string; + totalAmtMsat: bigint; } /** * @generated from protobuf message lnrpc.AMPRecord @@ -3490,7 +4056,7 @@ export interface Route { * @deprecated * @generated from protobuf field: int64 total_fees = 2 [deprecated = true]; */ - totalFees: string; + totalFees: bigint; /** * * The total amount of funds required to complete a payment over this route. @@ -3502,7 +4068,7 @@ export interface Route { * @deprecated * @generated from protobuf field: int64 total_amt = 3 [deprecated = true]; */ - totalAmt: string; + totalAmt: bigint; /** * * Contains details concerning the specific forwarding details at each hop. @@ -3516,14 +4082,14 @@ export interface Route { * * @generated from protobuf field: int64 total_fees_msat = 5; */ - totalFeesMsat: string; + totalFeesMsat: bigint; /** * * The total amount in millisatoshis. * * @generated from protobuf field: int64 total_amt_msat = 6; */ - totalAmtMsat: string; + totalAmtMsat: bigint; } /** * @generated from protobuf message lnrpc.NodeInfoRequest @@ -3567,7 +4133,7 @@ export interface NodeInfo { * * @generated from protobuf field: int64 total_capacity = 3; */ - totalCapacity: string; + totalCapacity: bigint; /** * A list of all public channels for the node. * @@ -3611,6 +4177,14 @@ export interface LightningNode { features: { [key: number]: Feature; }; + /** + * Custom node announcement tlv records. + * + * @generated from protobuf field: map custom_records = 7; + */ + customRecords: { + [key: string]: Uint8Array; + }; } /** * @generated from protobuf message lnrpc.NodeAddress @@ -3636,15 +4210,15 @@ export interface RoutingPolicy { /** * @generated from protobuf field: int64 min_htlc = 2; */ - minHtlc: string; + minHtlc: bigint; /** * @generated from protobuf field: int64 fee_base_msat = 3; */ - feeBaseMsat: string; + feeBaseMsat: bigint; /** * @generated from protobuf field: int64 fee_rate_milli_msat = 4; */ - feeRateMilliMsat: string; + feeRateMilliMsat: bigint; /** * @generated from protobuf field: bool disabled = 5; */ @@ -3652,11 +4226,19 @@ export interface RoutingPolicy { /** * @generated from protobuf field: uint64 max_htlc_msat = 6; */ - maxHtlcMsat: string; + maxHtlcMsat: bigint; /** * @generated from protobuf field: uint32 last_update = 7; */ lastUpdate: number; + /** + * Custom channel update tlv records. + * + * @generated from protobuf field: map custom_records = 8; + */ + customRecords: { + [key: string]: Uint8Array; + }; } /** * @@ -3698,7 +4280,7 @@ export interface ChannelEdge { /** * @generated from protobuf field: int64 capacity = 6; */ - capacity: string; + capacity: bigint; /** * @generated from protobuf field: lnrpc.RoutingPolicy node1_policy = 7; */ @@ -3707,6 +4289,14 @@ export interface ChannelEdge { * @generated from protobuf field: lnrpc.RoutingPolicy node2_policy = 8; */ node2Policy?: RoutingPolicy; + /** + * Custom channel announcement tlv records. + * + * @generated from protobuf field: map custom_records = 9; + */ + customRecords: { + [key: string]: Uint8Array; + }; } /** * @generated from protobuf message lnrpc.ChannelGraphRequest @@ -3833,7 +4423,7 @@ export interface NetworkInfo { /** * @generated from protobuf field: int64 total_network_capacity = 6; */ - totalNetworkCapacity: string; + totalNetworkCapacity: bigint; /** * @generated from protobuf field: double avg_channel_size = 7; */ @@ -3841,21 +4431,21 @@ export interface NetworkInfo { /** * @generated from protobuf field: int64 min_channel_size = 8; */ - minChannelSize: string; + minChannelSize: bigint; /** * @generated from protobuf field: int64 max_channel_size = 9; */ - maxChannelSize: string; + maxChannelSize: bigint; /** * @generated from protobuf field: int64 median_channel_size_sat = 10; */ - medianChannelSizeSat: string; + medianChannelSizeSat: bigint; /** * The number of edges marked as zombies. * * @generated from protobuf field: uint64 num_zombie_chans = 11; */ - numZombieChans: string; + numZombieChans: bigint; } /** * @generated from protobuf message lnrpc.StopRequest @@ -3956,7 +4546,7 @@ export interface ChannelEdgeUpdate { /** * @generated from protobuf field: int64 capacity = 3; */ - capacity: string; + capacity: bigint; /** * @generated from protobuf field: lnrpc.RoutingPolicy routing_policy = 4; */ @@ -3986,7 +4576,7 @@ export interface ClosedChannelUpdate { /** * @generated from protobuf field: int64 capacity = 2; */ - capacity: string; + capacity: bigint; /** * @generated from protobuf field: uint32 closed_height = 3; */ @@ -4033,6 +4623,15 @@ export interface HopHint { */ cltvExpiryDelta: number; } +/** + * @generated from protobuf message lnrpc.SetID + */ +export interface SetID { + /** + * @generated from protobuf field: bytes set_id = 1; + */ + setId: Uint8Array; +} /** * @generated from protobuf message lnrpc.RouteHint */ @@ -4046,6 +4645,35 @@ export interface RouteHint { */ hopHints: HopHint[]; } +/** + * @generated from protobuf message lnrpc.AMPInvoiceState + */ +export interface AMPInvoiceState { + /** + * The state the HTLCs associated with this setID are in. + * + * @generated from protobuf field: lnrpc.InvoiceHTLCState state = 1; + */ + state: InvoiceHTLCState; + /** + * The settle index of this HTLC set, if the invoice state is settled. + * + * @generated from protobuf field: uint64 settle_index = 2; + */ + settleIndex: bigint; + /** + * The time this HTLC set was settled expressed in unix epoch. + * + * @generated from protobuf field: int64 settle_time = 3; + */ + settleTime: bigint; + /** + * The total amount paid for the sub-invoice expressed in milli satoshis. + * + * @generated from protobuf field: int64 amt_paid_msat = 5; + */ + amtPaidMsat: bigint; +} /** * @generated from protobuf message lnrpc.Invoice */ @@ -4073,6 +4701,7 @@ export interface Invoice { * * The hash of the preimage. When using REST, this field must be encoded as * base64. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: bytes r_hash = 4; */ @@ -4085,7 +4714,7 @@ export interface Invoice { * * @generated from protobuf field: int64 value = 5; */ - value: string; + value: bigint; /** * * The value of this invoice in millisatoshis @@ -4094,31 +4723,39 @@ export interface Invoice { * * @generated from protobuf field: int64 value_msat = 23; */ - valueMsat: string; + valueMsat: bigint; /** + * * Whether this invoice has been fulfilled * + * The field is deprecated. Use the state field instead (compare to SETTLED). + * * @deprecated * @generated from protobuf field: bool settled = 6 [deprecated = true]; */ settled: boolean; /** - * When this invoice was created + * + * When this invoice was created. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: int64 creation_date = 7; */ - creationDate: string; + creationDate: bigint; /** - * When this invoice was settled + * + * When this invoice was settled. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: int64 settle_date = 8; */ - settleDate: string; + settleDate: bigint; /** * * A bare-bones invoice for a payment within the Lightning Network. With the * details of the invoice, the sender has all the data necessary to send a * payment to the recipient. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: string payment_request = 9; */ @@ -4138,7 +4775,7 @@ export interface Invoice { * * @generated from protobuf field: int64 expiry = 11; */ - expiry: string; + expiry: bigint; /** * Fallback on-chain address. * @@ -4150,7 +4787,7 @@ export interface Invoice { * * @generated from protobuf field: uint64 cltv_expiry = 13; */ - cltvExpiry: string; + cltvExpiry: bigint; /** * * Route hints that can each be individually used to assist in reaching the @@ -4171,27 +4808,29 @@ export interface Invoice { * this index making it monotonically increasing. Callers to the * SubscribeInvoices call can use this to instantly get notified of all added * invoices with an add_index greater than this one. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: uint64 add_index = 16; */ - addIndex: string; + addIndex: bigint; /** * * The "settle" index of this invoice. Each newly settled invoice will * increment this index making it monotonically increasing. Callers to the * SubscribeInvoices call can use this to instantly get notified of all * settled invoices with an settle_index greater than this one. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: uint64 settle_index = 17; */ - settleIndex: string; + settleIndex: bigint; /** * Deprecated, use amt_paid_sat or amt_paid_msat. * * @deprecated * @generated from protobuf field: int64 amt_paid = 18 [deprecated = true]; */ - amtPaid: string; + amtPaid: bigint; /** * * The amount that was accepted for this invoice, in satoshis. This will ONLY @@ -4200,10 +4839,11 @@ export interface Invoice { * was ultimately accepted. Additionally, it's possible that the sender paid * MORE that was specified in the original invoice. So we'll record that here * as well. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: int64 amt_paid_sat = 19; */ - amtPaidSat: string; + amtPaidSat: bigint; /** * * The amount that was accepted for this invoice, in millisatoshis. This will @@ -4212,25 +4852,31 @@ export interface Invoice { * amount was ultimately accepted. Additionally, it's possible that the sender * paid MORE that was specified in the original invoice. So we'll record that * here as well. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: int64 amt_paid_msat = 20; */ - amtPaidMsat: string; + amtPaidMsat: bigint; /** * * The state the invoice is in. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: lnrpc.Invoice.InvoiceState state = 21; */ state: Invoice_InvoiceState; /** + * * List of HTLCs paying to this invoice [EXPERIMENTAL]. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: repeated lnrpc.InvoiceHTLC htlcs = 22; */ htlcs: InvoiceHTLC[]; /** + * * List of features advertised on the invoice. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: map features = 24; */ @@ -4241,6 +4887,7 @@ export interface Invoice { * * Indicates if this invoice was a spontaneous payment that arrived via keysend * [EXPERIMENTAL]. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: bool is_keysend = 25; */ @@ -4248,8 +4895,9 @@ export interface Invoice { /** * * The payment address of this invoice. This value will be used in MPP - * payments, and also for newer invoies that always require the MPP paylaod + * payments, and also for newer invoices that always require the MPP payload * for added end-to-end security. + * Note: Output only, don't specify for creating an invoice. * * @generated from protobuf field: bytes payment_addr = 26; */ @@ -4261,6 +4909,21 @@ export interface Invoice { * @generated from protobuf field: bool is_amp = 27; */ isAmp: boolean; + /** + * + * [EXPERIMENTAL]: + * + * Maps a 32-byte hex-encoded set ID to the sub-invoice AMP state for the + * given set ID. This field is always populated for AMP invoices, and can be + * used along side LookupInvoice to obtain the HTLC information related to a + * given sub-invoice. + * Note: Output only, don't specify for creating an invoice. + * + * @generated from protobuf field: map amp_invoice_state = 28; + */ + ampInvoiceState: { + [key: string]: AMPInvoiceState; + }; } /** * @generated from protobuf enum lnrpc.Invoice.InvoiceState @@ -4300,13 +4963,13 @@ export interface InvoiceHTLC { * * @generated from protobuf field: uint64 htlc_index = 2; */ - htlcIndex: string; + htlcIndex: bigint; /** * The amount of the htlc in msat. * * @generated from protobuf field: uint64 amt_msat = 3; */ - amtMsat: string; + amtMsat: bigint; /** * Block height at which this htlc was accepted. * @@ -4318,13 +4981,13 @@ export interface InvoiceHTLC { * * @generated from protobuf field: int64 accept_time = 5; */ - acceptTime: string; + acceptTime: bigint; /** * Time at which this htlc was settled or canceled. * * @generated from protobuf field: int64 resolve_time = 6; */ - resolveTime: string; + resolveTime: bigint; /** * Block height at which this htlc expires. * @@ -4350,7 +5013,7 @@ export interface InvoiceHTLC { * * @generated from protobuf field: uint64 mpp_total_amt_msat = 10; */ - mppTotalAmtMsat: string; + mppTotalAmtMsat: bigint; /** * Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. * @@ -4425,7 +5088,7 @@ export interface AddInvoiceResponse { * * @generated from protobuf field: uint64 add_index = 16; */ - addIndex: string; + addIndex: bigint; /** * * The payment address of the generated invoice. This value should be used @@ -4479,13 +5142,13 @@ export interface ListInvoiceRequest { * * @generated from protobuf field: uint64 index_offset = 4; */ - indexOffset: string; + indexOffset: bigint; /** * The max number of invoices to return in the response to this query. * * @generated from protobuf field: uint64 num_max_invoices = 5; */ - numMaxInvoices: string; + numMaxInvoices: bigint; /** * * If set, the invoices returned will result from seeking backwards from the @@ -4514,7 +5177,7 @@ export interface ListInvoiceResponse { * * @generated from protobuf field: uint64 last_index_offset = 2; */ - lastIndexOffset: string; + lastIndexOffset: bigint; /** * * The index of the last item in the set of returned invoices. This can be used @@ -4522,7 +5185,7 @@ export interface ListInvoiceResponse { * * @generated from protobuf field: uint64 first_index_offset = 3; */ - firstIndexOffset: string; + firstIndexOffset: bigint; } /** * @generated from protobuf message lnrpc.InvoiceSubscription @@ -4537,7 +5200,7 @@ export interface InvoiceSubscription { * * @generated from protobuf field: uint64 add_index = 1; */ - addIndex: string; + addIndex: bigint; /** * * If specified (non-zero), then we'll first start by sending out @@ -4547,7 +5210,7 @@ export interface InvoiceSubscription { * * @generated from protobuf field: uint64 settle_index = 2; */ - settleIndex: string; + settleIndex: bigint; } /** * @generated from protobuf message lnrpc.Payment @@ -4565,21 +5228,21 @@ export interface Payment { * @deprecated * @generated from protobuf field: int64 value = 2 [deprecated = true]; */ - value: string; + value: bigint; /** * Deprecated, use creation_time_ns * * @deprecated * @generated from protobuf field: int64 creation_date = 3 [deprecated = true]; */ - creationDate: string; + creationDate: bigint; /** * Deprecated, use fee_sat or fee_msat. * * @deprecated * @generated from protobuf field: int64 fee = 5 [deprecated = true]; */ - fee: string; + fee: bigint; /** * The payment preimage * @@ -4591,13 +5254,13 @@ export interface Payment { * * @generated from protobuf field: int64 value_sat = 7; */ - valueSat: string; + valueSat: bigint; /** * The value of the payment in milli-satoshis * * @generated from protobuf field: int64 value_msat = 8; */ - valueMsat: string; + valueMsat: bigint; /** * The optional payment request being fulfilled. * @@ -4615,19 +5278,19 @@ export interface Payment { * * @generated from protobuf field: int64 fee_sat = 11; */ - feeSat: string; + feeSat: bigint; /** * The fee paid for this payment in milli-satoshis * * @generated from protobuf field: int64 fee_msat = 12; */ - feeMsat: string; + feeMsat: bigint; /** * The time in UNIX nanoseconds at which the payment was created. * * @generated from protobuf field: int64 creation_time_ns = 13; */ - creationTimeNs: string; + creationTimeNs: bigint; /** * The HTLCs made in attempt to settle the payment. * @@ -4642,7 +5305,7 @@ export interface Payment { * * @generated from protobuf field: uint64 payment_index = 15; */ - paymentIndex: string; + paymentIndex: bigint; /** * @generated from protobuf field: lnrpc.PaymentFailureReason failure_reason = 16; */ @@ -4678,7 +5341,7 @@ export interface HTLCAttempt { * * @generated from protobuf field: uint64 attempt_id = 7; */ - attemptId: string; + attemptId: bigint; /** * The status of the HTLC. * @@ -4696,7 +5359,7 @@ export interface HTLCAttempt { * * @generated from protobuf field: int64 attempt_time_ns = 3; */ - attemptTimeNs: string; + attemptTimeNs: bigint; /** * * The time in UNIX nanoseconds at which this HTLC was settled or failed. @@ -4704,7 +5367,7 @@ export interface HTLCAttempt { * * @generated from protobuf field: int64 resolve_time_ns = 4; */ - resolveTimeNs: string; + resolveTimeNs: bigint; /** * Detailed htlc failure info. * @@ -4759,13 +5422,13 @@ export interface ListPaymentsRequest { * * @generated from protobuf field: uint64 index_offset = 2; */ - indexOffset: string; + indexOffset: bigint; /** * The maximal number of payments returned in the response to this query. * * @generated from protobuf field: uint64 max_payments = 3; */ - maxPayments: string; + maxPayments: bigint; /** * * If set, the payments returned will result from seeking backwards from the @@ -4775,6 +5438,16 @@ export interface ListPaymentsRequest { * @generated from protobuf field: bool reversed = 4; */ reversed: boolean; + /** + * + * If set, all payments (complete and incomplete, independent of the + * max_payments parameter) will be counted. Note that setting this to true will + * increase the run time of the call significantly on systems that have a lot + * of payments, as all of them have to be iterated through to be counted. + * + * @generated from protobuf field: bool count_total_payments = 5; + */ + countTotalPayments: boolean; } /** * @generated from protobuf message lnrpc.ListPaymentsResponse @@ -4793,7 +5466,7 @@ export interface ListPaymentsResponse { * * @generated from protobuf field: uint64 first_index_offset = 2; */ - firstIndexOffset: string; + firstIndexOffset: bigint; /** * * The index of the last item in the set of returned payments. This can be used @@ -4801,7 +5474,35 @@ export interface ListPaymentsResponse { * * @generated from protobuf field: uint64 last_index_offset = 3; */ - lastIndexOffset: string; + lastIndexOffset: bigint; + /** + * + * Will only be set if count_total_payments in the request was set. Represents + * the total number of payments (complete and incomplete, independent of the + * number of payments requested in the query) currently present in the payments + * database. + * + * @generated from protobuf field: uint64 total_num_payments = 4; + */ + totalNumPayments: bigint; +} +/** + * @generated from protobuf message lnrpc.DeletePaymentRequest + */ +export interface DeletePaymentRequest { + /** + * Payment hash to delete. + * + * @generated from protobuf field: bytes payment_hash = 1; + */ + paymentHash: Uint8Array; + /** + * + * Only delete failed HTLCs from the payment, not the payment itself. + * + * @generated from protobuf field: bool failed_htlcs_only = 2; + */ + failedHtlcsOnly: boolean; } /** * @generated from protobuf message lnrpc.DeleteAllPaymentsRequest @@ -4821,6 +5522,11 @@ export interface DeleteAllPaymentsRequest { */ failedHtlcsOnly: boolean; } +/** + * @generated from protobuf message lnrpc.DeletePaymentResponse + */ +export interface DeletePaymentResponse { +} /** * @generated from protobuf message lnrpc.DeleteAllPaymentsResponse */ @@ -4838,6 +5544,15 @@ export interface AbandonChannelRequest { * @generated from protobuf field: bool pending_funding_shim_only = 2; */ pendingFundingShimOnly: boolean; + /** + * + * Override the requirement for being in dev mode by setting this to true and + * confirming the user knows what they are doing and this is a potential foot + * gun to lose funds if used on active channels. + * + * @generated from protobuf field: bool i_know_what_i_am_doing = 3; + */ + iKnowWhatIAmDoing: boolean; } /** * @generated from protobuf message lnrpc.AbandonChannelResponse @@ -4892,15 +5607,15 @@ export interface PayReq { /** * @generated from protobuf field: int64 num_satoshis = 3; */ - numSatoshis: string; + numSatoshis: bigint; /** * @generated from protobuf field: int64 timestamp = 4; */ - timestamp: string; + timestamp: bigint; /** * @generated from protobuf field: int64 expiry = 5; */ - expiry: string; + expiry: bigint; /** * @generated from protobuf field: string description = 6; */ @@ -4916,7 +5631,7 @@ export interface PayReq { /** * @generated from protobuf field: int64 cltv_expiry = 9; */ - cltvExpiry: string; + cltvExpiry: bigint; /** * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 10; */ @@ -4928,7 +5643,7 @@ export interface PayReq { /** * @generated from protobuf field: int64 num_msat = 12; */ - numMsat: string; + numMsat: bigint; /** * @generated from protobuf field: map features = 13; */ @@ -4979,14 +5694,14 @@ export interface ChannelFeeReport { * * @generated from protobuf field: int64 base_fee_msat = 2; */ - baseFeeMsat: string; + baseFeeMsat: bigint; /** * The amount charged per milli-satoshis transferred expressed in * millionths of a satoshi. * * @generated from protobuf field: int64 fee_per_mil = 3; */ - feePerMil: string; + feePerMil: bigint; /** * The effective fee rate in milli-satoshis. Computed by dividing the * fee_per_mil value by 1 million. @@ -5012,21 +5727,21 @@ export interface FeeReportResponse { * * @generated from protobuf field: uint64 day_fee_sum = 2; */ - dayFeeSum: string; + dayFeeSum: bigint; /** * The total amount of fee revenue (in satoshis) the switch has collected * over the past 1 week. * * @generated from protobuf field: uint64 week_fee_sum = 3; */ - weekFeeSum: string; + weekFeeSum: bigint; /** * The total amount of fee revenue (in satoshis) the switch has collected * over the past 1 month. * * @generated from protobuf field: uint64 month_fee_sum = 4; */ - monthFeeSum: string; + monthFeeSum: bigint; } /** * @generated from protobuf message lnrpc.PolicyUpdateRequest @@ -5059,7 +5774,7 @@ export interface PolicyUpdateRequest { * * @generated from protobuf field: int64 base_fee_msat = 3; */ - baseFeeMsat: string; + baseFeeMsat: bigint; /** * The effective fee rate in milli-satoshis. The precision of this value * goes up to 6 decimal places, so 1e-6. @@ -5067,6 +5782,12 @@ export interface PolicyUpdateRequest { * @generated from protobuf field: double fee_rate = 4; */ feeRate: number; + /** + * The effective fee rate in micro-satoshis (parts per million). + * + * @generated from protobuf field: uint32 fee_rate_ppm = 9; + */ + feeRatePpm: number; /** * The required timelock delta for HTLCs forwarded over the channel. * @@ -5079,14 +5800,14 @@ export interface PolicyUpdateRequest { * * @generated from protobuf field: uint64 max_htlc_msat = 6; */ - maxHtlcMsat: string; + maxHtlcMsat: bigint; /** * The minimum HTLC size in milli-satoshis. Only applied if * min_htlc_msat_specified is true. * * @generated from protobuf field: uint64 min_htlc_msat = 7; */ - minHtlcMsat: string; + minHtlcMsat: bigint; /** * If true, min_htlc_msat is applied. * @@ -5094,10 +5815,39 @@ export interface PolicyUpdateRequest { */ minHtlcMsatSpecified: boolean; } +/** + * @generated from protobuf message lnrpc.FailedUpdate + */ +export interface FailedUpdate { + /** + * The outpoint in format txid:n + * + * @generated from protobuf field: lnrpc.OutPoint outpoint = 1; + */ + outpoint?: OutPoint; + /** + * Reason for the policy update failure. + * + * @generated from protobuf field: lnrpc.UpdateFailure reason = 2; + */ + reason: UpdateFailure; + /** + * A string representation of the policy update error. + * + * @generated from protobuf field: string update_error = 3; + */ + updateError: string; +} /** * @generated from protobuf message lnrpc.PolicyUpdateResponse */ export interface PolicyUpdateResponse { + /** + * List of failed policy updates. + * + * @generated from protobuf field: repeated lnrpc.FailedUpdate failed_updates = 1; + */ + failedUpdates: FailedUpdate[]; } /** * @generated from protobuf message lnrpc.ForwardingHistoryRequest @@ -5110,7 +5860,7 @@ export interface ForwardingHistoryRequest { * * @generated from protobuf field: uint64 start_time = 1; */ - startTime: string; + startTime: bigint; /** * End time is the end point of the forwarding history request. The * response will carry at most 50k records between the start time and the @@ -5118,7 +5868,7 @@ export interface ForwardingHistoryRequest { * * @generated from protobuf field: uint64 end_time = 2; */ - endTime: string; + endTime: bigint; /** * Index offset is the offset in the time series to start at. As each * response can only contain 50k records, callers can use this to skip @@ -5133,6 +5883,13 @@ export interface ForwardingHistoryRequest { * @generated from protobuf field: uint32 num_max_events = 4; */ numMaxEvents: number; + /** + * Informs the server if the peer alias should be looked up for each + * forwarding event. + * + * @generated from protobuf field: bool peer_alias_lookup = 5; + */ + peerAliasLookup: boolean; } /** * @generated from protobuf message lnrpc.ForwardingEvent @@ -5145,7 +5902,7 @@ export interface ForwardingEvent { * @deprecated * @generated from protobuf field: uint64 timestamp = 1 [deprecated = true]; */ - timestamp: string; + timestamp: bigint; /** * The incoming channel ID that carried the HTLC that created the circuit. * @@ -5165,47 +5922,59 @@ export interface ForwardingEvent { * * @generated from protobuf field: uint64 amt_in = 5; */ - amtIn: string; + amtIn: bigint; /** * The total amount (in satoshis) of the outgoing HTLC that created the * second half of the circuit. * * @generated from protobuf field: uint64 amt_out = 6; */ - amtOut: string; + amtOut: bigint; /** * The total fee (in satoshis) that this payment circuit carried. * * @generated from protobuf field: uint64 fee = 7; */ - fee: string; + fee: bigint; /** * The total fee (in milli-satoshis) that this payment circuit carried. * * @generated from protobuf field: uint64 fee_msat = 8; */ - feeMsat: string; + feeMsat: bigint; /** * The total amount (in milli-satoshis) of the incoming HTLC that created * half the circuit. * * @generated from protobuf field: uint64 amt_in_msat = 9; */ - amtInMsat: string; + amtInMsat: bigint; /** * The total amount (in milli-satoshis) of the outgoing HTLC that created * the second half of the circuit. * * @generated from protobuf field: uint64 amt_out_msat = 10; */ - amtOutMsat: string; + amtOutMsat: bigint; /** * The number of nanoseconds elapsed since January 1, 1970 UTC when this * circuit was completed. * * @generated from protobuf field: uint64 timestamp_ns = 11; */ - timestampNs: string; + timestampNs: bigint; + /** + * The peer alias of the incoming channel. + * + * @generated from protobuf field: string peer_alias_in = 12; + */ + peerAliasIn: string; + /** + * The peer alias of the outgoing channel. + * + * @generated from protobuf field: string peer_alias_out = 13; + */ + peerAliasOut: string; } /** * @generated from protobuf message lnrpc.ForwardingHistoryResponse @@ -5396,7 +6165,15 @@ export interface BakeMacaroonRequest { * * @generated from protobuf field: uint64 root_key_id = 2; */ - rootKeyId: string; + rootKeyId: bigint; + /** + * + * Informs the RPC on whether to allow external permissions that LND is not + * aware of. + * + * @generated from protobuf field: bool allow_external_permissions = 3; + */ + allowExternalPermissions: boolean; } /** * @generated from protobuf message lnrpc.BakeMacaroonResponse @@ -5423,7 +6200,7 @@ export interface ListMacaroonIDsResponse { * * @generated from protobuf field: repeated uint64 root_key_ids = 1; */ - rootKeyIds: string[]; + rootKeyIds: bigint[]; } /** * @generated from protobuf message lnrpc.DeleteMacaroonIDRequest @@ -5434,7 +6211,7 @@ export interface DeleteMacaroonIDRequest { * * @generated from protobuf field: uint64 root_key_id = 1; */ - rootKeyId: string; + rootKeyId: bigint; } /** * @generated from protobuf message lnrpc.DeleteMacaroonIDResponse @@ -5499,7 +6276,7 @@ export interface Failure { * * @generated from protobuf field: uint64 htlc_msat = 4; */ - htlcMsat: string; + htlcMsat: bigint; /** * The sha256 sum of the onion payload. * @@ -5739,7 +6516,7 @@ export interface ChannelUpdate { * * @generated from protobuf field: uint64 htlc_minimum_msat = 7; */ - htlcMinimumMsat: string; + htlcMinimumMsat: bigint; /** * * The base fee that must be used for incoming HTLC's to this particular @@ -5762,7 +6539,7 @@ export interface ChannelUpdate { * * @generated from protobuf field: uint64 htlc_maximum_msat = 11; */ - htlcMaximumMsat: string; + htlcMaximumMsat: bigint; /** * * The set of data that was appended to this message, some of which we may @@ -5805,12 +6582,367 @@ export interface Op { */ actions: string[]; } +/** + * @generated from protobuf message lnrpc.CheckMacPermRequest + */ +export interface CheckMacPermRequest { + /** + * @generated from protobuf field: bytes macaroon = 1; + */ + macaroon: Uint8Array; + /** + * @generated from protobuf field: repeated lnrpc.MacaroonPermission permissions = 2; + */ + permissions: MacaroonPermission[]; + /** + * @generated from protobuf field: string fullMethod = 3; + */ + fullMethod: string; +} +/** + * @generated from protobuf message lnrpc.CheckMacPermResponse + */ +export interface CheckMacPermResponse { + /** + * @generated from protobuf field: bool valid = 1; + */ + valid: boolean; +} +/** + * @generated from protobuf message lnrpc.RPCMiddlewareRequest + */ +export interface RPCMiddlewareRequest { + /** + * + * The unique ID of the intercepted original gRPC request. Useful for mapping + * request to response when implementing full duplex message interception. For + * streaming requests, this will be the same ID for all incoming and outgoing + * middleware intercept messages of the _same_ stream. + * + * @generated from protobuf field: uint64 request_id = 1; + */ + requestId: bigint; + /** + * + * The raw bytes of the complete macaroon as sent by the gRPC client in the + * original request. This might be empty for a request that doesn't require + * macaroons such as the wallet unlocker RPCs. + * + * @generated from protobuf field: bytes raw_macaroon = 2; + */ + rawMacaroon: Uint8Array; + /** + * + * The parsed condition of the macaroon's custom caveat for convenient access. + * This field only contains the value of the custom caveat that the handling + * middleware has registered itself for. The condition _must_ be validated for + * messages of intercept_type stream_auth and request! + * + * @generated from protobuf field: string custom_caveat_condition = 3; + */ + customCaveatCondition: string; + /** + * @generated from protobuf oneof: intercept_type + */ + interceptType: { + oneofKind: "streamAuth"; + /** + * + * Intercept stream authentication: each new streaming RPC call that is + * initiated against lnd and contains the middleware's custom macaroon + * caveat can be approved or denied based upon the macaroon in the stream + * header. This message will only be sent for streaming RPCs, unary RPCs + * must handle the macaroon authentication in the request interception to + * avoid an additional message round trip between lnd and the middleware. + * + * @generated from protobuf field: lnrpc.StreamAuth stream_auth = 4; + */ + streamAuth: StreamAuth; + } | { + oneofKind: "request"; + /** + * + * Intercept incoming gRPC client request message: all incoming messages, + * both on streaming and unary RPCs, are forwarded to the middleware for + * inspection. For unary RPC messages the middleware is also expected to + * validate the custom macaroon caveat of the request. + * + * @generated from protobuf field: lnrpc.RPCMessage request = 5; + */ + request: RPCMessage; + } | { + oneofKind: "response"; + /** + * + * Intercept outgoing gRPC response message: all outgoing messages, both on + * streaming and unary RPCs, are forwarded to the middleware for inspection + * and amendment. The response in this message is the original response as + * it was generated by the main RPC server. It can either be accepted + * (=forwarded to the client), replaced/overwritten with a new message of + * the same type, or replaced by an error message. + * + * @generated from protobuf field: lnrpc.RPCMessage response = 6; + */ + response: RPCMessage; + } | { + oneofKind: "regComplete"; + /** + * + * This is used to indicate to the client that the server has successfully + * registered the interceptor. This is only used in the very first message + * that the server sends to the client after the client sends the server + * the middleware registration message. + * + * @generated from protobuf field: bool reg_complete = 8; + */ + regComplete: boolean; + } | { + oneofKind: undefined; + }; + /** + * + * The unique message ID of this middleware intercept message. There can be + * multiple middleware intercept messages per single gRPC request (one for the + * incoming request and one for the outgoing response) or gRPC stream (one for + * each incoming message and one for each outgoing response). This message ID + * must be referenced when responding (accepting/rejecting/modifying) to an + * intercept message. + * + * @generated from protobuf field: uint64 msg_id = 7; + */ + msgId: bigint; +} +/** + * @generated from protobuf message lnrpc.StreamAuth + */ +export interface StreamAuth { + /** + * + * The full URI (in the format /./MethodName, for + * example /lnrpc.Lightning/GetInfo) of the streaming RPC method that was just + * established. + * + * @generated from protobuf field: string method_full_uri = 1; + */ + methodFullUri: string; +} +/** + * @generated from protobuf message lnrpc.RPCMessage + */ +export interface RPCMessage { + /** + * + * The full URI (in the format /./MethodName, for + * example /lnrpc.Lightning/GetInfo) of the RPC method the message was sent + * to/from. + * + * @generated from protobuf field: string method_full_uri = 1; + */ + methodFullUri: string; + /** + * + * Indicates whether the message was sent over a streaming RPC method or not. + * + * @generated from protobuf field: bool stream_rpc = 2; + */ + streamRpc: boolean; + /** + * + * The full canonical gRPC name of the message type (in the format + * .TypeName, for example lnrpc.GetInfoRequest). In case of an + * error being returned from lnd, this simply contains the string "error". + * + * @generated from protobuf field: string type_name = 3; + */ + typeName: string; + /** + * + * The full content of the gRPC message, serialized in the binary protobuf + * format. + * + * @generated from protobuf field: bytes serialized = 4; + */ + serialized: Uint8Array; + /** + * + * Indicates that the response from lnd was an error, not a gRPC response. If + * this is set to true then the type_name contains the string "error" and + * serialized contains the error string. + * + * @generated from protobuf field: bool is_error = 5; + */ + isError: boolean; +} +/** + * @generated from protobuf message lnrpc.RPCMiddlewareResponse + */ +export interface RPCMiddlewareResponse { + /** + * + * The request message ID this response refers to. Must always be set when + * giving feedback to an intercept but is ignored for the initial registration + * message. + * + * @generated from protobuf field: uint64 ref_msg_id = 1; + */ + refMsgId: bigint; + /** + * @generated from protobuf oneof: middleware_message + */ + middlewareMessage: { + oneofKind: "register"; + /** + * + * The registration message identifies the middleware that's being + * registered in lnd. The registration message must be sent immediately + * after initiating the RegisterRpcMiddleware stream, otherwise lnd will + * time out the attempt and terminate the request. NOTE: The middleware + * will only receive interception messages for requests that contain a + * macaroon with the custom caveat that the middleware declares it is + * responsible for handling in the registration message! As a security + * measure, _no_ middleware can intercept requests made with _unencumbered_ + * macaroons! + * + * @generated from protobuf field: lnrpc.MiddlewareRegistration register = 2; + */ + register: MiddlewareRegistration; + } | { + oneofKind: "feedback"; + /** + * + * The middleware received an interception request and gives feedback to + * it. The request_id indicates what message the feedback refers to. + * + * @generated from protobuf field: lnrpc.InterceptFeedback feedback = 3; + */ + feedback: InterceptFeedback; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf message lnrpc.MiddlewareRegistration + */ +export interface MiddlewareRegistration { + /** + * + * The name of the middleware to register. The name should be as informative + * as possible and is logged on registration. + * + * @generated from protobuf field: string middleware_name = 1; + */ + middlewareName: string; + /** + * + * The name of the custom macaroon caveat that this middleware is responsible + * for. Only requests/responses that contain a macaroon with the registered + * custom caveat are forwarded for interception to the middleware. The + * exception being the read-only mode: All requests/responses are forwarded to + * a middleware that requests read-only access but such a middleware won't be + * allowed to _alter_ responses. As a security measure, _no_ middleware can + * change responses to requests made with _unencumbered_ macaroons! + * NOTE: Cannot be used at the same time as read_only_mode. + * + * @generated from protobuf field: string custom_macaroon_caveat_name = 2; + */ + customMacaroonCaveatName: string; + /** + * + * Instead of defining a custom macaroon caveat name a middleware can register + * itself for read-only access only. In that mode all requests/responses are + * forwarded to the middleware but the middleware isn't allowed to alter any of + * the responses. + * NOTE: Cannot be used at the same time as custom_macaroon_caveat_name. + * + * @generated from protobuf field: bool read_only_mode = 3; + */ + readOnlyMode: boolean; +} +/** + * @generated from protobuf message lnrpc.InterceptFeedback + */ +export interface InterceptFeedback { + /** + * + * The error to return to the user. If this is non-empty, the incoming gRPC + * stream/request is aborted and the error is returned to the gRPC client. If + * this value is empty, it means the middleware accepts the stream/request/ + * response and the processing of it can continue. + * + * @generated from protobuf field: string error = 1; + */ + error: string; + /** + * + * A boolean indicating that the gRPC message should be replaced/overwritten. + * This boolean is needed because in protobuf an empty message is serialized as + * a 0-length or nil byte slice and we wouldn't be able to distinguish between + * an empty replacement message and the "don't replace anything" case. + * + * @generated from protobuf field: bool replace_response = 2; + */ + replaceResponse: boolean; + /** + * + * If the replace_response field is set to true, this field must contain the + * binary serialized gRPC message in the protobuf format. + * + * @generated from protobuf field: bytes replacement_serialized = 3; + */ + replacementSerialized: Uint8Array; +} +/** + * @generated from protobuf enum lnrpc.OutputScriptType + */ +export enum OutputScriptType { + /** + * @generated from protobuf enum value: SCRIPT_TYPE_PUBKEY_HASH = 0; + */ + SCRIPT_TYPE_PUBKEY_HASH = 0, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_SCRIPT_HASH = 1; + */ + SCRIPT_TYPE_SCRIPT_HASH = 1, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2; + */ + SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3; + */ + SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_PUBKEY = 4; + */ + SCRIPT_TYPE_PUBKEY = 4, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_MULTISIG = 5; + */ + SCRIPT_TYPE_MULTISIG = 5, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_NULLDATA = 6; + */ + SCRIPT_TYPE_NULLDATA = 6, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_NON_STANDARD = 7; + */ + SCRIPT_TYPE_NON_STANDARD = 7, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_UNKNOWN = 8; + */ + SCRIPT_TYPE_WITNESS_UNKNOWN = 8, + /** + * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9; + */ + SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9 +} /** * * `AddressType` has to be one of: * * - `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) * - `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) + * - `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 4) * * @generated from protobuf enum lnrpc.AddressType */ @@ -5830,20 +6962,35 @@ export enum AddressType { /** * @generated from protobuf enum value: UNUSED_NESTED_PUBKEY_HASH = 3; */ - UNUSED_NESTED_PUBKEY_HASH = 3 + UNUSED_NESTED_PUBKEY_HASH = 3, + /** + * @generated from protobuf enum value: TAPROOT_PUBKEY = 4; + */ + TAPROOT_PUBKEY = 4, + /** + * @generated from protobuf enum value: UNUSED_TAPROOT_PUBKEY = 5; + */ + UNUSED_TAPROOT_PUBKEY = 5 } /** * @generated from protobuf enum lnrpc.CommitmentType */ export enum CommitmentType { + /** + * + * Returned when the commitment type isn't known or unavailable. + * + * @generated from protobuf enum value: UNKNOWN_COMMITMENT_TYPE = 0; + */ + UNKNOWN_COMMITMENT_TYPE = 0, /** * * A channel using the legacy commitment format having tweaked to_remote * keys. * - * @generated from protobuf enum value: LEGACY = 0; + * @generated from protobuf enum value: LEGACY = 1; */ - LEGACY = 0, + LEGACY = 1, /** * * A channel that uses the modern commitment format where the key in the @@ -5851,25 +6998,29 @@ export enum CommitmentType { * up and recovery easier as when the channel is closed, the funds go * directly to that key. * - * @generated from protobuf enum value: STATIC_REMOTE_KEY = 1; + * @generated from protobuf enum value: STATIC_REMOTE_KEY = 2; */ - STATIC_REMOTE_KEY = 1, + STATIC_REMOTE_KEY = 2, /** * * A channel that uses a commitment format that has anchor outputs on the * commitments, allowing fee bumping after a force close transaction has * been broadcast. * - * @generated from protobuf enum value: ANCHORS = 2; + * @generated from protobuf enum value: ANCHORS = 3; */ - ANCHORS = 2, + ANCHORS = 3, /** * - * Returned when the commitment type isn't known or unavailable. + * A channel that uses a commitment type that builds upon the anchors + * commitment format, but in addition requires a CLTV clause to spend outputs + * paying to the channel initiator. This is intended for use on leased channels + * to guarantee that the channel initiator has no incentives to close a leased + * channel before its maturity date. * - * @generated from protobuf enum value: UNKNOWN_COMMITMENT_TYPE = 999; + * @generated from protobuf enum value: SCRIPT_ENFORCED_LEASE = 4; */ - UNKNOWN_COMMITMENT_TYPE = 999 + SCRIPT_ENFORCED_LEASE = 4 } /** * @generated from protobuf enum lnrpc.Initiator @@ -6163,20 +7314,327 @@ export enum FeatureBit { */ AMP_OPT = 31 } +/** + * @generated from protobuf enum lnrpc.UpdateFailure + */ +export enum UpdateFailure { + /** + * @generated from protobuf enum value: UPDATE_FAILURE_UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * @generated from protobuf enum value: UPDATE_FAILURE_PENDING = 1; + */ + PENDING = 1, + /** + * @generated from protobuf enum value: UPDATE_FAILURE_NOT_FOUND = 2; + */ + NOT_FOUND = 2, + /** + * @generated from protobuf enum value: UPDATE_FAILURE_INTERNAL_ERR = 3; + */ + INTERNAL_ERR = 3, + /** + * @generated from protobuf enum value: UPDATE_FAILURE_INVALID_PARAMETER = 4; + */ + INVALID_PARAMETER = 4 +} +// @generated message type with reflection information, may provide speed optimized methods +class LookupHtlcRequest$Type extends MessageType { + constructor() { + super("lnrpc.LookupHtlcRequest", [ + { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): LookupHtlcRequest { + const message = { chanId: 0n, htlcIndex: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupHtlcRequest): LookupHtlcRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 chan_id */ 1: + message.chanId = reader.uint64().toBigInt(); + break; + case /* uint64 htlc_index */ 2: + message.htlcIndex = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: LookupHtlcRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 chan_id = 1; */ + if (message.chanId !== 0n) + writer.tag(1, WireType.Varint).uint64(message.chanId); + /* uint64 htlc_index = 2; */ + if (message.htlcIndex !== 0n) + writer.tag(2, WireType.Varint).uint64(message.htlcIndex); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.LookupHtlcRequest + */ +export const LookupHtlcRequest = new LookupHtlcRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LookupHtlcResponse$Type extends MessageType { + constructor() { + super("lnrpc.LookupHtlcResponse", [ + { no: 1, name: "settled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "offchain", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): LookupHtlcResponse { + const message = { settled: false, offchain: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupHtlcResponse): LookupHtlcResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool settled */ 1: + message.settled = reader.bool(); + break; + case /* bool offchain */ 2: + message.offchain = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: LookupHtlcResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool settled = 1; */ + if (message.settled !== false) + writer.tag(1, WireType.Varint).bool(message.settled); + /* bool offchain = 2; */ + if (message.offchain !== false) + writer.tag(2, WireType.Varint).bool(message.offchain); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.LookupHtlcResponse + */ +export const LookupHtlcResponse = new LookupHtlcResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SubscribeCustomMessagesRequest$Type extends MessageType { + constructor() { + super("lnrpc.SubscribeCustomMessagesRequest", []); + } + create(value?: PartialMessage): SubscribeCustomMessagesRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeCustomMessagesRequest): SubscribeCustomMessagesRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: SubscribeCustomMessagesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SubscribeCustomMessagesRequest + */ +export const SubscribeCustomMessagesRequest = new SubscribeCustomMessagesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CustomMessage$Type extends MessageType { + constructor() { + super("lnrpc.CustomMessage", [ + { no: 1, name: "peer", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "type", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 3, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): CustomMessage { + const message = { peer: new Uint8Array(0), type: 0, data: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CustomMessage): CustomMessage { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes peer */ 1: + message.peer = reader.bytes(); + break; + case /* uint32 type */ 2: + message.type = reader.uint32(); + break; + case /* bytes data */ 3: + message.data = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CustomMessage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes peer = 1; */ + if (message.peer.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.peer); + /* uint32 type = 2; */ + if (message.type !== 0) + writer.tag(2, WireType.Varint).uint32(message.type); + /* bytes data = 3; */ + if (message.data.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.CustomMessage + */ +export const CustomMessage = new CustomMessage$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendCustomMessageRequest$Type extends MessageType { + constructor() { + super("lnrpc.SendCustomMessageRequest", [ + { no: 1, name: "peer", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "type", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 3, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): SendCustomMessageRequest { + const message = { peer: new Uint8Array(0), type: 0, data: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCustomMessageRequest): SendCustomMessageRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes peer */ 1: + message.peer = reader.bytes(); + break; + case /* uint32 type */ 2: + message.type = reader.uint32(); + break; + case /* bytes data */ 3: + message.data = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SendCustomMessageRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes peer = 1; */ + if (message.peer.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.peer); + /* uint32 type = 2; */ + if (message.type !== 0) + writer.tag(2, WireType.Varint).uint32(message.type); + /* bytes data = 3; */ + if (message.data.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SendCustomMessageRequest + */ +export const SendCustomMessageRequest = new SendCustomMessageRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SendCustomMessageResponse$Type extends MessageType { + constructor() { + super("lnrpc.SendCustomMessageResponse", []); + } + create(value?: PartialMessage): SendCustomMessageResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCustomMessageResponse): SendCustomMessageResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: SendCustomMessageResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SendCustomMessageResponse + */ +export const SendCustomMessageResponse = new SendCustomMessageResponse$Type(); // @generated message type with reflection information, may provide speed optimized methods class Utxo$Type extends MessageType { constructor() { super("lnrpc.Utxo", [ { no: 1, name: "address_type", kind: "enum", T: () => ["lnrpc.AddressType", AddressType] }, { no: 2, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "amount_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 3, name: "amount_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "pk_script", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 5, name: "outpoint", kind: "message", T: () => OutPoint }, - { no: 6, name: "confirmations", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + { no: 6, name: "confirmations", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): Utxo { - const message = { addressType: 0, address: "", amountSat: "0", pkScript: "", confirmations: "0" }; + const message = { addressType: 0, address: "", amountSat: 0n, pkScript: "", confirmations: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -6194,7 +7652,7 @@ class Utxo$Type extends MessageType { message.address = reader.string(); break; case /* int64 amount_sat */ 3: - message.amountSat = reader.int64().toString(); + message.amountSat = reader.int64().toBigInt(); break; case /* string pk_script */ 4: message.pkScript = reader.string(); @@ -6203,7 +7661,7 @@ class Utxo$Type extends MessageType { message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); break; case /* int64 confirmations */ 6: - message.confirmations = reader.int64().toString(); + message.confirmations = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -6224,7 +7682,7 @@ class Utxo$Type extends MessageType { if (message.address !== "") writer.tag(2, WireType.LengthDelimited).string(message.address); /* int64 amount_sat = 3; */ - if (message.amountSat !== "0") + if (message.amountSat !== 0n) writer.tag(3, WireType.Varint).int64(message.amountSat); /* string pk_script = 4; */ if (message.pkScript !== "") @@ -6233,7 +7691,7 @@ class Utxo$Type extends MessageType { if (message.outpoint) OutPoint.internalBinaryWrite(message.outpoint, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); /* int64 confirmations = 6; */ - if (message.confirmations !== "0") + if (message.confirmations !== 0n) writer.tag(6, WireType.Varint).int64(message.confirmations); let u = options.writeUnknownFields; if (u !== false) @@ -6246,23 +7704,107 @@ class Utxo$Type extends MessageType { */ export const Utxo = new Utxo$Type(); // @generated message type with reflection information, may provide speed optimized methods +class OutputDetail$Type extends MessageType { + constructor() { + super("lnrpc.OutputDetail", [ + { no: 1, name: "output_type", kind: "enum", T: () => ["lnrpc.OutputScriptType", OutputScriptType] }, + { no: 2, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "pk_script", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "output_index", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "is_our_address", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): OutputDetail { + const message = { outputType: 0, address: "", pkScript: "", outputIndex: 0n, amount: 0n, isOurAddress: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OutputDetail): OutputDetail { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.OutputScriptType output_type */ 1: + message.outputType = reader.int32(); + break; + case /* string address */ 2: + message.address = reader.string(); + break; + case /* string pk_script */ 3: + message.pkScript = reader.string(); + break; + case /* int64 output_index */ 4: + message.outputIndex = reader.int64().toBigInt(); + break; + case /* int64 amount */ 5: + message.amount = reader.int64().toBigInt(); + break; + case /* bool is_our_address */ 6: + message.isOurAddress = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: OutputDetail, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.OutputScriptType output_type = 1; */ + if (message.outputType !== 0) + writer.tag(1, WireType.Varint).int32(message.outputType); + /* string address = 2; */ + if (message.address !== "") + writer.tag(2, WireType.LengthDelimited).string(message.address); + /* string pk_script = 3; */ + if (message.pkScript !== "") + writer.tag(3, WireType.LengthDelimited).string(message.pkScript); + /* int64 output_index = 4; */ + if (message.outputIndex !== 0n) + writer.tag(4, WireType.Varint).int64(message.outputIndex); + /* int64 amount = 5; */ + if (message.amount !== 0n) + writer.tag(5, WireType.Varint).int64(message.amount); + /* bool is_our_address = 6; */ + if (message.isOurAddress !== false) + writer.tag(6, WireType.Varint).bool(message.isOurAddress); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.OutputDetail + */ +export const OutputDetail = new OutputDetail$Type(); +// @generated message type with reflection information, may provide speed optimized methods class Transaction$Type extends MessageType { constructor() { super("lnrpc.Transaction", [ { no: 1, name: "tx_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 3, name: "num_confirmations", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, { no: 4, name: "block_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 5, name: "block_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 6, name: "time_stamp", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 7, name: "total_fees", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 6, name: "time_stamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "total_fees", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 8, name: "dest_addresses", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: "output_details", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => OutputDetail }, { no: 9, name: "raw_tx_hex", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + { no: 10, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: "previous_outpoints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PreviousOutPoint } ]); } create(value?: PartialMessage): Transaction { - const message = { txHash: "", amount: "0", numConfirmations: 0, blockHash: "", blockHeight: 0, timeStamp: "0", totalFees: "0", destAddresses: [], rawTxHex: "", label: "" }; + const message = { txHash: "", amount: 0n, numConfirmations: 0, blockHash: "", blockHeight: 0, timeStamp: 0n, totalFees: 0n, destAddresses: [], outputDetails: [], rawTxHex: "", label: "", previousOutpoints: [] }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -6277,7 +7819,7 @@ class Transaction$Type extends MessageType { message.txHash = reader.string(); break; case /* int64 amount */ 2: - message.amount = reader.int64().toString(); + message.amount = reader.int64().toBigInt(); break; case /* int32 num_confirmations */ 3: message.numConfirmations = reader.int32(); @@ -6289,20 +7831,26 @@ class Transaction$Type extends MessageType { message.blockHeight = reader.int32(); break; case /* int64 time_stamp */ 6: - message.timeStamp = reader.int64().toString(); + message.timeStamp = reader.int64().toBigInt(); break; case /* int64 total_fees */ 7: - message.totalFees = reader.int64().toString(); + message.totalFees = reader.int64().toBigInt(); break; - case /* repeated string dest_addresses */ 8: + case /* repeated string dest_addresses = 8 [deprecated = true];*/ 8: message.destAddresses.push(reader.string()); break; + case /* repeated lnrpc.OutputDetail output_details */ 11: + message.outputDetails.push(OutputDetail.internalBinaryRead(reader, reader.uint32(), options)); + break; case /* string raw_tx_hex */ 9: message.rawTxHex = reader.string(); break; case /* string label */ 10: message.label = reader.string(); break; + case /* repeated lnrpc.PreviousOutPoint previous_outpoints */ 12: + message.previousOutpoints.push(PreviousOutPoint.internalBinaryRead(reader, reader.uint32(), options)); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -6319,7 +7867,7 @@ class Transaction$Type extends MessageType { if (message.txHash !== "") writer.tag(1, WireType.LengthDelimited).string(message.txHash); /* int64 amount = 2; */ - if (message.amount !== "0") + if (message.amount !== 0n) writer.tag(2, WireType.Varint).int64(message.amount); /* int32 num_confirmations = 3; */ if (message.numConfirmations !== 0) @@ -6331,20 +7879,26 @@ class Transaction$Type extends MessageType { if (message.blockHeight !== 0) writer.tag(5, WireType.Varint).int32(message.blockHeight); /* int64 time_stamp = 6; */ - if (message.timeStamp !== "0") + if (message.timeStamp !== 0n) writer.tag(6, WireType.Varint).int64(message.timeStamp); /* int64 total_fees = 7; */ - if (message.totalFees !== "0") + if (message.totalFees !== 0n) writer.tag(7, WireType.Varint).int64(message.totalFees); - /* repeated string dest_addresses = 8; */ + /* repeated string dest_addresses = 8 [deprecated = true]; */ for (let i = 0; i < message.destAddresses.length; i++) writer.tag(8, WireType.LengthDelimited).string(message.destAddresses[i]); + /* repeated lnrpc.OutputDetail output_details = 11; */ + for (let i = 0; i < message.outputDetails.length; i++) + OutputDetail.internalBinaryWrite(message.outputDetails[i], writer.tag(11, WireType.LengthDelimited).fork(), options).join(); /* string raw_tx_hex = 9; */ if (message.rawTxHex !== "") writer.tag(9, WireType.LengthDelimited).string(message.rawTxHex); /* string label = 10; */ if (message.label !== "") writer.tag(10, WireType.LengthDelimited).string(message.label); + /* repeated lnrpc.PreviousOutPoint previous_outpoints = 12; */ + for (let i = 0; i < message.previousOutpoints.length; i++) + PreviousOutPoint.internalBinaryWrite(message.previousOutpoints[i], writer.tag(12, WireType.LengthDelimited).fork(), options).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -6467,9 +8021,9 @@ export const TransactionDetails = new TransactionDetails$Type(); class FeeLimit$Type extends MessageType { constructor() { super("lnrpc.FeeLimit", [ - { no: 1, name: "fixed", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/ }, - { no: 3, name: "fixed_msat", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/ }, - { no: 2, name: "percent", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/ } + { no: 1, name: "fixed", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "fixed_msat", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "percent", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): FeeLimit { @@ -6487,19 +8041,19 @@ class FeeLimit$Type extends MessageType { case /* int64 fixed */ 1: message.limit = { oneofKind: "fixed", - fixed: reader.int64().toString() + fixed: reader.int64().toBigInt() }; break; case /* int64 fixed_msat */ 3: message.limit = { oneofKind: "fixedMsat", - fixedMsat: reader.int64().toString() + fixedMsat: reader.int64().toBigInt() }; break; case /* int64 percent */ 2: message.limit = { oneofKind: "percent", - percent: reader.int64().toString() + percent: reader.int64().toBigInt() }; break; default: @@ -6539,8 +8093,8 @@ class SendRequest$Type extends MessageType { super("lnrpc.SendRequest", [ { no: 1, name: "dest", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 2, name: "dest_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 3, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 5, name: "payment_hash_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 6, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, @@ -6556,7 +8110,7 @@ class SendRequest$Type extends MessageType { ]); } create(value?: PartialMessage): SendRequest { - const message = { dest: new Uint8Array(0), destString: "", amt: "0", amtMsat: "0", paymentHash: new Uint8Array(0), paymentHashString: "", paymentRequest: "", finalCltvDelta: 0, outgoingChanId: "0", lastHopPubkey: new Uint8Array(0), cltvLimit: 0, destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], paymentAddr: new Uint8Array(0) }; + const message = { dest: new Uint8Array(0), destString: "", amt: 0n, amtMsat: 0n, paymentHash: new Uint8Array(0), paymentHashString: "", paymentRequest: "", finalCltvDelta: 0, outgoingChanId: "0", lastHopPubkey: new Uint8Array(0), cltvLimit: 0, destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], paymentAddr: new Uint8Array(0) }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -6574,10 +8128,10 @@ class SendRequest$Type extends MessageType { message.destString = reader.string(); break; case /* int64 amt */ 3: - message.amt = reader.int64().toString(); + message.amt = reader.int64().toBigInt(); break; case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toString(); + message.amtMsat = reader.int64().toBigInt(); break; case /* bytes payment_hash */ 4: message.paymentHash = reader.bytes(); @@ -6654,10 +8208,10 @@ class SendRequest$Type extends MessageType { if (message.destString !== "") writer.tag(2, WireType.LengthDelimited).string(message.destString); /* int64 amt = 3; */ - if (message.amt !== "0") + if (message.amt !== 0n) writer.tag(3, WireType.Varint).int64(message.amt); /* int64 amt_msat = 12; */ - if (message.amtMsat !== "0") + if (message.amtMsat !== 0n) writer.tag(12, WireType.Varint).int64(message.amtMsat); /* bytes payment_hash = 4; */ if (message.paymentHash.length) @@ -6845,20 +8399,23 @@ class ChannelAcceptRequest$Type extends MessageType { { no: 1, name: "node_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 2, name: "chain_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 3, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "funding_amt", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 5, name: "push_amt", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 6, name: "dust_limit", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 7, name: "max_value_in_flight", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 8, name: "channel_reserve", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 9, name: "min_htlc", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 10, name: "fee_per_kw", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "funding_amt", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "push_amt", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "dust_limit", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "max_value_in_flight", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "channel_reserve", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "min_htlc", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "fee_per_kw", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 11, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 12, name: "max_accepted_htlcs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 13, name: "channel_flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + { no: 13, name: "channel_flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 14, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, + { no: 15, name: "wants_zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 16, name: "wants_scid_alias", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): ChannelAcceptRequest { - const message = { nodePubkey: new Uint8Array(0), chainHash: new Uint8Array(0), pendingChanId: new Uint8Array(0), fundingAmt: "0", pushAmt: "0", dustLimit: "0", maxValueInFlight: "0", channelReserve: "0", minHtlc: "0", feePerKw: "0", csvDelay: 0, maxAcceptedHtlcs: 0, channelFlags: 0 }; + const message = { nodePubkey: new Uint8Array(0), chainHash: new Uint8Array(0), pendingChanId: new Uint8Array(0), fundingAmt: 0n, pushAmt: 0n, dustLimit: 0n, maxValueInFlight: 0n, channelReserve: 0n, minHtlc: 0n, feePerKw: 0n, csvDelay: 0, maxAcceptedHtlcs: 0, channelFlags: 0, commitmentType: 0, wantsZeroConf: false, wantsScidAlias: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -6879,25 +8436,25 @@ class ChannelAcceptRequest$Type extends MessageType { message.pendingChanId = reader.bytes(); break; case /* uint64 funding_amt */ 4: - message.fundingAmt = reader.uint64().toString(); + message.fundingAmt = reader.uint64().toBigInt(); break; case /* uint64 push_amt */ 5: - message.pushAmt = reader.uint64().toString(); + message.pushAmt = reader.uint64().toBigInt(); break; case /* uint64 dust_limit */ 6: - message.dustLimit = reader.uint64().toString(); + message.dustLimit = reader.uint64().toBigInt(); break; case /* uint64 max_value_in_flight */ 7: - message.maxValueInFlight = reader.uint64().toString(); + message.maxValueInFlight = reader.uint64().toBigInt(); break; case /* uint64 channel_reserve */ 8: - message.channelReserve = reader.uint64().toString(); + message.channelReserve = reader.uint64().toBigInt(); break; case /* uint64 min_htlc */ 9: - message.minHtlc = reader.uint64().toString(); + message.minHtlc = reader.uint64().toBigInt(); break; case /* uint64 fee_per_kw */ 10: - message.feePerKw = reader.uint64().toString(); + message.feePerKw = reader.uint64().toBigInt(); break; case /* uint32 csv_delay */ 11: message.csvDelay = reader.uint32(); @@ -6908,6 +8465,15 @@ class ChannelAcceptRequest$Type extends MessageType { case /* uint32 channel_flags */ 13: message.channelFlags = reader.uint32(); break; + case /* lnrpc.CommitmentType commitment_type */ 14: + message.commitmentType = reader.int32(); + break; + case /* bool wants_zero_conf */ 15: + message.wantsZeroConf = reader.bool(); + break; + case /* bool wants_scid_alias */ 16: + message.wantsScidAlias = reader.bool(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -6930,25 +8496,25 @@ class ChannelAcceptRequest$Type extends MessageType { if (message.pendingChanId.length) writer.tag(3, WireType.LengthDelimited).bytes(message.pendingChanId); /* uint64 funding_amt = 4; */ - if (message.fundingAmt !== "0") + if (message.fundingAmt !== 0n) writer.tag(4, WireType.Varint).uint64(message.fundingAmt); /* uint64 push_amt = 5; */ - if (message.pushAmt !== "0") + if (message.pushAmt !== 0n) writer.tag(5, WireType.Varint).uint64(message.pushAmt); /* uint64 dust_limit = 6; */ - if (message.dustLimit !== "0") + if (message.dustLimit !== 0n) writer.tag(6, WireType.Varint).uint64(message.dustLimit); /* uint64 max_value_in_flight = 7; */ - if (message.maxValueInFlight !== "0") + if (message.maxValueInFlight !== 0n) writer.tag(7, WireType.Varint).uint64(message.maxValueInFlight); /* uint64 channel_reserve = 8; */ - if (message.channelReserve !== "0") + if (message.channelReserve !== 0n) writer.tag(8, WireType.Varint).uint64(message.channelReserve); /* uint64 min_htlc = 9; */ - if (message.minHtlc !== "0") + if (message.minHtlc !== 0n) writer.tag(9, WireType.Varint).uint64(message.minHtlc); /* uint64 fee_per_kw = 10; */ - if (message.feePerKw !== "0") + if (message.feePerKw !== 0n) writer.tag(10, WireType.Varint).uint64(message.feePerKw); /* uint32 csv_delay = 11; */ if (message.csvDelay !== 0) @@ -6959,6 +8525,15 @@ class ChannelAcceptRequest$Type extends MessageType { /* uint32 channel_flags = 13; */ if (message.channelFlags !== 0) writer.tag(13, WireType.Varint).uint32(message.channelFlags); + /* lnrpc.CommitmentType commitment_type = 14; */ + if (message.commitmentType !== 0) + writer.tag(14, WireType.Varint).int32(message.commitmentType); + /* bool wants_zero_conf = 15; */ + if (message.wantsZeroConf !== false) + writer.tag(15, WireType.Varint).bool(message.wantsZeroConf); + /* bool wants_scid_alias = 16; */ + if (message.wantsScidAlias !== false) + writer.tag(16, WireType.Varint).bool(message.wantsScidAlias); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -6978,15 +8553,16 @@ class ChannelAcceptResponse$Type extends MessageType { { no: 3, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "upfront_shutdown", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 5, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 7, name: "in_flight_max_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 6, name: "reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "in_flight_max_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 8, name: "max_htlc_count", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 9, name: "min_htlc_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 10, name: "min_accept_depth", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + { no: 9, name: "min_htlc_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "min_accept_depth", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 11, name: "zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): ChannelAcceptResponse { - const message = { accept: false, pendingChanId: new Uint8Array(0), error: "", upfrontShutdown: "", csvDelay: 0, reserveSat: "0", inFlightMaxMsat: "0", maxHtlcCount: 0, minHtlcIn: "0", minAcceptDepth: 0 }; + const message = { accept: false, pendingChanId: new Uint8Array(0), error: "", upfrontShutdown: "", csvDelay: 0, reserveSat: 0n, inFlightMaxMsat: 0n, maxHtlcCount: 0, minHtlcIn: 0n, minAcceptDepth: 0, zeroConf: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -7013,20 +8589,23 @@ class ChannelAcceptResponse$Type extends MessageType { message.csvDelay = reader.uint32(); break; case /* uint64 reserve_sat */ 6: - message.reserveSat = reader.uint64().toString(); + message.reserveSat = reader.uint64().toBigInt(); break; case /* uint64 in_flight_max_msat */ 7: - message.inFlightMaxMsat = reader.uint64().toString(); + message.inFlightMaxMsat = reader.uint64().toBigInt(); break; case /* uint32 max_htlc_count */ 8: message.maxHtlcCount = reader.uint32(); break; case /* uint64 min_htlc_in */ 9: - message.minHtlcIn = reader.uint64().toString(); + message.minHtlcIn = reader.uint64().toBigInt(); break; case /* uint32 min_accept_depth */ 10: message.minAcceptDepth = reader.uint32(); break; + case /* bool zero_conf */ 11: + message.zeroConf = reader.bool(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -7055,20 +8634,23 @@ class ChannelAcceptResponse$Type extends MessageType { if (message.csvDelay !== 0) writer.tag(5, WireType.Varint).uint32(message.csvDelay); /* uint64 reserve_sat = 6; */ - if (message.reserveSat !== "0") + if (message.reserveSat !== 0n) writer.tag(6, WireType.Varint).uint64(message.reserveSat); /* uint64 in_flight_max_msat = 7; */ - if (message.inFlightMaxMsat !== "0") + if (message.inFlightMaxMsat !== 0n) writer.tag(7, WireType.Varint).uint64(message.inFlightMaxMsat); /* uint32 max_htlc_count = 8; */ if (message.maxHtlcCount !== 0) writer.tag(8, WireType.Varint).uint32(message.maxHtlcCount); /* uint64 min_htlc_in = 9; */ - if (message.minHtlcIn !== "0") + if (message.minHtlcIn !== 0n) writer.tag(9, WireType.Varint).uint64(message.minHtlcIn); /* uint32 min_accept_depth = 10; */ if (message.minAcceptDepth !== 0) writer.tag(10, WireType.Varint).uint32(message.minAcceptDepth); + /* bool zero_conf = 11; */ + if (message.zeroConf !== false) + writer.tag(11, WireType.Varint).bool(message.zeroConf); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -7208,6 +8790,60 @@ class OutPoint$Type extends MessageType { */ export const OutPoint = new OutPoint$Type(); // @generated message type with reflection information, may provide speed optimized methods +class PreviousOutPoint$Type extends MessageType { + constructor() { + super("lnrpc.PreviousOutPoint", [ + { no: 1, name: "outpoint", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "is_our_output", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): PreviousOutPoint { + const message = { outpoint: "", isOurOutput: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PreviousOutPoint): PreviousOutPoint { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string outpoint */ 1: + message.outpoint = reader.string(); + break; + case /* bool is_our_output */ 2: + message.isOurOutput = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PreviousOutPoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string outpoint = 1; */ + if (message.outpoint !== "") + writer.tag(1, WireType.LengthDelimited).string(message.outpoint); + /* bool is_our_output = 2; */ + if (message.isOurOutput !== false) + writer.tag(2, WireType.Varint).bool(message.isOurOutput); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.PreviousOutPoint + */ +export const PreviousOutPoint = new PreviousOutPoint$Type(); +// @generated message type with reflection information, may provide speed optimized methods class LightningAddress$Type extends MessageType { constructor() { super("lnrpc.LightningAddress", [ @@ -7265,7 +8901,7 @@ export const LightningAddress = new LightningAddress$Type(); class EstimateFeeRequest$Type extends MessageType { constructor() { super("lnrpc.EstimateFeeRequest", [ - { no: 1, name: "AddrToAmount", kind: "map", jsonName: "AddrToAmount", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 3 /*ScalarType.INT64*/ } }, + { no: 1, name: "AddrToAmount", kind: "map", jsonName: "AddrToAmount", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } }, { no: 2, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, { no: 3, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, { no: 4, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } @@ -7315,12 +8951,12 @@ class EstimateFeeRequest$Type extends MessageType { key = reader.string(); break; case 2: - val = reader.int64().toString(); + val = reader.int64().toBigInt(); break; default: throw new globalThis.Error("unknown map entry field for field lnrpc.EstimateFeeRequest.AddrToAmount"); } } - map[key ?? ""] = val ?? "0"; + map[key ?? ""] = val ?? 0n; } internalBinaryWrite(message: EstimateFeeRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ @@ -7349,13 +8985,13 @@ export const EstimateFeeRequest = new EstimateFeeRequest$Type(); class EstimateFeeResponse$Type extends MessageType { constructor() { super("lnrpc.EstimateFeeResponse", [ - { no: 1, name: "fee_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 2, name: "feerate_sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 3, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 1, name: "fee_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "feerate_sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): EstimateFeeResponse { - const message = { feeSat: "0", feerateSatPerByte: "0", satPerVbyte: "0" }; + const message = { feeSat: 0n, feerateSatPerByte: 0n, satPerVbyte: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -7367,13 +9003,13 @@ class EstimateFeeResponse$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 fee_sat */ 1: - message.feeSat = reader.int64().toString(); + message.feeSat = reader.int64().toBigInt(); break; case /* int64 feerate_sat_per_byte = 2 [deprecated = true];*/ 2: - message.feerateSatPerByte = reader.int64().toString(); + message.feerateSatPerByte = reader.int64().toBigInt(); break; case /* uint64 sat_per_vbyte */ 3: - message.satPerVbyte = reader.uint64().toString(); + message.satPerVbyte = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -7388,13 +9024,13 @@ class EstimateFeeResponse$Type extends MessageType { } internalBinaryWrite(message: EstimateFeeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 fee_sat = 1; */ - if (message.feeSat !== "0") + if (message.feeSat !== 0n) writer.tag(1, WireType.Varint).int64(message.feeSat); /* int64 feerate_sat_per_byte = 2 [deprecated = true]; */ - if (message.feerateSatPerByte !== "0") + if (message.feerateSatPerByte !== 0n) writer.tag(2, WireType.Varint).int64(message.feerateSatPerByte); /* uint64 sat_per_vbyte = 3; */ - if (message.satPerVbyte !== "0") + if (message.satPerVbyte !== 0n) writer.tag(3, WireType.Varint).uint64(message.satPerVbyte); let u = options.writeUnknownFields; if (u !== false) @@ -7410,17 +9046,17 @@ export const EstimateFeeResponse = new EstimateFeeResponse$Type(); class SendManyRequest$Type extends MessageType { constructor() { super("lnrpc.SendManyRequest", [ - { no: 1, name: "AddrToAmount", kind: "map", jsonName: "AddrToAmount", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 3 /*ScalarType.INT64*/ } }, + { no: 1, name: "AddrToAmount", kind: "map", jsonName: "AddrToAmount", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } }, { no: 3, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 4, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 6, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 7, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, { no: 8, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): SendManyRequest { - const message = { addrToAmount: {}, targetConf: 0, satPerVbyte: "0", satPerByte: "0", label: "", minConfs: 0, spendUnconfirmed: false }; + const message = { addrToAmount: {}, targetConf: 0, satPerVbyte: 0n, satPerByte: 0n, label: "", minConfs: 0, spendUnconfirmed: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -7438,10 +9074,10 @@ class SendManyRequest$Type extends MessageType { message.targetConf = reader.int32(); break; case /* uint64 sat_per_vbyte */ 4: - message.satPerVbyte = reader.uint64().toString(); + message.satPerVbyte = reader.uint64().toBigInt(); break; case /* int64 sat_per_byte = 5 [deprecated = true];*/ 5: - message.satPerByte = reader.int64().toString(); + message.satPerByte = reader.int64().toBigInt(); break; case /* string label */ 6: message.label = reader.string(); @@ -7472,12 +9108,12 @@ class SendManyRequest$Type extends MessageType { key = reader.string(); break; case 2: - val = reader.int64().toString(); + val = reader.int64().toBigInt(); break; default: throw new globalThis.Error("unknown map entry field for field lnrpc.SendManyRequest.AddrToAmount"); } } - map[key ?? ""] = val ?? "0"; + map[key ?? ""] = val ?? 0n; } internalBinaryWrite(message: SendManyRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ @@ -7487,10 +9123,10 @@ class SendManyRequest$Type extends MessageType { if (message.targetConf !== 0) writer.tag(3, WireType.Varint).int32(message.targetConf); /* uint64 sat_per_vbyte = 4; */ - if (message.satPerVbyte !== "0") + if (message.satPerVbyte !== 0n) writer.tag(4, WireType.Varint).uint64(message.satPerVbyte); /* int64 sat_per_byte = 5 [deprecated = true]; */ - if (message.satPerByte !== "0") + if (message.satPerByte !== 0n) writer.tag(5, WireType.Varint).int64(message.satPerByte); /* string label = 6; */ if (message.label !== "") @@ -7563,10 +9199,10 @@ class SendCoinsRequest$Type extends MessageType { constructor() { super("lnrpc.SendCoinsRequest", [ { no: 1, name: "addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 3, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 4, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 6, name: "send_all", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 7, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 8, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, @@ -7574,7 +9210,7 @@ class SendCoinsRequest$Type extends MessageType { ]); } create(value?: PartialMessage): SendCoinsRequest { - const message = { addr: "", amount: "0", targetConf: 0, satPerVbyte: "0", satPerByte: "0", sendAll: false, label: "", minConfs: 0, spendUnconfirmed: false }; + const message = { addr: "", amount: 0n, targetConf: 0, satPerVbyte: 0n, satPerByte: 0n, sendAll: false, label: "", minConfs: 0, spendUnconfirmed: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -7589,16 +9225,16 @@ class SendCoinsRequest$Type extends MessageType { message.addr = reader.string(); break; case /* int64 amount */ 2: - message.amount = reader.int64().toString(); + message.amount = reader.int64().toBigInt(); break; case /* int32 target_conf */ 3: message.targetConf = reader.int32(); break; case /* uint64 sat_per_vbyte */ 4: - message.satPerVbyte = reader.uint64().toString(); + message.satPerVbyte = reader.uint64().toBigInt(); break; case /* int64 sat_per_byte = 5 [deprecated = true];*/ 5: - message.satPerByte = reader.int64().toString(); + message.satPerByte = reader.int64().toBigInt(); break; case /* bool send_all */ 6: message.sendAll = reader.bool(); @@ -7628,16 +9264,16 @@ class SendCoinsRequest$Type extends MessageType { if (message.addr !== "") writer.tag(1, WireType.LengthDelimited).string(message.addr); /* int64 amount = 2; */ - if (message.amount !== "0") + if (message.amount !== 0n) writer.tag(2, WireType.Varint).int64(message.amount); /* int32 target_conf = 3; */ if (message.targetConf !== 0) writer.tag(3, WireType.Varint).int32(message.targetConf); /* uint64 sat_per_vbyte = 4; */ - if (message.satPerVbyte !== "0") + if (message.satPerVbyte !== 0n) writer.tag(4, WireType.Varint).uint64(message.satPerVbyte); /* int64 sat_per_byte = 5 [deprecated = true]; */ - if (message.satPerByte !== "0") + if (message.satPerByte !== 0n) writer.tag(5, WireType.Varint).int64(message.satPerByte); /* bool send_all = 6; */ if (message.sendAll !== false) @@ -7921,11 +9557,12 @@ export const NewAddressResponse = new NewAddressResponse$Type(); class SignMessageRequest$Type extends MessageType { constructor() { super("lnrpc.SignMessageRequest", [ - { no: 1, name: "msg", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + { no: 1, name: "msg", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "single_hash", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): SignMessageRequest { - const message = { msg: new Uint8Array(0) }; + const message = { msg: new Uint8Array(0), singleHash: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -7939,6 +9576,9 @@ class SignMessageRequest$Type extends MessageType { case /* bytes msg */ 1: message.msg = reader.bytes(); break; + case /* bool single_hash */ 2: + message.singleHash = reader.bool(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -7954,6 +9594,9 @@ class SignMessageRequest$Type extends MessageType { /* bytes msg = 1; */ if (message.msg.length) writer.tag(1, WireType.LengthDelimited).bytes(message.msg); + /* bool single_hash = 2; */ + if (message.singleHash !== false) + writer.tag(2, WireType.Varint).bool(message.singleHash); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -8125,11 +9768,11 @@ class ConnectPeerRequest$Type extends MessageType { super("lnrpc.ConnectPeerRequest", [ { no: 1, name: "addr", kind: "message", T: () => LightningAddress }, { no: 2, name: "perm", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "timeout", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 3, name: "timeout", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): ConnectPeerRequest { - const message = { perm: false, timeout: "0" }; + const message = { perm: false, timeout: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -8147,7 +9790,7 @@ class ConnectPeerRequest$Type extends MessageType { message.perm = reader.bool(); break; case /* uint64 timeout */ 3: - message.timeout = reader.uint64().toString(); + message.timeout = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -8168,7 +9811,7 @@ class ConnectPeerRequest$Type extends MessageType { if (message.perm !== false) writer.tag(2, WireType.Varint).bool(message.perm); /* uint64 timeout = 3; */ - if (message.timeout !== "0") + if (message.timeout !== 0n) writer.tag(3, WireType.Varint).uint64(message.timeout); let u = options.writeUnknownFields; if (u !== false) @@ -8284,16 +9927,16 @@ class HTLC$Type extends MessageType { constructor() { super("lnrpc.HTLC", [ { no: 1, name: "incoming", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 3, name: "hash_lock", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 4, name: "expiration_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 6, name: "forwarding_channel", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 7, name: "forwarding_htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 5, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "forwarding_channel", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "forwarding_htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): HTLC { - const message = { incoming: false, amount: "0", hashLock: new Uint8Array(0), expirationHeight: 0, htlcIndex: "0", forwardingChannel: "0", forwardingHtlcIndex: "0" }; + const message = { incoming: false, amount: 0n, hashLock: new Uint8Array(0), expirationHeight: 0, htlcIndex: 0n, forwardingChannel: 0n, forwardingHtlcIndex: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -8308,7 +9951,7 @@ class HTLC$Type extends MessageType { message.incoming = reader.bool(); break; case /* int64 amount */ 2: - message.amount = reader.int64().toString(); + message.amount = reader.int64().toBigInt(); break; case /* bytes hash_lock */ 3: message.hashLock = reader.bytes(); @@ -8317,13 +9960,13 @@ class HTLC$Type extends MessageType { message.expirationHeight = reader.uint32(); break; case /* uint64 htlc_index */ 5: - message.htlcIndex = reader.uint64().toString(); + message.htlcIndex = reader.uint64().toBigInt(); break; case /* uint64 forwarding_channel */ 6: - message.forwardingChannel = reader.uint64().toString(); + message.forwardingChannel = reader.uint64().toBigInt(); break; case /* uint64 forwarding_htlc_index */ 7: - message.forwardingHtlcIndex = reader.uint64().toString(); + message.forwardingHtlcIndex = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -8341,7 +9984,7 @@ class HTLC$Type extends MessageType { if (message.incoming !== false) writer.tag(1, WireType.Varint).bool(message.incoming); /* int64 amount = 2; */ - if (message.amount !== "0") + if (message.amount !== 0n) writer.tag(2, WireType.Varint).int64(message.amount); /* bytes hash_lock = 3; */ if (message.hashLock.length) @@ -8350,13 +9993,13 @@ class HTLC$Type extends MessageType { if (message.expirationHeight !== 0) writer.tag(4, WireType.Varint).uint32(message.expirationHeight); /* uint64 htlc_index = 5; */ - if (message.htlcIndex !== "0") + if (message.htlcIndex !== 0n) writer.tag(5, WireType.Varint).uint64(message.htlcIndex); /* uint64 forwarding_channel = 6; */ - if (message.forwardingChannel !== "0") + if (message.forwardingChannel !== 0n) writer.tag(6, WireType.Varint).uint64(message.forwardingChannel); /* uint64 forwarding_htlc_index = 7; */ - if (message.forwardingHtlcIndex !== "0") + if (message.forwardingHtlcIndex !== 0n) writer.tag(7, WireType.Varint).uint64(message.forwardingHtlcIndex); let u = options.writeUnknownFields; if (u !== false) @@ -8373,15 +10016,15 @@ class ChannelConstraints$Type extends MessageType { constructor() { super("lnrpc.ChannelConstraints", [ { no: 1, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "chan_reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "dust_limit_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 4, name: "max_pending_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 5, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "chan_reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "dust_limit_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "max_pending_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 6, name: "max_accepted_htlcs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } ]); } create(value?: PartialMessage): ChannelConstraints { - const message = { csvDelay: 0, chanReserveSat: "0", dustLimitSat: "0", maxPendingAmtMsat: "0", minHtlcMsat: "0", maxAcceptedHtlcs: 0 }; + const message = { csvDelay: 0, chanReserveSat: 0n, dustLimitSat: 0n, maxPendingAmtMsat: 0n, minHtlcMsat: 0n, maxAcceptedHtlcs: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -8396,16 +10039,16 @@ class ChannelConstraints$Type extends MessageType { message.csvDelay = reader.uint32(); break; case /* uint64 chan_reserve_sat */ 2: - message.chanReserveSat = reader.uint64().toString(); + message.chanReserveSat = reader.uint64().toBigInt(); break; case /* uint64 dust_limit_sat */ 3: - message.dustLimitSat = reader.uint64().toString(); + message.dustLimitSat = reader.uint64().toBigInt(); break; case /* uint64 max_pending_amt_msat */ 4: - message.maxPendingAmtMsat = reader.uint64().toString(); + message.maxPendingAmtMsat = reader.uint64().toBigInt(); break; case /* uint64 min_htlc_msat */ 5: - message.minHtlcMsat = reader.uint64().toString(); + message.minHtlcMsat = reader.uint64().toBigInt(); break; case /* uint32 max_accepted_htlcs */ 6: message.maxAcceptedHtlcs = reader.uint32(); @@ -8426,16 +10069,16 @@ class ChannelConstraints$Type extends MessageType { if (message.csvDelay !== 0) writer.tag(1, WireType.Varint).uint32(message.csvDelay); /* uint64 chan_reserve_sat = 2; */ - if (message.chanReserveSat !== "0") + if (message.chanReserveSat !== 0n) writer.tag(2, WireType.Varint).uint64(message.chanReserveSat); /* uint64 dust_limit_sat = 3; */ - if (message.dustLimitSat !== "0") + if (message.dustLimitSat !== 0n) writer.tag(3, WireType.Varint).uint64(message.dustLimitSat); /* uint64 max_pending_amt_msat = 4; */ - if (message.maxPendingAmtMsat !== "0") + if (message.maxPendingAmtMsat !== 0n) writer.tag(4, WireType.Varint).uint64(message.maxPendingAmtMsat); /* uint64 min_htlc_msat = 5; */ - if (message.minHtlcMsat !== "0") + if (message.minHtlcMsat !== 0n) writer.tag(5, WireType.Varint).uint64(message.minHtlcMsat); /* uint32 max_accepted_htlcs = 6; */ if (message.maxAcceptedHtlcs !== 0) @@ -8458,36 +10101,39 @@ class Channel$Type extends MessageType { { no: 2, name: "remote_pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 5, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 6, name: "local_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 7, name: "remote_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 8, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 9, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 10, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 11, name: "unsettled_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 12, name: "total_satoshis_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 13, name: "total_satoshis_received", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 14, name: "num_updates", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 5, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "local_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "remote_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 11, name: "unsettled_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "total_satoshis_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 13, name: "total_satoshis_received", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 14, name: "num_updates", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 15, name: "pending_htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HTLC }, { no: 16, name: "csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 17, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 18, name: "initiator", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 19, name: "chan_status_flags", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 20, name: "local_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 21, name: "remote_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 20, name: "local_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 21, name: "remote_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 22, name: "static_remote_key", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 26, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, - { no: 23, name: "lifetime", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 24, name: "uptime", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 23, name: "lifetime", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 24, name: "uptime", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 25, name: "close_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 27, name: "push_amount_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 27, name: "push_amount_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 28, name: "thaw_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 29, name: "local_constraints", kind: "message", T: () => ChannelConstraints }, - { no: 30, name: "remote_constraints", kind: "message", T: () => ChannelConstraints } + { no: 30, name: "remote_constraints", kind: "message", T: () => ChannelConstraints }, + { no: 31, name: "alias_scids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 32, name: "zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 33, name: "zero_conf_confirmed_scid", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): Channel { - const message = { active: false, remotePubkey: "", channelPoint: "", chanId: "0", capacity: "0", localBalance: "0", remoteBalance: "0", commitFee: "0", commitWeight: "0", feePerKw: "0", unsettledBalance: "0", totalSatoshisSent: "0", totalSatoshisReceived: "0", numUpdates: "0", pendingHtlcs: [], csvDelay: 0, private: false, initiator: false, chanStatusFlags: "", localChanReserveSat: "0", remoteChanReserveSat: "0", staticRemoteKey: false, commitmentType: 0, lifetime: "0", uptime: "0", closeAddress: "", pushAmountSat: "0", thawHeight: 0 }; + const message = { active: false, remotePubkey: "", channelPoint: "", chanId: "0", capacity: 0n, localBalance: 0n, remoteBalance: 0n, commitFee: 0n, commitWeight: 0n, feePerKw: 0n, unsettledBalance: 0n, totalSatoshisSent: 0n, totalSatoshisReceived: 0n, numUpdates: 0n, pendingHtlcs: [], csvDelay: 0, private: false, initiator: false, chanStatusFlags: "", localChanReserveSat: 0n, remoteChanReserveSat: 0n, staticRemoteKey: false, commitmentType: 0, lifetime: 0n, uptime: 0n, closeAddress: "", pushAmountSat: 0n, thawHeight: 0, aliasScids: [], zeroConf: false, zeroConfConfirmedScid: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -8511,34 +10157,34 @@ class Channel$Type extends MessageType { message.chanId = reader.uint64().toString(); break; case /* int64 capacity */ 5: - message.capacity = reader.int64().toString(); + message.capacity = reader.int64().toBigInt(); break; case /* int64 local_balance */ 6: - message.localBalance = reader.int64().toString(); + message.localBalance = reader.int64().toBigInt(); break; case /* int64 remote_balance */ 7: - message.remoteBalance = reader.int64().toString(); + message.remoteBalance = reader.int64().toBigInt(); break; case /* int64 commit_fee */ 8: - message.commitFee = reader.int64().toString(); + message.commitFee = reader.int64().toBigInt(); break; case /* int64 commit_weight */ 9: - message.commitWeight = reader.int64().toString(); + message.commitWeight = reader.int64().toBigInt(); break; case /* int64 fee_per_kw */ 10: - message.feePerKw = reader.int64().toString(); + message.feePerKw = reader.int64().toBigInt(); break; case /* int64 unsettled_balance */ 11: - message.unsettledBalance = reader.int64().toString(); + message.unsettledBalance = reader.int64().toBigInt(); break; case /* int64 total_satoshis_sent */ 12: - message.totalSatoshisSent = reader.int64().toString(); + message.totalSatoshisSent = reader.int64().toBigInt(); break; case /* int64 total_satoshis_received */ 13: - message.totalSatoshisReceived = reader.int64().toString(); + message.totalSatoshisReceived = reader.int64().toBigInt(); break; case /* uint64 num_updates */ 14: - message.numUpdates = reader.uint64().toString(); + message.numUpdates = reader.uint64().toBigInt(); break; case /* repeated lnrpc.HTLC pending_htlcs */ 15: message.pendingHtlcs.push(HTLC.internalBinaryRead(reader, reader.uint32(), options)); @@ -8556,10 +10202,10 @@ class Channel$Type extends MessageType { message.chanStatusFlags = reader.string(); break; case /* int64 local_chan_reserve_sat = 20 [deprecated = true];*/ 20: - message.localChanReserveSat = reader.int64().toString(); + message.localChanReserveSat = reader.int64().toBigInt(); break; case /* int64 remote_chan_reserve_sat = 21 [deprecated = true];*/ 21: - message.remoteChanReserveSat = reader.int64().toString(); + message.remoteChanReserveSat = reader.int64().toBigInt(); break; case /* bool static_remote_key = 22 [deprecated = true];*/ 22: message.staticRemoteKey = reader.bool(); @@ -8568,16 +10214,16 @@ class Channel$Type extends MessageType { message.commitmentType = reader.int32(); break; case /* int64 lifetime */ 23: - message.lifetime = reader.int64().toString(); + message.lifetime = reader.int64().toBigInt(); break; case /* int64 uptime */ 24: - message.uptime = reader.int64().toString(); + message.uptime = reader.int64().toBigInt(); break; case /* string close_address */ 25: message.closeAddress = reader.string(); break; case /* uint64 push_amount_sat */ 27: - message.pushAmountSat = reader.uint64().toString(); + message.pushAmountSat = reader.uint64().toBigInt(); break; case /* uint32 thaw_height */ 28: message.thawHeight = reader.uint32(); @@ -8588,6 +10234,19 @@ class Channel$Type extends MessageType { case /* lnrpc.ChannelConstraints remote_constraints */ 30: message.remoteConstraints = ChannelConstraints.internalBinaryRead(reader, reader.uint32(), options, message.remoteConstraints); break; + case /* repeated uint64 alias_scids */ 31: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.aliasScids.push(reader.uint64().toBigInt()); + else + message.aliasScids.push(reader.uint64().toBigInt()); + break; + case /* bool zero_conf */ 32: + message.zeroConf = reader.bool(); + break; + case /* uint64 zero_conf_confirmed_scid */ 33: + message.zeroConfConfirmedScid = reader.uint64().toBigInt(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -8613,34 +10272,34 @@ class Channel$Type extends MessageType { if (message.chanId !== "0") writer.tag(4, WireType.Varint).uint64(message.chanId); /* int64 capacity = 5; */ - if (message.capacity !== "0") + if (message.capacity !== 0n) writer.tag(5, WireType.Varint).int64(message.capacity); /* int64 local_balance = 6; */ - if (message.localBalance !== "0") + if (message.localBalance !== 0n) writer.tag(6, WireType.Varint).int64(message.localBalance); /* int64 remote_balance = 7; */ - if (message.remoteBalance !== "0") + if (message.remoteBalance !== 0n) writer.tag(7, WireType.Varint).int64(message.remoteBalance); /* int64 commit_fee = 8; */ - if (message.commitFee !== "0") + if (message.commitFee !== 0n) writer.tag(8, WireType.Varint).int64(message.commitFee); /* int64 commit_weight = 9; */ - if (message.commitWeight !== "0") + if (message.commitWeight !== 0n) writer.tag(9, WireType.Varint).int64(message.commitWeight); /* int64 fee_per_kw = 10; */ - if (message.feePerKw !== "0") + if (message.feePerKw !== 0n) writer.tag(10, WireType.Varint).int64(message.feePerKw); /* int64 unsettled_balance = 11; */ - if (message.unsettledBalance !== "0") + if (message.unsettledBalance !== 0n) writer.tag(11, WireType.Varint).int64(message.unsettledBalance); /* int64 total_satoshis_sent = 12; */ - if (message.totalSatoshisSent !== "0") + if (message.totalSatoshisSent !== 0n) writer.tag(12, WireType.Varint).int64(message.totalSatoshisSent); /* int64 total_satoshis_received = 13; */ - if (message.totalSatoshisReceived !== "0") + if (message.totalSatoshisReceived !== 0n) writer.tag(13, WireType.Varint).int64(message.totalSatoshisReceived); /* uint64 num_updates = 14; */ - if (message.numUpdates !== "0") + if (message.numUpdates !== 0n) writer.tag(14, WireType.Varint).uint64(message.numUpdates); /* repeated lnrpc.HTLC pending_htlcs = 15; */ for (let i = 0; i < message.pendingHtlcs.length; i++) @@ -8658,10 +10317,10 @@ class Channel$Type extends MessageType { if (message.chanStatusFlags !== "") writer.tag(19, WireType.LengthDelimited).string(message.chanStatusFlags); /* int64 local_chan_reserve_sat = 20 [deprecated = true]; */ - if (message.localChanReserveSat !== "0") + if (message.localChanReserveSat !== 0n) writer.tag(20, WireType.Varint).int64(message.localChanReserveSat); /* int64 remote_chan_reserve_sat = 21 [deprecated = true]; */ - if (message.remoteChanReserveSat !== "0") + if (message.remoteChanReserveSat !== 0n) writer.tag(21, WireType.Varint).int64(message.remoteChanReserveSat); /* bool static_remote_key = 22 [deprecated = true]; */ if (message.staticRemoteKey !== false) @@ -8670,16 +10329,16 @@ class Channel$Type extends MessageType { if (message.commitmentType !== 0) writer.tag(26, WireType.Varint).int32(message.commitmentType); /* int64 lifetime = 23; */ - if (message.lifetime !== "0") + if (message.lifetime !== 0n) writer.tag(23, WireType.Varint).int64(message.lifetime); /* int64 uptime = 24; */ - if (message.uptime !== "0") + if (message.uptime !== 0n) writer.tag(24, WireType.Varint).int64(message.uptime); /* string close_address = 25; */ if (message.closeAddress !== "") writer.tag(25, WireType.LengthDelimited).string(message.closeAddress); /* uint64 push_amount_sat = 27; */ - if (message.pushAmountSat !== "0") + if (message.pushAmountSat !== 0n) writer.tag(27, WireType.Varint).uint64(message.pushAmountSat); /* uint32 thaw_height = 28; */ if (message.thawHeight !== 0) @@ -8690,6 +10349,19 @@ class Channel$Type extends MessageType { /* lnrpc.ChannelConstraints remote_constraints = 30; */ if (message.remoteConstraints) ChannelConstraints.internalBinaryWrite(message.remoteConstraints, writer.tag(30, WireType.LengthDelimited).fork(), options).join(); + /* repeated uint64 alias_scids = 31; */ + if (message.aliasScids.length) { + writer.tag(31, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.aliasScids.length; i++) + writer.uint64(message.aliasScids[i]); + writer.join(); + } + /* bool zero_conf = 32; */ + if (message.zeroConf !== false) + writer.tag(32, WireType.Varint).bool(message.zeroConf); + /* uint64 zero_conf_confirmed_scid = 33; */ + if (message.zeroConfConfirmedScid !== 0n) + writer.tag(33, WireType.Varint).uint64(message.zeroConfConfirmedScid); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -8823,6 +10495,141 @@ class ListChannelsResponse$Type extends MessageType { */ export const ListChannelsResponse = new ListChannelsResponse$Type(); // @generated message type with reflection information, may provide speed optimized methods +class AliasMap$Type extends MessageType { + constructor() { + super("lnrpc.AliasMap", [ + { no: 1, name: "base_scid", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "aliases", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): AliasMap { + const message = { baseScid: 0n, aliases: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AliasMap): AliasMap { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 base_scid */ 1: + message.baseScid = reader.uint64().toBigInt(); + break; + case /* repeated uint64 aliases */ 2: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.aliases.push(reader.uint64().toBigInt()); + else + message.aliases.push(reader.uint64().toBigInt()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AliasMap, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 base_scid = 1; */ + if (message.baseScid !== 0n) + writer.tag(1, WireType.Varint).uint64(message.baseScid); + /* repeated uint64 aliases = 2; */ + if (message.aliases.length) { + writer.tag(2, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.aliases.length; i++) + writer.uint64(message.aliases[i]); + writer.join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.AliasMap + */ +export const AliasMap = new AliasMap$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListAliasesRequest$Type extends MessageType { + constructor() { + super("lnrpc.ListAliasesRequest", []); + } + create(value?: PartialMessage): ListAliasesRequest { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListAliasesRequest): ListAliasesRequest { + return target ?? this.create(); + } + internalBinaryWrite(message: ListAliasesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListAliasesRequest + */ +export const ListAliasesRequest = new ListAliasesRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListAliasesResponse$Type extends MessageType { + constructor() { + super("lnrpc.ListAliasesResponse", [ + { no: 1, name: "alias_maps", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => AliasMap } + ]); + } + create(value?: PartialMessage): ListAliasesResponse { + const message = { aliasMaps: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListAliasesResponse): ListAliasesResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.AliasMap alias_maps */ 1: + message.aliasMaps.push(AliasMap.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListAliasesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.AliasMap alias_maps = 1; */ + for (let i = 0; i < message.aliasMaps.length; i++) + AliasMap.internalBinaryWrite(message.aliasMaps[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.ListAliasesResponse + */ +export const ListAliasesResponse = new ListAliasesResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods class ChannelCloseSummary$Type extends MessageType { constructor() { super("lnrpc.ChannelCloseSummary", [ @@ -8831,18 +10638,20 @@ class ChannelCloseSummary$Type extends MessageType { { no: 3, name: "chain_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "closing_tx_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 5, name: "remote_pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 6, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 7, name: "close_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 8, name: "settled_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 9, name: "time_locked_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 8, name: "settled_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "time_locked_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 10, name: "close_type", kind: "enum", T: () => ["lnrpc.ChannelCloseSummary.ClosureType", ChannelCloseSummary_ClosureType] }, { no: 11, name: "open_initiator", kind: "enum", T: () => ["lnrpc.Initiator", Initiator, "INITIATOR_"] }, { no: 12, name: "close_initiator", kind: "enum", T: () => ["lnrpc.Initiator", Initiator, "INITIATOR_"] }, - { no: 13, name: "resolutions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Resolution } + { no: 13, name: "resolutions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Resolution }, + { no: 14, name: "alias_scids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 15, name: "zero_conf_confirmed_scid", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } ]); } create(value?: PartialMessage): ChannelCloseSummary { - const message = { channelPoint: "", chanId: "0", chainHash: "", closingTxHash: "", remotePubkey: "", capacity: "0", closeHeight: 0, settledBalance: "0", timeLockedBalance: "0", closeType: 0, openInitiator: 0, closeInitiator: 0, resolutions: [] }; + const message = { channelPoint: "", chanId: "0", chainHash: "", closingTxHash: "", remotePubkey: "", capacity: 0n, closeHeight: 0, settledBalance: 0n, timeLockedBalance: 0n, closeType: 0, openInitiator: 0, closeInitiator: 0, resolutions: [], aliasScids: [], zeroConfConfirmedScid: "0" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -8869,16 +10678,16 @@ class ChannelCloseSummary$Type extends MessageType { message.remotePubkey = reader.string(); break; case /* int64 capacity */ 6: - message.capacity = reader.int64().toString(); + message.capacity = reader.int64().toBigInt(); break; case /* uint32 close_height */ 7: message.closeHeight = reader.uint32(); break; case /* int64 settled_balance */ 8: - message.settledBalance = reader.int64().toString(); + message.settledBalance = reader.int64().toBigInt(); break; case /* int64 time_locked_balance */ 9: - message.timeLockedBalance = reader.int64().toString(); + message.timeLockedBalance = reader.int64().toBigInt(); break; case /* lnrpc.ChannelCloseSummary.ClosureType close_type */ 10: message.closeType = reader.int32(); @@ -8892,6 +10701,16 @@ class ChannelCloseSummary$Type extends MessageType { case /* repeated lnrpc.Resolution resolutions */ 13: message.resolutions.push(Resolution.internalBinaryRead(reader, reader.uint32(), options)); break; + case /* repeated uint64 alias_scids */ 14: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.aliasScids.push(reader.uint64().toBigInt()); + else + message.aliasScids.push(reader.uint64().toBigInt()); + break; + case /* uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING];*/ 15: + message.zeroConfConfirmedScid = reader.uint64().toString(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -8920,16 +10739,16 @@ class ChannelCloseSummary$Type extends MessageType { if (message.remotePubkey !== "") writer.tag(5, WireType.LengthDelimited).string(message.remotePubkey); /* int64 capacity = 6; */ - if (message.capacity !== "0") + if (message.capacity !== 0n) writer.tag(6, WireType.Varint).int64(message.capacity); /* uint32 close_height = 7; */ if (message.closeHeight !== 0) writer.tag(7, WireType.Varint).uint32(message.closeHeight); /* int64 settled_balance = 8; */ - if (message.settledBalance !== "0") + if (message.settledBalance !== 0n) writer.tag(8, WireType.Varint).int64(message.settledBalance); /* int64 time_locked_balance = 9; */ - if (message.timeLockedBalance !== "0") + if (message.timeLockedBalance !== 0n) writer.tag(9, WireType.Varint).int64(message.timeLockedBalance); /* lnrpc.ChannelCloseSummary.ClosureType close_type = 10; */ if (message.closeType !== 0) @@ -8943,6 +10762,16 @@ class ChannelCloseSummary$Type extends MessageType { /* repeated lnrpc.Resolution resolutions = 13; */ for (let i = 0; i < message.resolutions.length; i++) Resolution.internalBinaryWrite(message.resolutions[i], writer.tag(13, WireType.LengthDelimited).fork(), options).join(); + /* repeated uint64 alias_scids = 14; */ + if (message.aliasScids.length) { + writer.tag(14, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.aliasScids.length; i++) + writer.uint64(message.aliasScids[i]); + writer.join(); + } + /* uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING]; */ + if (message.zeroConfConfirmedScid !== "0") + writer.tag(15, WireType.Varint).uint64(message.zeroConfConfirmedScid); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -8960,12 +10789,12 @@ class Resolution$Type extends MessageType { { no: 1, name: "resolution_type", kind: "enum", T: () => ["lnrpc.ResolutionType", ResolutionType] }, { no: 2, name: "outcome", kind: "enum", T: () => ["lnrpc.ResolutionOutcome", ResolutionOutcome] }, { no: 3, name: "outpoint", kind: "message", T: () => OutPoint }, - { no: 4, name: "amount_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "amount_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 5, name: "sweep_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): Resolution { - const message = { resolutionType: 0, outcome: 0, amountSat: "0", sweepTxid: "" }; + const message = { resolutionType: 0, outcome: 0, amountSat: 0n, sweepTxid: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -8986,7 +10815,7 @@ class Resolution$Type extends MessageType { message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); break; case /* uint64 amount_sat */ 4: - message.amountSat = reader.uint64().toString(); + message.amountSat = reader.uint64().toBigInt(); break; case /* string sweep_txid */ 5: message.sweepTxid = reader.string(); @@ -9013,7 +10842,7 @@ class Resolution$Type extends MessageType { if (message.outpoint) OutPoint.internalBinaryWrite(message.outpoint, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); /* uint64 amount_sat = 4; */ - if (message.amountSat !== "0") + if (message.amountSat !== 0n) writer.tag(4, WireType.Varint).uint64(message.amountSat); /* string sweep_txid = 5; */ if (message.sweepTxid !== "") @@ -9163,21 +10992,22 @@ class Peer$Type extends MessageType { super("lnrpc.Peer", [ { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "bytes_sent", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 5, name: "bytes_recv", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 6, name: "sat_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 7, name: "sat_recv", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 4, name: "bytes_sent", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "bytes_recv", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "sat_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "sat_recv", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 8, name: "inbound", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 9, name: "ping_time", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 9, name: "ping_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 10, name: "sync_type", kind: "enum", T: () => ["lnrpc.Peer.SyncType", Peer_SyncType] }, { no: 11, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, { no: 12, name: "errors", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => TimestampedError }, { no: 13, name: "flap_count", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 14, name: "last_flap_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + { no: 14, name: "last_flap_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 15, name: "last_ping_payload", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } ]); } create(value?: PartialMessage): Peer { - const message = { pubKey: "", address: "", bytesSent: "0", bytesRecv: "0", satSent: "0", satRecv: "0", inbound: false, pingTime: "0", syncType: 0, features: {}, errors: [], flapCount: 0, lastFlapNs: "0" }; + const message = { pubKey: "", address: "", bytesSent: 0n, bytesRecv: 0n, satSent: 0n, satRecv: 0n, inbound: false, pingTime: 0n, syncType: 0, features: {}, errors: [], flapCount: 0, lastFlapNs: 0n, lastPingPayload: new Uint8Array(0) }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -9195,22 +11025,22 @@ class Peer$Type extends MessageType { message.address = reader.string(); break; case /* uint64 bytes_sent */ 4: - message.bytesSent = reader.uint64().toString(); + message.bytesSent = reader.uint64().toBigInt(); break; case /* uint64 bytes_recv */ 5: - message.bytesRecv = reader.uint64().toString(); + message.bytesRecv = reader.uint64().toBigInt(); break; case /* int64 sat_sent */ 6: - message.satSent = reader.int64().toString(); + message.satSent = reader.int64().toBigInt(); break; case /* int64 sat_recv */ 7: - message.satRecv = reader.int64().toString(); + message.satRecv = reader.int64().toBigInt(); break; case /* bool inbound */ 8: message.inbound = reader.bool(); break; case /* int64 ping_time */ 9: - message.pingTime = reader.int64().toString(); + message.pingTime = reader.int64().toBigInt(); break; case /* lnrpc.Peer.SyncType sync_type */ 10: message.syncType = reader.int32(); @@ -9225,7 +11055,10 @@ class Peer$Type extends MessageType { message.flapCount = reader.int32(); break; case /* int64 last_flap_ns */ 14: - message.lastFlapNs = reader.int64().toString(); + message.lastFlapNs = reader.int64().toBigInt(); + break; + case /* bytes last_ping_payload */ 15: + message.lastPingPayload = reader.bytes(); break; default: let u = options.readUnknownField; @@ -9262,22 +11095,22 @@ class Peer$Type extends MessageType { if (message.address !== "") writer.tag(3, WireType.LengthDelimited).string(message.address); /* uint64 bytes_sent = 4; */ - if (message.bytesSent !== "0") + if (message.bytesSent !== 0n) writer.tag(4, WireType.Varint).uint64(message.bytesSent); /* uint64 bytes_recv = 5; */ - if (message.bytesRecv !== "0") + if (message.bytesRecv !== 0n) writer.tag(5, WireType.Varint).uint64(message.bytesRecv); /* int64 sat_sent = 6; */ - if (message.satSent !== "0") + if (message.satSent !== 0n) writer.tag(6, WireType.Varint).int64(message.satSent); /* int64 sat_recv = 7; */ - if (message.satRecv !== "0") + if (message.satRecv !== 0n) writer.tag(7, WireType.Varint).int64(message.satRecv); /* bool inbound = 8; */ if (message.inbound !== false) writer.tag(8, WireType.Varint).bool(message.inbound); /* int64 ping_time = 9; */ - if (message.pingTime !== "0") + if (message.pingTime !== 0n) writer.tag(9, WireType.Varint).int64(message.pingTime); /* lnrpc.Peer.SyncType sync_type = 10; */ if (message.syncType !== 0) @@ -9296,8 +11129,11 @@ class Peer$Type extends MessageType { if (message.flapCount !== 0) writer.tag(13, WireType.Varint).int32(message.flapCount); /* int64 last_flap_ns = 14; */ - if (message.lastFlapNs !== "0") + if (message.lastFlapNs !== 0n) writer.tag(14, WireType.Varint).int64(message.lastFlapNs); + /* bytes last_ping_payload = 15; */ + if (message.lastPingPayload.length) + writer.tag(15, WireType.LengthDelimited).bytes(message.lastPingPayload); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -9312,12 +11148,12 @@ export const Peer = new Peer$Type(); class TimestampedError$Type extends MessageType { constructor() { super("lnrpc.TimestampedError", [ - { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 2, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): TimestampedError { - const message = { timestamp: "0", error: "" }; + const message = { timestamp: 0n, error: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -9329,7 +11165,7 @@ class TimestampedError$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 timestamp */ 1: - message.timestamp = reader.uint64().toString(); + message.timestamp = reader.uint64().toBigInt(); break; case /* string error */ 2: message.error = reader.string(); @@ -9347,7 +11183,7 @@ class TimestampedError$Type extends MessageType { } internalBinaryWrite(message: TimestampedError, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 timestamp = 1; */ - if (message.timestamp !== "0") + if (message.timestamp !== 0n) writer.tag(1, WireType.Varint).uint64(message.timestamp); /* string error = 2; */ if (message.error !== "") @@ -9577,17 +11413,18 @@ class GetInfoResponse$Type extends MessageType { { no: 5, name: "num_peers", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 6, name: "block_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 8, name: "block_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "best_header_timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 13, name: "best_header_timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 9, name: "synced_to_chain", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 18, name: "synced_to_graph", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 10, name: "testnet", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 16, name: "chains", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Chain }, { no: 12, name: "uris", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 19, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } } + { no: 19, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, + { no: 21, name: "require_htlc_interceptor", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): GetInfoResponse { - const message = { version: "", commitHash: "", identityPubkey: "", alias: "", color: "", numPendingChannels: 0, numActiveChannels: 0, numInactiveChannels: 0, numPeers: 0, blockHeight: 0, blockHash: "", bestHeaderTimestamp: "0", syncedToChain: false, syncedToGraph: false, testnet: false, chains: [], uris: [], features: {} }; + const message = { version: "", commitHash: "", identityPubkey: "", alias: "", color: "", numPendingChannels: 0, numActiveChannels: 0, numInactiveChannels: 0, numPeers: 0, blockHeight: 0, blockHash: "", bestHeaderTimestamp: 0n, syncedToChain: false, syncedToGraph: false, testnet: false, chains: [], uris: [], features: {}, requireHtlcInterceptor: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -9632,7 +11469,7 @@ class GetInfoResponse$Type extends MessageType { message.blockHash = reader.string(); break; case /* int64 best_header_timestamp */ 13: - message.bestHeaderTimestamp = reader.int64().toString(); + message.bestHeaderTimestamp = reader.int64().toBigInt(); break; case /* bool synced_to_chain */ 9: message.syncedToChain = reader.bool(); @@ -9652,6 +11489,9 @@ class GetInfoResponse$Type extends MessageType { case /* map features */ 19: this.binaryReadMap19(message.features, reader, options); break; + case /* bool require_htlc_interceptor */ 21: + message.requireHtlcInterceptor = reader.bool(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -9714,7 +11554,7 @@ class GetInfoResponse$Type extends MessageType { if (message.blockHash !== "") writer.tag(8, WireType.LengthDelimited).string(message.blockHash); /* int64 best_header_timestamp = 13; */ - if (message.bestHeaderTimestamp !== "0") + if (message.bestHeaderTimestamp !== 0n) writer.tag(13, WireType.Varint).int64(message.bestHeaderTimestamp); /* bool synced_to_chain = 9; */ if (message.syncedToChain !== false) @@ -9738,6 +11578,9 @@ class GetInfoResponse$Type extends MessageType { Feature.internalBinaryWrite(message.features[k as any], writer, options); writer.join().join(); } + /* bool require_htlc_interceptor = 21; */ + if (message.requireHtlcInterceptor !== false) + writer.tag(21, WireType.Varint).bool(message.requireHtlcInterceptor); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -10058,13 +11901,14 @@ class CloseChannelRequest$Type extends MessageType { { no: 1, name: "channel_point", kind: "message", T: () => ChannelPoint }, { no: 2, name: "force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 3, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 4, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 5, name: "delivery_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 6, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "max_fee_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): CloseChannelRequest { - const message = { force: false, targetConf: 0, satPerByte: "0", deliveryAddress: "", satPerVbyte: "0" }; + const message = { force: false, targetConf: 0, satPerByte: 0n, deliveryAddress: "", satPerVbyte: 0n, maxFeePerVbyte: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -10085,13 +11929,16 @@ class CloseChannelRequest$Type extends MessageType { message.targetConf = reader.int32(); break; case /* int64 sat_per_byte = 4 [deprecated = true];*/ 4: - message.satPerByte = reader.int64().toString(); + message.satPerByte = reader.int64().toBigInt(); break; case /* string delivery_address */ 5: message.deliveryAddress = reader.string(); break; case /* uint64 sat_per_vbyte */ 6: - message.satPerVbyte = reader.uint64().toString(); + message.satPerVbyte = reader.uint64().toBigInt(); + break; + case /* uint64 max_fee_per_vbyte */ 7: + message.maxFeePerVbyte = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -10115,14 +11962,17 @@ class CloseChannelRequest$Type extends MessageType { if (message.targetConf !== 0) writer.tag(3, WireType.Varint).int32(message.targetConf); /* int64 sat_per_byte = 4 [deprecated = true]; */ - if (message.satPerByte !== "0") + if (message.satPerByte !== 0n) writer.tag(4, WireType.Varint).int64(message.satPerByte); /* string delivery_address = 5; */ if (message.deliveryAddress !== "") writer.tag(5, WireType.LengthDelimited).string(message.deliveryAddress); /* uint64 sat_per_vbyte = 6; */ - if (message.satPerVbyte !== "0") + if (message.satPerVbyte !== 0n) writer.tag(6, WireType.Varint).uint64(message.satPerVbyte); + /* uint64 max_fee_per_vbyte = 7; */ + if (message.maxFeePerVbyte !== 0n) + writer.tag(7, WireType.Varint).uint64(message.maxFeePerVbyte); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -10252,12 +12102,12 @@ class ReadyForPsbtFunding$Type extends MessageType { constructor() { super("lnrpc.ReadyForPsbtFunding", [ { no: 1, name: "funding_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "funding_amount", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "funding_amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 3, name: "psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } ]); } create(value?: PartialMessage): ReadyForPsbtFunding { - const message = { fundingAddress: "", fundingAmount: "0", psbt: new Uint8Array(0) }; + const message = { fundingAddress: "", fundingAmount: 0n, psbt: new Uint8Array(0) }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -10272,7 +12122,7 @@ class ReadyForPsbtFunding$Type extends MessageType { message.fundingAddress = reader.string(); break; case /* int64 funding_amount */ 2: - message.fundingAmount = reader.int64().toString(); + message.fundingAmount = reader.int64().toBigInt(); break; case /* bytes psbt */ 3: message.psbt = reader.bytes(); @@ -10293,7 +12143,7 @@ class ReadyForPsbtFunding$Type extends MessageType { if (message.fundingAddress !== "") writer.tag(1, WireType.LengthDelimited).string(message.fundingAddress); /* int64 funding_amount = 2; */ - if (message.fundingAmount !== "0") + if (message.fundingAmount !== 0n) writer.tag(2, WireType.Varint).int64(message.fundingAmount); /* bytes psbt = 3; */ if (message.psbt.length) @@ -10309,30 +12159,270 @@ class ReadyForPsbtFunding$Type extends MessageType { */ export const ReadyForPsbtFunding = new ReadyForPsbtFunding$Type(); // @generated message type with reflection information, may provide speed optimized methods +class BatchOpenChannelRequest$Type extends MessageType { + constructor() { + super("lnrpc.BatchOpenChannelRequest", [ + { no: 1, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => BatchOpenChannel }, + { no: 2, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "sat_per_vbyte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 5, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: "label", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): BatchOpenChannelRequest { + const message = { channels: [], targetConf: 0, satPerVbyte: 0n, minConfs: 0, spendUnconfirmed: false, label: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannelRequest): BatchOpenChannelRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.BatchOpenChannel channels */ 1: + message.channels.push(BatchOpenChannel.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* int32 target_conf */ 2: + message.targetConf = reader.int32(); + break; + case /* int64 sat_per_vbyte */ 3: + message.satPerVbyte = reader.int64().toBigInt(); + break; + case /* int32 min_confs */ 4: + message.minConfs = reader.int32(); + break; + case /* bool spend_unconfirmed */ 5: + message.spendUnconfirmed = reader.bool(); + break; + case /* string label */ 6: + message.label = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BatchOpenChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.BatchOpenChannel channels = 1; */ + for (let i = 0; i < message.channels.length; i++) + BatchOpenChannel.internalBinaryWrite(message.channels[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* int32 target_conf = 2; */ + if (message.targetConf !== 0) + writer.tag(2, WireType.Varint).int32(message.targetConf); + /* int64 sat_per_vbyte = 3; */ + if (message.satPerVbyte !== 0n) + writer.tag(3, WireType.Varint).int64(message.satPerVbyte); + /* int32 min_confs = 4; */ + if (message.minConfs !== 0) + writer.tag(4, WireType.Varint).int32(message.minConfs); + /* bool spend_unconfirmed = 5; */ + if (message.spendUnconfirmed !== false) + writer.tag(5, WireType.Varint).bool(message.spendUnconfirmed); + /* string label = 6; */ + if (message.label !== "") + writer.tag(6, WireType.LengthDelimited).string(message.label); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.BatchOpenChannelRequest + */ +export const BatchOpenChannelRequest = new BatchOpenChannelRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BatchOpenChannel$Type extends MessageType { + constructor() { + super("lnrpc.BatchOpenChannel", [ + { no: 1, name: "node_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "local_funding_amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "push_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "min_htlc_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "remote_csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 7, name: "close_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 9, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] } + ]); + } + create(value?: PartialMessage): BatchOpenChannel { + const message = { nodePubkey: new Uint8Array(0), localFundingAmount: 0n, pushSat: 0n, private: false, minHtlcMsat: 0n, remoteCsvDelay: 0, closeAddress: "", pendingChanId: new Uint8Array(0), commitmentType: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannel): BatchOpenChannel { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes node_pubkey */ 1: + message.nodePubkey = reader.bytes(); + break; + case /* int64 local_funding_amount */ 2: + message.localFundingAmount = reader.int64().toBigInt(); + break; + case /* int64 push_sat */ 3: + message.pushSat = reader.int64().toBigInt(); + break; + case /* bool private */ 4: + message.private = reader.bool(); + break; + case /* int64 min_htlc_msat */ 5: + message.minHtlcMsat = reader.int64().toBigInt(); + break; + case /* uint32 remote_csv_delay */ 6: + message.remoteCsvDelay = reader.uint32(); + break; + case /* string close_address */ 7: + message.closeAddress = reader.string(); + break; + case /* bytes pending_chan_id */ 8: + message.pendingChanId = reader.bytes(); + break; + case /* lnrpc.CommitmentType commitment_type */ 9: + message.commitmentType = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BatchOpenChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes node_pubkey = 1; */ + if (message.nodePubkey.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.nodePubkey); + /* int64 local_funding_amount = 2; */ + if (message.localFundingAmount !== 0n) + writer.tag(2, WireType.Varint).int64(message.localFundingAmount); + /* int64 push_sat = 3; */ + if (message.pushSat !== 0n) + writer.tag(3, WireType.Varint).int64(message.pushSat); + /* bool private = 4; */ + if (message.private !== false) + writer.tag(4, WireType.Varint).bool(message.private); + /* int64 min_htlc_msat = 5; */ + if (message.minHtlcMsat !== 0n) + writer.tag(5, WireType.Varint).int64(message.minHtlcMsat); + /* uint32 remote_csv_delay = 6; */ + if (message.remoteCsvDelay !== 0) + writer.tag(6, WireType.Varint).uint32(message.remoteCsvDelay); + /* string close_address = 7; */ + if (message.closeAddress !== "") + writer.tag(7, WireType.LengthDelimited).string(message.closeAddress); + /* bytes pending_chan_id = 8; */ + if (message.pendingChanId.length) + writer.tag(8, WireType.LengthDelimited).bytes(message.pendingChanId); + /* lnrpc.CommitmentType commitment_type = 9; */ + if (message.commitmentType !== 0) + writer.tag(9, WireType.Varint).int32(message.commitmentType); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.BatchOpenChannel + */ +export const BatchOpenChannel = new BatchOpenChannel$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BatchOpenChannelResponse$Type extends MessageType { + constructor() { + super("lnrpc.BatchOpenChannelResponse", [ + { no: 1, name: "pending_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingUpdate } + ]); + } + create(value?: PartialMessage): BatchOpenChannelResponse { + const message = { pendingChannels: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannelResponse): BatchOpenChannelResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.PendingUpdate pending_channels */ 1: + message.pendingChannels.push(PendingUpdate.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BatchOpenChannelResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.PendingUpdate pending_channels = 1; */ + for (let i = 0; i < message.pendingChannels.length; i++) + PendingUpdate.internalBinaryWrite(message.pendingChannels[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.BatchOpenChannelResponse + */ +export const BatchOpenChannelResponse = new BatchOpenChannelResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods class OpenChannelRequest$Type extends MessageType { constructor() { super("lnrpc.OpenChannelRequest", [ - { no: 1, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 1, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 2, name: "node_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 3, name: "node_pubkey_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "local_funding_amount", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 5, name: "push_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 4, name: "local_funding_amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "push_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 6, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 7, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 7, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 8, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 9, name: "min_htlc_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 9, name: "min_htlc_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 10, name: "remote_csv_delay", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 11, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, { no: 12, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 13, name: "close_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 14, name: "funding_shim", kind: "message", T: () => FundingShim }, - { no: 15, name: "remote_max_value_in_flight_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 15, name: "remote_max_value_in_flight_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 16, name: "remote_max_htlcs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 17, name: "max_local_csv", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + { no: 17, name: "max_local_csv", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 18, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, + { no: 19, name: "zero_conf", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 20, name: "scid_alias", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 21, name: "base_fee", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 22, name: "fee_rate", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 23, name: "use_base_fee", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 24, name: "use_fee_rate", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 25, name: "remote_chan_reserve_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): OpenChannelRequest { - const message = { satPerVbyte: "0", nodePubkey: new Uint8Array(0), nodePubkeyString: "", localFundingAmount: "0", pushSat: "0", targetConf: 0, satPerByte: "0", private: false, minHtlcMsat: "0", remoteCsvDelay: 0, minConfs: 0, spendUnconfirmed: false, closeAddress: "", remoteMaxValueInFlightMsat: "0", remoteMaxHtlcs: 0, maxLocalCsv: 0 }; + const message = { satPerVbyte: 0n, nodePubkey: new Uint8Array(0), nodePubkeyString: "", localFundingAmount: 0n, pushSat: 0n, targetConf: 0, satPerByte: 0n, private: false, minHtlcMsat: 0n, remoteCsvDelay: 0, minConfs: 0, spendUnconfirmed: false, closeAddress: "", remoteMaxValueInFlightMsat: 0n, remoteMaxHtlcs: 0, maxLocalCsv: 0, commitmentType: 0, zeroConf: false, scidAlias: false, baseFee: 0n, feeRate: 0n, useBaseFee: false, useFeeRate: false, remoteChanReserveSat: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -10344,7 +12434,7 @@ class OpenChannelRequest$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 sat_per_vbyte */ 1: - message.satPerVbyte = reader.uint64().toString(); + message.satPerVbyte = reader.uint64().toBigInt(); break; case /* bytes node_pubkey */ 2: message.nodePubkey = reader.bytes(); @@ -10353,22 +12443,22 @@ class OpenChannelRequest$Type extends MessageType { message.nodePubkeyString = reader.string(); break; case /* int64 local_funding_amount */ 4: - message.localFundingAmount = reader.int64().toString(); + message.localFundingAmount = reader.int64().toBigInt(); break; case /* int64 push_sat */ 5: - message.pushSat = reader.int64().toString(); + message.pushSat = reader.int64().toBigInt(); break; case /* int32 target_conf */ 6: message.targetConf = reader.int32(); break; case /* int64 sat_per_byte = 7 [deprecated = true];*/ 7: - message.satPerByte = reader.int64().toString(); + message.satPerByte = reader.int64().toBigInt(); break; case /* bool private */ 8: message.private = reader.bool(); break; case /* int64 min_htlc_msat */ 9: - message.minHtlcMsat = reader.int64().toString(); + message.minHtlcMsat = reader.int64().toBigInt(); break; case /* uint32 remote_csv_delay */ 10: message.remoteCsvDelay = reader.uint32(); @@ -10386,7 +12476,7 @@ class OpenChannelRequest$Type extends MessageType { message.fundingShim = FundingShim.internalBinaryRead(reader, reader.uint32(), options, message.fundingShim); break; case /* uint64 remote_max_value_in_flight_msat */ 15: - message.remoteMaxValueInFlightMsat = reader.uint64().toString(); + message.remoteMaxValueInFlightMsat = reader.uint64().toBigInt(); break; case /* uint32 remote_max_htlcs */ 16: message.remoteMaxHtlcs = reader.uint32(); @@ -10394,6 +12484,30 @@ class OpenChannelRequest$Type extends MessageType { case /* uint32 max_local_csv */ 17: message.maxLocalCsv = reader.uint32(); break; + case /* lnrpc.CommitmentType commitment_type */ 18: + message.commitmentType = reader.int32(); + break; + case /* bool zero_conf */ 19: + message.zeroConf = reader.bool(); + break; + case /* bool scid_alias */ 20: + message.scidAlias = reader.bool(); + break; + case /* uint64 base_fee */ 21: + message.baseFee = reader.uint64().toBigInt(); + break; + case /* uint64 fee_rate */ 22: + message.feeRate = reader.uint64().toBigInt(); + break; + case /* bool use_base_fee */ 23: + message.useBaseFee = reader.bool(); + break; + case /* bool use_fee_rate */ 24: + message.useFeeRate = reader.bool(); + break; + case /* uint64 remote_chan_reserve_sat */ 25: + message.remoteChanReserveSat = reader.uint64().toBigInt(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -10407,7 +12521,7 @@ class OpenChannelRequest$Type extends MessageType { } internalBinaryWrite(message: OpenChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 sat_per_vbyte = 1; */ - if (message.satPerVbyte !== "0") + if (message.satPerVbyte !== 0n) writer.tag(1, WireType.Varint).uint64(message.satPerVbyte); /* bytes node_pubkey = 2; */ if (message.nodePubkey.length) @@ -10416,22 +12530,22 @@ class OpenChannelRequest$Type extends MessageType { if (message.nodePubkeyString !== "") writer.tag(3, WireType.LengthDelimited).string(message.nodePubkeyString); /* int64 local_funding_amount = 4; */ - if (message.localFundingAmount !== "0") + if (message.localFundingAmount !== 0n) writer.tag(4, WireType.Varint).int64(message.localFundingAmount); /* int64 push_sat = 5; */ - if (message.pushSat !== "0") + if (message.pushSat !== 0n) writer.tag(5, WireType.Varint).int64(message.pushSat); /* int32 target_conf = 6; */ if (message.targetConf !== 0) writer.tag(6, WireType.Varint).int32(message.targetConf); /* int64 sat_per_byte = 7 [deprecated = true]; */ - if (message.satPerByte !== "0") + if (message.satPerByte !== 0n) writer.tag(7, WireType.Varint).int64(message.satPerByte); /* bool private = 8; */ if (message.private !== false) writer.tag(8, WireType.Varint).bool(message.private); /* int64 min_htlc_msat = 9; */ - if (message.minHtlcMsat !== "0") + if (message.minHtlcMsat !== 0n) writer.tag(9, WireType.Varint).int64(message.minHtlcMsat); /* uint32 remote_csv_delay = 10; */ if (message.remoteCsvDelay !== 0) @@ -10449,7 +12563,7 @@ class OpenChannelRequest$Type extends MessageType { if (message.fundingShim) FundingShim.internalBinaryWrite(message.fundingShim, writer.tag(14, WireType.LengthDelimited).fork(), options).join(); /* uint64 remote_max_value_in_flight_msat = 15; */ - if (message.remoteMaxValueInFlightMsat !== "0") + if (message.remoteMaxValueInFlightMsat !== 0n) writer.tag(15, WireType.Varint).uint64(message.remoteMaxValueInFlightMsat); /* uint32 remote_max_htlcs = 16; */ if (message.remoteMaxHtlcs !== 0) @@ -10457,6 +12571,30 @@ class OpenChannelRequest$Type extends MessageType { /* uint32 max_local_csv = 17; */ if (message.maxLocalCsv !== 0) writer.tag(17, WireType.Varint).uint32(message.maxLocalCsv); + /* lnrpc.CommitmentType commitment_type = 18; */ + if (message.commitmentType !== 0) + writer.tag(18, WireType.Varint).int32(message.commitmentType); + /* bool zero_conf = 19; */ + if (message.zeroConf !== false) + writer.tag(19, WireType.Varint).bool(message.zeroConf); + /* bool scid_alias = 20; */ + if (message.scidAlias !== false) + writer.tag(20, WireType.Varint).bool(message.scidAlias); + /* uint64 base_fee = 21; */ + if (message.baseFee !== 0n) + writer.tag(21, WireType.Varint).uint64(message.baseFee); + /* uint64 fee_rate = 22; */ + if (message.feeRate !== 0n) + writer.tag(22, WireType.Varint).uint64(message.feeRate); + /* bool use_base_fee = 23; */ + if (message.useBaseFee !== false) + writer.tag(23, WireType.Varint).bool(message.useBaseFee); + /* bool use_fee_rate = 24; */ + if (message.useFeeRate !== false) + writer.tag(24, WireType.Varint).bool(message.useFeeRate); + /* uint64 remote_chan_reserve_sat = 25; */ + if (message.remoteChanReserveSat !== 0n) + writer.tag(25, WireType.Varint).uint64(message.remoteChanReserveSat); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -10656,7 +12794,7 @@ export const KeyDescriptor = new KeyDescriptor$Type(); class ChanPointShim$Type extends MessageType { constructor() { super("lnrpc.ChanPointShim", [ - { no: 1, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 1, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 2, name: "chan_point", kind: "message", T: () => ChannelPoint }, { no: 3, name: "local_key", kind: "message", T: () => KeyDescriptor }, { no: 4, name: "remote_key", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, @@ -10665,7 +12803,7 @@ class ChanPointShim$Type extends MessageType { ]); } create(value?: PartialMessage): ChanPointShim { - const message = { amt: "0", remoteKey: new Uint8Array(0), pendingChanId: new Uint8Array(0), thawHeight: 0 }; + const message = { amt: 0n, remoteKey: new Uint8Array(0), pendingChanId: new Uint8Array(0), thawHeight: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -10677,7 +12815,7 @@ class ChanPointShim$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 amt */ 1: - message.amt = reader.int64().toString(); + message.amt = reader.int64().toBigInt(); break; case /* lnrpc.ChannelPoint chan_point */ 2: message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); @@ -10707,7 +12845,7 @@ class ChanPointShim$Type extends MessageType { } internalBinaryWrite(message: ChanPointShim, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 amt = 1; */ - if (message.amt !== "0") + if (message.amt !== 0n) writer.tag(1, WireType.Varint).int64(message.amt); /* lnrpc.ChannelPoint chan_point = 2; */ if (message.chanPoint) @@ -10907,11 +13045,12 @@ class FundingPsbtVerify$Type extends MessageType { constructor() { super("lnrpc.FundingPsbtVerify", [ { no: 1, name: "funded_psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + { no: 2, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "skip_finalize", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): FundingPsbtVerify { - const message = { fundedPsbt: new Uint8Array(0), pendingChanId: new Uint8Array(0) }; + const message = { fundedPsbt: new Uint8Array(0), pendingChanId: new Uint8Array(0), skipFinalize: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -10928,6 +13067,9 @@ class FundingPsbtVerify$Type extends MessageType { case /* bytes pending_chan_id */ 2: message.pendingChanId = reader.bytes(); break; + case /* bool skip_finalize */ 3: + message.skipFinalize = reader.bool(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -10946,6 +13088,9 @@ class FundingPsbtVerify$Type extends MessageType { /* bytes pending_chan_id = 2; */ if (message.pendingChanId.length) writer.tag(2, WireType.LengthDelimited).bytes(message.pendingChanId); + /* bool skip_finalize = 3; */ + if (message.skipFinalize !== false) + writer.tag(3, WireType.Varint).bool(message.skipFinalize); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -11128,7 +13273,7 @@ class PendingHTLC$Type extends MessageType { constructor() { super("lnrpc.PendingHTLC", [ { no: 1, name: "incoming", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 3, name: "outpoint", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "maturity_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 5, name: "blocks_til_maturity", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, @@ -11136,7 +13281,7 @@ class PendingHTLC$Type extends MessageType { ]); } create(value?: PartialMessage): PendingHTLC { - const message = { incoming: false, amount: "0", outpoint: "", maturityHeight: 0, blocksTilMaturity: 0, stage: 0 }; + const message = { incoming: false, amount: 0n, outpoint: "", maturityHeight: 0, blocksTilMaturity: 0, stage: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -11151,7 +13296,7 @@ class PendingHTLC$Type extends MessageType { message.incoming = reader.bool(); break; case /* int64 amount */ 2: - message.amount = reader.int64().toString(); + message.amount = reader.int64().toBigInt(); break; case /* string outpoint */ 3: message.outpoint = reader.string(); @@ -11181,7 +13326,7 @@ class PendingHTLC$Type extends MessageType { if (message.incoming !== false) writer.tag(1, WireType.Varint).bool(message.incoming); /* int64 amount = 2; */ - if (message.amount !== "0") + if (message.amount !== 0n) writer.tag(2, WireType.Varint).int64(message.amount); /* string outpoint = 3; */ if (message.outpoint !== "") @@ -11235,7 +13380,7 @@ export const PendingChannelsRequest = new PendingChannelsRequest$Type(); class PendingChannelsResponse$Type extends MessageType { constructor() { super("lnrpc.PendingChannelsResponse", [ - { no: 1, name: "total_limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 1, name: "total_limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 2, name: "pending_open_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_PendingOpenChannel }, { no: 3, name: "pending_closing_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_ClosedChannel }, { no: 4, name: "pending_force_closing_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_ForceClosedChannel }, @@ -11243,7 +13388,7 @@ class PendingChannelsResponse$Type extends MessageType ]); } create(value?: PartialMessage): PendingChannelsResponse { - const message = { totalLimboBalance: "0", pendingOpenChannels: [], pendingClosingChannels: [], pendingForceClosingChannels: [], waitingCloseChannels: [] }; + const message = { totalLimboBalance: 0n, pendingOpenChannels: [], pendingClosingChannels: [], pendingForceClosingChannels: [], waitingCloseChannels: [] }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -11255,7 +13400,7 @@ class PendingChannelsResponse$Type extends MessageType let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 total_limbo_balance */ 1: - message.totalLimboBalance = reader.int64().toString(); + message.totalLimboBalance = reader.int64().toBigInt(); break; case /* repeated lnrpc.PendingChannelsResponse.PendingOpenChannel pending_open_channels */ 2: message.pendingOpenChannels.push(PendingChannelsResponse_PendingOpenChannel.internalBinaryRead(reader, reader.uint32(), options)); @@ -11282,7 +13427,7 @@ class PendingChannelsResponse$Type extends MessageType } internalBinaryWrite(message: PendingChannelsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 total_limbo_balance = 1; */ - if (message.totalLimboBalance !== "0") + if (message.totalLimboBalance !== 0n) writer.tag(1, WireType.Varint).int64(message.totalLimboBalance); /* repeated lnrpc.PendingChannelsResponse.PendingOpenChannel pending_open_channels = 2; */ for (let i = 0; i < message.pendingOpenChannels.length; i++) @@ -11312,17 +13457,20 @@ class PendingChannelsResponse_PendingChannel$Type extends MessageType ["lnrpc.Initiator", Initiator, "INITIATOR_"] }, - { no: 9, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] } + { no: 9, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, + { no: 10, name: "num_forwarding_packages", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 11, name: "chan_status_flags", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): PendingChannelsResponse_PendingChannel { - const message = { remoteNodePub: "", channelPoint: "", capacity: "0", localBalance: "0", remoteBalance: "0", localChanReserveSat: "0", remoteChanReserveSat: "0", initiator: 0, commitmentType: 0 }; + const message = { remoteNodePub: "", channelPoint: "", capacity: 0n, localBalance: 0n, remoteBalance: 0n, localChanReserveSat: 0n, remoteChanReserveSat: 0n, initiator: 0, commitmentType: 0, numForwardingPackages: 0n, chanStatusFlags: "", private: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -11340,19 +13488,19 @@ class PendingChannelsResponse_PendingChannel$Type extends MessageType PendingChannelsResponse_PendingChannel }, - { no: 2, name: "confirmation_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 5, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 6, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + { no: 4, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): PendingChannelsResponse_PendingOpenChannel { - const message = { confirmationHeight: 0, commitFee: "0", commitWeight: "0", feePerKw: "0" }; + const message = { commitFee: 0n, commitWeight: 0n, feePerKw: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -11435,17 +13600,14 @@ class PendingChannelsResponse_PendingOpenChannel$Type extends MessageType PendingChannelsResponse_PendingChannel }, - { no: 2, name: "limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 3, name: "commitments", kind: "message", T: () => PendingChannelsResponse_Commitments } + { no: 2, name: "limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "commitments", kind: "message", T: () => PendingChannelsResponse_Commitments }, + { no: 4, name: "closing_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): PendingChannelsResponse_WaitingCloseChannel { - const message = { limboBalance: "0" }; + const message = { limboBalance: 0n, closingTxid: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -11509,11 +13669,14 @@ class PendingChannelsResponse_WaitingCloseChannel$Type extends MessageType): PendingChannelsResponse_Commitments { - const message = { localTxid: "", remoteTxid: "", remotePendingTxid: "", localCommitFeeSat: "0", remoteCommitFeeSat: "0", remotePendingCommitFeeSat: "0" }; + const message = { localTxid: "", remoteTxid: "", remotePendingTxid: "", localCommitFeeSat: 0n, remoteCommitFeeSat: 0n, remotePendingCommitFeeSat: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -11579,13 +13745,13 @@ class PendingChannelsResponse_Commitments$Type extends MessageType PendingChannelsResponse_PendingChannel }, { no: 2, name: "closing_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 3, name: "limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "maturity_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 5, name: "blocks_til_maturity", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 6, name: "recovered_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 6, name: "recovered_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 8, name: "pending_htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingHTLC }, { no: 9, name: "anchor", kind: "enum", T: () => ["lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState", PendingChannelsResponse_ForceClosedChannel_AnchorState] } ]); } create(value?: PartialMessage): PendingChannelsResponse_ForceClosedChannel { - const message = { closingTxid: "", limboBalance: "0", maturityHeight: 0, blocksTilMaturity: 0, recoveredBalance: "0", pendingHtlcs: [], anchor: 0 }; + const message = { closingTxid: "", limboBalance: 0n, maturityHeight: 0, blocksTilMaturity: 0, recoveredBalance: 0n, pendingHtlcs: [], anchor: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -11714,7 +13880,7 @@ class PendingChannelsResponse_ForceClosedChannel$Type extends MessageType { { no: 3, name: "active_channel", kind: "message", oneof: "channel", T: () => ChannelPoint }, { no: 4, name: "inactive_channel", kind: "message", oneof: "channel", T: () => ChannelPoint }, { no: 6, name: "pending_open_channel", kind: "message", oneof: "channel", T: () => PendingUpdate }, + { no: 7, name: "fully_resolved_channel", kind: "message", oneof: "channel", T: () => ChannelPoint }, { no: 5, name: "type", kind: "enum", T: () => ["lnrpc.ChannelEventUpdate.UpdateType", ChannelEventUpdate_UpdateType] } ]); } @@ -11857,6 +14024,12 @@ class ChannelEventUpdate$Type extends MessageType { pendingOpenChannel: PendingUpdate.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).pendingOpenChannel) }; break; + case /* lnrpc.ChannelPoint fully_resolved_channel */ 7: + message.channel = { + oneofKind: "fullyResolvedChannel", + fullyResolvedChannel: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, (message.channel as any).fullyResolvedChannel) + }; + break; case /* lnrpc.ChannelEventUpdate.UpdateType type */ 5: message.type = reader.int32(); break; @@ -11887,6 +14060,9 @@ class ChannelEventUpdate$Type extends MessageType { /* lnrpc.PendingUpdate pending_open_channel = 6; */ if (message.channel.oneofKind === "pendingOpenChannel") PendingUpdate.internalBinaryWrite(message.channel.pendingOpenChannel, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.ChannelPoint fully_resolved_channel = 7; */ + if (message.channel.oneofKind === "fullyResolvedChannel") + ChannelPoint.internalBinaryWrite(message.channel.fullyResolvedChannel, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); /* lnrpc.ChannelEventUpdate.UpdateType type = 5; */ if (message.type !== 0) writer.tag(5, WireType.Varint).int32(message.type); @@ -11904,12 +14080,12 @@ export const ChannelEventUpdate = new ChannelEventUpdate$Type(); class WalletAccountBalance$Type extends MessageType { constructor() { super("lnrpc.WalletAccountBalance", [ - { no: 1, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 2, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + { no: 1, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): WalletAccountBalance { - const message = { confirmedBalance: "0", unconfirmedBalance: "0" }; + const message = { confirmedBalance: 0n, unconfirmedBalance: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -11921,10 +14097,10 @@ class WalletAccountBalance$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 confirmed_balance */ 1: - message.confirmedBalance = reader.int64().toString(); + message.confirmedBalance = reader.int64().toBigInt(); break; case /* int64 unconfirmed_balance */ 2: - message.unconfirmedBalance = reader.int64().toString(); + message.unconfirmedBalance = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -11939,10 +14115,10 @@ class WalletAccountBalance$Type extends MessageType { } internalBinaryWrite(message: WalletAccountBalance, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 confirmed_balance = 1; */ - if (message.confirmedBalance !== "0") + if (message.confirmedBalance !== 0n) writer.tag(1, WireType.Varint).int64(message.confirmedBalance); /* int64 unconfirmed_balance = 2; */ - if (message.unconfirmedBalance !== "0") + if (message.unconfirmedBalance !== 0n) writer.tag(2, WireType.Varint).int64(message.unconfirmedBalance); let u = options.writeUnknownFields; if (u !== false) @@ -11984,14 +14160,16 @@ export const WalletBalanceRequest = new WalletBalanceRequest$Type(); class WalletBalanceResponse$Type extends MessageType { constructor() { super("lnrpc.WalletBalanceResponse", [ - { no: 1, name: "total_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 2, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 3, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 1, name: "total_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "locked_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "reserved_balance_anchor_chan", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "account_balance", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => WalletAccountBalance } } ]); } create(value?: PartialMessage): WalletBalanceResponse { - const message = { totalBalance: "0", confirmedBalance: "0", unconfirmedBalance: "0", accountBalance: {} }; + const message = { totalBalance: 0n, confirmedBalance: 0n, unconfirmedBalance: 0n, lockedBalance: 0n, reservedBalanceAnchorChan: 0n, accountBalance: {} }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -12003,13 +14181,19 @@ class WalletBalanceResponse$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 total_balance */ 1: - message.totalBalance = reader.int64().toString(); + message.totalBalance = reader.int64().toBigInt(); break; case /* int64 confirmed_balance */ 2: - message.confirmedBalance = reader.int64().toString(); + message.confirmedBalance = reader.int64().toBigInt(); break; case /* int64 unconfirmed_balance */ 3: - message.unconfirmedBalance = reader.int64().toString(); + message.unconfirmedBalance = reader.int64().toBigInt(); + break; + case /* int64 locked_balance */ 5: + message.lockedBalance = reader.int64().toBigInt(); + break; + case /* int64 reserved_balance_anchor_chan */ 6: + message.reservedBalanceAnchorChan = reader.int64().toBigInt(); break; case /* map account_balance */ 4: this.binaryReadMap4(message.accountBalance, reader, options); @@ -12043,14 +14227,20 @@ class WalletBalanceResponse$Type extends MessageType { } internalBinaryWrite(message: WalletBalanceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 total_balance = 1; */ - if (message.totalBalance !== "0") + if (message.totalBalance !== 0n) writer.tag(1, WireType.Varint).int64(message.totalBalance); /* int64 confirmed_balance = 2; */ - if (message.confirmedBalance !== "0") + if (message.confirmedBalance !== 0n) writer.tag(2, WireType.Varint).int64(message.confirmedBalance); /* int64 unconfirmed_balance = 3; */ - if (message.unconfirmedBalance !== "0") + if (message.unconfirmedBalance !== 0n) writer.tag(3, WireType.Varint).int64(message.unconfirmedBalance); + /* int64 locked_balance = 5; */ + if (message.lockedBalance !== 0n) + writer.tag(5, WireType.Varint).int64(message.lockedBalance); + /* int64 reserved_balance_anchor_chan = 6; */ + if (message.reservedBalanceAnchorChan !== 0n) + writer.tag(6, WireType.Varint).int64(message.reservedBalanceAnchorChan); /* map account_balance = 4; */ for (let k of Object.keys(message.accountBalance)) { writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); @@ -12072,12 +14262,12 @@ export const WalletBalanceResponse = new WalletBalanceResponse$Type(); class Amount$Type extends MessageType { constructor() { super("lnrpc.Amount", [ - { no: 1, name: "sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 1, name: "sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): Amount { - const message = { sat: "0", msat: "0" }; + const message = { sat: 0n, msat: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -12089,10 +14279,10 @@ class Amount$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 sat */ 1: - message.sat = reader.uint64().toString(); + message.sat = reader.uint64().toBigInt(); break; case /* uint64 msat */ 2: - message.msat = reader.uint64().toString(); + message.msat = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -12107,10 +14297,10 @@ class Amount$Type extends MessageType { } internalBinaryWrite(message: Amount, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 sat = 1; */ - if (message.sat !== "0") + if (message.sat !== 0n) writer.tag(1, WireType.Varint).uint64(message.sat); /* uint64 msat = 2; */ - if (message.msat !== "0") + if (message.msat !== 0n) writer.tag(2, WireType.Varint).uint64(message.msat); let u = options.writeUnknownFields; if (u !== false) @@ -12152,8 +14342,8 @@ export const ChannelBalanceRequest = new ChannelBalanceRequest$Type(); class ChannelBalanceResponse$Type extends MessageType { constructor() { super("lnrpc.ChannelBalanceResponse", [ - { no: 1, name: "balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 2, name: "pending_open_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 1, name: "balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "pending_open_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 3, name: "local_balance", kind: "message", T: () => Amount }, { no: 4, name: "remote_balance", kind: "message", T: () => Amount }, { no: 5, name: "unsettled_local_balance", kind: "message", T: () => Amount }, @@ -12163,7 +14353,7 @@ class ChannelBalanceResponse$Type extends MessageType { ]); } create(value?: PartialMessage): ChannelBalanceResponse { - const message = { balance: "0", pendingOpenBalance: "0" }; + const message = { balance: 0n, pendingOpenBalance: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -12175,10 +14365,10 @@ class ChannelBalanceResponse$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 balance = 1 [deprecated = true];*/ 1: - message.balance = reader.int64().toString(); + message.balance = reader.int64().toBigInt(); break; case /* int64 pending_open_balance = 2 [deprecated = true];*/ 2: - message.pendingOpenBalance = reader.int64().toString(); + message.pendingOpenBalance = reader.int64().toBigInt(); break; case /* lnrpc.Amount local_balance */ 3: message.localBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.localBalance); @@ -12211,10 +14401,10 @@ class ChannelBalanceResponse$Type extends MessageType { } internalBinaryWrite(message: ChannelBalanceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 balance = 1 [deprecated = true]; */ - if (message.balance !== "0") + if (message.balance !== 0n) writer.tag(1, WireType.Varint).int64(message.balance); /* int64 pending_open_balance = 2 [deprecated = true]; */ - if (message.pendingOpenBalance !== "0") + if (message.pendingOpenBalance !== 0n) writer.tag(2, WireType.Varint).int64(message.pendingOpenBalance); /* lnrpc.Amount local_balance = 3; */ if (message.localBalance) @@ -12249,8 +14439,8 @@ class QueryRoutesRequest$Type extends MessageType { constructor() { super("lnrpc.QueryRoutesRequest", [ { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, { no: 5, name: "fee_limit", kind: "message", T: () => FeeLimit }, { no: 6, name: "ignored_nodes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 12 /*ScalarType.BYTES*/ }, @@ -12263,11 +14453,12 @@ class QueryRoutesRequest$Type extends MessageType { { no: 14, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, { no: 15, name: "last_hop_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 16, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, - { no: 17, name: "dest_features", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.FeatureBit", FeatureBit] } + { no: 17, name: "dest_features", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.FeatureBit", FeatureBit] }, + { no: 18, name: "time_pref", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } ]); } create(value?: PartialMessage): QueryRoutesRequest { - const message = { pubKey: "", amt: "0", amtMsat: "0", finalCltvDelta: 0, ignoredNodes: [], ignoredEdges: [], sourcePubKey: "", useMissionControl: false, ignoredPairs: [], cltvLimit: 0, destCustomRecords: {}, outgoingChanId: "0", lastHopPubkey: new Uint8Array(0), routeHints: [], destFeatures: [] }; + const message = { pubKey: "", amt: 0n, amtMsat: 0n, finalCltvDelta: 0, ignoredNodes: [], ignoredEdges: [], sourcePubKey: "", useMissionControl: false, ignoredPairs: [], cltvLimit: 0, destCustomRecords: {}, outgoingChanId: "0", lastHopPubkey: new Uint8Array(0), routeHints: [], destFeatures: [], timePref: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -12282,10 +14473,10 @@ class QueryRoutesRequest$Type extends MessageType { message.pubKey = reader.string(); break; case /* int64 amt */ 2: - message.amt = reader.int64().toString(); + message.amt = reader.int64().toBigInt(); break; case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toString(); + message.amtMsat = reader.int64().toBigInt(); break; case /* int32 final_cltv_delta */ 4: message.finalCltvDelta = reader.int32(); @@ -12330,6 +14521,9 @@ class QueryRoutesRequest$Type extends MessageType { else message.destFeatures.push(reader.int32()); break; + case /* double time_pref */ 18: + message.timePref = reader.double(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -12362,10 +14556,10 @@ class QueryRoutesRequest$Type extends MessageType { if (message.pubKey !== "") writer.tag(1, WireType.LengthDelimited).string(message.pubKey); /* int64 amt = 2; */ - if (message.amt !== "0") + if (message.amt !== 0n) writer.tag(2, WireType.Varint).int64(message.amt); /* int64 amt_msat = 12; */ - if (message.amtMsat !== "0") + if (message.amtMsat !== 0n) writer.tag(12, WireType.Varint).int64(message.amtMsat); /* int32 final_cltv_delta = 4; */ if (message.finalCltvDelta !== 0) @@ -12410,6 +14604,9 @@ class QueryRoutesRequest$Type extends MessageType { writer.int32(message.destFeatures[i]); writer.join(); } + /* double time_pref = 18; */ + if (message.timePref !== 0) + writer.tag(18, WireType.Bit64).double(message.timePref); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -12587,21 +14784,22 @@ class Hop$Type extends MessageType { constructor() { super("lnrpc.Hop", [ { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "chan_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 3, name: "amt_to_forward", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 4, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "chan_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "amt_to_forward", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 5, name: "expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "amt_to_forward_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 7, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 6, name: "amt_to_forward_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 8, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 9, name: "tlv_payload", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 10, name: "mpp_record", kind: "message", T: () => MPPRecord }, { no: 12, name: "amp_record", kind: "message", T: () => AMPRecord }, - { no: 11, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } } + { no: 11, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, + { no: 13, name: "metadata", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } ]); } create(value?: PartialMessage): Hop { - const message = { chanId: "0", chanCapacity: "0", amtToForward: "0", fee: "0", expiry: 0, amtToForwardMsat: "0", feeMsat: "0", pubKey: "", tlvPayload: false, customRecords: {} }; + const message = { chanId: "0", chanCapacity: 0n, amtToForward: 0n, fee: 0n, expiry: 0, amtToForwardMsat: 0n, feeMsat: 0n, pubKey: "", tlvPayload: false, customRecords: {}, metadata: new Uint8Array(0) }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -12616,27 +14814,27 @@ class Hop$Type extends MessageType { message.chanId = reader.uint64().toString(); break; case /* int64 chan_capacity = 2 [deprecated = true];*/ 2: - message.chanCapacity = reader.int64().toString(); + message.chanCapacity = reader.int64().toBigInt(); break; case /* int64 amt_to_forward = 3 [deprecated = true];*/ 3: - message.amtToForward = reader.int64().toString(); + message.amtToForward = reader.int64().toBigInt(); break; case /* int64 fee = 4 [deprecated = true];*/ 4: - message.fee = reader.int64().toString(); + message.fee = reader.int64().toBigInt(); break; case /* uint32 expiry */ 5: message.expiry = reader.uint32(); break; case /* int64 amt_to_forward_msat */ 6: - message.amtToForwardMsat = reader.int64().toString(); + message.amtToForwardMsat = reader.int64().toBigInt(); break; case /* int64 fee_msat */ 7: - message.feeMsat = reader.int64().toString(); + message.feeMsat = reader.int64().toBigInt(); break; case /* string pub_key */ 8: message.pubKey = reader.string(); break; - case /* bool tlv_payload */ 9: + case /* bool tlv_payload = 9 [deprecated = true];*/ 9: message.tlvPayload = reader.bool(); break; case /* lnrpc.MPPRecord mpp_record */ 10: @@ -12648,6 +14846,9 @@ class Hop$Type extends MessageType { case /* map custom_records */ 11: this.binaryReadMap11(message.customRecords, reader, options); break; + case /* bytes metadata */ 13: + message.metadata = reader.bytes(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -12680,27 +14881,27 @@ class Hop$Type extends MessageType { if (message.chanId !== "0") writer.tag(1, WireType.Varint).uint64(message.chanId); /* int64 chan_capacity = 2 [deprecated = true]; */ - if (message.chanCapacity !== "0") + if (message.chanCapacity !== 0n) writer.tag(2, WireType.Varint).int64(message.chanCapacity); /* int64 amt_to_forward = 3 [deprecated = true]; */ - if (message.amtToForward !== "0") + if (message.amtToForward !== 0n) writer.tag(3, WireType.Varint).int64(message.amtToForward); /* int64 fee = 4 [deprecated = true]; */ - if (message.fee !== "0") + if (message.fee !== 0n) writer.tag(4, WireType.Varint).int64(message.fee); /* uint32 expiry = 5; */ if (message.expiry !== 0) writer.tag(5, WireType.Varint).uint32(message.expiry); /* int64 amt_to_forward_msat = 6; */ - if (message.amtToForwardMsat !== "0") + if (message.amtToForwardMsat !== 0n) writer.tag(6, WireType.Varint).int64(message.amtToForwardMsat); /* int64 fee_msat = 7; */ - if (message.feeMsat !== "0") + if (message.feeMsat !== 0n) writer.tag(7, WireType.Varint).int64(message.feeMsat); /* string pub_key = 8; */ if (message.pubKey !== "") writer.tag(8, WireType.LengthDelimited).string(message.pubKey); - /* bool tlv_payload = 9; */ + /* bool tlv_payload = 9 [deprecated = true]; */ if (message.tlvPayload !== false) writer.tag(9, WireType.Varint).bool(message.tlvPayload); /* lnrpc.MPPRecord mpp_record = 10; */ @@ -12712,6 +14913,9 @@ class Hop$Type extends MessageType { /* map custom_records = 11; */ for (let k of Object.keys(message.customRecords)) writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); + /* bytes metadata = 13; */ + if (message.metadata.length) + writer.tag(13, WireType.LengthDelimited).bytes(message.metadata); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -12727,11 +14931,11 @@ class MPPRecord$Type extends MessageType { constructor() { super("lnrpc.MPPRecord", [ { no: 11, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 10, name: "total_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + { no: 10, name: "total_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): MPPRecord { - const message = { paymentAddr: new Uint8Array(0), totalAmtMsat: "0" }; + const message = { paymentAddr: new Uint8Array(0), totalAmtMsat: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -12746,7 +14950,7 @@ class MPPRecord$Type extends MessageType { message.paymentAddr = reader.bytes(); break; case /* int64 total_amt_msat */ 10: - message.totalAmtMsat = reader.int64().toString(); + message.totalAmtMsat = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -12764,7 +14968,7 @@ class MPPRecord$Type extends MessageType { if (message.paymentAddr.length) writer.tag(11, WireType.LengthDelimited).bytes(message.paymentAddr); /* int64 total_amt_msat = 10; */ - if (message.totalAmtMsat !== "0") + if (message.totalAmtMsat !== 0n) writer.tag(10, WireType.Varint).int64(message.totalAmtMsat); let u = options.writeUnknownFields; if (u !== false) @@ -12842,15 +15046,15 @@ class Route$Type extends MessageType { constructor() { super("lnrpc.Route", [ { no: 1, name: "total_time_lock", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "total_fees", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 3, name: "total_amt", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "total_fees", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "total_amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "hops", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Hop }, - { no: 5, name: "total_fees_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 6, name: "total_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + { no: 5, name: "total_fees_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "total_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): Route { - const message = { totalTimeLock: 0, totalFees: "0", totalAmt: "0", hops: [], totalFeesMsat: "0", totalAmtMsat: "0" }; + const message = { totalTimeLock: 0, totalFees: 0n, totalAmt: 0n, hops: [], totalFeesMsat: 0n, totalAmtMsat: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -12865,19 +15069,19 @@ class Route$Type extends MessageType { message.totalTimeLock = reader.uint32(); break; case /* int64 total_fees = 2 [deprecated = true];*/ 2: - message.totalFees = reader.int64().toString(); + message.totalFees = reader.int64().toBigInt(); break; case /* int64 total_amt = 3 [deprecated = true];*/ 3: - message.totalAmt = reader.int64().toString(); + message.totalAmt = reader.int64().toBigInt(); break; case /* repeated lnrpc.Hop hops */ 4: message.hops.push(Hop.internalBinaryRead(reader, reader.uint32(), options)); break; case /* int64 total_fees_msat */ 5: - message.totalFeesMsat = reader.int64().toString(); + message.totalFeesMsat = reader.int64().toBigInt(); break; case /* int64 total_amt_msat */ 6: - message.totalAmtMsat = reader.int64().toString(); + message.totalAmtMsat = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -12895,19 +15099,19 @@ class Route$Type extends MessageType { if (message.totalTimeLock !== 0) writer.tag(1, WireType.Varint).uint32(message.totalTimeLock); /* int64 total_fees = 2 [deprecated = true]; */ - if (message.totalFees !== "0") + if (message.totalFees !== 0n) writer.tag(2, WireType.Varint).int64(message.totalFees); /* int64 total_amt = 3 [deprecated = true]; */ - if (message.totalAmt !== "0") + if (message.totalAmt !== 0n) writer.tag(3, WireType.Varint).int64(message.totalAmt); /* repeated lnrpc.Hop hops = 4; */ for (let i = 0; i < message.hops.length; i++) Hop.internalBinaryWrite(message.hops[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); /* int64 total_fees_msat = 5; */ - if (message.totalFeesMsat !== "0") + if (message.totalFeesMsat !== 0n) writer.tag(5, WireType.Varint).int64(message.totalFeesMsat); /* int64 total_amt_msat = 6; */ - if (message.totalAmtMsat !== "0") + if (message.totalAmtMsat !== 0n) writer.tag(6, WireType.Varint).int64(message.totalAmtMsat); let u = options.writeUnknownFields; if (u !== false) @@ -12979,12 +15183,12 @@ class NodeInfo$Type extends MessageType { super("lnrpc.NodeInfo", [ { no: 1, name: "node", kind: "message", T: () => LightningNode }, { no: 2, name: "num_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "total_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 3, name: "total_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelEdge } ]); } create(value?: PartialMessage): NodeInfo { - const message = { numChannels: 0, totalCapacity: "0", channels: [] }; + const message = { numChannels: 0, totalCapacity: 0n, channels: [] }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -13002,7 +15206,7 @@ class NodeInfo$Type extends MessageType { message.numChannels = reader.uint32(); break; case /* int64 total_capacity */ 3: - message.totalCapacity = reader.int64().toString(); + message.totalCapacity = reader.int64().toBigInt(); break; case /* repeated lnrpc.ChannelEdge channels */ 4: message.channels.push(ChannelEdge.internalBinaryRead(reader, reader.uint32(), options)); @@ -13026,7 +15230,7 @@ class NodeInfo$Type extends MessageType { if (message.numChannels !== 0) writer.tag(2, WireType.Varint).uint32(message.numChannels); /* int64 total_capacity = 3; */ - if (message.totalCapacity !== "0") + if (message.totalCapacity !== 0n) writer.tag(3, WireType.Varint).int64(message.totalCapacity); /* repeated lnrpc.ChannelEdge channels = 4; */ for (let i = 0; i < message.channels.length; i++) @@ -13050,11 +15254,12 @@ class LightningNode$Type extends MessageType { { no: 3, name: "alias", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "addresses", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodeAddress }, { no: 5, name: "color", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } } + { no: 6, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, + { no: 7, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } } ]); } create(value?: PartialMessage): LightningNode { - const message = { lastUpdate: 0, pubKey: "", alias: "", addresses: [], color: "", features: {} }; + const message = { lastUpdate: 0, pubKey: "", alias: "", addresses: [], color: "", features: {}, customRecords: {} }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -13083,6 +15288,9 @@ class LightningNode$Type extends MessageType { case /* map features */ 6: this.binaryReadMap6(message.features, reader, options); break; + case /* map custom_records */ 7: + this.binaryReadMap7(message.customRecords, reader, options); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -13110,6 +15318,22 @@ class LightningNode$Type extends MessageType { } map[key ?? 0] = val ?? Feature.create(); } + private binaryReadMap7(map: LightningNode["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof LightningNode["customRecords"] | undefined, val: LightningNode["customRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.LightningNode.custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } internalBinaryWrite(message: LightningNode, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint32 last_update = 1; */ if (message.lastUpdate !== 0) @@ -13133,6 +15357,9 @@ class LightningNode$Type extends MessageType { Feature.internalBinaryWrite(message.features[k as any], writer, options); writer.join().join(); } + /* map custom_records = 7; */ + for (let k of Object.keys(message.customRecords)) + writer.tag(7, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -13202,16 +15429,17 @@ class RoutingPolicy$Type extends MessageType { constructor() { super("lnrpc.RoutingPolicy", [ { no: 1, name: "time_lock_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "min_htlc", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 3, name: "fee_base_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 4, name: "fee_rate_milli_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "min_htlc", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "fee_base_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "fee_rate_milli_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 5, name: "disabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 6, name: "max_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 7, name: "last_update", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + { no: 6, name: "max_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "last_update", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 8, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } } ]); } create(value?: PartialMessage): RoutingPolicy { - const message = { timeLockDelta: 0, minHtlc: "0", feeBaseMsat: "0", feeRateMilliMsat: "0", disabled: false, maxHtlcMsat: "0", lastUpdate: 0 }; + const message = { timeLockDelta: 0, minHtlc: 0n, feeBaseMsat: 0n, feeRateMilliMsat: 0n, disabled: false, maxHtlcMsat: 0n, lastUpdate: 0, customRecords: {} }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -13226,23 +15454,26 @@ class RoutingPolicy$Type extends MessageType { message.timeLockDelta = reader.uint32(); break; case /* int64 min_htlc */ 2: - message.minHtlc = reader.int64().toString(); + message.minHtlc = reader.int64().toBigInt(); break; case /* int64 fee_base_msat */ 3: - message.feeBaseMsat = reader.int64().toString(); + message.feeBaseMsat = reader.int64().toBigInt(); break; case /* int64 fee_rate_milli_msat */ 4: - message.feeRateMilliMsat = reader.int64().toString(); + message.feeRateMilliMsat = reader.int64().toBigInt(); break; case /* bool disabled */ 5: message.disabled = reader.bool(); break; case /* uint64 max_htlc_msat */ 6: - message.maxHtlcMsat = reader.uint64().toString(); + message.maxHtlcMsat = reader.uint64().toBigInt(); break; case /* uint32 last_update */ 7: message.lastUpdate = reader.uint32(); break; + case /* map custom_records */ 8: + this.binaryReadMap8(message.customRecords, reader, options); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -13254,28 +15485,47 @@ class RoutingPolicy$Type extends MessageType { } return message; } + private binaryReadMap8(map: RoutingPolicy["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof RoutingPolicy["customRecords"] | undefined, val: RoutingPolicy["customRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.RoutingPolicy.custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } internalBinaryWrite(message: RoutingPolicy, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint32 time_lock_delta = 1; */ if (message.timeLockDelta !== 0) writer.tag(1, WireType.Varint).uint32(message.timeLockDelta); /* int64 min_htlc = 2; */ - if (message.minHtlc !== "0") + if (message.minHtlc !== 0n) writer.tag(2, WireType.Varint).int64(message.minHtlc); /* int64 fee_base_msat = 3; */ - if (message.feeBaseMsat !== "0") + if (message.feeBaseMsat !== 0n) writer.tag(3, WireType.Varint).int64(message.feeBaseMsat); /* int64 fee_rate_milli_msat = 4; */ - if (message.feeRateMilliMsat !== "0") + if (message.feeRateMilliMsat !== 0n) writer.tag(4, WireType.Varint).int64(message.feeRateMilliMsat); /* bool disabled = 5; */ if (message.disabled !== false) writer.tag(5, WireType.Varint).bool(message.disabled); /* uint64 max_htlc_msat = 6; */ - if (message.maxHtlcMsat !== "0") + if (message.maxHtlcMsat !== 0n) writer.tag(6, WireType.Varint).uint64(message.maxHtlcMsat); /* uint32 last_update = 7; */ if (message.lastUpdate !== 0) writer.tag(7, WireType.Varint).uint32(message.lastUpdate); + /* map custom_records = 8; */ + for (let k of Object.keys(message.customRecords)) + writer.tag(8, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -13295,13 +15545,14 @@ class ChannelEdge$Type extends MessageType { { no: 3, name: "last_update", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 4, name: "node1_pub", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 5, name: "node2_pub", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 6, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 7, name: "node1_policy", kind: "message", T: () => RoutingPolicy }, - { no: 8, name: "node2_policy", kind: "message", T: () => RoutingPolicy } + { no: 8, name: "node2_policy", kind: "message", T: () => RoutingPolicy }, + { no: 9, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } } ]); } create(value?: PartialMessage): ChannelEdge { - const message = { channelId: "0", chanPoint: "", lastUpdate: 0, node1Pub: "", node2Pub: "", capacity: "0" }; + const message = { channelId: "0", chanPoint: "", lastUpdate: 0, node1Pub: "", node2Pub: "", capacity: 0n, customRecords: {} }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -13328,7 +15579,7 @@ class ChannelEdge$Type extends MessageType { message.node2Pub = reader.string(); break; case /* int64 capacity */ 6: - message.capacity = reader.int64().toString(); + message.capacity = reader.int64().toBigInt(); break; case /* lnrpc.RoutingPolicy node1_policy */ 7: message.node1Policy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.node1Policy); @@ -13336,6 +15587,9 @@ class ChannelEdge$Type extends MessageType { case /* lnrpc.RoutingPolicy node2_policy */ 8: message.node2Policy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.node2Policy); break; + case /* map custom_records */ 9: + this.binaryReadMap9(message.customRecords, reader, options); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -13347,6 +15601,22 @@ class ChannelEdge$Type extends MessageType { } return message; } + private binaryReadMap9(map: ChannelEdge["customRecords"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof ChannelEdge["customRecords"] | undefined, val: ChannelEdge["customRecords"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.uint64().toString(); + break; + case 2: + val = reader.bytes(); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.ChannelEdge.custom_records"); + } + } + map[key ?? "0"] = val ?? new Uint8Array(0); + } internalBinaryWrite(message: ChannelEdge, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 channel_id = 1 [jstype = JS_STRING]; */ if (message.channelId !== "0") @@ -13364,7 +15634,7 @@ class ChannelEdge$Type extends MessageType { if (message.node2Pub !== "") writer.tag(5, WireType.LengthDelimited).string(message.node2Pub); /* int64 capacity = 6; */ - if (message.capacity !== "0") + if (message.capacity !== 0n) writer.tag(6, WireType.Varint).int64(message.capacity); /* lnrpc.RoutingPolicy node1_policy = 7; */ if (message.node1Policy) @@ -13372,6 +15642,9 @@ class ChannelEdge$Type extends MessageType { /* lnrpc.RoutingPolicy node2_policy = 8; */ if (message.node2Policy) RoutingPolicy.internalBinaryWrite(message.node2Policy, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* map custom_records = 9; */ + for (let k of Object.keys(message.customRecords)) + writer.tag(9, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -13741,16 +16014,16 @@ class NetworkInfo$Type extends MessageType { { no: 3, name: "max_out_degree", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 4, name: "num_nodes", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 5, name: "num_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "total_network_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 6, name: "total_network_capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 7, name: "avg_channel_size", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, - { no: 8, name: "min_channel_size", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 9, name: "max_channel_size", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 10, name: "median_channel_size_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 11, name: "num_zombie_chans", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 8, name: "min_channel_size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "max_channel_size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "median_channel_size_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 11, name: "num_zombie_chans", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): NetworkInfo { - const message = { graphDiameter: 0, avgOutDegree: 0, maxOutDegree: 0, numNodes: 0, numChannels: 0, totalNetworkCapacity: "0", avgChannelSize: 0, minChannelSize: "0", maxChannelSize: "0", medianChannelSizeSat: "0", numZombieChans: "0" }; + const message = { graphDiameter: 0, avgOutDegree: 0, maxOutDegree: 0, numNodes: 0, numChannels: 0, totalNetworkCapacity: 0n, avgChannelSize: 0, minChannelSize: 0n, maxChannelSize: 0n, medianChannelSizeSat: 0n, numZombieChans: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -13777,22 +16050,22 @@ class NetworkInfo$Type extends MessageType { message.numChannels = reader.uint32(); break; case /* int64 total_network_capacity */ 6: - message.totalNetworkCapacity = reader.int64().toString(); + message.totalNetworkCapacity = reader.int64().toBigInt(); break; case /* double avg_channel_size */ 7: message.avgChannelSize = reader.double(); break; case /* int64 min_channel_size */ 8: - message.minChannelSize = reader.int64().toString(); + message.minChannelSize = reader.int64().toBigInt(); break; case /* int64 max_channel_size */ 9: - message.maxChannelSize = reader.int64().toString(); + message.maxChannelSize = reader.int64().toBigInt(); break; case /* int64 median_channel_size_sat */ 10: - message.medianChannelSizeSat = reader.int64().toString(); + message.medianChannelSizeSat = reader.int64().toBigInt(); break; case /* uint64 num_zombie_chans */ 11: - message.numZombieChans = reader.uint64().toString(); + message.numZombieChans = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -13822,22 +16095,22 @@ class NetworkInfo$Type extends MessageType { if (message.numChannels !== 0) writer.tag(5, WireType.Varint).uint32(message.numChannels); /* int64 total_network_capacity = 6; */ - if (message.totalNetworkCapacity !== "0") + if (message.totalNetworkCapacity !== 0n) writer.tag(6, WireType.Varint).int64(message.totalNetworkCapacity); /* double avg_channel_size = 7; */ if (message.avgChannelSize !== 0) writer.tag(7, WireType.Bit64).double(message.avgChannelSize); /* int64 min_channel_size = 8; */ - if (message.minChannelSize !== "0") + if (message.minChannelSize !== 0n) writer.tag(8, WireType.Varint).int64(message.minChannelSize); /* int64 max_channel_size = 9; */ - if (message.maxChannelSize !== "0") + if (message.maxChannelSize !== 0n) writer.tag(9, WireType.Varint).int64(message.maxChannelSize); /* int64 median_channel_size_sat = 10; */ - if (message.medianChannelSizeSat !== "0") + if (message.medianChannelSizeSat !== 0n) writer.tag(10, WireType.Varint).int64(message.medianChannelSizeSat); /* uint64 num_zombie_chans = 11; */ - if (message.numZombieChans !== "0") + if (message.numZombieChans !== 0n) writer.tag(11, WireType.Varint).uint64(message.numZombieChans); let u = options.writeUnknownFields; if (u !== false) @@ -14103,14 +16376,14 @@ class ChannelEdgeUpdate$Type extends MessageType { super("lnrpc.ChannelEdgeUpdate", [ { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, { no: 2, name: "chan_point", kind: "message", T: () => ChannelPoint }, - { no: 3, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 3, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "routing_policy", kind: "message", T: () => RoutingPolicy }, { no: 5, name: "advertising_node", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 6, name: "connecting_node", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): ChannelEdgeUpdate { - const message = { chanId: "0", capacity: "0", advertisingNode: "", connectingNode: "" }; + const message = { chanId: "0", capacity: 0n, advertisingNode: "", connectingNode: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -14128,7 +16401,7 @@ class ChannelEdgeUpdate$Type extends MessageType { message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); break; case /* int64 capacity */ 3: - message.capacity = reader.int64().toString(); + message.capacity = reader.int64().toBigInt(); break; case /* lnrpc.RoutingPolicy routing_policy */ 4: message.routingPolicy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.routingPolicy); @@ -14158,7 +16431,7 @@ class ChannelEdgeUpdate$Type extends MessageType { if (message.chanPoint) ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); /* int64 capacity = 3; */ - if (message.capacity !== "0") + if (message.capacity !== 0n) writer.tag(3, WireType.Varint).int64(message.capacity); /* lnrpc.RoutingPolicy routing_policy = 4; */ if (message.routingPolicy) @@ -14184,13 +16457,13 @@ class ClosedChannelUpdate$Type extends MessageType { constructor() { super("lnrpc.ClosedChannelUpdate", [ { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 3, name: "closed_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 4, name: "chan_point", kind: "message", T: () => ChannelPoint } ]); } create(value?: PartialMessage): ClosedChannelUpdate { - const message = { chanId: "0", capacity: "0", closedHeight: 0 }; + const message = { chanId: "0", capacity: 0n, closedHeight: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -14205,7 +16478,7 @@ class ClosedChannelUpdate$Type extends MessageType { message.chanId = reader.uint64().toString(); break; case /* int64 capacity */ 2: - message.capacity = reader.int64().toString(); + message.capacity = reader.int64().toBigInt(); break; case /* uint32 closed_height */ 3: message.closedHeight = reader.uint32(); @@ -14229,7 +16502,7 @@ class ClosedChannelUpdate$Type extends MessageType { if (message.chanId !== "0") writer.tag(1, WireType.Varint).uint64(message.chanId); /* int64 capacity = 2; */ - if (message.capacity !== "0") + if (message.capacity !== 0n) writer.tag(2, WireType.Varint).int64(message.capacity); /* uint32 closed_height = 3; */ if (message.closedHeight !== 0) @@ -14323,6 +16596,53 @@ class HopHint$Type extends MessageType { */ export const HopHint = new HopHint$Type(); // @generated message type with reflection information, may provide speed optimized methods +class SetID$Type extends MessageType { + constructor() { + super("lnrpc.SetID", [ + { no: 1, name: "set_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): SetID { + const message = { setId: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetID): SetID { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes set_id */ 1: + message.setId = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SetID, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes set_id = 1; */ + if (message.setId.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.setId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.SetID + */ +export const SetID = new SetID$Type(); +// @generated message type with reflection information, may provide speed optimized methods class RouteHint$Type extends MessageType { constructor() { super("lnrpc.RouteHint", [ @@ -14370,39 +16690,108 @@ class RouteHint$Type extends MessageType { */ export const RouteHint = new RouteHint$Type(); // @generated message type with reflection information, may provide speed optimized methods +class AMPInvoiceState$Type extends MessageType { + constructor() { + super("lnrpc.AMPInvoiceState", [ + { no: 1, name: "state", kind: "enum", T: () => ["lnrpc.InvoiceHTLCState", InvoiceHTLCState] }, + { no: 2, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "settle_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "amt_paid_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): AMPInvoiceState { + const message = { state: 0, settleIndex: 0n, settleTime: 0n, amtPaidMsat: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AMPInvoiceState): AMPInvoiceState { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.InvoiceHTLCState state */ 1: + message.state = reader.int32(); + break; + case /* uint64 settle_index */ 2: + message.settleIndex = reader.uint64().toBigInt(); + break; + case /* int64 settle_time */ 3: + message.settleTime = reader.int64().toBigInt(); + break; + case /* int64 amt_paid_msat */ 5: + message.amtPaidMsat = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AMPInvoiceState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.InvoiceHTLCState state = 1; */ + if (message.state !== 0) + writer.tag(1, WireType.Varint).int32(message.state); + /* uint64 settle_index = 2; */ + if (message.settleIndex !== 0n) + writer.tag(2, WireType.Varint).uint64(message.settleIndex); + /* int64 settle_time = 3; */ + if (message.settleTime !== 0n) + writer.tag(3, WireType.Varint).int64(message.settleTime); + /* int64 amt_paid_msat = 5; */ + if (message.amtPaidMsat !== 0n) + writer.tag(5, WireType.Varint).int64(message.amtPaidMsat); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.AMPInvoiceState + */ +export const AMPInvoiceState = new AMPInvoiceState$Type(); +// @generated message type with reflection information, may provide speed optimized methods class Invoice$Type extends MessageType { constructor() { super("lnrpc.Invoice", [ { no: 1, name: "memo", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "r_preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 4, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 23, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 5, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 23, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 6, name: "settled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 7, name: "creation_date", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 8, name: "settle_date", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 7, name: "creation_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "settle_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 9, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 10, name: "description_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 11, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 11, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 12, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 13, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 14, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, { no: 15, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 16, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 17, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 18, name: "amt_paid", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 19, name: "amt_paid_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 20, name: "amt_paid_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 16, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 17, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 18, name: "amt_paid", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 19, name: "amt_paid_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 20, name: "amt_paid_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 21, name: "state", kind: "enum", T: () => ["lnrpc.Invoice.InvoiceState", Invoice_InvoiceState] }, { no: 22, name: "htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => InvoiceHTLC }, { no: 24, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } }, { no: 25, name: "is_keysend", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, { no: 26, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 27, name: "is_amp", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + { no: 27, name: "is_amp", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 28, name: "amp_invoice_state", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => AMPInvoiceState } } ]); } create(value?: PartialMessage): Invoice { - const message = { memo: "", rPreimage: new Uint8Array(0), rHash: new Uint8Array(0), value: "0", valueMsat: "0", settled: false, creationDate: "0", settleDate: "0", paymentRequest: "", descriptionHash: new Uint8Array(0), expiry: "0", fallbackAddr: "", cltvExpiry: "0", routeHints: [], private: false, addIndex: "0", settleIndex: "0", amtPaid: "0", amtPaidSat: "0", amtPaidMsat: "0", state: 0, htlcs: [], features: {}, isKeysend: false, paymentAddr: new Uint8Array(0), isAmp: false }; + const message = { memo: "", rPreimage: new Uint8Array(0), rHash: new Uint8Array(0), value: 0n, valueMsat: 0n, settled: false, creationDate: 0n, settleDate: 0n, paymentRequest: "", descriptionHash: new Uint8Array(0), expiry: 0n, fallbackAddr: "", cltvExpiry: 0n, routeHints: [], private: false, addIndex: 0n, settleIndex: 0n, amtPaid: 0n, amtPaidSat: 0n, amtPaidMsat: 0n, state: 0, htlcs: [], features: {}, isKeysend: false, paymentAddr: new Uint8Array(0), isAmp: false, ampInvoiceState: {} }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -14423,19 +16812,19 @@ class Invoice$Type extends MessageType { message.rHash = reader.bytes(); break; case /* int64 value */ 5: - message.value = reader.int64().toString(); + message.value = reader.int64().toBigInt(); break; case /* int64 value_msat */ 23: - message.valueMsat = reader.int64().toString(); + message.valueMsat = reader.int64().toBigInt(); break; case /* bool settled = 6 [deprecated = true];*/ 6: message.settled = reader.bool(); break; case /* int64 creation_date */ 7: - message.creationDate = reader.int64().toString(); + message.creationDate = reader.int64().toBigInt(); break; case /* int64 settle_date */ 8: - message.settleDate = reader.int64().toString(); + message.settleDate = reader.int64().toBigInt(); break; case /* string payment_request */ 9: message.paymentRequest = reader.string(); @@ -14444,13 +16833,13 @@ class Invoice$Type extends MessageType { message.descriptionHash = reader.bytes(); break; case /* int64 expiry */ 11: - message.expiry = reader.int64().toString(); + message.expiry = reader.int64().toBigInt(); break; case /* string fallback_addr */ 12: message.fallbackAddr = reader.string(); break; case /* uint64 cltv_expiry */ 13: - message.cltvExpiry = reader.uint64().toString(); + message.cltvExpiry = reader.uint64().toBigInt(); break; case /* repeated lnrpc.RouteHint route_hints */ 14: message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); @@ -14459,19 +16848,19 @@ class Invoice$Type extends MessageType { message.private = reader.bool(); break; case /* uint64 add_index */ 16: - message.addIndex = reader.uint64().toString(); + message.addIndex = reader.uint64().toBigInt(); break; case /* uint64 settle_index */ 17: - message.settleIndex = reader.uint64().toString(); + message.settleIndex = reader.uint64().toBigInt(); break; case /* int64 amt_paid = 18 [deprecated = true];*/ 18: - message.amtPaid = reader.int64().toString(); + message.amtPaid = reader.int64().toBigInt(); break; case /* int64 amt_paid_sat */ 19: - message.amtPaidSat = reader.int64().toString(); + message.amtPaidSat = reader.int64().toBigInt(); break; case /* int64 amt_paid_msat */ 20: - message.amtPaidMsat = reader.int64().toString(); + message.amtPaidMsat = reader.int64().toBigInt(); break; case /* lnrpc.Invoice.InvoiceState state */ 21: message.state = reader.int32(); @@ -14491,6 +16880,9 @@ class Invoice$Type extends MessageType { case /* bool is_amp */ 27: message.isAmp = reader.bool(); break; + case /* map amp_invoice_state */ 28: + this.binaryReadMap28(message.ampInvoiceState, reader, options); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -14518,6 +16910,22 @@ class Invoice$Type extends MessageType { } map[key ?? 0] = val ?? Feature.create(); } + private binaryReadMap28(map: Invoice["ampInvoiceState"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Invoice["ampInvoiceState"] | undefined, val: Invoice["ampInvoiceState"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = AMPInvoiceState.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field lnrpc.Invoice.amp_invoice_state"); + } + } + map[key ?? ""] = val ?? AMPInvoiceState.create(); + } internalBinaryWrite(message: Invoice, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string memo = 1; */ if (message.memo !== "") @@ -14529,19 +16937,19 @@ class Invoice$Type extends MessageType { if (message.rHash.length) writer.tag(4, WireType.LengthDelimited).bytes(message.rHash); /* int64 value = 5; */ - if (message.value !== "0") + if (message.value !== 0n) writer.tag(5, WireType.Varint).int64(message.value); /* int64 value_msat = 23; */ - if (message.valueMsat !== "0") + if (message.valueMsat !== 0n) writer.tag(23, WireType.Varint).int64(message.valueMsat); /* bool settled = 6 [deprecated = true]; */ if (message.settled !== false) writer.tag(6, WireType.Varint).bool(message.settled); /* int64 creation_date = 7; */ - if (message.creationDate !== "0") + if (message.creationDate !== 0n) writer.tag(7, WireType.Varint).int64(message.creationDate); /* int64 settle_date = 8; */ - if (message.settleDate !== "0") + if (message.settleDate !== 0n) writer.tag(8, WireType.Varint).int64(message.settleDate); /* string payment_request = 9; */ if (message.paymentRequest !== "") @@ -14550,13 +16958,13 @@ class Invoice$Type extends MessageType { if (message.descriptionHash.length) writer.tag(10, WireType.LengthDelimited).bytes(message.descriptionHash); /* int64 expiry = 11; */ - if (message.expiry !== "0") + if (message.expiry !== 0n) writer.tag(11, WireType.Varint).int64(message.expiry); /* string fallback_addr = 12; */ if (message.fallbackAddr !== "") writer.tag(12, WireType.LengthDelimited).string(message.fallbackAddr); /* uint64 cltv_expiry = 13; */ - if (message.cltvExpiry !== "0") + if (message.cltvExpiry !== 0n) writer.tag(13, WireType.Varint).uint64(message.cltvExpiry); /* repeated lnrpc.RouteHint route_hints = 14; */ for (let i = 0; i < message.routeHints.length; i++) @@ -14565,19 +16973,19 @@ class Invoice$Type extends MessageType { if (message.private !== false) writer.tag(15, WireType.Varint).bool(message.private); /* uint64 add_index = 16; */ - if (message.addIndex !== "0") + if (message.addIndex !== 0n) writer.tag(16, WireType.Varint).uint64(message.addIndex); /* uint64 settle_index = 17; */ - if (message.settleIndex !== "0") + if (message.settleIndex !== 0n) writer.tag(17, WireType.Varint).uint64(message.settleIndex); /* int64 amt_paid = 18 [deprecated = true]; */ - if (message.amtPaid !== "0") + if (message.amtPaid !== 0n) writer.tag(18, WireType.Varint).int64(message.amtPaid); /* int64 amt_paid_sat = 19; */ - if (message.amtPaidSat !== "0") + if (message.amtPaidSat !== 0n) writer.tag(19, WireType.Varint).int64(message.amtPaidSat); /* int64 amt_paid_msat = 20; */ - if (message.amtPaidMsat !== "0") + if (message.amtPaidMsat !== 0n) writer.tag(20, WireType.Varint).int64(message.amtPaidMsat); /* lnrpc.Invoice.InvoiceState state = 21; */ if (message.state !== 0) @@ -14601,6 +17009,13 @@ class Invoice$Type extends MessageType { /* bool is_amp = 27; */ if (message.isAmp !== false) writer.tag(27, WireType.Varint).bool(message.isAmp); + /* map amp_invoice_state = 28; */ + for (let k of Object.keys(message.ampInvoiceState)) { + writer.tag(28, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + AMPInvoiceState.internalBinaryWrite(message.ampInvoiceState[k], writer, options); + writer.join().join(); + } let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -14616,20 +17031,20 @@ class InvoiceHTLC$Type extends MessageType { constructor() { super("lnrpc.InvoiceHTLC", [ { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "accept_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "accept_time", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 6, name: "resolve_time", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 5, name: "accept_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "resolve_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 7, name: "expiry_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, { no: 8, name: "state", kind: "enum", T: () => ["lnrpc.InvoiceHTLCState", InvoiceHTLCState] }, { no: 9, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, - { no: 10, name: "mpp_total_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 10, name: "mpp_total_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 11, name: "amp", kind: "message", T: () => AMP } ]); } create(value?: PartialMessage): InvoiceHTLC { - const message = { chanId: "0", htlcIndex: "0", amtMsat: "0", acceptHeight: 0, acceptTime: "0", resolveTime: "0", expiryHeight: 0, state: 0, customRecords: {}, mppTotalAmtMsat: "0" }; + const message = { chanId: "0", htlcIndex: 0n, amtMsat: 0n, acceptHeight: 0, acceptTime: 0n, resolveTime: 0n, expiryHeight: 0, state: 0, customRecords: {}, mppTotalAmtMsat: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -14644,19 +17059,19 @@ class InvoiceHTLC$Type extends MessageType { message.chanId = reader.uint64().toString(); break; case /* uint64 htlc_index */ 2: - message.htlcIndex = reader.uint64().toString(); + message.htlcIndex = reader.uint64().toBigInt(); break; case /* uint64 amt_msat */ 3: - message.amtMsat = reader.uint64().toString(); + message.amtMsat = reader.uint64().toBigInt(); break; case /* int32 accept_height */ 4: message.acceptHeight = reader.int32(); break; case /* int64 accept_time */ 5: - message.acceptTime = reader.int64().toString(); + message.acceptTime = reader.int64().toBigInt(); break; case /* int64 resolve_time */ 6: - message.resolveTime = reader.int64().toString(); + message.resolveTime = reader.int64().toBigInt(); break; case /* int32 expiry_height */ 7: message.expiryHeight = reader.int32(); @@ -14668,7 +17083,7 @@ class InvoiceHTLC$Type extends MessageType { this.binaryReadMap9(message.customRecords, reader, options); break; case /* uint64 mpp_total_amt_msat */ 10: - message.mppTotalAmtMsat = reader.uint64().toString(); + message.mppTotalAmtMsat = reader.uint64().toBigInt(); break; case /* lnrpc.AMP amp */ 11: message.amp = AMP.internalBinaryRead(reader, reader.uint32(), options, message.amp); @@ -14705,19 +17120,19 @@ class InvoiceHTLC$Type extends MessageType { if (message.chanId !== "0") writer.tag(1, WireType.Varint).uint64(message.chanId); /* uint64 htlc_index = 2; */ - if (message.htlcIndex !== "0") + if (message.htlcIndex !== 0n) writer.tag(2, WireType.Varint).uint64(message.htlcIndex); /* uint64 amt_msat = 3; */ - if (message.amtMsat !== "0") + if (message.amtMsat !== 0n) writer.tag(3, WireType.Varint).uint64(message.amtMsat); /* int32 accept_height = 4; */ if (message.acceptHeight !== 0) writer.tag(4, WireType.Varint).int32(message.acceptHeight); /* int64 accept_time = 5; */ - if (message.acceptTime !== "0") + if (message.acceptTime !== 0n) writer.tag(5, WireType.Varint).int64(message.acceptTime); /* int64 resolve_time = 6; */ - if (message.resolveTime !== "0") + if (message.resolveTime !== 0n) writer.tag(6, WireType.Varint).int64(message.resolveTime); /* int32 expiry_height = 7; */ if (message.expiryHeight !== 0) @@ -14729,7 +17144,7 @@ class InvoiceHTLC$Type extends MessageType { for (let k of Object.keys(message.customRecords)) writer.tag(9, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.customRecords[k]).join(); /* uint64 mpp_total_amt_msat = 10; */ - if (message.mppTotalAmtMsat !== "0") + if (message.mppTotalAmtMsat !== 0n) writer.tag(10, WireType.Varint).uint64(message.mppTotalAmtMsat); /* lnrpc.AMP amp = 11; */ if (message.amp) @@ -14825,12 +17240,12 @@ class AddInvoiceResponse$Type extends MessageType { super("lnrpc.AddInvoiceResponse", [ { no: 1, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 2, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 16, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 16, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 17, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } ]); } create(value?: PartialMessage): AddInvoiceResponse { - const message = { rHash: new Uint8Array(0), paymentRequest: "", addIndex: "0", paymentAddr: new Uint8Array(0) }; + const message = { rHash: new Uint8Array(0), paymentRequest: "", addIndex: 0n, paymentAddr: new Uint8Array(0) }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -14848,7 +17263,7 @@ class AddInvoiceResponse$Type extends MessageType { message.paymentRequest = reader.string(); break; case /* uint64 add_index */ 16: - message.addIndex = reader.uint64().toString(); + message.addIndex = reader.uint64().toBigInt(); break; case /* bytes payment_addr */ 17: message.paymentAddr = reader.bytes(); @@ -14872,7 +17287,7 @@ class AddInvoiceResponse$Type extends MessageType { if (message.paymentRequest !== "") writer.tag(2, WireType.LengthDelimited).string(message.paymentRequest); /* uint64 add_index = 16; */ - if (message.addIndex !== "0") + if (message.addIndex !== 0n) writer.tag(16, WireType.Varint).uint64(message.addIndex); /* bytes payment_addr = 17; */ if (message.paymentAddr.length) @@ -14946,13 +17361,13 @@ class ListInvoiceRequest$Type extends MessageType { constructor() { super("lnrpc.ListInvoiceRequest", [ { no: 1, name: "pending_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 4, name: "index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 5, name: "num_max_invoices", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "num_max_invoices", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 6, name: "reversed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): ListInvoiceRequest { - const message = { pendingOnly: false, indexOffset: "0", numMaxInvoices: "0", reversed: false }; + const message = { pendingOnly: false, indexOffset: 0n, numMaxInvoices: 0n, reversed: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -14967,10 +17382,10 @@ class ListInvoiceRequest$Type extends MessageType { message.pendingOnly = reader.bool(); break; case /* uint64 index_offset */ 4: - message.indexOffset = reader.uint64().toString(); + message.indexOffset = reader.uint64().toBigInt(); break; case /* uint64 num_max_invoices */ 5: - message.numMaxInvoices = reader.uint64().toString(); + message.numMaxInvoices = reader.uint64().toBigInt(); break; case /* bool reversed */ 6: message.reversed = reader.bool(); @@ -14991,10 +17406,10 @@ class ListInvoiceRequest$Type extends MessageType { if (message.pendingOnly !== false) writer.tag(1, WireType.Varint).bool(message.pendingOnly); /* uint64 index_offset = 4; */ - if (message.indexOffset !== "0") + if (message.indexOffset !== 0n) writer.tag(4, WireType.Varint).uint64(message.indexOffset); /* uint64 num_max_invoices = 5; */ - if (message.numMaxInvoices !== "0") + if (message.numMaxInvoices !== 0n) writer.tag(5, WireType.Varint).uint64(message.numMaxInvoices); /* bool reversed = 6; */ if (message.reversed !== false) @@ -15014,12 +17429,12 @@ class ListInvoiceResponse$Type extends MessageType { constructor() { super("lnrpc.ListInvoiceResponse", [ { no: 1, name: "invoices", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Invoice }, - { no: 2, name: "last_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "first_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 2, name: "last_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "first_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): ListInvoiceResponse { - const message = { invoices: [], lastIndexOffset: "0", firstIndexOffset: "0" }; + const message = { invoices: [], lastIndexOffset: 0n, firstIndexOffset: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -15034,10 +17449,10 @@ class ListInvoiceResponse$Type extends MessageType { message.invoices.push(Invoice.internalBinaryRead(reader, reader.uint32(), options)); break; case /* uint64 last_index_offset */ 2: - message.lastIndexOffset = reader.uint64().toString(); + message.lastIndexOffset = reader.uint64().toBigInt(); break; case /* uint64 first_index_offset */ 3: - message.firstIndexOffset = reader.uint64().toString(); + message.firstIndexOffset = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -15055,10 +17470,10 @@ class ListInvoiceResponse$Type extends MessageType { for (let i = 0; i < message.invoices.length; i++) Invoice.internalBinaryWrite(message.invoices[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* uint64 last_index_offset = 2; */ - if (message.lastIndexOffset !== "0") + if (message.lastIndexOffset !== 0n) writer.tag(2, WireType.Varint).uint64(message.lastIndexOffset); /* uint64 first_index_offset = 3; */ - if (message.firstIndexOffset !== "0") + if (message.firstIndexOffset !== 0n) writer.tag(3, WireType.Varint).uint64(message.firstIndexOffset); let u = options.writeUnknownFields; if (u !== false) @@ -15074,12 +17489,12 @@ export const ListInvoiceResponse = new ListInvoiceResponse$Type(); class InvoiceSubscription$Type extends MessageType { constructor() { super("lnrpc.InvoiceSubscription", [ - { no: 1, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 1, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): InvoiceSubscription { - const message = { addIndex: "0", settleIndex: "0" }; + const message = { addIndex: 0n, settleIndex: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -15091,10 +17506,10 @@ class InvoiceSubscription$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 add_index */ 1: - message.addIndex = reader.uint64().toString(); + message.addIndex = reader.uint64().toBigInt(); break; case /* uint64 settle_index */ 2: - message.settleIndex = reader.uint64().toString(); + message.settleIndex = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -15109,10 +17524,10 @@ class InvoiceSubscription$Type extends MessageType { } internalBinaryWrite(message: InvoiceSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 add_index = 1; */ - if (message.addIndex !== "0") + if (message.addIndex !== 0n) writer.tag(1, WireType.Varint).uint64(message.addIndex); /* uint64 settle_index = 2; */ - if (message.settleIndex !== "0") + if (message.settleIndex !== 0n) writer.tag(2, WireType.Varint).uint64(message.settleIndex); let u = options.writeUnknownFields; if (u !== false) @@ -15129,24 +17544,24 @@ class Payment$Type extends MessageType { constructor() { super("lnrpc.Payment", [ { no: 1, name: "payment_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 3, name: "creation_date", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 5, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "value", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "creation_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 6, name: "payment_preimage", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "value_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 8, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 7, name: "value_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 9, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 10, name: "status", kind: "enum", T: () => ["lnrpc.Payment.PaymentStatus", Payment_PaymentStatus] }, - { no: 11, name: "fee_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 12, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 13, name: "creation_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 11, name: "fee_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 13, name: "creation_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 14, name: "htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HTLCAttempt }, - { no: 15, name: "payment_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 15, name: "payment_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 16, name: "failure_reason", kind: "enum", T: () => ["lnrpc.PaymentFailureReason", PaymentFailureReason] } ]); } create(value?: PartialMessage): Payment { - const message = { paymentHash: "", value: "0", creationDate: "0", fee: "0", paymentPreimage: "", valueSat: "0", valueMsat: "0", paymentRequest: "", status: 0, feeSat: "0", feeMsat: "0", creationTimeNs: "0", htlcs: [], paymentIndex: "0", failureReason: 0 }; + const message = { paymentHash: "", value: 0n, creationDate: 0n, fee: 0n, paymentPreimage: "", valueSat: 0n, valueMsat: 0n, paymentRequest: "", status: 0, feeSat: 0n, feeMsat: 0n, creationTimeNs: 0n, htlcs: [], paymentIndex: 0n, failureReason: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -15161,22 +17576,22 @@ class Payment$Type extends MessageType { message.paymentHash = reader.string(); break; case /* int64 value = 2 [deprecated = true];*/ 2: - message.value = reader.int64().toString(); + message.value = reader.int64().toBigInt(); break; case /* int64 creation_date = 3 [deprecated = true];*/ 3: - message.creationDate = reader.int64().toString(); + message.creationDate = reader.int64().toBigInt(); break; case /* int64 fee = 5 [deprecated = true];*/ 5: - message.fee = reader.int64().toString(); + message.fee = reader.int64().toBigInt(); break; case /* string payment_preimage */ 6: message.paymentPreimage = reader.string(); break; case /* int64 value_sat */ 7: - message.valueSat = reader.int64().toString(); + message.valueSat = reader.int64().toBigInt(); break; case /* int64 value_msat */ 8: - message.valueMsat = reader.int64().toString(); + message.valueMsat = reader.int64().toBigInt(); break; case /* string payment_request */ 9: message.paymentRequest = reader.string(); @@ -15185,19 +17600,19 @@ class Payment$Type extends MessageType { message.status = reader.int32(); break; case /* int64 fee_sat */ 11: - message.feeSat = reader.int64().toString(); + message.feeSat = reader.int64().toBigInt(); break; case /* int64 fee_msat */ 12: - message.feeMsat = reader.int64().toString(); + message.feeMsat = reader.int64().toBigInt(); break; case /* int64 creation_time_ns */ 13: - message.creationTimeNs = reader.int64().toString(); + message.creationTimeNs = reader.int64().toBigInt(); break; case /* repeated lnrpc.HTLCAttempt htlcs */ 14: message.htlcs.push(HTLCAttempt.internalBinaryRead(reader, reader.uint32(), options)); break; case /* uint64 payment_index */ 15: - message.paymentIndex = reader.uint64().toString(); + message.paymentIndex = reader.uint64().toBigInt(); break; case /* lnrpc.PaymentFailureReason failure_reason */ 16: message.failureReason = reader.int32(); @@ -15218,22 +17633,22 @@ class Payment$Type extends MessageType { if (message.paymentHash !== "") writer.tag(1, WireType.LengthDelimited).string(message.paymentHash); /* int64 value = 2 [deprecated = true]; */ - if (message.value !== "0") + if (message.value !== 0n) writer.tag(2, WireType.Varint).int64(message.value); /* int64 creation_date = 3 [deprecated = true]; */ - if (message.creationDate !== "0") + if (message.creationDate !== 0n) writer.tag(3, WireType.Varint).int64(message.creationDate); /* int64 fee = 5 [deprecated = true]; */ - if (message.fee !== "0") + if (message.fee !== 0n) writer.tag(5, WireType.Varint).int64(message.fee); /* string payment_preimage = 6; */ if (message.paymentPreimage !== "") writer.tag(6, WireType.LengthDelimited).string(message.paymentPreimage); /* int64 value_sat = 7; */ - if (message.valueSat !== "0") + if (message.valueSat !== 0n) writer.tag(7, WireType.Varint).int64(message.valueSat); /* int64 value_msat = 8; */ - if (message.valueMsat !== "0") + if (message.valueMsat !== 0n) writer.tag(8, WireType.Varint).int64(message.valueMsat); /* string payment_request = 9; */ if (message.paymentRequest !== "") @@ -15242,19 +17657,19 @@ class Payment$Type extends MessageType { if (message.status !== 0) writer.tag(10, WireType.Varint).int32(message.status); /* int64 fee_sat = 11; */ - if (message.feeSat !== "0") + if (message.feeSat !== 0n) writer.tag(11, WireType.Varint).int64(message.feeSat); /* int64 fee_msat = 12; */ - if (message.feeMsat !== "0") + if (message.feeMsat !== 0n) writer.tag(12, WireType.Varint).int64(message.feeMsat); /* int64 creation_time_ns = 13; */ - if (message.creationTimeNs !== "0") + if (message.creationTimeNs !== 0n) writer.tag(13, WireType.Varint).int64(message.creationTimeNs); /* repeated lnrpc.HTLCAttempt htlcs = 14; */ for (let i = 0; i < message.htlcs.length; i++) HTLCAttempt.internalBinaryWrite(message.htlcs[i], writer.tag(14, WireType.LengthDelimited).fork(), options).join(); /* uint64 payment_index = 15; */ - if (message.paymentIndex !== "0") + if (message.paymentIndex !== 0n) writer.tag(15, WireType.Varint).uint64(message.paymentIndex); /* lnrpc.PaymentFailureReason failure_reason = 16; */ if (message.failureReason !== 0) @@ -15273,17 +17688,17 @@ export const Payment = new Payment$Type(); class HTLCAttempt$Type extends MessageType { constructor() { super("lnrpc.HTLCAttempt", [ - { no: 7, name: "attempt_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 7, name: "attempt_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 1, name: "status", kind: "enum", T: () => ["lnrpc.HTLCAttempt.HTLCStatus", HTLCAttempt_HTLCStatus] }, { no: 2, name: "route", kind: "message", T: () => Route }, - { no: 3, name: "attempt_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 4, name: "resolve_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 3, name: "attempt_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "resolve_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 5, name: "failure", kind: "message", T: () => Failure }, { no: 6, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } ]); } create(value?: PartialMessage): HTLCAttempt { - const message = { attemptId: "0", status: 0, attemptTimeNs: "0", resolveTimeNs: "0", preimage: new Uint8Array(0) }; + const message = { attemptId: 0n, status: 0, attemptTimeNs: 0n, resolveTimeNs: 0n, preimage: new Uint8Array(0) }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -15295,7 +17710,7 @@ class HTLCAttempt$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 attempt_id */ 7: - message.attemptId = reader.uint64().toString(); + message.attemptId = reader.uint64().toBigInt(); break; case /* lnrpc.HTLCAttempt.HTLCStatus status */ 1: message.status = reader.int32(); @@ -15304,10 +17719,10 @@ class HTLCAttempt$Type extends MessageType { message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); break; case /* int64 attempt_time_ns */ 3: - message.attemptTimeNs = reader.int64().toString(); + message.attemptTimeNs = reader.int64().toBigInt(); break; case /* int64 resolve_time_ns */ 4: - message.resolveTimeNs = reader.int64().toString(); + message.resolveTimeNs = reader.int64().toBigInt(); break; case /* lnrpc.Failure failure */ 5: message.failure = Failure.internalBinaryRead(reader, reader.uint32(), options, message.failure); @@ -15328,7 +17743,7 @@ class HTLCAttempt$Type extends MessageType { } internalBinaryWrite(message: HTLCAttempt, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 attempt_id = 7; */ - if (message.attemptId !== "0") + if (message.attemptId !== 0n) writer.tag(7, WireType.Varint).uint64(message.attemptId); /* lnrpc.HTLCAttempt.HTLCStatus status = 1; */ if (message.status !== 0) @@ -15337,10 +17752,10 @@ class HTLCAttempt$Type extends MessageType { if (message.route) Route.internalBinaryWrite(message.route, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); /* int64 attempt_time_ns = 3; */ - if (message.attemptTimeNs !== "0") + if (message.attemptTimeNs !== 0n) writer.tag(3, WireType.Varint).int64(message.attemptTimeNs); /* int64 resolve_time_ns = 4; */ - if (message.resolveTimeNs !== "0") + if (message.resolveTimeNs !== 0n) writer.tag(4, WireType.Varint).int64(message.resolveTimeNs); /* lnrpc.Failure failure = 5; */ if (message.failure) @@ -15363,13 +17778,14 @@ class ListPaymentsRequest$Type extends MessageType { constructor() { super("lnrpc.ListPaymentsRequest", [ { no: 1, name: "include_incomplete", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "max_payments", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 4, name: "reversed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + { no: 2, name: "index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "max_payments", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "reversed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "count_total_payments", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): ListPaymentsRequest { - const message = { includeIncomplete: false, indexOffset: "0", maxPayments: "0", reversed: false }; + const message = { includeIncomplete: false, indexOffset: 0n, maxPayments: 0n, reversed: false, countTotalPayments: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -15384,14 +17800,17 @@ class ListPaymentsRequest$Type extends MessageType { message.includeIncomplete = reader.bool(); break; case /* uint64 index_offset */ 2: - message.indexOffset = reader.uint64().toString(); + message.indexOffset = reader.uint64().toBigInt(); break; case /* uint64 max_payments */ 3: - message.maxPayments = reader.uint64().toString(); + message.maxPayments = reader.uint64().toBigInt(); break; case /* bool reversed */ 4: message.reversed = reader.bool(); break; + case /* bool count_total_payments */ 5: + message.countTotalPayments = reader.bool(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -15408,14 +17827,17 @@ class ListPaymentsRequest$Type extends MessageType { if (message.includeIncomplete !== false) writer.tag(1, WireType.Varint).bool(message.includeIncomplete); /* uint64 index_offset = 2; */ - if (message.indexOffset !== "0") + if (message.indexOffset !== 0n) writer.tag(2, WireType.Varint).uint64(message.indexOffset); /* uint64 max_payments = 3; */ - if (message.maxPayments !== "0") + if (message.maxPayments !== 0n) writer.tag(3, WireType.Varint).uint64(message.maxPayments); /* bool reversed = 4; */ if (message.reversed !== false) writer.tag(4, WireType.Varint).bool(message.reversed); + /* bool count_total_payments = 5; */ + if (message.countTotalPayments !== false) + writer.tag(5, WireType.Varint).bool(message.countTotalPayments); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -15431,12 +17853,13 @@ class ListPaymentsResponse$Type extends MessageType { constructor() { super("lnrpc.ListPaymentsResponse", [ { no: 1, name: "payments", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Payment }, - { no: 2, name: "first_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "last_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 2, name: "first_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "last_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "total_num_payments", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): ListPaymentsResponse { - const message = { payments: [], firstIndexOffset: "0", lastIndexOffset: "0" }; + const message = { payments: [], firstIndexOffset: 0n, lastIndexOffset: 0n, totalNumPayments: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -15451,10 +17874,13 @@ class ListPaymentsResponse$Type extends MessageType { message.payments.push(Payment.internalBinaryRead(reader, reader.uint32(), options)); break; case /* uint64 first_index_offset */ 2: - message.firstIndexOffset = reader.uint64().toString(); + message.firstIndexOffset = reader.uint64().toBigInt(); break; case /* uint64 last_index_offset */ 3: - message.lastIndexOffset = reader.uint64().toString(); + message.lastIndexOffset = reader.uint64().toBigInt(); + break; + case /* uint64 total_num_payments */ 4: + message.totalNumPayments = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -15472,11 +17898,14 @@ class ListPaymentsResponse$Type extends MessageType { for (let i = 0; i < message.payments.length; i++) Payment.internalBinaryWrite(message.payments[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* uint64 first_index_offset = 2; */ - if (message.firstIndexOffset !== "0") + if (message.firstIndexOffset !== 0n) writer.tag(2, WireType.Varint).uint64(message.firstIndexOffset); /* uint64 last_index_offset = 3; */ - if (message.lastIndexOffset !== "0") + if (message.lastIndexOffset !== 0n) writer.tag(3, WireType.Varint).uint64(message.lastIndexOffset); + /* uint64 total_num_payments = 4; */ + if (message.totalNumPayments !== 0n) + writer.tag(4, WireType.Varint).uint64(message.totalNumPayments); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -15488,6 +17917,60 @@ class ListPaymentsResponse$Type extends MessageType { */ export const ListPaymentsResponse = new ListPaymentsResponse$Type(); // @generated message type with reflection information, may provide speed optimized methods +class DeletePaymentRequest$Type extends MessageType { + constructor() { + super("lnrpc.DeletePaymentRequest", [ + { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "failed_htlcs_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): DeletePaymentRequest { + const message = { paymentHash: new Uint8Array(0), failedHtlcsOnly: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePaymentRequest): DeletePaymentRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes payment_hash */ 1: + message.paymentHash = reader.bytes(); + break; + case /* bool failed_htlcs_only */ 2: + message.failedHtlcsOnly = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DeletePaymentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes payment_hash = 1; */ + if (message.paymentHash.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); + /* bool failed_htlcs_only = 2; */ + if (message.failedHtlcsOnly !== false) + writer.tag(2, WireType.Varint).bool(message.failedHtlcsOnly); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DeletePaymentRequest + */ +export const DeletePaymentRequest = new DeletePaymentRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods class DeleteAllPaymentsRequest$Type extends MessageType { constructor() { super("lnrpc.DeleteAllPaymentsRequest", [ @@ -15542,6 +18025,32 @@ class DeleteAllPaymentsRequest$Type extends MessageType { + constructor() { + super("lnrpc.DeletePaymentResponse", []); + } + create(value?: PartialMessage): DeletePaymentResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePaymentResponse): DeletePaymentResponse { + return target ?? this.create(); + } + internalBinaryWrite(message: DeletePaymentResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.DeletePaymentResponse + */ +export const DeletePaymentResponse = new DeletePaymentResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods class DeleteAllPaymentsResponse$Type extends MessageType { constructor() { super("lnrpc.DeleteAllPaymentsResponse", []); @@ -15572,11 +18081,12 @@ class AbandonChannelRequest$Type extends MessageType { constructor() { super("lnrpc.AbandonChannelRequest", [ { no: 1, name: "channel_point", kind: "message", T: () => ChannelPoint }, - { no: 2, name: "pending_funding_shim_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + { no: 2, name: "pending_funding_shim_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "i_know_what_i_am_doing", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): AbandonChannelRequest { - const message = { pendingFundingShimOnly: false }; + const message = { pendingFundingShimOnly: false, iKnowWhatIAmDoing: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -15593,6 +18103,9 @@ class AbandonChannelRequest$Type extends MessageType { case /* bool pending_funding_shim_only */ 2: message.pendingFundingShimOnly = reader.bool(); break; + case /* bool i_know_what_i_am_doing */ 3: + message.iKnowWhatIAmDoing = reader.bool(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -15611,6 +18124,9 @@ class AbandonChannelRequest$Type extends MessageType { /* bool pending_funding_shim_only = 2; */ if (message.pendingFundingShimOnly !== false) writer.tag(2, WireType.Varint).bool(message.pendingFundingShimOnly); + /* bool i_know_what_i_am_doing = 3; */ + if (message.iKnowWhatIAmDoing !== false) + writer.tag(3, WireType.Varint).bool(message.iKnowWhatIAmDoing); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -15801,21 +18317,21 @@ class PayReq$Type extends MessageType { super("lnrpc.PayReq", [ { no: 1, name: "destination", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "payment_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "num_satoshis", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 4, name: "timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 3, name: "num_satoshis", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 6, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 7, name: "description_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 8, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "cltv_expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 9, name: "cltv_expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 10, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, { no: 11, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 12, name: "num_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 12, name: "num_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 13, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } } ]); } create(value?: PartialMessage): PayReq { - const message = { destination: "", paymentHash: "", numSatoshis: "0", timestamp: "0", expiry: "0", description: "", descriptionHash: "", fallbackAddr: "", cltvExpiry: "0", routeHints: [], paymentAddr: new Uint8Array(0), numMsat: "0", features: {} }; + const message = { destination: "", paymentHash: "", numSatoshis: 0n, timestamp: 0n, expiry: 0n, description: "", descriptionHash: "", fallbackAddr: "", cltvExpiry: 0n, routeHints: [], paymentAddr: new Uint8Array(0), numMsat: 0n, features: {} }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -15833,13 +18349,13 @@ class PayReq$Type extends MessageType { message.paymentHash = reader.string(); break; case /* int64 num_satoshis */ 3: - message.numSatoshis = reader.int64().toString(); + message.numSatoshis = reader.int64().toBigInt(); break; case /* int64 timestamp */ 4: - message.timestamp = reader.int64().toString(); + message.timestamp = reader.int64().toBigInt(); break; case /* int64 expiry */ 5: - message.expiry = reader.int64().toString(); + message.expiry = reader.int64().toBigInt(); break; case /* string description */ 6: message.description = reader.string(); @@ -15851,7 +18367,7 @@ class PayReq$Type extends MessageType { message.fallbackAddr = reader.string(); break; case /* int64 cltv_expiry */ 9: - message.cltvExpiry = reader.int64().toString(); + message.cltvExpiry = reader.int64().toBigInt(); break; case /* repeated lnrpc.RouteHint route_hints */ 10: message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); @@ -15860,7 +18376,7 @@ class PayReq$Type extends MessageType { message.paymentAddr = reader.bytes(); break; case /* int64 num_msat */ 12: - message.numMsat = reader.int64().toString(); + message.numMsat = reader.int64().toBigInt(); break; case /* map features */ 13: this.binaryReadMap13(message.features, reader, options); @@ -15900,13 +18416,13 @@ class PayReq$Type extends MessageType { if (message.paymentHash !== "") writer.tag(2, WireType.LengthDelimited).string(message.paymentHash); /* int64 num_satoshis = 3; */ - if (message.numSatoshis !== "0") + if (message.numSatoshis !== 0n) writer.tag(3, WireType.Varint).int64(message.numSatoshis); /* int64 timestamp = 4; */ - if (message.timestamp !== "0") + if (message.timestamp !== 0n) writer.tag(4, WireType.Varint).int64(message.timestamp); /* int64 expiry = 5; */ - if (message.expiry !== "0") + if (message.expiry !== 0n) writer.tag(5, WireType.Varint).int64(message.expiry); /* string description = 6; */ if (message.description !== "") @@ -15918,7 +18434,7 @@ class PayReq$Type extends MessageType { if (message.fallbackAddr !== "") writer.tag(8, WireType.LengthDelimited).string(message.fallbackAddr); /* int64 cltv_expiry = 9; */ - if (message.cltvExpiry !== "0") + if (message.cltvExpiry !== 0n) writer.tag(9, WireType.Varint).int64(message.cltvExpiry); /* repeated lnrpc.RouteHint route_hints = 10; */ for (let i = 0; i < message.routeHints.length; i++) @@ -15927,7 +18443,7 @@ class PayReq$Type extends MessageType { if (message.paymentAddr.length) writer.tag(11, WireType.LengthDelimited).bytes(message.paymentAddr); /* int64 num_msat = 12; */ - if (message.numMsat !== "0") + if (message.numMsat !== 0n) writer.tag(12, WireType.Varint).int64(message.numMsat); /* map features = 13; */ for (let k of Object.keys(message.features)) { @@ -16039,13 +18555,13 @@ class ChannelFeeReport$Type extends MessageType { super("lnrpc.ChannelFeeReport", [ { no: 5, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, { no: 1, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "base_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 3, name: "fee_per_mil", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "base_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "fee_per_mil", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "fee_rate", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } ]); } create(value?: PartialMessage): ChannelFeeReport { - const message = { chanId: "0", channelPoint: "", baseFeeMsat: "0", feePerMil: "0", feeRate: 0 }; + const message = { chanId: "0", channelPoint: "", baseFeeMsat: 0n, feePerMil: 0n, feeRate: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -16063,10 +18579,10 @@ class ChannelFeeReport$Type extends MessageType { message.channelPoint = reader.string(); break; case /* int64 base_fee_msat */ 2: - message.baseFeeMsat = reader.int64().toString(); + message.baseFeeMsat = reader.int64().toBigInt(); break; case /* int64 fee_per_mil */ 3: - message.feePerMil = reader.int64().toString(); + message.feePerMil = reader.int64().toBigInt(); break; case /* double fee_rate */ 4: message.feeRate = reader.double(); @@ -16090,10 +18606,10 @@ class ChannelFeeReport$Type extends MessageType { if (message.channelPoint !== "") writer.tag(1, WireType.LengthDelimited).string(message.channelPoint); /* int64 base_fee_msat = 2; */ - if (message.baseFeeMsat !== "0") + if (message.baseFeeMsat !== 0n) writer.tag(2, WireType.Varint).int64(message.baseFeeMsat); /* int64 fee_per_mil = 3; */ - if (message.feePerMil !== "0") + if (message.feePerMil !== 0n) writer.tag(3, WireType.Varint).int64(message.feePerMil); /* double fee_rate = 4; */ if (message.feeRate !== 0) @@ -16113,13 +18629,13 @@ class FeeReportResponse$Type extends MessageType { constructor() { super("lnrpc.FeeReportResponse", [ { no: 1, name: "channel_fees", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelFeeReport }, - { no: 2, name: "day_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "week_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 4, name: "month_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 2, name: "day_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "week_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "month_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): FeeReportResponse { - const message = { channelFees: [], dayFeeSum: "0", weekFeeSum: "0", monthFeeSum: "0" }; + const message = { channelFees: [], dayFeeSum: 0n, weekFeeSum: 0n, monthFeeSum: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -16134,13 +18650,13 @@ class FeeReportResponse$Type extends MessageType { message.channelFees.push(ChannelFeeReport.internalBinaryRead(reader, reader.uint32(), options)); break; case /* uint64 day_fee_sum */ 2: - message.dayFeeSum = reader.uint64().toString(); + message.dayFeeSum = reader.uint64().toBigInt(); break; case /* uint64 week_fee_sum */ 3: - message.weekFeeSum = reader.uint64().toString(); + message.weekFeeSum = reader.uint64().toBigInt(); break; case /* uint64 month_fee_sum */ 4: - message.monthFeeSum = reader.uint64().toString(); + message.monthFeeSum = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -16158,13 +18674,13 @@ class FeeReportResponse$Type extends MessageType { for (let i = 0; i < message.channelFees.length; i++) ChannelFeeReport.internalBinaryWrite(message.channelFees[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* uint64 day_fee_sum = 2; */ - if (message.dayFeeSum !== "0") + if (message.dayFeeSum !== 0n) writer.tag(2, WireType.Varint).uint64(message.dayFeeSum); /* uint64 week_fee_sum = 3; */ - if (message.weekFeeSum !== "0") + if (message.weekFeeSum !== 0n) writer.tag(3, WireType.Varint).uint64(message.weekFeeSum); /* uint64 month_fee_sum = 4; */ - if (message.monthFeeSum !== "0") + if (message.monthFeeSum !== 0n) writer.tag(4, WireType.Varint).uint64(message.monthFeeSum); let u = options.writeUnknownFields; if (u !== false) @@ -16182,16 +18698,17 @@ class PolicyUpdateRequest$Type extends MessageType { super("lnrpc.PolicyUpdateRequest", [ { no: 1, name: "global", kind: "scalar", oneof: "scope", T: 8 /*ScalarType.BOOL*/ }, { no: 2, name: "chan_point", kind: "message", oneof: "scope", T: () => ChannelPoint }, - { no: 3, name: "base_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 3, name: "base_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "fee_rate", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 9, name: "fee_rate_ppm", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 5, name: "time_lock_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "max_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 7, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 6, name: "max_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 8, name: "min_htlc_msat_specified", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): PolicyUpdateRequest { - const message = { scope: { oneofKind: undefined }, baseFeeMsat: "0", feeRate: 0, timeLockDelta: 0, maxHtlcMsat: "0", minHtlcMsat: "0", minHtlcMsatSpecified: false }; + const message = { scope: { oneofKind: undefined }, baseFeeMsat: 0n, feeRate: 0, feeRatePpm: 0, timeLockDelta: 0, maxHtlcMsat: 0n, minHtlcMsat: 0n, minHtlcMsatSpecified: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -16215,19 +18732,22 @@ class PolicyUpdateRequest$Type extends MessageType { }; break; case /* int64 base_fee_msat */ 3: - message.baseFeeMsat = reader.int64().toString(); + message.baseFeeMsat = reader.int64().toBigInt(); break; case /* double fee_rate */ 4: message.feeRate = reader.double(); break; + case /* uint32 fee_rate_ppm */ 9: + message.feeRatePpm = reader.uint32(); + break; case /* uint32 time_lock_delta */ 5: message.timeLockDelta = reader.uint32(); break; case /* uint64 max_htlc_msat */ 6: - message.maxHtlcMsat = reader.uint64().toString(); + message.maxHtlcMsat = reader.uint64().toBigInt(); break; case /* uint64 min_htlc_msat */ 7: - message.minHtlcMsat = reader.uint64().toString(); + message.minHtlcMsat = reader.uint64().toBigInt(); break; case /* bool min_htlc_msat_specified */ 8: message.minHtlcMsatSpecified = reader.bool(); @@ -16251,19 +18771,22 @@ class PolicyUpdateRequest$Type extends MessageType { if (message.scope.oneofKind === "chanPoint") ChannelPoint.internalBinaryWrite(message.scope.chanPoint, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); /* int64 base_fee_msat = 3; */ - if (message.baseFeeMsat !== "0") + if (message.baseFeeMsat !== 0n) writer.tag(3, WireType.Varint).int64(message.baseFeeMsat); /* double fee_rate = 4; */ if (message.feeRate !== 0) writer.tag(4, WireType.Bit64).double(message.feeRate); + /* uint32 fee_rate_ppm = 9; */ + if (message.feeRatePpm !== 0) + writer.tag(9, WireType.Varint).uint32(message.feeRatePpm); /* uint32 time_lock_delta = 5; */ if (message.timeLockDelta !== 0) writer.tag(5, WireType.Varint).uint32(message.timeLockDelta); /* uint64 max_htlc_msat = 6; */ - if (message.maxHtlcMsat !== "0") + if (message.maxHtlcMsat !== 0n) writer.tag(6, WireType.Varint).uint64(message.maxHtlcMsat); /* uint64 min_htlc_msat = 7; */ - if (message.minHtlcMsat !== "0") + if (message.minHtlcMsat !== 0n) writer.tag(7, WireType.Varint).uint64(message.minHtlcMsat); /* bool min_htlc_msat_specified = 8; */ if (message.minHtlcMsatSpecified !== false) @@ -16279,21 +18802,103 @@ class PolicyUpdateRequest$Type extends MessageType { */ export const PolicyUpdateRequest = new PolicyUpdateRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods +class FailedUpdate$Type extends MessageType { + constructor() { + super("lnrpc.FailedUpdate", [ + { no: 1, name: "outpoint", kind: "message", T: () => OutPoint }, + { no: 2, name: "reason", kind: "enum", T: () => ["lnrpc.UpdateFailure", UpdateFailure, "UPDATE_FAILURE_"] }, + { no: 3, name: "update_error", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): FailedUpdate { + const message = { reason: 0, updateError: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FailedUpdate): FailedUpdate { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* lnrpc.OutPoint outpoint */ 1: + message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); + break; + case /* lnrpc.UpdateFailure reason */ 2: + message.reason = reader.int32(); + break; + case /* string update_error */ 3: + message.updateError = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FailedUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* lnrpc.OutPoint outpoint = 1; */ + if (message.outpoint) + OutPoint.internalBinaryWrite(message.outpoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.UpdateFailure reason = 2; */ + if (message.reason !== 0) + writer.tag(2, WireType.Varint).int32(message.reason); + /* string update_error = 3; */ + if (message.updateError !== "") + writer.tag(3, WireType.LengthDelimited).string(message.updateError); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.FailedUpdate + */ +export const FailedUpdate = new FailedUpdate$Type(); +// @generated message type with reflection information, may provide speed optimized methods class PolicyUpdateResponse$Type extends MessageType { constructor() { - super("lnrpc.PolicyUpdateResponse", []); + super("lnrpc.PolicyUpdateResponse", [ + { no: 1, name: "failed_updates", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => FailedUpdate } + ]); } create(value?: PartialMessage): PolicyUpdateResponse { - const message = {}; + const message = { failedUpdates: [] }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PolicyUpdateResponse): PolicyUpdateResponse { - return target ?? this.create(); + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated lnrpc.FailedUpdate failed_updates */ 1: + message.failedUpdates.push(FailedUpdate.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } internalBinaryWrite(message: PolicyUpdateResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated lnrpc.FailedUpdate failed_updates = 1; */ + for (let i = 0; i < message.failedUpdates.length; i++) + FailedUpdate.internalBinaryWrite(message.failedUpdates[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -16308,14 +18913,15 @@ export const PolicyUpdateResponse = new PolicyUpdateResponse$Type(); class ForwardingHistoryRequest$Type extends MessageType { constructor() { super("lnrpc.ForwardingHistoryRequest", [ - { no: 1, name: "start_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "end_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 1, name: "start_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "end_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 3, name: "index_offset", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "num_max_events", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } + { no: 4, name: "num_max_events", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "peer_alias_lookup", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): ForwardingHistoryRequest { - const message = { startTime: "0", endTime: "0", indexOffset: 0, numMaxEvents: 0 }; + const message = { startTime: 0n, endTime: 0n, indexOffset: 0, numMaxEvents: 0, peerAliasLookup: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -16327,10 +18933,10 @@ class ForwardingHistoryRequest$Type extends MessageType { constructor() { super("lnrpc.ForwardingEvent", [ - { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 2, name: "chan_id_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, { no: 4, name: "chan_id_out", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 5, name: "amt_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 6, name: "amt_out", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 7, name: "fee", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 8, name: "fee_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 9, name: "amt_in_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 10, name: "amt_out_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 11, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 5, name: "amt_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "amt_out", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "fee", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 8, name: "fee_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 9, name: "amt_in_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 10, name: "amt_out_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 11, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "peer_alias_in", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 13, name: "peer_alias_out", kind: "scalar", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): ForwardingEvent { - const message = { timestamp: "0", chanIdIn: "0", chanIdOut: "0", amtIn: "0", amtOut: "0", fee: "0", feeMsat: "0", amtInMsat: "0", amtOutMsat: "0", timestampNs: "0" }; + const message = { timestamp: 0n, chanIdIn: "0", chanIdOut: "0", amtIn: 0n, amtOut: 0n, fee: 0n, feeMsat: 0n, amtInMsat: 0n, amtOutMsat: 0n, timestampNs: 0n, peerAliasIn: "", peerAliasOut: "" }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -16401,7 +19015,7 @@ class ForwardingEvent$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 timestamp = 1 [deprecated = true];*/ 1: - message.timestamp = reader.uint64().toString(); + message.timestamp = reader.uint64().toBigInt(); break; case /* uint64 chan_id_in = 2 [jstype = JS_STRING];*/ 2: message.chanIdIn = reader.uint64().toString(); @@ -16410,25 +19024,31 @@ class ForwardingEvent$Type extends MessageType { message.chanIdOut = reader.uint64().toString(); break; case /* uint64 amt_in */ 5: - message.amtIn = reader.uint64().toString(); + message.amtIn = reader.uint64().toBigInt(); break; case /* uint64 amt_out */ 6: - message.amtOut = reader.uint64().toString(); + message.amtOut = reader.uint64().toBigInt(); break; case /* uint64 fee */ 7: - message.fee = reader.uint64().toString(); + message.fee = reader.uint64().toBigInt(); break; case /* uint64 fee_msat */ 8: - message.feeMsat = reader.uint64().toString(); + message.feeMsat = reader.uint64().toBigInt(); break; case /* uint64 amt_in_msat */ 9: - message.amtInMsat = reader.uint64().toString(); + message.amtInMsat = reader.uint64().toBigInt(); break; case /* uint64 amt_out_msat */ 10: - message.amtOutMsat = reader.uint64().toString(); + message.amtOutMsat = reader.uint64().toBigInt(); break; case /* uint64 timestamp_ns */ 11: - message.timestampNs = reader.uint64().toString(); + message.timestampNs = reader.uint64().toBigInt(); + break; + case /* string peer_alias_in */ 12: + message.peerAliasIn = reader.string(); + break; + case /* string peer_alias_out */ 13: + message.peerAliasOut = reader.string(); break; default: let u = options.readUnknownField; @@ -16443,7 +19063,7 @@ class ForwardingEvent$Type extends MessageType { } internalBinaryWrite(message: ForwardingEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 timestamp = 1 [deprecated = true]; */ - if (message.timestamp !== "0") + if (message.timestamp !== 0n) writer.tag(1, WireType.Varint).uint64(message.timestamp); /* uint64 chan_id_in = 2 [jstype = JS_STRING]; */ if (message.chanIdIn !== "0") @@ -16452,26 +19072,32 @@ class ForwardingEvent$Type extends MessageType { if (message.chanIdOut !== "0") writer.tag(4, WireType.Varint).uint64(message.chanIdOut); /* uint64 amt_in = 5; */ - if (message.amtIn !== "0") + if (message.amtIn !== 0n) writer.tag(5, WireType.Varint).uint64(message.amtIn); /* uint64 amt_out = 6; */ - if (message.amtOut !== "0") + if (message.amtOut !== 0n) writer.tag(6, WireType.Varint).uint64(message.amtOut); /* uint64 fee = 7; */ - if (message.fee !== "0") + if (message.fee !== 0n) writer.tag(7, WireType.Varint).uint64(message.fee); /* uint64 fee_msat = 8; */ - if (message.feeMsat !== "0") + if (message.feeMsat !== 0n) writer.tag(8, WireType.Varint).uint64(message.feeMsat); /* uint64 amt_in_msat = 9; */ - if (message.amtInMsat !== "0") + if (message.amtInMsat !== 0n) writer.tag(9, WireType.Varint).uint64(message.amtInMsat); /* uint64 amt_out_msat = 10; */ - if (message.amtOutMsat !== "0") + if (message.amtOutMsat !== 0n) writer.tag(10, WireType.Varint).uint64(message.amtOutMsat); /* uint64 timestamp_ns = 11; */ - if (message.timestampNs !== "0") + if (message.timestampNs !== 0n) writer.tag(11, WireType.Varint).uint64(message.timestampNs); + /* string peer_alias_in = 12; */ + if (message.peerAliasIn !== "") + writer.tag(12, WireType.LengthDelimited).string(message.peerAliasIn); + /* string peer_alias_out = 13; */ + if (message.peerAliasOut !== "") + writer.tag(13, WireType.LengthDelimited).string(message.peerAliasOut); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -17015,11 +19641,12 @@ class BakeMacaroonRequest$Type extends MessageType { constructor() { super("lnrpc.BakeMacaroonRequest", [ { no: 1, name: "permissions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MacaroonPermission }, - { no: 2, name: "root_key_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 2, name: "root_key_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "allow_external_permissions", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): BakeMacaroonRequest { - const message = { permissions: [], rootKeyId: "0" }; + const message = { permissions: [], rootKeyId: 0n, allowExternalPermissions: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -17034,7 +19661,10 @@ class BakeMacaroonRequest$Type extends MessageType { message.permissions.push(MacaroonPermission.internalBinaryRead(reader, reader.uint32(), options)); break; case /* uint64 root_key_id */ 2: - message.rootKeyId = reader.uint64().toString(); + message.rootKeyId = reader.uint64().toBigInt(); + break; + case /* bool allow_external_permissions */ 3: + message.allowExternalPermissions = reader.bool(); break; default: let u = options.readUnknownField; @@ -17052,8 +19682,11 @@ class BakeMacaroonRequest$Type extends MessageType { for (let i = 0; i < message.permissions.length; i++) MacaroonPermission.internalBinaryWrite(message.permissions[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* uint64 root_key_id = 2; */ - if (message.rootKeyId !== "0") + if (message.rootKeyId !== 0n) writer.tag(2, WireType.Varint).uint64(message.rootKeyId); + /* bool allow_external_permissions = 3; */ + if (message.allowExternalPermissions !== false) + writer.tag(3, WireType.Varint).bool(message.allowExternalPermissions); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -17141,7 +19774,7 @@ export const ListMacaroonIDsRequest = new ListMacaroonIDsRequest$Type(); class ListMacaroonIDsResponse$Type extends MessageType { constructor() { super("lnrpc.ListMacaroonIDsResponse", [ - { no: 1, name: "root_key_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/ } + { no: 1, name: "root_key_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): ListMacaroonIDsResponse { @@ -17159,9 +19792,9 @@ class ListMacaroonIDsResponse$Type extends MessageType case /* repeated uint64 root_key_ids */ 1: if (wireType === WireType.LengthDelimited) for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.rootKeyIds.push(reader.uint64().toString()); + message.rootKeyIds.push(reader.uint64().toBigInt()); else - message.rootKeyIds.push(reader.uint64().toString()); + message.rootKeyIds.push(reader.uint64().toBigInt()); break; default: let u = options.readUnknownField; @@ -17196,11 +19829,11 @@ export const ListMacaroonIDsResponse = new ListMacaroonIDsResponse$Type(); class DeleteMacaroonIDRequest$Type extends MessageType { constructor() { super("lnrpc.DeleteMacaroonIDRequest", [ - { no: 1, name: "root_key_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 1, name: "root_key_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): DeleteMacaroonIDRequest { - const message = { rootKeyId: "0" }; + const message = { rootKeyId: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -17212,7 +19845,7 @@ class DeleteMacaroonIDRequest$Type extends MessageType let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 root_key_id */ 1: - message.rootKeyId = reader.uint64().toString(); + message.rootKeyId = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -17227,7 +19860,7 @@ class DeleteMacaroonIDRequest$Type extends MessageType } internalBinaryWrite(message: DeleteMacaroonIDRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 root_key_id = 1; */ - if (message.rootKeyId !== "0") + if (message.rootKeyId !== 0n) writer.tag(1, WireType.Varint).uint64(message.rootKeyId); let u = options.writeUnknownFields; if (u !== false) @@ -17432,7 +20065,7 @@ class Failure$Type extends MessageType { super("lnrpc.Failure", [ { no: 1, name: "code", kind: "enum", T: () => ["lnrpc.Failure.FailureCode", Failure_FailureCode] }, { no: 3, name: "channel_update", kind: "message", T: () => ChannelUpdate }, - { no: 4, name: "htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 5, name: "onion_sha_256", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 6, name: "cltv_expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 7, name: "flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, @@ -17441,7 +20074,7 @@ class Failure$Type extends MessageType { ]); } create(value?: PartialMessage): Failure { - const message = { code: 0, htlcMsat: "0", onionSha256: new Uint8Array(0), cltvExpiry: 0, flags: 0, failureSourceIndex: 0, height: 0 }; + const message = { code: 0, htlcMsat: 0n, onionSha256: new Uint8Array(0), cltvExpiry: 0, flags: 0, failureSourceIndex: 0, height: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -17459,7 +20092,7 @@ class Failure$Type extends MessageType { message.channelUpdate = ChannelUpdate.internalBinaryRead(reader, reader.uint32(), options, message.channelUpdate); break; case /* uint64 htlc_msat */ 4: - message.htlcMsat = reader.uint64().toString(); + message.htlcMsat = reader.uint64().toBigInt(); break; case /* bytes onion_sha_256 */ 5: message.onionSha256 = reader.bytes(); @@ -17495,7 +20128,7 @@ class Failure$Type extends MessageType { if (message.channelUpdate) ChannelUpdate.internalBinaryWrite(message.channelUpdate, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); /* uint64 htlc_msat = 4; */ - if (message.htlcMsat !== "0") + if (message.htlcMsat !== 0n) writer.tag(4, WireType.Varint).uint64(message.htlcMsat); /* bytes onion_sha_256 = 5; */ if (message.onionSha256.length) @@ -17533,15 +20166,15 @@ class ChannelUpdate$Type extends MessageType { { no: 10, name: "message_flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 5, name: "channel_flags", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 6, name: "time_lock_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 7, name: "htlc_minimum_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 7, name: "htlc_minimum_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 8, name: "base_fee", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 9, name: "fee_rate", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 11, name: "htlc_maximum_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 11, name: "htlc_maximum_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 12, name: "extra_opaque_data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } ]); } create(value?: PartialMessage): ChannelUpdate { - const message = { signature: new Uint8Array(0), chainHash: new Uint8Array(0), chanId: "0", timestamp: 0, messageFlags: 0, channelFlags: 0, timeLockDelta: 0, htlcMinimumMsat: "0", baseFee: 0, feeRate: 0, htlcMaximumMsat: "0", extraOpaqueData: new Uint8Array(0) }; + const message = { signature: new Uint8Array(0), chainHash: new Uint8Array(0), chanId: "0", timestamp: 0, messageFlags: 0, channelFlags: 0, timeLockDelta: 0, htlcMinimumMsat: 0n, baseFee: 0, feeRate: 0, htlcMaximumMsat: 0n, extraOpaqueData: new Uint8Array(0) }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -17574,7 +20207,7 @@ class ChannelUpdate$Type extends MessageType { message.timeLockDelta = reader.uint32(); break; case /* uint64 htlc_minimum_msat */ 7: - message.htlcMinimumMsat = reader.uint64().toString(); + message.htlcMinimumMsat = reader.uint64().toBigInt(); break; case /* uint32 base_fee */ 8: message.baseFee = reader.uint32(); @@ -17583,7 +20216,7 @@ class ChannelUpdate$Type extends MessageType { message.feeRate = reader.uint32(); break; case /* uint64 htlc_maximum_msat */ 11: - message.htlcMaximumMsat = reader.uint64().toString(); + message.htlcMaximumMsat = reader.uint64().toBigInt(); break; case /* bytes extra_opaque_data */ 12: message.extraOpaqueData = reader.bytes(); @@ -17622,7 +20255,7 @@ class ChannelUpdate$Type extends MessageType { if (message.timeLockDelta !== 0) writer.tag(6, WireType.Varint).uint32(message.timeLockDelta); /* uint64 htlc_minimum_msat = 7; */ - if (message.htlcMinimumMsat !== "0") + if (message.htlcMinimumMsat !== 0n) writer.tag(7, WireType.Varint).uint64(message.htlcMinimumMsat); /* uint32 base_fee = 8; */ if (message.baseFee !== 0) @@ -17631,7 +20264,7 @@ class ChannelUpdate$Type extends MessageType { if (message.feeRate !== 0) writer.tag(9, WireType.Varint).uint32(message.feeRate); /* uint64 htlc_maximum_msat = 11; */ - if (message.htlcMaximumMsat !== "0") + if (message.htlcMaximumMsat !== 0n) writer.tag(11, WireType.Varint).uint64(message.htlcMaximumMsat); /* bytes extra_opaque_data = 12; */ if (message.extraOpaqueData.length) @@ -17761,6 +20394,533 @@ class Op$Type extends MessageType { * @generated MessageType for protobuf message lnrpc.Op */ export const Op = new Op$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckMacPermRequest$Type extends MessageType { + constructor() { + super("lnrpc.CheckMacPermRequest", [ + { no: 1, name: "macaroon", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 2, name: "permissions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MacaroonPermission }, + { no: 3, name: "fullMethod", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): CheckMacPermRequest { + const message = { macaroon: new Uint8Array(0), permissions: [], fullMethod: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CheckMacPermRequest): CheckMacPermRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes macaroon */ 1: + message.macaroon = reader.bytes(); + break; + case /* repeated lnrpc.MacaroonPermission permissions */ 2: + message.permissions.push(MacaroonPermission.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string fullMethod */ 3: + message.fullMethod = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CheckMacPermRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes macaroon = 1; */ + if (message.macaroon.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.macaroon); + /* repeated lnrpc.MacaroonPermission permissions = 2; */ + for (let i = 0; i < message.permissions.length; i++) + MacaroonPermission.internalBinaryWrite(message.permissions[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* string fullMethod = 3; */ + if (message.fullMethod !== "") + writer.tag(3, WireType.LengthDelimited).string(message.fullMethod); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.CheckMacPermRequest + */ +export const CheckMacPermRequest = new CheckMacPermRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CheckMacPermResponse$Type extends MessageType { + constructor() { + super("lnrpc.CheckMacPermResponse", [ + { no: 1, name: "valid", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): CheckMacPermResponse { + const message = { valid: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CheckMacPermResponse): CheckMacPermResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool valid */ 1: + message.valid = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: CheckMacPermResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool valid = 1; */ + if (message.valid !== false) + writer.tag(1, WireType.Varint).bool(message.valid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.CheckMacPermResponse + */ +export const CheckMacPermResponse = new CheckMacPermResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RPCMiddlewareRequest$Type extends MessageType { + constructor() { + super("lnrpc.RPCMiddlewareRequest", [ + { no: 1, name: "request_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "raw_macaroon", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "custom_caveat_condition", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "stream_auth", kind: "message", oneof: "interceptType", T: () => StreamAuth }, + { no: 5, name: "request", kind: "message", oneof: "interceptType", T: () => RPCMessage }, + { no: 6, name: "response", kind: "message", oneof: "interceptType", T: () => RPCMessage }, + { no: 8, name: "reg_complete", kind: "scalar", oneof: "interceptType", T: 8 /*ScalarType.BOOL*/ }, + { no: 7, name: "msg_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): RPCMiddlewareRequest { + const message = { requestId: 0n, rawMacaroon: new Uint8Array(0), customCaveatCondition: "", interceptType: { oneofKind: undefined }, msgId: 0n }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMiddlewareRequest): RPCMiddlewareRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 request_id */ 1: + message.requestId = reader.uint64().toBigInt(); + break; + case /* bytes raw_macaroon */ 2: + message.rawMacaroon = reader.bytes(); + break; + case /* string custom_caveat_condition */ 3: + message.customCaveatCondition = reader.string(); + break; + case /* lnrpc.StreamAuth stream_auth */ 4: + message.interceptType = { + oneofKind: "streamAuth", + streamAuth: StreamAuth.internalBinaryRead(reader, reader.uint32(), options, (message.interceptType as any).streamAuth) + }; + break; + case /* lnrpc.RPCMessage request */ 5: + message.interceptType = { + oneofKind: "request", + request: RPCMessage.internalBinaryRead(reader, reader.uint32(), options, (message.interceptType as any).request) + }; + break; + case /* lnrpc.RPCMessage response */ 6: + message.interceptType = { + oneofKind: "response", + response: RPCMessage.internalBinaryRead(reader, reader.uint32(), options, (message.interceptType as any).response) + }; + break; + case /* bool reg_complete */ 8: + message.interceptType = { + oneofKind: "regComplete", + regComplete: reader.bool() + }; + break; + case /* uint64 msg_id */ 7: + message.msgId = reader.uint64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RPCMiddlewareRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 request_id = 1; */ + if (message.requestId !== 0n) + writer.tag(1, WireType.Varint).uint64(message.requestId); + /* bytes raw_macaroon = 2; */ + if (message.rawMacaroon.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.rawMacaroon); + /* string custom_caveat_condition = 3; */ + if (message.customCaveatCondition !== "") + writer.tag(3, WireType.LengthDelimited).string(message.customCaveatCondition); + /* lnrpc.StreamAuth stream_auth = 4; */ + if (message.interceptType.oneofKind === "streamAuth") + StreamAuth.internalBinaryWrite(message.interceptType.streamAuth, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.RPCMessage request = 5; */ + if (message.interceptType.oneofKind === "request") + RPCMessage.internalBinaryWrite(message.interceptType.request, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.RPCMessage response = 6; */ + if (message.interceptType.oneofKind === "response") + RPCMessage.internalBinaryWrite(message.interceptType.response, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* bool reg_complete = 8; */ + if (message.interceptType.oneofKind === "regComplete") + writer.tag(8, WireType.Varint).bool(message.interceptType.regComplete); + /* uint64 msg_id = 7; */ + if (message.msgId !== 0n) + writer.tag(7, WireType.Varint).uint64(message.msgId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.RPCMiddlewareRequest + */ +export const RPCMiddlewareRequest = new RPCMiddlewareRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StreamAuth$Type extends MessageType { + constructor() { + super("lnrpc.StreamAuth", [ + { no: 1, name: "method_full_uri", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): StreamAuth { + const message = { methodFullUri: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StreamAuth): StreamAuth { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string method_full_uri */ 1: + message.methodFullUri = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: StreamAuth, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string method_full_uri = 1; */ + if (message.methodFullUri !== "") + writer.tag(1, WireType.LengthDelimited).string(message.methodFullUri); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.StreamAuth + */ +export const StreamAuth = new StreamAuth$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RPCMessage$Type extends MessageType { + constructor() { + super("lnrpc.RPCMessage", [ + { no: 1, name: "method_full_uri", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "stream_rpc", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "type_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "serialized", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 5, name: "is_error", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): RPCMessage { + const message = { methodFullUri: "", streamRpc: false, typeName: "", serialized: new Uint8Array(0), isError: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMessage): RPCMessage { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string method_full_uri */ 1: + message.methodFullUri = reader.string(); + break; + case /* bool stream_rpc */ 2: + message.streamRpc = reader.bool(); + break; + case /* string type_name */ 3: + message.typeName = reader.string(); + break; + case /* bytes serialized */ 4: + message.serialized = reader.bytes(); + break; + case /* bool is_error */ 5: + message.isError = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RPCMessage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string method_full_uri = 1; */ + if (message.methodFullUri !== "") + writer.tag(1, WireType.LengthDelimited).string(message.methodFullUri); + /* bool stream_rpc = 2; */ + if (message.streamRpc !== false) + writer.tag(2, WireType.Varint).bool(message.streamRpc); + /* string type_name = 3; */ + if (message.typeName !== "") + writer.tag(3, WireType.LengthDelimited).string(message.typeName); + /* bytes serialized = 4; */ + if (message.serialized.length) + writer.tag(4, WireType.LengthDelimited).bytes(message.serialized); + /* bool is_error = 5; */ + if (message.isError !== false) + writer.tag(5, WireType.Varint).bool(message.isError); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.RPCMessage + */ +export const RPCMessage = new RPCMessage$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RPCMiddlewareResponse$Type extends MessageType { + constructor() { + super("lnrpc.RPCMiddlewareResponse", [ + { no: 1, name: "ref_msg_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "register", kind: "message", oneof: "middlewareMessage", T: () => MiddlewareRegistration }, + { no: 3, name: "feedback", kind: "message", oneof: "middlewareMessage", T: () => InterceptFeedback } + ]); + } + create(value?: PartialMessage): RPCMiddlewareResponse { + const message = { refMsgId: 0n, middlewareMessage: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMiddlewareResponse): RPCMiddlewareResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint64 ref_msg_id */ 1: + message.refMsgId = reader.uint64().toBigInt(); + break; + case /* lnrpc.MiddlewareRegistration register */ 2: + message.middlewareMessage = { + oneofKind: "register", + register: MiddlewareRegistration.internalBinaryRead(reader, reader.uint32(), options, (message.middlewareMessage as any).register) + }; + break; + case /* lnrpc.InterceptFeedback feedback */ 3: + message.middlewareMessage = { + oneofKind: "feedback", + feedback: InterceptFeedback.internalBinaryRead(reader, reader.uint32(), options, (message.middlewareMessage as any).feedback) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RPCMiddlewareResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint64 ref_msg_id = 1; */ + if (message.refMsgId !== 0n) + writer.tag(1, WireType.Varint).uint64(message.refMsgId); + /* lnrpc.MiddlewareRegistration register = 2; */ + if (message.middlewareMessage.oneofKind === "register") + MiddlewareRegistration.internalBinaryWrite(message.middlewareMessage.register, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* lnrpc.InterceptFeedback feedback = 3; */ + if (message.middlewareMessage.oneofKind === "feedback") + InterceptFeedback.internalBinaryWrite(message.middlewareMessage.feedback, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.RPCMiddlewareResponse + */ +export const RPCMiddlewareResponse = new RPCMiddlewareResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MiddlewareRegistration$Type extends MessageType { + constructor() { + super("lnrpc.MiddlewareRegistration", [ + { no: 1, name: "middleware_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "custom_macaroon_caveat_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "read_only_mode", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): MiddlewareRegistration { + const message = { middlewareName: "", customMacaroonCaveatName: "", readOnlyMode: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MiddlewareRegistration): MiddlewareRegistration { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string middleware_name */ 1: + message.middlewareName = reader.string(); + break; + case /* string custom_macaroon_caveat_name */ 2: + message.customMacaroonCaveatName = reader.string(); + break; + case /* bool read_only_mode */ 3: + message.readOnlyMode = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MiddlewareRegistration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string middleware_name = 1; */ + if (message.middlewareName !== "") + writer.tag(1, WireType.LengthDelimited).string(message.middlewareName); + /* string custom_macaroon_caveat_name = 2; */ + if (message.customMacaroonCaveatName !== "") + writer.tag(2, WireType.LengthDelimited).string(message.customMacaroonCaveatName); + /* bool read_only_mode = 3; */ + if (message.readOnlyMode !== false) + writer.tag(3, WireType.Varint).bool(message.readOnlyMode); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.MiddlewareRegistration + */ +export const MiddlewareRegistration = new MiddlewareRegistration$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class InterceptFeedback$Type extends MessageType { + constructor() { + super("lnrpc.InterceptFeedback", [ + { no: 1, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "replace_response", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "replacement_serialized", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); + } + create(value?: PartialMessage): InterceptFeedback { + const message = { error: "", replaceResponse: false, replacementSerialized: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InterceptFeedback): InterceptFeedback { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string error */ 1: + message.error = reader.string(); + break; + case /* bool replace_response */ 2: + message.replaceResponse = reader.bool(); + break; + case /* bytes replacement_serialized */ 3: + message.replacementSerialized = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: InterceptFeedback, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string error = 1; */ + if (message.error !== "") + writer.tag(1, WireType.LengthDelimited).string(message.error); + /* bool replace_response = 2; */ + if (message.replaceResponse !== false) + writer.tag(2, WireType.Varint).bool(message.replaceResponse); + /* bytes replacement_serialized = 3; */ + if (message.replacementSerialized.length) + writer.tag(3, WireType.LengthDelimited).bytes(message.replacementSerialized); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message lnrpc.InterceptFeedback + */ +export const InterceptFeedback = new InterceptFeedback$Type(); /** * @generated ServiceType for protobuf service lnrpc.Lightning */ @@ -17788,6 +20948,7 @@ export const Lightning = new ServiceType("lnrpc.Lightning", [ { name: "ClosedChannels", options: {}, I: ClosedChannelsRequest, O: ClosedChannelsResponse }, { name: "OpenChannelSync", options: {}, I: OpenChannelRequest, O: ChannelPoint }, { name: "OpenChannel", serverStreaming: true, options: {}, I: OpenChannelRequest, O: OpenStatusUpdate }, + { name: "BatchOpenChannel", options: {}, I: BatchOpenChannelRequest, O: BatchOpenChannelResponse }, { name: "FundingStateStep", options: {}, I: FundingTransitionMsg, O: FundingStateStepResp }, { name: "ChannelAcceptor", serverStreaming: true, clientStreaming: true, options: {}, I: ChannelAcceptResponse, O: ChannelAcceptRequest }, { name: "CloseChannel", serverStreaming: true, options: {}, I: CloseChannelRequest, O: CloseStatusUpdate }, @@ -17802,6 +20963,7 @@ export const Lightning = new ServiceType("lnrpc.Lightning", [ { name: "SubscribeInvoices", serverStreaming: true, options: {}, I: InvoiceSubscription, O: Invoice }, { name: "DecodePayReq", options: {}, I: PayReqString, O: PayReq }, { name: "ListPayments", options: {}, I: ListPaymentsRequest, O: ListPaymentsResponse }, + { name: "DeletePayment", options: {}, I: DeletePaymentRequest, O: DeletePaymentResponse }, { name: "DeleteAllPayments", options: {}, I: DeleteAllPaymentsRequest, O: DeleteAllPaymentsResponse }, { name: "DescribeGraph", options: {}, I: ChannelGraphRequest, O: ChannelGraph }, { name: "GetNodeMetrics", options: {}, I: NodeMetricsRequest, O: NodeMetricsResponse }, @@ -17823,5 +20985,11 @@ export const Lightning = new ServiceType("lnrpc.Lightning", [ { name: "BakeMacaroon", options: {}, I: BakeMacaroonRequest, O: BakeMacaroonResponse }, { name: "ListMacaroonIDs", options: {}, I: ListMacaroonIDsRequest, O: ListMacaroonIDsResponse }, { name: "DeleteMacaroonID", options: {}, I: DeleteMacaroonIDRequest, O: DeleteMacaroonIDResponse }, - { name: "ListPermissions", options: {}, I: ListPermissionsRequest, O: ListPermissionsResponse } + { name: "ListPermissions", options: {}, I: ListPermissionsRequest, O: ListPermissionsResponse }, + { name: "CheckMacaroonPermissions", options: {}, I: CheckMacPermRequest, O: CheckMacPermResponse }, + { name: "RegisterRPCMiddleware", serverStreaming: true, clientStreaming: true, options: {}, I: RPCMiddlewareResponse, O: RPCMiddlewareRequest }, + { name: "SendCustomMessage", options: {}, I: SendCustomMessageRequest, O: SendCustomMessageResponse }, + { name: "SubscribeCustomMessages", serverStreaming: true, options: {}, I: SubscribeCustomMessagesRequest, O: CustomMessage }, + { name: "ListAliases", options: {}, I: ListAliasesRequest, O: ListAliasesResponse }, + { name: "LookupHtlc", options: {}, I: LookupHtlcRequest, O: LookupHtlcResponse } ]); diff --git a/proto/lnd/router.client.ts b/proto/lnd/router.client.ts index 9e3b5871..6502d78b 100644 --- a/proto/lnd/router.client.ts +++ b/proto/lnd/router.client.ts @@ -1,4 +1,4 @@ -// @generated by protobuf-ts 2.5.0 with parameter long_type_string +// @generated by protobuf-ts 2.5.0 // @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) // tslint:disable import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; @@ -26,15 +26,16 @@ import type { QueryMissionControlResponse } from "./router"; import type { QueryMissionControlRequest } from "./router"; import type { ResetMissionControlResponse } from "./router"; import type { ResetMissionControlRequest } from "./router"; -import type { HTLCAttempt } from "./rpc"; +import type { HTLCAttempt } from "./lightning"; import type { SendToRouteResponse } from "./router"; import type { SendToRouteRequest } from "./router"; import type { RouteFeeResponse } from "./router"; import type { RouteFeeRequest } from "./router"; import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; +import type { TrackPaymentsRequest } from "./router"; import type { TrackPaymentRequest } from "./router"; import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -import type { Payment } from "./rpc"; +import type { Payment } from "./lightning"; import type { SendPaymentRequest } from "./router"; import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; @@ -62,6 +63,18 @@ export interface IRouterClient { * @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment); */ trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall; + /** + * + * TrackPayments returns an update stream for every payment that is not in a + * terminal state. Note that if payments are in-flight while starting a new + * subscription, the start of the payment stream could produce out-of-order + * and/or duplicate events. In order to get updates for every in-flight + * payment attempt make sure to subscribe to this method before initiating any + * payments. + * + * @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment); + */ + trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall; /** * * EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it @@ -234,6 +247,21 @@ export class RouterClient implements IRouterClient, ServiceInfo { const method = this.methods[1], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } + /** + * + * TrackPayments returns an update stream for every payment that is not in a + * terminal state. Note that if payments are in-flight while starting a new + * subscription, the start of the payment stream could produce out-of-order + * and/or duplicate events. In order to get updates for every in-flight + * payment attempt make sure to subscribe to this method before initiating any + * payments. + * + * @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment); + */ + trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall { + const method = this.methods[2], opt = this._transport.mergeOptions(options); + return stackIntercept("serverStreaming", this._transport, method, opt, input); + } /** * * EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it @@ -242,7 +270,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse); */ estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[2], opt = this._transport.mergeOptions(options); + const method = this.methods[3], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -257,7 +285,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse); */ sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[3], opt = this._transport.mergeOptions(options); + const method = this.methods[4], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -270,7 +298,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt); */ sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[4], opt = this._transport.mergeOptions(options); + const method = this.methods[5], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -281,7 +309,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse); */ resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[5], opt = this._transport.mergeOptions(options); + const method = this.methods[6], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -292,7 +320,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse); */ queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[6], opt = this._transport.mergeOptions(options); + const method = this.methods[7], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -305,7 +333,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse); */ xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[7], opt = this._transport.mergeOptions(options); + const method = this.methods[8], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -315,7 +343,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse); */ getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[8], opt = this._transport.mergeOptions(options); + const method = this.methods[9], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -326,7 +354,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse); */ setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[9], opt = this._transport.mergeOptions(options); + const method = this.methods[10], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -337,7 +365,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse); */ queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[10], opt = this._transport.mergeOptions(options); + const method = this.methods[11], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -349,7 +377,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse); */ buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[11], opt = this._transport.mergeOptions(options); + const method = this.methods[12], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } /** @@ -360,7 +388,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent); */ subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[12], opt = this._transport.mergeOptions(options); + const method = this.methods[13], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } /** @@ -373,7 +401,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus); */ sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[13], opt = this._transport.mergeOptions(options); + const method = this.methods[14], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } /** @@ -385,7 +413,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus); */ trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[14], opt = this._transport.mergeOptions(options); + const method = this.methods[15], opt = this._transport.mergeOptions(options); return stackIntercept("serverStreaming", this._transport, method, opt, input); } /** @@ -399,7 +427,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest); */ htlcInterceptor(options?: RpcOptions): DuplexStreamingCall { - const method = this.methods[15], opt = this._transport.mergeOptions(options); + const method = this.methods[16], opt = this._transport.mergeOptions(options); return stackIntercept("duplex", this._transport, method, opt); } /** @@ -412,7 +440,7 @@ export class RouterClient implements IRouterClient, ServiceInfo { * @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse); */ updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[16], opt = this._transport.mergeOptions(options); + const method = this.methods[17], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } } diff --git a/proto/lnd/router.ts b/proto/lnd/router.ts index d902dba8..ae4eba46 100644 --- a/proto/lnd/router.ts +++ b/proto/lnd/router.ts @@ -1,7 +1,7 @@ -// @generated by protobuf-ts 2.5.0 with parameter long_type_string +// @generated by protobuf-ts 2.5.0 // @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) // tslint:disable -import { Payment } from "./rpc"; +import { Payment } from "./lightning"; import { ServiceType } from "@protobuf-ts/runtime-rpc"; import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; import type { IBinaryWriter } from "@protobuf-ts/runtime"; @@ -13,13 +13,13 @@ import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; -import { ChannelPoint } from "./rpc"; -import { HTLCAttempt } from "./rpc"; -import { Failure_FailureCode } from "./rpc"; -import { Failure } from "./rpc"; -import { Route } from "./rpc"; -import { FeatureBit } from "./rpc"; -import { RouteHint } from "./rpc"; +import { ChannelPoint } from "./lightning"; +import { HTLCAttempt } from "./lightning"; +import { Failure_FailureCode } from "./lightning"; +import { Failure } from "./lightning"; +import { Route } from "./lightning"; +import { FeatureBit } from "./lightning"; +import { RouteHint } from "./lightning"; /** * @generated from protobuf message routerrpc.SendPaymentRequest */ @@ -38,7 +38,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: int64 amt = 2; */ - amt: string; + amt: bigint; /** * * Number of millisatoshis to send. @@ -47,7 +47,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: int64 amt_msat = 12; */ - amtMsat: string; + amtMsat: bigint; /** * The hash to use within the payment's HTLC * @@ -100,7 +100,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: int64 fee_limit_sat = 7; */ - feeLimitSat: string; + feeLimitSat: bigint; /** * * The maximum number of millisatoshis that will be paid as a fee of the @@ -113,7 +113,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: int64 fee_limit_msat = 13; */ - feeLimitMsat: string; + feeLimitMsat: bigint; /** * * Deprecated, use outgoing_chan_ids. The channel id of the channel that must @@ -131,7 +131,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: repeated uint64 outgoing_chan_ids = 19; */ - outgoingChanIds: string[]; + outgoingChanIds: bigint[]; /** * * The pubkey of the last hop of the route. If empty, any hop may be used. @@ -210,7 +210,7 @@ export interface SendPaymentRequest { * * @generated from protobuf field: uint64 max_shard_size_msat = 21; */ - maxShardSizeMsat: string; + maxShardSizeMsat: bigint; /** * * If set, an AMP-payment will be attempted. @@ -218,6 +218,14 @@ export interface SendPaymentRequest { * @generated from protobuf field: bool amp = 22; */ amp: boolean; + /** + * + * The time preference for this payment. Set to -1 to optimize for fees + * only, to 1 to optimize for reliability only or a value inbetween for a mix. + * + * @generated from protobuf field: double time_pref = 23; + */ + timePref: number; } /** * @generated from protobuf message routerrpc.TrackPaymentRequest @@ -238,6 +246,19 @@ export interface TrackPaymentRequest { */ noInflightUpdates: boolean; } +/** + * @generated from protobuf message routerrpc.TrackPaymentsRequest + */ +export interface TrackPaymentsRequest { + /** + * + * If set, only the final payment updates are streamed back. Intermediate + * updates that show which htlcs are still in flight are suppressed. + * + * @generated from protobuf field: bool no_inflight_updates = 1; + */ + noInflightUpdates: boolean; +} /** * @generated from protobuf message routerrpc.RouteFeeRequest */ @@ -255,7 +276,7 @@ export interface RouteFeeRequest { * * @generated from protobuf field: int64 amt_sat = 2; */ - amtSat: string; + amtSat: bigint; } /** * @generated from protobuf message routerrpc.RouteFeeResponse @@ -268,7 +289,7 @@ export interface RouteFeeResponse { * * @generated from protobuf field: int64 routing_fee_msat = 1; */ - routingFeeMsat: string; + routingFeeMsat: bigint; /** * * An estimate of the worst case time delay that can occur. Note that callers @@ -277,7 +298,7 @@ export interface RouteFeeResponse { * * @generated from protobuf field: int64 time_lock_delay = 2; */ - timeLockDelay: string; + timeLockDelay: bigint; } /** * @generated from protobuf message routerrpc.SendToRouteRequest @@ -295,6 +316,16 @@ export interface SendToRouteRequest { * @generated from protobuf field: lnrpc.Route route = 2; */ route?: Route; + /** + * + * Whether the payment should be marked as failed when a temporary error is + * returned from the given route. Set it to true so the payment won't be + * failed unless a terminal error is occurred, such as payment timeout, no + * routes, incorrect payment details, or insufficient funds. + * + * @generated from protobuf field: bool skip_temp_err = 3; + */ + skipTempErr: boolean; } /** * @generated from protobuf message routerrpc.SendToRouteResponse @@ -351,6 +382,14 @@ export interface XImportMissionControlRequest { * @generated from protobuf field: repeated routerrpc.PairHistory pairs = 1; */ pairs: PairHistory[]; + /** + * Whether to force override MC pair history. Note that even with force + * override the failure pair is imported before the success pair and both + * still clamp existing failure/success amounts. + * + * @generated from protobuf field: bool force = 2; + */ + force: boolean; } /** * @generated from protobuf message routerrpc.XImportMissionControlResponse @@ -389,7 +428,7 @@ export interface PairData { * * @generated from protobuf field: int64 fail_time = 1; */ - failTime: string; + failTime: bigint; /** * * Lowest amount that failed to forward rounded to whole sats. This may be @@ -397,7 +436,7 @@ export interface PairData { * * @generated from protobuf field: int64 fail_amt_sat = 2; */ - failAmtSat: string; + failAmtSat: bigint; /** * * Lowest amount that failed to forward in millisats. This may be @@ -405,25 +444,25 @@ export interface PairData { * * @generated from protobuf field: int64 fail_amt_msat = 4; */ - failAmtMsat: string; + failAmtMsat: bigint; /** * Time of last success. * * @generated from protobuf field: int64 success_time = 5; */ - successTime: string; + successTime: bigint; /** * Highest amount that we could successfully forward rounded to whole sats. * * @generated from protobuf field: int64 success_amt_sat = 6; */ - successAmtSat: string; + successAmtSat: bigint; /** * Highest amount that we could successfully forward in millisats. * * @generated from protobuf field: int64 success_amt_msat = 7; */ - successAmtMsat: string; + successAmtMsat: bigint; } /** * @generated from protobuf message routerrpc.GetMissionControlConfigRequest @@ -474,7 +513,7 @@ export interface MissionControlConfig { * * @generated from protobuf field: uint64 half_life_seconds = 1; */ - halfLifeSeconds: string; + halfLifeSeconds: bigint; /** * * The probability of success mission control should assign to hop in a route @@ -511,7 +550,7 @@ export interface MissionControlConfig { * * @generated from protobuf field: uint64 minimum_failure_relax_interval = 5; */ - minimumFailureRelaxInterval: string; + minimumFailureRelaxInterval: bigint; } /** * @generated from protobuf message routerrpc.QueryProbabilityRequest @@ -534,7 +573,7 @@ export interface QueryProbabilityRequest { * * @generated from protobuf field: int64 amt_msat = 3; */ - amtMsat: string; + amtMsat: bigint; } /** * @generated from protobuf message routerrpc.QueryProbabilityResponse @@ -564,7 +603,7 @@ export interface BuildRouteRequest { * * @generated from protobuf field: int64 amt_msat = 1; */ - amtMsat: string; + amtMsat: bigint; /** * * CLTV delta from the current height that should be used for the timelock @@ -632,7 +671,7 @@ export interface HtlcEvent { * * @generated from protobuf field: uint64 incoming_channel_id = 1; */ - incomingChannelId: string; + incomingChannelId: bigint; /** * * The short channel id that the outgoing htlc left our node on. This value @@ -640,7 +679,7 @@ export interface HtlcEvent { * * @generated from protobuf field: uint64 outgoing_channel_id = 2; */ - outgoingChannelId: string; + outgoingChannelId: bigint; /** * * Incoming id is the index of the incoming htlc in the incoming channel. @@ -648,7 +687,7 @@ export interface HtlcEvent { * * @generated from protobuf field: uint64 incoming_htlc_id = 3; */ - incomingHtlcId: string; + incomingHtlcId: bigint; /** * * Outgoing id is the index of the outgoing htlc in the outgoing channel. @@ -656,14 +695,14 @@ export interface HtlcEvent { * * @generated from protobuf field: uint64 outgoing_htlc_id = 4; */ - outgoingHtlcId: string; + outgoingHtlcId: bigint; /** * * The time in unix nanoseconds that the event occurred. * * @generated from protobuf field: uint64 timestamp_ns = 5; */ - timestampNs: string; + timestampNs: bigint; /** * * The event type indicates whether the htlc was part of a send, receive or @@ -699,6 +738,18 @@ export interface HtlcEvent { * @generated from protobuf field: routerrpc.LinkFailEvent link_fail_event = 10; */ linkFailEvent: LinkFailEvent; + } | { + oneofKind: "subscribedEvent"; + /** + * @generated from protobuf field: routerrpc.SubscribedEvent subscribed_event = 11; + */ + subscribedEvent: SubscribedEvent; + } | { + oneofKind: "finalHtlcEvent"; + /** + * @generated from protobuf field: routerrpc.FinalHtlcEvent final_htlc_event = 12; + */ + finalHtlcEvent: FinalHtlcEvent; } | { oneofKind: undefined; }; @@ -745,13 +796,13 @@ export interface HtlcInfo { * * @generated from protobuf field: uint64 incoming_amt_msat = 3; */ - incomingAmtMsat: string; + incomingAmtMsat: bigint; /** * The amount of the outgoing htlc. * * @generated from protobuf field: uint64 outgoing_amt_msat = 4; */ - outgoingAmtMsat: string; + outgoingAmtMsat: bigint; } /** * @generated from protobuf message routerrpc.ForwardEvent @@ -773,6 +824,30 @@ export interface ForwardFailEvent { * @generated from protobuf message routerrpc.SettleEvent */ export interface SettleEvent { + /** + * The revealed preimage. + * + * @generated from protobuf field: bytes preimage = 1; + */ + preimage: Uint8Array; +} +/** + * @generated from protobuf message routerrpc.FinalHtlcEvent + */ +export interface FinalHtlcEvent { + /** + * @generated from protobuf field: bool settled = 1; + */ + settled: boolean; + /** + * @generated from protobuf field: bool offchain = 2; + */ + offchain: boolean; +} +/** + * @generated from protobuf message routerrpc.SubscribedEvent + */ +export interface SubscribedEvent { } /** * @generated from protobuf message routerrpc.LinkFailEvent @@ -840,13 +915,13 @@ export interface CircuitKey { * * @generated from protobuf field: uint64 chan_id = 1; */ - chanId: string; + chanId: bigint; /** * / The index of the incoming htlc in the incoming channel. * * @generated from protobuf field: uint64 htlc_id = 2; */ - htlcId: string; + htlcId: bigint; } /** * @generated from protobuf message routerrpc.ForwardHtlcInterceptRequest @@ -865,7 +940,7 @@ export interface ForwardHtlcInterceptRequest { * * @generated from protobuf field: uint64 incoming_amount_msat = 5; */ - incomingAmountMsat: string; + incomingAmountMsat: bigint; /** * The incoming htlc expiry. * @@ -888,13 +963,13 @@ export interface ForwardHtlcInterceptRequest { * * @generated from protobuf field: uint64 outgoing_requested_chan_id = 7; */ - outgoingRequestedChanId: string; + outgoingRequestedChanId: bigint; /** * The outgoing htlc amount. * * @generated from protobuf field: uint64 outgoing_amount_msat = 3; */ - outgoingAmountMsat: string; + outgoingAmountMsat: bigint; /** * The outgoing htlc expiry. * @@ -915,6 +990,13 @@ export interface ForwardHtlcInterceptRequest { * @generated from protobuf field: bytes onion_blob = 9; */ onionBlob: Uint8Array; + /** + * The block height at which this htlc will be auto-failed to prevent the + * channel from force-closing. + * + * @generated from protobuf field: int32 auto_fail_height = 10; + */ + autoFailHeight: number; } /** * * @@ -947,6 +1029,27 @@ export interface ForwardHtlcInterceptResponse { * @generated from protobuf field: bytes preimage = 3; */ preimage: Uint8Array; + /** + * Encrypted failure message in case the resolve action is Fail. + * + * If failure_message is specified, the failure_code field must be set + * to zero. + * + * @generated from protobuf field: bytes failure_message = 4; + */ + failureMessage: Uint8Array; + /** + * Return the specified failure code in case the resolve action is Fail. The + * message data fields are populated automatically. + * + * If a non-zero failure_code is specified, failure_message must not be set. + * + * For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the + * default value for this field. + * + * @generated from protobuf field: lnrpc.Failure.FailureCode failure_code = 5; + */ + failureCode: Failure_FailureCode; } /** * @generated from protobuf message routerrpc.UpdateChanStatusRequest @@ -1098,7 +1201,7 @@ export enum PaymentState { FAILED_NO_ROUTE = 3, /** * - * A non-recoverable error has occured. + * A non-recoverable error has occurred. * * @generated from protobuf enum value: FAILED_ERROR = 4; */ @@ -1158,17 +1261,17 @@ class SendPaymentRequest$Type extends MessageType { constructor() { super("routerrpc.SendPaymentRequest", [ { no: 1, name: "dest", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 3, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 4, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, { no: 20, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 5, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 6, name: "timeout_seconds", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 7, name: "fee_limit_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 13, name: "fee_limit_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 7, name: "fee_limit_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 13, name: "fee_limit_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 8, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 19, name: "outgoing_chan_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/ }, + { no: 19, name: "outgoing_chan_ids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 14, name: "last_hop_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 9, name: "cltv_limit", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, { no: 10, name: "route_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RouteHint }, @@ -1177,12 +1280,13 @@ class SendPaymentRequest$Type extends MessageType { { no: 16, name: "dest_features", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.FeatureBit", FeatureBit] }, { no: 17, name: "max_parts", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 18, name: "no_inflight_updates", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 21, name: "max_shard_size_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 22, name: "amp", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + { no: 21, name: "max_shard_size_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 22, name: "amp", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 23, name: "time_pref", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } ]); } create(value?: PartialMessage): SendPaymentRequest { - const message = { dest: new Uint8Array(0), amt: "0", amtMsat: "0", paymentHash: new Uint8Array(0), finalCltvDelta: 0, paymentAddr: new Uint8Array(0), paymentRequest: "", timeoutSeconds: 0, feeLimitSat: "0", feeLimitMsat: "0", outgoingChanId: "0", outgoingChanIds: [], lastHopPubkey: new Uint8Array(0), cltvLimit: 0, routeHints: [], destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], maxParts: 0, noInflightUpdates: false, maxShardSizeMsat: "0", amp: false }; + const message = { dest: new Uint8Array(0), amt: 0n, amtMsat: 0n, paymentHash: new Uint8Array(0), finalCltvDelta: 0, paymentAddr: new Uint8Array(0), paymentRequest: "", timeoutSeconds: 0, feeLimitSat: 0n, feeLimitMsat: 0n, outgoingChanId: "0", outgoingChanIds: [], lastHopPubkey: new Uint8Array(0), cltvLimit: 0, routeHints: [], destCustomRecords: {}, allowSelfPayment: false, destFeatures: [], maxParts: 0, noInflightUpdates: false, maxShardSizeMsat: 0n, amp: false, timePref: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -1197,10 +1301,10 @@ class SendPaymentRequest$Type extends MessageType { message.dest = reader.bytes(); break; case /* int64 amt */ 2: - message.amt = reader.int64().toString(); + message.amt = reader.int64().toBigInt(); break; case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toString(); + message.amtMsat = reader.int64().toBigInt(); break; case /* bytes payment_hash */ 3: message.paymentHash = reader.bytes(); @@ -1218,10 +1322,10 @@ class SendPaymentRequest$Type extends MessageType { message.timeoutSeconds = reader.int32(); break; case /* int64 fee_limit_sat */ 7: - message.feeLimitSat = reader.int64().toString(); + message.feeLimitSat = reader.int64().toBigInt(); break; case /* int64 fee_limit_msat */ 13: - message.feeLimitMsat = reader.int64().toString(); + message.feeLimitMsat = reader.int64().toBigInt(); break; case /* uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING];*/ 8: message.outgoingChanId = reader.uint64().toString(); @@ -1229,9 +1333,9 @@ class SendPaymentRequest$Type extends MessageType { case /* repeated uint64 outgoing_chan_ids */ 19: if (wireType === WireType.LengthDelimited) for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.outgoingChanIds.push(reader.uint64().toString()); + message.outgoingChanIds.push(reader.uint64().toBigInt()); else - message.outgoingChanIds.push(reader.uint64().toString()); + message.outgoingChanIds.push(reader.uint64().toBigInt()); break; case /* bytes last_hop_pubkey */ 14: message.lastHopPubkey = reader.bytes(); @@ -1262,11 +1366,14 @@ class SendPaymentRequest$Type extends MessageType { message.noInflightUpdates = reader.bool(); break; case /* uint64 max_shard_size_msat */ 21: - message.maxShardSizeMsat = reader.uint64().toString(); + message.maxShardSizeMsat = reader.uint64().toBigInt(); break; case /* bool amp */ 22: message.amp = reader.bool(); break; + case /* double time_pref */ 23: + message.timePref = reader.double(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -1299,10 +1406,10 @@ class SendPaymentRequest$Type extends MessageType { if (message.dest.length) writer.tag(1, WireType.LengthDelimited).bytes(message.dest); /* int64 amt = 2; */ - if (message.amt !== "0") + if (message.amt !== 0n) writer.tag(2, WireType.Varint).int64(message.amt); /* int64 amt_msat = 12; */ - if (message.amtMsat !== "0") + if (message.amtMsat !== 0n) writer.tag(12, WireType.Varint).int64(message.amtMsat); /* bytes payment_hash = 3; */ if (message.paymentHash.length) @@ -1320,10 +1427,10 @@ class SendPaymentRequest$Type extends MessageType { if (message.timeoutSeconds !== 0) writer.tag(6, WireType.Varint).int32(message.timeoutSeconds); /* int64 fee_limit_sat = 7; */ - if (message.feeLimitSat !== "0") + if (message.feeLimitSat !== 0n) writer.tag(7, WireType.Varint).int64(message.feeLimitSat); /* int64 fee_limit_msat = 13; */ - if (message.feeLimitMsat !== "0") + if (message.feeLimitMsat !== 0n) writer.tag(13, WireType.Varint).int64(message.feeLimitMsat); /* uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING]; */ if (message.outgoingChanId !== "0") @@ -1364,11 +1471,14 @@ class SendPaymentRequest$Type extends MessageType { if (message.noInflightUpdates !== false) writer.tag(18, WireType.Varint).bool(message.noInflightUpdates); /* uint64 max_shard_size_msat = 21; */ - if (message.maxShardSizeMsat !== "0") + if (message.maxShardSizeMsat !== 0n) writer.tag(21, WireType.Varint).uint64(message.maxShardSizeMsat); /* bool amp = 22; */ if (message.amp !== false) writer.tag(22, WireType.Varint).bool(message.amp); + /* double time_pref = 23; */ + if (message.timePref !== 0) + writer.tag(23, WireType.Bit64).double(message.timePref); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -1434,15 +1544,62 @@ class TrackPaymentRequest$Type extends MessageType { */ export const TrackPaymentRequest = new TrackPaymentRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods +class TrackPaymentsRequest$Type extends MessageType { + constructor() { + super("routerrpc.TrackPaymentsRequest", [ + { no: 1, name: "no_inflight_updates", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): TrackPaymentsRequest { + const message = { noInflightUpdates: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackPaymentsRequest): TrackPaymentsRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool no_inflight_updates */ 1: + message.noInflightUpdates = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TrackPaymentsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool no_inflight_updates = 1; */ + if (message.noInflightUpdates !== false) + writer.tag(1, WireType.Varint).bool(message.noInflightUpdates); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.TrackPaymentsRequest + */ +export const TrackPaymentsRequest = new TrackPaymentsRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods class RouteFeeRequest$Type extends MessageType { constructor() { super("routerrpc.RouteFeeRequest", [ { no: 1, name: "dest", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + { no: 2, name: "amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): RouteFeeRequest { - const message = { dest: new Uint8Array(0), amtSat: "0" }; + const message = { dest: new Uint8Array(0), amtSat: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -1457,7 +1614,7 @@ class RouteFeeRequest$Type extends MessageType { message.dest = reader.bytes(); break; case /* int64 amt_sat */ 2: - message.amtSat = reader.int64().toString(); + message.amtSat = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -1475,7 +1632,7 @@ class RouteFeeRequest$Type extends MessageType { if (message.dest.length) writer.tag(1, WireType.LengthDelimited).bytes(message.dest); /* int64 amt_sat = 2; */ - if (message.amtSat !== "0") + if (message.amtSat !== 0n) writer.tag(2, WireType.Varint).int64(message.amtSat); let u = options.writeUnknownFields; if (u !== false) @@ -1491,12 +1648,12 @@ export const RouteFeeRequest = new RouteFeeRequest$Type(); class RouteFeeResponse$Type extends MessageType { constructor() { super("routerrpc.RouteFeeResponse", [ - { no: 1, name: "routing_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 2, name: "time_lock_delay", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + { no: 1, name: "routing_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "time_lock_delay", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): RouteFeeResponse { - const message = { routingFeeMsat: "0", timeLockDelay: "0" }; + const message = { routingFeeMsat: 0n, timeLockDelay: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -1508,10 +1665,10 @@ class RouteFeeResponse$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 routing_fee_msat */ 1: - message.routingFeeMsat = reader.int64().toString(); + message.routingFeeMsat = reader.int64().toBigInt(); break; case /* int64 time_lock_delay */ 2: - message.timeLockDelay = reader.int64().toString(); + message.timeLockDelay = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -1526,10 +1683,10 @@ class RouteFeeResponse$Type extends MessageType { } internalBinaryWrite(message: RouteFeeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 routing_fee_msat = 1; */ - if (message.routingFeeMsat !== "0") + if (message.routingFeeMsat !== 0n) writer.tag(1, WireType.Varint).int64(message.routingFeeMsat); /* int64 time_lock_delay = 2; */ - if (message.timeLockDelay !== "0") + if (message.timeLockDelay !== 0n) writer.tag(2, WireType.Varint).int64(message.timeLockDelay); let u = options.writeUnknownFields; if (u !== false) @@ -1546,11 +1703,12 @@ class SendToRouteRequest$Type extends MessageType { constructor() { super("routerrpc.SendToRouteRequest", [ { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "route", kind: "message", T: () => Route } + { no: 2, name: "route", kind: "message", T: () => Route }, + { no: 3, name: "skip_temp_err", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): SendToRouteRequest { - const message = { paymentHash: new Uint8Array(0) }; + const message = { paymentHash: new Uint8Array(0), skipTempErr: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -1567,6 +1725,9 @@ class SendToRouteRequest$Type extends MessageType { case /* lnrpc.Route route */ 2: message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); break; + case /* bool skip_temp_err */ 3: + message.skipTempErr = reader.bool(); + break; default: let u = options.readUnknownField; if (u === "throw") @@ -1585,6 +1746,9 @@ class SendToRouteRequest$Type extends MessageType { /* lnrpc.Route route = 2; */ if (message.route) Route.internalBinaryWrite(message.route, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* bool skip_temp_err = 3; */ + if (message.skipTempErr !== false) + writer.tag(3, WireType.Varint).bool(message.skipTempErr); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -1778,11 +1942,12 @@ export const QueryMissionControlResponse = new QueryMissionControlResponse$Type( class XImportMissionControlRequest$Type extends MessageType { constructor() { super("routerrpc.XImportMissionControlRequest", [ - { no: 1, name: "pairs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PairHistory } + { no: 1, name: "pairs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PairHistory }, + { no: 2, name: "force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } ]); } create(value?: PartialMessage): XImportMissionControlRequest { - const message = { pairs: [] }; + const message = { pairs: [], force: false }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -1796,6 +1961,9 @@ class XImportMissionControlRequest$Type extends MessageType { constructor() { super("routerrpc.PairData", [ - { no: 1, name: "fail_time", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 2, name: "fail_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 4, name: "fail_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 5, name: "success_time", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 6, name: "success_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, - { no: 7, name: "success_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + { no: 1, name: "fail_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "fail_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "fail_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "success_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 6, name: "success_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 7, name: "success_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): PairData { - const message = { failTime: "0", failAmtSat: "0", failAmtMsat: "0", successTime: "0", successAmtSat: "0", successAmtMsat: "0" }; + const message = { failTime: 0n, failAmtSat: 0n, failAmtMsat: 0n, successTime: 0n, successAmtSat: 0n, successAmtMsat: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -1933,22 +2104,22 @@ class PairData$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 fail_time */ 1: - message.failTime = reader.int64().toString(); + message.failTime = reader.int64().toBigInt(); break; case /* int64 fail_amt_sat */ 2: - message.failAmtSat = reader.int64().toString(); + message.failAmtSat = reader.int64().toBigInt(); break; case /* int64 fail_amt_msat */ 4: - message.failAmtMsat = reader.int64().toString(); + message.failAmtMsat = reader.int64().toBigInt(); break; case /* int64 success_time */ 5: - message.successTime = reader.int64().toString(); + message.successTime = reader.int64().toBigInt(); break; case /* int64 success_amt_sat */ 6: - message.successAmtSat = reader.int64().toString(); + message.successAmtSat = reader.int64().toBigInt(); break; case /* int64 success_amt_msat */ 7: - message.successAmtMsat = reader.int64().toString(); + message.successAmtMsat = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -1963,22 +2134,22 @@ class PairData$Type extends MessageType { } internalBinaryWrite(message: PairData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 fail_time = 1; */ - if (message.failTime !== "0") + if (message.failTime !== 0n) writer.tag(1, WireType.Varint).int64(message.failTime); /* int64 fail_amt_sat = 2; */ - if (message.failAmtSat !== "0") + if (message.failAmtSat !== 0n) writer.tag(2, WireType.Varint).int64(message.failAmtSat); /* int64 fail_amt_msat = 4; */ - if (message.failAmtMsat !== "0") + if (message.failAmtMsat !== 0n) writer.tag(4, WireType.Varint).int64(message.failAmtMsat); /* int64 success_time = 5; */ - if (message.successTime !== "0") + if (message.successTime !== 0n) writer.tag(5, WireType.Varint).int64(message.successTime); /* int64 success_amt_sat = 6; */ - if (message.successAmtSat !== "0") + if (message.successAmtSat !== 0n) writer.tag(6, WireType.Varint).int64(message.successAmtSat); /* int64 success_amt_msat = 7; */ - if (message.successAmtMsat !== "0") + if (message.successAmtMsat !== 0n) writer.tag(7, WireType.Varint).int64(message.successAmtMsat); let u = options.writeUnknownFields; if (u !== false) @@ -2140,15 +2311,15 @@ export const SetMissionControlConfigResponse = new SetMissionControlConfigRespon class MissionControlConfig$Type extends MessageType { constructor() { super("routerrpc.MissionControlConfig", [ - { no: 1, name: "half_life_seconds", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 1, name: "half_life_seconds", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 2, name: "hop_probability", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ }, { no: 3, name: "weight", kind: "scalar", T: 2 /*ScalarType.FLOAT*/ }, { no: 4, name: "maximum_payment_results", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "minimum_failure_relax_interval", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 5, name: "minimum_failure_relax_interval", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): MissionControlConfig { - const message = { halfLifeSeconds: "0", hopProbability: 0, weight: 0, maximumPaymentResults: 0, minimumFailureRelaxInterval: "0" }; + const message = { halfLifeSeconds: 0n, hopProbability: 0, weight: 0, maximumPaymentResults: 0, minimumFailureRelaxInterval: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -2160,7 +2331,7 @@ class MissionControlConfig$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 half_life_seconds */ 1: - message.halfLifeSeconds = reader.uint64().toString(); + message.halfLifeSeconds = reader.uint64().toBigInt(); break; case /* float hop_probability */ 2: message.hopProbability = reader.float(); @@ -2172,7 +2343,7 @@ class MissionControlConfig$Type extends MessageType { message.maximumPaymentResults = reader.uint32(); break; case /* uint64 minimum_failure_relax_interval */ 5: - message.minimumFailureRelaxInterval = reader.uint64().toString(); + message.minimumFailureRelaxInterval = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -2187,7 +2358,7 @@ class MissionControlConfig$Type extends MessageType { } internalBinaryWrite(message: MissionControlConfig, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 half_life_seconds = 1; */ - if (message.halfLifeSeconds !== "0") + if (message.halfLifeSeconds !== 0n) writer.tag(1, WireType.Varint).uint64(message.halfLifeSeconds); /* float hop_probability = 2; */ if (message.hopProbability !== 0) @@ -2199,7 +2370,7 @@ class MissionControlConfig$Type extends MessageType { if (message.maximumPaymentResults !== 0) writer.tag(4, WireType.Varint).uint32(message.maximumPaymentResults); /* uint64 minimum_failure_relax_interval = 5; */ - if (message.minimumFailureRelaxInterval !== "0") + if (message.minimumFailureRelaxInterval !== 0n) writer.tag(5, WireType.Varint).uint64(message.minimumFailureRelaxInterval); let u = options.writeUnknownFields; if (u !== false) @@ -2217,11 +2388,11 @@ class QueryProbabilityRequest$Type extends MessageType super("routerrpc.QueryProbabilityRequest", [ { no: 1, name: "from_node", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, { no: 2, name: "to_node", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + { no: 3, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): QueryProbabilityRequest { - const message = { fromNode: new Uint8Array(0), toNode: new Uint8Array(0), amtMsat: "0" }; + const message = { fromNode: new Uint8Array(0), toNode: new Uint8Array(0), amtMsat: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -2239,7 +2410,7 @@ class QueryProbabilityRequest$Type extends MessageType message.toNode = reader.bytes(); break; case /* int64 amt_msat */ 3: - message.amtMsat = reader.int64().toString(); + message.amtMsat = reader.int64().toBigInt(); break; default: let u = options.readUnknownField; @@ -2260,7 +2431,7 @@ class QueryProbabilityRequest$Type extends MessageType if (message.toNode.length) writer.tag(2, WireType.LengthDelimited).bytes(message.toNode); /* int64 amt_msat = 3; */ - if (message.amtMsat !== "0") + if (message.amtMsat !== 0n) writer.tag(3, WireType.Varint).int64(message.amtMsat); let u = options.writeUnknownFields; if (u !== false) @@ -2330,7 +2501,7 @@ export const QueryProbabilityResponse = new QueryProbabilityResponse$Type(); class BuildRouteRequest$Type extends MessageType { constructor() { super("routerrpc.BuildRouteRequest", [ - { no: 1, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 1, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 2, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, { no: 3, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, { no: 4, name: "hop_pubkeys", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 12 /*ScalarType.BYTES*/ }, @@ -2338,7 +2509,7 @@ class BuildRouteRequest$Type extends MessageType { ]); } create(value?: PartialMessage): BuildRouteRequest { - const message = { amtMsat: "0", finalCltvDelta: 0, outgoingChanId: "0", hopPubkeys: [], paymentAddr: new Uint8Array(0) }; + const message = { amtMsat: 0n, finalCltvDelta: 0, outgoingChanId: "0", hopPubkeys: [], paymentAddr: new Uint8Array(0) }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -2350,7 +2521,7 @@ class BuildRouteRequest$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* int64 amt_msat */ 1: - message.amtMsat = reader.int64().toString(); + message.amtMsat = reader.int64().toBigInt(); break; case /* int32 final_cltv_delta */ 2: message.finalCltvDelta = reader.int32(); @@ -2377,7 +2548,7 @@ class BuildRouteRequest$Type extends MessageType { } internalBinaryWrite(message: BuildRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* int64 amt_msat = 1; */ - if (message.amtMsat !== "0") + if (message.amtMsat !== 0n) writer.tag(1, WireType.Varint).int64(message.amtMsat); /* int32 final_cltv_delta = 2; */ if (message.finalCltvDelta !== 0) @@ -2478,20 +2649,22 @@ export const SubscribeHtlcEventsRequest = new SubscribeHtlcEventsRequest$Type(); class HtlcEvent$Type extends MessageType { constructor() { super("routerrpc.HtlcEvent", [ - { no: 1, name: "incoming_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "outgoing_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "incoming_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 4, name: "outgoing_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 5, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 1, name: "incoming_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "outgoing_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "incoming_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "outgoing_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 6, name: "event_type", kind: "enum", T: () => ["routerrpc.HtlcEvent.EventType", HtlcEvent_EventType] }, { no: 7, name: "forward_event", kind: "message", oneof: "event", T: () => ForwardEvent }, { no: 8, name: "forward_fail_event", kind: "message", oneof: "event", T: () => ForwardFailEvent }, { no: 9, name: "settle_event", kind: "message", oneof: "event", T: () => SettleEvent }, - { no: 10, name: "link_fail_event", kind: "message", oneof: "event", T: () => LinkFailEvent } + { no: 10, name: "link_fail_event", kind: "message", oneof: "event", T: () => LinkFailEvent }, + { no: 11, name: "subscribed_event", kind: "message", oneof: "event", T: () => SubscribedEvent }, + { no: 12, name: "final_htlc_event", kind: "message", oneof: "event", T: () => FinalHtlcEvent } ]); } create(value?: PartialMessage): HtlcEvent { - const message = { incomingChannelId: "0", outgoingChannelId: "0", incomingHtlcId: "0", outgoingHtlcId: "0", timestampNs: "0", eventType: 0, event: { oneofKind: undefined } }; + const message = { incomingChannelId: 0n, outgoingChannelId: 0n, incomingHtlcId: 0n, outgoingHtlcId: 0n, timestampNs: 0n, eventType: 0, event: { oneofKind: undefined } }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -2503,19 +2676,19 @@ class HtlcEvent$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 incoming_channel_id */ 1: - message.incomingChannelId = reader.uint64().toString(); + message.incomingChannelId = reader.uint64().toBigInt(); break; case /* uint64 outgoing_channel_id */ 2: - message.outgoingChannelId = reader.uint64().toString(); + message.outgoingChannelId = reader.uint64().toBigInt(); break; case /* uint64 incoming_htlc_id */ 3: - message.incomingHtlcId = reader.uint64().toString(); + message.incomingHtlcId = reader.uint64().toBigInt(); break; case /* uint64 outgoing_htlc_id */ 4: - message.outgoingHtlcId = reader.uint64().toString(); + message.outgoingHtlcId = reader.uint64().toBigInt(); break; case /* uint64 timestamp_ns */ 5: - message.timestampNs = reader.uint64().toString(); + message.timestampNs = reader.uint64().toBigInt(); break; case /* routerrpc.HtlcEvent.EventType event_type */ 6: message.eventType = reader.int32(); @@ -2544,6 +2717,18 @@ class HtlcEvent$Type extends MessageType { linkFailEvent: LinkFailEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).linkFailEvent) }; break; + case /* routerrpc.SubscribedEvent subscribed_event */ 11: + message.event = { + oneofKind: "subscribedEvent", + subscribedEvent: SubscribedEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).subscribedEvent) + }; + break; + case /* routerrpc.FinalHtlcEvent final_htlc_event */ 12: + message.event = { + oneofKind: "finalHtlcEvent", + finalHtlcEvent: FinalHtlcEvent.internalBinaryRead(reader, reader.uint32(), options, (message.event as any).finalHtlcEvent) + }; + break; default: let u = options.readUnknownField; if (u === "throw") @@ -2557,19 +2742,19 @@ class HtlcEvent$Type extends MessageType { } internalBinaryWrite(message: HtlcEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 incoming_channel_id = 1; */ - if (message.incomingChannelId !== "0") + if (message.incomingChannelId !== 0n) writer.tag(1, WireType.Varint).uint64(message.incomingChannelId); /* uint64 outgoing_channel_id = 2; */ - if (message.outgoingChannelId !== "0") + if (message.outgoingChannelId !== 0n) writer.tag(2, WireType.Varint).uint64(message.outgoingChannelId); /* uint64 incoming_htlc_id = 3; */ - if (message.incomingHtlcId !== "0") + if (message.incomingHtlcId !== 0n) writer.tag(3, WireType.Varint).uint64(message.incomingHtlcId); /* uint64 outgoing_htlc_id = 4; */ - if (message.outgoingHtlcId !== "0") + if (message.outgoingHtlcId !== 0n) writer.tag(4, WireType.Varint).uint64(message.outgoingHtlcId); /* uint64 timestamp_ns = 5; */ - if (message.timestampNs !== "0") + if (message.timestampNs !== 0n) writer.tag(5, WireType.Varint).uint64(message.timestampNs); /* routerrpc.HtlcEvent.EventType event_type = 6; */ if (message.eventType !== 0) @@ -2586,6 +2771,12 @@ class HtlcEvent$Type extends MessageType { /* routerrpc.LinkFailEvent link_fail_event = 10; */ if (message.event.oneofKind === "linkFailEvent") LinkFailEvent.internalBinaryWrite(message.event.linkFailEvent, writer.tag(10, WireType.LengthDelimited).fork(), options).join(); + /* routerrpc.SubscribedEvent subscribed_event = 11; */ + if (message.event.oneofKind === "subscribedEvent") + SubscribedEvent.internalBinaryWrite(message.event.subscribedEvent, writer.tag(11, WireType.LengthDelimited).fork(), options).join(); + /* routerrpc.FinalHtlcEvent final_htlc_event = 12; */ + if (message.event.oneofKind === "finalHtlcEvent") + FinalHtlcEvent.internalBinaryWrite(message.event.finalHtlcEvent, writer.tag(12, WireType.LengthDelimited).fork(), options).join(); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -2602,12 +2793,12 @@ class HtlcInfo$Type extends MessageType { super("routerrpc.HtlcInfo", [ { no: 1, name: "incoming_timelock", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 2, name: "outgoing_timelock", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "incoming_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 4, name: "outgoing_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 3, name: "incoming_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 4, name: "outgoing_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): HtlcInfo { - const message = { incomingTimelock: 0, outgoingTimelock: 0, incomingAmtMsat: "0", outgoingAmtMsat: "0" }; + const message = { incomingTimelock: 0, outgoingTimelock: 0, incomingAmtMsat: 0n, outgoingAmtMsat: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -2625,10 +2816,10 @@ class HtlcInfo$Type extends MessageType { message.outgoingTimelock = reader.uint32(); break; case /* uint64 incoming_amt_msat */ 3: - message.incomingAmtMsat = reader.uint64().toString(); + message.incomingAmtMsat = reader.uint64().toBigInt(); break; case /* uint64 outgoing_amt_msat */ 4: - message.outgoingAmtMsat = reader.uint64().toString(); + message.outgoingAmtMsat = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -2649,10 +2840,10 @@ class HtlcInfo$Type extends MessageType { if (message.outgoingTimelock !== 0) writer.tag(2, WireType.Varint).uint32(message.outgoingTimelock); /* uint64 incoming_amt_msat = 3; */ - if (message.incomingAmtMsat !== "0") + if (message.incomingAmtMsat !== 0n) writer.tag(3, WireType.Varint).uint64(message.incomingAmtMsat); /* uint64 outgoing_amt_msat = 4; */ - if (message.outgoingAmtMsat !== "0") + if (message.outgoingAmtMsat !== 0n) writer.tag(4, WireType.Varint).uint64(message.outgoingAmtMsat); let u = options.writeUnknownFields; if (u !== false) @@ -2740,19 +2931,40 @@ export const ForwardFailEvent = new ForwardFailEvent$Type(); // @generated message type with reflection information, may provide speed optimized methods class SettleEvent$Type extends MessageType { constructor() { - super("routerrpc.SettleEvent", []); + super("routerrpc.SettleEvent", [ + { no: 1, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); } create(value?: PartialMessage): SettleEvent { - const message = {}; + const message = { preimage: new Uint8Array(0) }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleEvent): SettleEvent { - return target ?? this.create(); + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bytes preimage */ 1: + message.preimage = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } internalBinaryWrite(message: SettleEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bytes preimage = 1; */ + if (message.preimage.length) + writer.tag(1, WireType.LengthDelimited).bytes(message.preimage); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); @@ -2764,6 +2976,86 @@ class SettleEvent$Type extends MessageType { */ export const SettleEvent = new SettleEvent$Type(); // @generated message type with reflection information, may provide speed optimized methods +class FinalHtlcEvent$Type extends MessageType { + constructor() { + super("routerrpc.FinalHtlcEvent", [ + { no: 1, name: "settled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "offchain", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): FinalHtlcEvent { + const message = { settled: false, offchain: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FinalHtlcEvent): FinalHtlcEvent { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool settled */ 1: + message.settled = reader.bool(); + break; + case /* bool offchain */ 2: + message.offchain = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FinalHtlcEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool settled = 1; */ + if (message.settled !== false) + writer.tag(1, WireType.Varint).bool(message.settled); + /* bool offchain = 2; */ + if (message.offchain !== false) + writer.tag(2, WireType.Varint).bool(message.offchain); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.FinalHtlcEvent + */ +export const FinalHtlcEvent = new FinalHtlcEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SubscribedEvent$Type extends MessageType { + constructor() { + super("routerrpc.SubscribedEvent", []); + } + create(value?: PartialMessage): SubscribedEvent { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribedEvent): SubscribedEvent { + return target ?? this.create(); + } + internalBinaryWrite(message: SubscribedEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message routerrpc.SubscribedEvent + */ +export const SubscribedEvent = new SubscribedEvent$Type(); +// @generated message type with reflection information, may provide speed optimized methods class LinkFailEvent$Type extends MessageType { constructor() { super("routerrpc.LinkFailEvent", [ @@ -2896,12 +3188,12 @@ export const PaymentStatus = new PaymentStatus$Type(); class CircuitKey$Type extends MessageType { constructor() { super("routerrpc.CircuitKey", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } + { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } ]); } create(value?: PartialMessage): CircuitKey { - const message = { chanId: "0", htlcId: "0" }; + const message = { chanId: 0n, htlcId: 0n }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -2913,10 +3205,10 @@ class CircuitKey$Type extends MessageType { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* uint64 chan_id */ 1: - message.chanId = reader.uint64().toString(); + message.chanId = reader.uint64().toBigInt(); break; case /* uint64 htlc_id */ 2: - message.htlcId = reader.uint64().toString(); + message.htlcId = reader.uint64().toBigInt(); break; default: let u = options.readUnknownField; @@ -2931,10 +3223,10 @@ class CircuitKey$Type extends MessageType { } internalBinaryWrite(message: CircuitKey, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* uint64 chan_id = 1; */ - if (message.chanId !== "0") + if (message.chanId !== 0n) writer.tag(1, WireType.Varint).uint64(message.chanId); /* uint64 htlc_id = 2; */ - if (message.htlcId !== "0") + if (message.htlcId !== 0n) writer.tag(2, WireType.Varint).uint64(message.htlcId); let u = options.writeUnknownFields; if (u !== false) @@ -2951,18 +3243,19 @@ class ForwardHtlcInterceptRequest$Type extends MessageType CircuitKey }, - { no: 5, name: "incoming_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 5, name: "incoming_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 6, name: "incoming_expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 2, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 7, name: "outgoing_requested_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "outgoing_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 7, name: "outgoing_requested_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "outgoing_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, { no: 4, name: "outgoing_expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, { no: 8, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, - { no: 9, name: "onion_blob", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + { no: 9, name: "onion_blob", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 10, name: "auto_fail_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ } ]); } create(value?: PartialMessage): ForwardHtlcInterceptRequest { - const message = { incomingAmountMsat: "0", incomingExpiry: 0, paymentHash: new Uint8Array(0), outgoingRequestedChanId: "0", outgoingAmountMsat: "0", outgoingExpiry: 0, customRecords: {}, onionBlob: new Uint8Array(0) }; + const message = { incomingAmountMsat: 0n, incomingExpiry: 0, paymentHash: new Uint8Array(0), outgoingRequestedChanId: 0n, outgoingAmountMsat: 0n, outgoingExpiry: 0, customRecords: {}, onionBlob: new Uint8Array(0), autoFailHeight: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -2977,7 +3270,7 @@ class ForwardHtlcInterceptRequest$Type extends MessageType CircuitKey }, { no: 2, name: "action", kind: "enum", T: () => ["routerrpc.ResolveHoldForwardAction", ResolveHoldForwardAction] }, - { no: 3, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + { no: 3, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 4, name: "failure_message", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 5, name: "failure_code", kind: "enum", T: () => ["lnrpc.Failure.FailureCode", Failure_FailureCode] } ]); } create(value?: PartialMessage): ForwardHtlcInterceptResponse { - const message = { action: 0, preimage: new Uint8Array(0) }; + const message = { action: 0, preimage: new Uint8Array(0), failureMessage: new Uint8Array(0), failureCode: 0 }; globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== undefined) reflectionMergePartial(this, message, value); @@ -3095,6 +3396,12 @@ class ForwardHtlcInterceptResponse$Type extends MessageType= 32768). + uint32 type = 2; + + // Raw message data + bytes data = 3; +} + +message SendCustomMessageRequest { + // Peer to send the message to + bytes peer = 1; + + // Message type. This value needs to be in the custom range (>= 32768). + uint32 type = 2; + + // Raw message data. + bytes data = 3; +} + +message SendCustomMessageResponse { } message Utxo { @@ -536,6 +641,39 @@ message Utxo { int64 confirmations = 6; } +enum OutputScriptType { + SCRIPT_TYPE_PUBKEY_HASH = 0; + SCRIPT_TYPE_SCRIPT_HASH = 1; + SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2; + SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3; + SCRIPT_TYPE_PUBKEY = 4; + SCRIPT_TYPE_MULTISIG = 5; + SCRIPT_TYPE_NULLDATA = 6; + SCRIPT_TYPE_NON_STANDARD = 7; + SCRIPT_TYPE_WITNESS_UNKNOWN = 8; + SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9; +} + +message OutputDetail { + // The type of the output + OutputScriptType output_type = 1; + + // The address + string address = 2; + + // The pkscript in hex + string pk_script = 3; + + // The output index used in the raw transaction + int64 output_index = 4; + + // The value of the output coin in satoshis + int64 amount = 5; + + // Denotes if the output is controlled by the internal wallet + bool is_our_address = 6; +} + message Transaction { // The transaction hash string tx_hash = 1; @@ -558,15 +696,23 @@ message Transaction { // Fees paid for this transaction int64 total_fees = 7; - // Addresses that received funds for this transaction - repeated string dest_addresses = 8; + // Addresses that received funds for this transaction. Deprecated as it is + // now incorporated in the output_details field. + repeated string dest_addresses = 8 [deprecated = true]; + + // Outputs that received funds for this transaction + repeated OutputDetail output_details = 11; // The raw transaction hex. string raw_tx_hex = 9; // A label that was optionally set on transaction broadcast. string label = 10; + + // PreviousOutpoints/Inputs of this transaction. + repeated PreviousOutPoint previous_outpoints = 12; } + message GetTransactionsRequest { /* The height from which to list transactions, inclusive. If this value is @@ -669,7 +815,8 @@ message SendRequest { The maximum number of satoshis that will be paid as a fee of the payment. This value can be represented either as a percentage of the amount being sent, or as a fixed amount of the maximum fee the user is willing the pay to - send the payment. + send the payment. If not specified, lnd will use a default value of 100% + fees for small amounts (<=1k sat) or 5% fees for larger amounts. */ FeeLimit fee_limit = 8; @@ -791,6 +938,17 @@ message ChannelAcceptRequest { // A bit-field which the initiator uses to specify proposed channel // behavior. uint32 channel_flags = 13; + + // The commitment type the initiator wishes to use for the proposed channel. + CommitmentType commitment_type = 14; + + // Whether the initiator wants to open a zero-conf channel via the channel + // type. + bool wants_zero_conf = 15; + + // Whether the initiator wants to use the scid-alias channel type. This is + // separate from the feature bit. + bool wants_scid_alias = 16; } message ChannelAcceptResponse { @@ -851,6 +1009,13 @@ message ChannelAcceptResponse { The number of confirmations we require before we consider the channel open. */ uint32 min_accept_depth = 10; + + /* + Whether the responder wants this to be a zero-conf channel. This will fail + if either side does not have the scid-alias feature bit set. The minimum + depth field must be zero if this is true. + */ + bool zero_conf = 11; } message ChannelPoint { @@ -883,12 +1048,21 @@ message OutPoint { uint32 output_index = 3; } +message PreviousOutPoint { + // The outpoint in format txid:n. + string outpoint = 1; + + // Denotes if the outpoint is controlled by the internal wallet. + // The flag will only detect p2wkh, np2wkh and p2tr inputs as its own. + bool is_our_output = 2; +} + message LightningAddress { - // The identity pubkey of the Lightning node + // The identity pubkey of the Lightning node. string pubkey = 1; // The network location of the lightning node, e.g. `69.69.69.69:1337` or - // `localhost:10011` + // `localhost:10011`. string host = 2; } @@ -1014,12 +1188,15 @@ message ListUnspentResponse { - `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) - `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) +- `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 4) */ enum AddressType { WITNESS_PUBKEY_HASH = 0; NESTED_PUBKEY_HASH = 1; UNUSED_WITNESS_PUBKEY_HASH = 2; UNUSED_NESTED_PUBKEY_HASH = 3; + TAPROOT_PUBKEY = 4; + UNUSED_TAPROOT_PUBKEY = 5; } message NewAddressRequest { @@ -1043,6 +1220,12 @@ message SignMessageRequest { base64. */ bytes msg = 1; + + /* + Instead of the default double-SHA256 hashing of the message before signing, + only use one round of hashing instead. + */ + bool single_hash = 2; } message SignMessageResponse { // The signature for the given message @@ -1068,11 +1251,15 @@ message VerifyMessageResponse { } message ConnectPeerRequest { - // Lightning address of the peer, in the format `@host` + /* + Lightning address of the peer to connect to. + */ LightningAddress addr = 1; - /* If set, the daemon will attempt to persistently connect to the target - * peer. Otherwise, the call will be synchronous. */ + /* + If set, the daemon will attempt to persistently connect to the target + peer. Otherwise, the call will be synchronous. + */ bool perm = 2; /* @@ -1114,11 +1301,16 @@ message HTLC { } enum CommitmentType { + /* + Returned when the commitment type isn't known or unavailable. + */ + UNKNOWN_COMMITMENT_TYPE = 0; + /* A channel using the legacy commitment format having tweaked to_remote keys. */ - LEGACY = 0; + LEGACY = 1; /* A channel that uses the modern commitment format where the key in the @@ -1126,19 +1318,23 @@ enum CommitmentType { up and recovery easier as when the channel is closed, the funds go directly to that key. */ - STATIC_REMOTE_KEY = 1; + STATIC_REMOTE_KEY = 2; /* A channel that uses a commitment format that has anchor outputs on the commitments, allowing fee bumping after a force close transaction has been broadcast. */ - ANCHORS = 2; + ANCHORS = 3; /* - Returned when the commitment type isn't known or unavailable. + A channel that uses a commitment type that builds upon the anchors + commitment format, but in addition requires a CLTV clause to spend outputs + paying to the channel initiator. This is intended for use on leased channels + to guarantee that the channel initiator has no incentives to close a leased + channel before its maturity date. */ - UNKNOWN_COMMITMENT_TYPE = 999; + SCRIPT_ENFORCED_LEASE = 4; } message ChannelConstraints { @@ -1316,6 +1512,18 @@ message Channel { // List constraints for the remote node. ChannelConstraints remote_constraints = 30; + + /* + This lists out the set of alias short channel ids that exist for a channel. + This may be empty. + */ + repeated uint64 alias_scids = 31; + + // Whether or not this is a zero-conf channel. + bool zero_conf = 32; + + // This is the confirmed / on-chain zero-conf SCID. + uint64 zero_conf_confirmed_scid = 33; } message ListChannelsRequest { @@ -1335,6 +1543,22 @@ message ListChannelsResponse { repeated Channel channels = 11; } +message AliasMap { + /* + For non-zero-conf channels, this is the confirmed SCID. Otherwise, this is + the first assigned "base" alias. + */ + uint64 base_scid = 1; + + // The set of all aliases stored for the base SCID. + repeated uint64 aliases = 2; +} +message ListAliasesRequest { +} +message ListAliasesResponse { + repeated AliasMap alias_maps = 1; +} + enum Initiator { INITIATOR_UNKNOWN = 0; INITIATOR_LOCAL = 1; @@ -1399,6 +1623,15 @@ message ChannelCloseSummary { Initiator close_initiator = 12; repeated Resolution resolutions = 13; + + /* + This lists out the set of alias short channel ids that existed for the + closed channel. This may be empty. + */ + repeated uint64 alias_scids = 14; + + // The confirmed SCID for a zero-conf channel. + uint64 zero_conf_confirmed_scid = 15 [jstype = JS_STRING]; } enum ResolutionType { @@ -1560,6 +1793,11 @@ message Peer { zero, we have not observed any flaps for this peer. */ int64 last_flap_ns = 14; + + /* + The last ping payload the peer has sent to us. + */ + bytes last_ping_payload = 15; } message TimestampedError { @@ -1662,6 +1900,11 @@ message GetInfoResponse { announcements and invoices. */ map features = 19; + + /* + Indicates whether the HTLC interceptor API is in always-on mode. + */ + bool require_htlc_interceptor = 21; } message GetRecoveryInfoRequest { @@ -1734,6 +1977,11 @@ message CloseChannelRequest { // A manual fee rate set in sat/vbyte that should be used when crafting the // closure transaction. uint64 sat_per_vbyte = 6; + + // The maximum fee rate the closer is willing to pay. + // + // NOTE: This field is only respected if we're the initiator of the channel. + uint64 max_fee_per_vbyte = 7; } message CloseStatusUpdate { @@ -1770,6 +2018,84 @@ message ReadyForPsbtFunding { bytes psbt = 3; } +message BatchOpenChannelRequest { + // The list of channels to open. + repeated BatchOpenChannel channels = 1; + + // The target number of blocks that the funding transaction should be + // confirmed by. + int32 target_conf = 2; + + // A manual fee rate set in sat/vByte that should be used when crafting the + // funding transaction. + int64 sat_per_vbyte = 3; + + // The minimum number of confirmations each one of your outputs used for + // the funding transaction must satisfy. + int32 min_confs = 4; + + // Whether unconfirmed outputs should be used as inputs for the funding + // transaction. + bool spend_unconfirmed = 5; + + // An optional label for the batch transaction, limited to 500 characters. + string label = 6; +} + +message BatchOpenChannel { + // The pubkey of the node to open a channel with. When using REST, this + // field must be encoded as base64. + bytes node_pubkey = 1; + + // The number of satoshis the wallet should commit to the channel. + int64 local_funding_amount = 2; + + // The number of satoshis to push to the remote side as part of the initial + // commitment state. + int64 push_sat = 3; + + // Whether this channel should be private, not announced to the greater + // network. + bool private = 4; + + // The minimum value in millisatoshi we will require for incoming HTLCs on + // the channel. + int64 min_htlc_msat = 5; + + // The delay we require on the remote's commitment transaction. If this is + // not set, it will be scaled automatically with the channel size. + uint32 remote_csv_delay = 6; + + /* + Close address is an optional address which specifies the address to which + funds should be paid out to upon cooperative close. This field may only be + set if the peer supports the option upfront feature bit (call listpeers + to check). The remote peer will only accept cooperative closes to this + address if it is set. + + Note: If this value is set on channel creation, you will *not* be able to + cooperatively close out to a different address. + */ + string close_address = 7; + + /* + An optional, unique identifier of 32 random bytes that will be used as the + pending channel ID to identify the channel while it is in the pre-pending + state. + */ + bytes pending_chan_id = 8; + + /* + The explicit commitment type to use. Note this field will only be used if + the remote peer supports explicit channel negotiation. + */ + CommitmentType commitment_type = 9; +} + +message BatchOpenChannelResponse { + repeated PendingUpdate pending_channels = 1; +} + message OpenChannelRequest { // A manual fee rate set in sat/vbyte that should be used when crafting the // funding transaction. @@ -1861,6 +2187,57 @@ message OpenChannelRequest { transaction. */ uint32 max_local_csv = 17; + + /* + The explicit commitment type to use. Note this field will only be used if + the remote peer supports explicit channel negotiation. + */ + CommitmentType commitment_type = 18; + + /* + If this is true, then a zero-conf channel open will be attempted. + */ + bool zero_conf = 19; + + /* + If this is true, then an option-scid-alias channel-type open will be + attempted. + */ + bool scid_alias = 20; + + /* + The base fee charged regardless of the number of milli-satoshis sent. + */ + uint64 base_fee = 21; + + /* + The fee rate in ppm (parts per million) that will be charged in + proportion of the value of each forwarded HTLC. + */ + uint64 fee_rate = 22; + + /* + If use_base_fee is true the open channel announcement will update the + channel base fee with the value specified in base_fee. In the case of + a base_fee of 0 use_base_fee is needed downstream to distinguish whether + to use the default base fee value specified in the config or 0. + */ + bool use_base_fee = 23; + + /* + If use_fee_rate is true the open channel announcement will update the + channel fee rate with the value specified in fee_rate. In the case of + a fee_rate of 0 use_fee_rate is needed downstream to distinguish whether + to use the default fee rate value specified in the config or 0. + */ + bool use_fee_rate = 24; + + /* + The number of satoshis we require the remote peer to reserve. This value, + if specified, must be above the dust limit and below 20% of the channel + capacity. + */ + uint64 remote_chan_reserve_sat = 25; } message OpenStatusUpdate { oneof update { @@ -2000,6 +2377,20 @@ message FundingPsbtVerify { // The pending channel ID of the channel to get the PSBT for. bytes pending_chan_id = 2; + + /* + Can only be used if the no_publish flag was set to true in the OpenChannel + call meaning that the caller is solely responsible for publishing the final + funding transaction. If skip_finalize is set to true then lnd will not wait + for a FundingPsbtFinalize state step and instead assumes that a transaction + with the same TXID as the passed in PSBT will eventually confirm. + IT IS ABSOLUTELY IMPERATIVE that the TXID of the transaction that is + eventually published does have the _same TXID_ as the verified PSBT. That + means no inputs or outputs can change, only signatures can be added. If the + TXID changes between this call and the publish step then the channel will + never be created and the funds will be in limbo. + */ + bool skip_finalize = 3; } message FundingPsbtFinalize { @@ -2104,15 +2495,21 @@ message PendingChannelsResponse { // The commitment type used by this channel. CommitmentType commitment_type = 9; + + // Total number of forwarding packages created in this channel. + int64 num_forwarding_packages = 10; + + // A set of flags showing the current state of the channel. + string chan_status_flags = 11; + + // Whether this channel is advertised to the network or not. + bool private = 12; } message PendingOpenChannel { // The pending channel PendingChannel channel = 1; - // The height at which this channel will be confirmed - uint32 confirmation_height = 2; - /* The amount calculated to be paid in fees for the current set of commitment transactions. The fee amount is persisted with the channel @@ -2131,6 +2528,9 @@ message PendingChannelsResponse { transaction. This value can later be updated once the channel is open. */ int64 fee_per_kw = 6; + + // Previously used for confirmation_height. Do not reuse. + reserved 2; } message WaitingCloseChannel { @@ -2145,6 +2545,9 @@ message PendingChannelsResponse { this point. */ Commitments commitments = 3; + + // The transaction id of the closing transaction + string closing_txid = 4; } message Commitments { @@ -2209,9 +2612,17 @@ message PendingChannelsResponse { repeated PendingHTLC pending_htlcs = 8; + /* + There are three resolution states for the anchor: + limbo, lost and recovered. Derive the current state + from the limbo and recovered balances. + */ enum AnchorState { + // The recovered_balance is zero and limbo_balance is non-zero. LIMBO = 0; + // The recovered_balance is non-zero. RECOVERED = 1; + // A state that is neither LIMBO nor RECOVERED. LOST = 2; } @@ -2248,6 +2659,7 @@ message ChannelEventUpdate { ChannelPoint active_channel = 3; ChannelPoint inactive_channel = 4; PendingUpdate pending_open_channel = 6; + ChannelPoint fully_resolved_channel = 7; } enum UpdateType { @@ -2256,6 +2668,7 @@ message ChannelEventUpdate { ACTIVE_CHANNEL = 2; INACTIVE_CHANNEL = 3; PENDING_OPEN_CHANNEL = 4; + FULLY_RESOLVED_CHANNEL = 5; } UpdateType type = 5; @@ -2282,6 +2695,13 @@ message WalletBalanceResponse { // The unconfirmed balance of a wallet(with 0 confirmations) int64 unconfirmed_balance = 3; + // The total amount of wallet UTXOs held in outputs that are locked for + // other usage. + int64 locked_balance = 5; + + // The amount of reserve required. + int64 reserved_balance_anchor_chan = 6; + // A mapping of each wallet account's name to its balance. map account_balance = 4; } @@ -2355,7 +2775,8 @@ message QueryRoutesRequest { The maximum number of satoshis that will be paid as a fee of the payment. This value can be represented either as a percentage of the amount being sent, or as a fixed amount of the maximum fee the user is willing the pay to - send the payment. + send the payment. If not specified, lnd will use a default value of 100% + fees for small amounts (<=1k sat) or 5% fees for larger amounts. */ FeeLimit fee_limit = 5; @@ -2398,7 +2819,7 @@ message QueryRoutesRequest { An optional field that can be used to pass an arbitrary set of TLV records to a peer which understands the new records. This can be used to pass application specific data during the payment attempt. If the destination - does not support the specified recrods, and error will be returned. + does not support the specified records, an error will be returned. Record types are required to be in the custom range >= 65536. When using REST, the values must be encoded as base64. */ @@ -2428,6 +2849,12 @@ message QueryRoutesRequest { fallback. */ repeated lnrpc.FeatureBit dest_features = 17; + + /* + The time preference for this payment. Set to -1 to optimize for fees + only, to 1 to optimize for reliability only or a value inbetween for a mix. + */ + double time_pref = 18; } message NodePair { @@ -2496,7 +2923,7 @@ message Hop { TLV format. Note that if any custom tlv_records below are specified, then this field MUST be set to true for them to be encoded properly. */ - bool tlv_payload = 9; + bool tlv_payload = 9 [deprecated = true]; /* An optional TLV record that signals the use of an MPP payment. If present, @@ -2522,6 +2949,9 @@ message Hop { to drop off at each hop within the onion. */ map custom_records = 11; + + // The payment metadata to send along with the payment to the payee. + bytes metadata = 13; } message MPPRecord { @@ -2638,6 +3068,9 @@ message LightningNode { repeated NodeAddress addresses = 4; string color = 5; map features = 6; + + // Custom node announcement tlv records. + map custom_records = 7; } message NodeAddress { @@ -2653,6 +3086,9 @@ message RoutingPolicy { bool disabled = 5; uint64 max_htlc_msat = 6; uint32 last_update = 7; + + // Custom channel update tlv records. + map custom_records = 8; } /* @@ -2680,6 +3116,9 @@ message ChannelEdge { RoutingPolicy node1_policy = 7; RoutingPolicy node2_policy = 8; + + // Custom channel announcement tlv records. + map custom_records = 9; } message ChannelGraphRequest { @@ -2846,6 +3285,10 @@ message HopHint { uint32 cltv_expiry_delta = 5; } +message SetID { + bytes set_id = 1; +} + message RouteHint { /* A list of hop hints that when chained together can assist in reaching a @@ -2854,6 +3297,20 @@ message RouteHint { repeated HopHint hop_hints = 1; } +message AMPInvoiceState { + // The state the HTLCs associated with this setID are in. + InvoiceHTLCState state = 1; + + // The settle index of this HTLC set, if the invoice state is settled. + uint64 settle_index = 2; + + // The time this HTLC set was settled expressed in unix epoch. + int64 settle_time = 3; + + // The total amount paid for the sub-invoice expressed in milli satoshis. + int64 amt_paid_msat = 5; +} + message Invoice { /* An optional memo to attach along with the invoice. Used for record keeping @@ -2875,6 +3332,7 @@ message Invoice { /* The hash of the preimage. When using REST, this field must be encoded as base64. + Note: Output only, don't specify for creating an invoice. */ bytes r_hash = 4; @@ -2892,19 +3350,30 @@ message Invoice { */ int64 value_msat = 23; - // Whether this invoice has been fulfilled + /* + Whether this invoice has been fulfilled + + The field is deprecated. Use the state field instead (compare to SETTLED). + */ bool settled = 6 [deprecated = true]; - // When this invoice was created + /* + When this invoice was created. + Note: Output only, don't specify for creating an invoice. + */ int64 creation_date = 7; - // When this invoice was settled + /* + When this invoice was settled. + Note: Output only, don't specify for creating an invoice. + */ int64 settle_date = 8; /* A bare-bones invoice for a payment within the Lightning Network. With the details of the invoice, the sender has all the data necessary to send a payment to the recipient. + Note: Output only, don't specify for creating an invoice. */ string payment_request = 9; @@ -2939,6 +3408,7 @@ message Invoice { this index making it monotonically increasing. Callers to the SubscribeInvoices call can use this to instantly get notified of all added invoices with an add_index greater than this one. + Note: Output only, don't specify for creating an invoice. */ uint64 add_index = 16; @@ -2947,6 +3417,7 @@ message Invoice { increment this index making it monotonically increasing. Callers to the SubscribeInvoices call can use this to instantly get notified of all settled invoices with an settle_index greater than this one. + Note: Output only, don't specify for creating an invoice. */ uint64 settle_index = 17; @@ -2960,6 +3431,7 @@ message Invoice { was ultimately accepted. Additionally, it's possible that the sender paid MORE that was specified in the original invoice. So we'll record that here as well. + Note: Output only, don't specify for creating an invoice. */ int64 amt_paid_sat = 19; @@ -2970,6 +3442,7 @@ message Invoice { amount was ultimately accepted. Additionally, it's possible that the sender paid MORE that was specified in the original invoice. So we'll record that here as well. + Note: Output only, don't specify for creating an invoice. */ int64 amt_paid_msat = 20; @@ -2982,25 +3455,34 @@ message Invoice { /* The state the invoice is in. + Note: Output only, don't specify for creating an invoice. */ InvoiceState state = 21; - // List of HTLCs paying to this invoice [EXPERIMENTAL]. + /* + List of HTLCs paying to this invoice [EXPERIMENTAL]. + Note: Output only, don't specify for creating an invoice. + */ repeated InvoiceHTLC htlcs = 22; - // List of features advertised on the invoice. + /* + List of features advertised on the invoice. + Note: Output only, don't specify for creating an invoice. + */ map features = 24; /* Indicates if this invoice was a spontaneous payment that arrived via keysend [EXPERIMENTAL]. + Note: Output only, don't specify for creating an invoice. */ bool is_keysend = 25; /* The payment address of this invoice. This value will be used in MPP - payments, and also for newer invoies that always require the MPP paylaod + payments, and also for newer invoices that always require the MPP payload for added end-to-end security. + Note: Output only, don't specify for creating an invoice. */ bytes payment_addr = 26; @@ -3008,6 +3490,17 @@ message Invoice { Signals whether or not this is an AMP invoice. */ bool is_amp = 27; + + /* + [EXPERIMENTAL]: + + Maps a 32-byte hex-encoded set ID to the sub-invoice AMP state for the + given set ID. This field is always populated for AMP invoices, and can be + used along side LookupInvoice to obtain the HTLC information related to a + given sub-invoice. + Note: Output only, don't specify for creating an invoice. + */ + map amp_invoice_state = 28; } enum InvoiceHTLCState { @@ -3327,6 +3820,14 @@ message ListPaymentsRequest { of the returned payments is always oldest first (ascending index order). */ bool reversed = 4; + + /* + If set, all payments (complete and incomplete, independent of the + max_payments parameter) will be counted. Note that setting this to true will + increase the run time of the call significantly on systems that have a lot + of payments, as all of them have to be iterated through to be counted. + */ + bool count_total_payments = 5; } message ListPaymentsResponse { @@ -3344,6 +3845,24 @@ message ListPaymentsResponse { as the index_offset to continue seeking forwards in the next request. */ uint64 last_index_offset = 3; + + /* + Will only be set if count_total_payments in the request was set. Represents + the total number of payments (complete and incomplete, independent of the + number of payments requested in the query) currently present in the payments + database. + */ + uint64 total_num_payments = 4; +} + +message DeletePaymentRequest { + // Payment hash to delete. + bytes payment_hash = 1; + + /* + Only delete failed HTLCs from the payment, not the payment itself. + */ + bool failed_htlcs_only = 2; } message DeleteAllPaymentsRequest { @@ -3356,6 +3875,9 @@ message DeleteAllPaymentsRequest { bool failed_htlcs_only = 2; } +message DeletePaymentResponse { +} + message DeleteAllPaymentsResponse { } @@ -3363,6 +3885,13 @@ message AbandonChannelRequest { ChannelPoint channel_point = 1; bool pending_funding_shim_only = 2; + + /* + Override the requirement for being in dev mode by setting this to true and + confirming the user knows what they are doing and this is a potential foot + gun to lose funds if used on active channels. + */ + bool i_know_what_i_am_doing = 3; } message AbandonChannelResponse { @@ -3484,6 +4013,9 @@ message PolicyUpdateRequest { // goes up to 6 decimal places, so 1e-6. double fee_rate = 4; + // The effective fee rate in micro-satoshis (parts per million). + uint32 fee_rate_ppm = 9; + // The required timelock delta for HTLCs forwarded over the channel. uint32 time_lock_delta = 5; @@ -3498,7 +4030,28 @@ message PolicyUpdateRequest { // If true, min_htlc_msat is applied. bool min_htlc_msat_specified = 8; } +enum UpdateFailure { + UPDATE_FAILURE_UNKNOWN = 0; + UPDATE_FAILURE_PENDING = 1; + UPDATE_FAILURE_NOT_FOUND = 2; + UPDATE_FAILURE_INTERNAL_ERR = 3; + UPDATE_FAILURE_INVALID_PARAMETER = 4; +} + +message FailedUpdate { + // The outpoint in format txid:n + OutPoint outpoint = 1; + + // Reason for the policy update failure. + UpdateFailure reason = 2; + + // A string representation of the policy update error. + string update_error = 3; +} + message PolicyUpdateResponse { + // List of failed policy updates. + repeated FailedUpdate failed_updates = 1; } message ForwardingHistoryRequest { @@ -3519,6 +4072,10 @@ message ForwardingHistoryRequest { // The max number of events to return in the response to this query. uint32 num_max_events = 4; + + // Informs the server if the peer alias should be looked up for each + // forwarding event. + bool peer_alias_lookup = 5; } message ForwardingEvent { // Timestamp is the time (unix epoch offset) that this circuit was @@ -3558,6 +4115,12 @@ message ForwardingEvent { // circuit was completed. uint64 timestamp_ns = 11; + // The peer alias of the incoming channel. + string peer_alias_in = 12; + + // The peer alias of the outgoing channel. + string peer_alias_out = 13; + // TODO(roasbeef): add settlement latency? // * use FPE on the chan id? // * also list failures? @@ -3666,6 +4229,12 @@ message BakeMacaroonRequest { // The root key ID used to create the macaroon, must be a positive integer. uint64 root_key_id = 2; + + /* + Informs the RPC on whether to allow external permissions that LND is not + aware of. + */ + bool allow_external_permissions = 3; } message BakeMacaroonResponse { // The hex encoded macaroon, serialized in binary format. @@ -3877,3 +4446,224 @@ message Op { string entity = 1; repeated string actions = 2; } + +message CheckMacPermRequest { + bytes macaroon = 1; + repeated MacaroonPermission permissions = 2; + string fullMethod = 3; +} + +message CheckMacPermResponse { + bool valid = 1; +} + +message RPCMiddlewareRequest { + /* + The unique ID of the intercepted original gRPC request. Useful for mapping + request to response when implementing full duplex message interception. For + streaming requests, this will be the same ID for all incoming and outgoing + middleware intercept messages of the _same_ stream. + */ + uint64 request_id = 1; + + /* + The raw bytes of the complete macaroon as sent by the gRPC client in the + original request. This might be empty for a request that doesn't require + macaroons such as the wallet unlocker RPCs. + */ + bytes raw_macaroon = 2; + + /* + The parsed condition of the macaroon's custom caveat for convenient access. + This field only contains the value of the custom caveat that the handling + middleware has registered itself for. The condition _must_ be validated for + messages of intercept_type stream_auth and request! + */ + string custom_caveat_condition = 3; + + /* + There are three types of messages that will be sent to the middleware for + inspection and approval: Stream authentication, request and response + interception. The first two can only be accepted (=forward to main RPC + server) or denied (=return error to client). Intercepted responses can also + be replaced/overwritten. + */ + oneof intercept_type { + /* + Intercept stream authentication: each new streaming RPC call that is + initiated against lnd and contains the middleware's custom macaroon + caveat can be approved or denied based upon the macaroon in the stream + header. This message will only be sent for streaming RPCs, unary RPCs + must handle the macaroon authentication in the request interception to + avoid an additional message round trip between lnd and the middleware. + */ + StreamAuth stream_auth = 4; + + /* + Intercept incoming gRPC client request message: all incoming messages, + both on streaming and unary RPCs, are forwarded to the middleware for + inspection. For unary RPC messages the middleware is also expected to + validate the custom macaroon caveat of the request. + */ + RPCMessage request = 5; + + /* + Intercept outgoing gRPC response message: all outgoing messages, both on + streaming and unary RPCs, are forwarded to the middleware for inspection + and amendment. The response in this message is the original response as + it was generated by the main RPC server. It can either be accepted + (=forwarded to the client), replaced/overwritten with a new message of + the same type, or replaced by an error message. + */ + RPCMessage response = 6; + + /* + This is used to indicate to the client that the server has successfully + registered the interceptor. This is only used in the very first message + that the server sends to the client after the client sends the server + the middleware registration message. + */ + bool reg_complete = 8; + } + + /* + The unique message ID of this middleware intercept message. There can be + multiple middleware intercept messages per single gRPC request (one for the + incoming request and one for the outgoing response) or gRPC stream (one for + each incoming message and one for each outgoing response). This message ID + must be referenced when responding (accepting/rejecting/modifying) to an + intercept message. + */ + uint64 msg_id = 7; +} + +message StreamAuth { + /* + The full URI (in the format /./MethodName, for + example /lnrpc.Lightning/GetInfo) of the streaming RPC method that was just + established. + */ + string method_full_uri = 1; +} + +message RPCMessage { + /* + The full URI (in the format /./MethodName, for + example /lnrpc.Lightning/GetInfo) of the RPC method the message was sent + to/from. + */ + string method_full_uri = 1; + + /* + Indicates whether the message was sent over a streaming RPC method or not. + */ + bool stream_rpc = 2; + + /* + The full canonical gRPC name of the message type (in the format + .TypeName, for example lnrpc.GetInfoRequest). In case of an + error being returned from lnd, this simply contains the string "error". + */ + string type_name = 3; + + /* + The full content of the gRPC message, serialized in the binary protobuf + format. + */ + bytes serialized = 4; + + /* + Indicates that the response from lnd was an error, not a gRPC response. If + this is set to true then the type_name contains the string "error" and + serialized contains the error string. + */ + bool is_error = 5; +} + +message RPCMiddlewareResponse { + /* + The request message ID this response refers to. Must always be set when + giving feedback to an intercept but is ignored for the initial registration + message. + */ + uint64 ref_msg_id = 1; + + /* + The middleware can only send two types of messages to lnd: The initial + registration message that identifies the middleware and after that only + feedback messages to requests sent to the middleware. + */ + oneof middleware_message { + /* + The registration message identifies the middleware that's being + registered in lnd. The registration message must be sent immediately + after initiating the RegisterRpcMiddleware stream, otherwise lnd will + time out the attempt and terminate the request. NOTE: The middleware + will only receive interception messages for requests that contain a + macaroon with the custom caveat that the middleware declares it is + responsible for handling in the registration message! As a security + measure, _no_ middleware can intercept requests made with _unencumbered_ + macaroons! + */ + MiddlewareRegistration register = 2; + + /* + The middleware received an interception request and gives feedback to + it. The request_id indicates what message the feedback refers to. + */ + InterceptFeedback feedback = 3; + } +} + +message MiddlewareRegistration { + /* + The name of the middleware to register. The name should be as informative + as possible and is logged on registration. + */ + string middleware_name = 1; + + /* + The name of the custom macaroon caveat that this middleware is responsible + for. Only requests/responses that contain a macaroon with the registered + custom caveat are forwarded for interception to the middleware. The + exception being the read-only mode: All requests/responses are forwarded to + a middleware that requests read-only access but such a middleware won't be + allowed to _alter_ responses. As a security measure, _no_ middleware can + change responses to requests made with _unencumbered_ macaroons! + NOTE: Cannot be used at the same time as read_only_mode. + */ + string custom_macaroon_caveat_name = 2; + + /* + Instead of defining a custom macaroon caveat name a middleware can register + itself for read-only access only. In that mode all requests/responses are + forwarded to the middleware but the middleware isn't allowed to alter any of + the responses. + NOTE: Cannot be used at the same time as custom_macaroon_caveat_name. + */ + bool read_only_mode = 3; +} + +message InterceptFeedback { + /* + The error to return to the user. If this is non-empty, the incoming gRPC + stream/request is aborted and the error is returned to the gRPC client. If + this value is empty, it means the middleware accepts the stream/request/ + response and the processing of it can continue. + */ + string error = 1; + + /* + A boolean indicating that the gRPC message should be replaced/overwritten. + This boolean is needed because in protobuf an empty message is serialized as + a 0-length or nil byte slice and we wouldn't be able to distinguish between + an empty replacement message and the "don't replace anything" case. + */ + bool replace_response = 2; + + /* + If the replace_response field is set to true, this field must contain the + binary serialized gRPC message in the protobuf format. + */ + bytes replacement_serialized = 3; +} \ No newline at end of file diff --git a/proto/others/router.proto b/proto/others/router.proto index 2743dff0..1105fd63 100644 --- a/proto/others/router.proto +++ b/proto/others/router.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -import "rpc.proto"; +import "lightning.proto"; package routerrpc; @@ -22,6 +22,16 @@ service Router { */ rpc TrackPaymentV2 (TrackPaymentRequest) returns (stream lnrpc.Payment); + /* + TrackPayments returns an update stream for every payment that is not in a + terminal state. Note that if payments are in-flight while starting a new + subscription, the start of the payment stream could produce out-of-order + and/or duplicate events. In order to get updates for every in-flight + payment attempt make sure to subscribe to this method before initiating any + payments. + */ + rpc TrackPayments (TrackPaymentsRequest) returns (stream lnrpc.Payment); + /* EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it may cost to send an HTLC to the target end destination. @@ -284,6 +294,12 @@ message SendPaymentRequest { If set, an AMP-payment will be attempted. */ bool amp = 22; + + /* + The time preference for this payment. Set to -1 to optimize for fees + only, to 1 to optimize for reliability only or a value inbetween for a mix. + */ + double time_pref = 23; } message TrackPaymentRequest { @@ -297,6 +313,14 @@ message TrackPaymentRequest { bool no_inflight_updates = 2; } +message TrackPaymentsRequest { + /* + If set, only the final payment updates are streamed back. Intermediate + updates that show which htlcs are still in flight are suppressed. + */ + bool no_inflight_updates = 1; +} + message RouteFeeRequest { /* The destination once wishes to obtain a routing fee quote to. @@ -330,6 +354,14 @@ message SendToRouteRequest { // Route that should be used to attempt to complete the payment. lnrpc.Route route = 2; + + /* + Whether the payment should be marked as failed when a temporary error is + returned from the given route. Set it to true so the payment won't be + failed unless a terminal error is occurred, such as payment timeout, no + routes, incorrect payment details, or insufficient funds. + */ + bool skip_temp_err = 3; } message SendToRouteResponse { @@ -360,6 +392,11 @@ message QueryMissionControlResponse { message XImportMissionControlRequest { // Node pair-level mission control state to be imported. repeated PairHistory pairs = 1; + + // Whether to force override MC pair history. Note that even with force + // override the failure pair is imported before the success pair and both + // still clamp existing failure/success amounts. + bool force = 2; } message XImportMissionControlResponse { @@ -581,6 +618,8 @@ message HtlcEvent { ForwardFailEvent forward_fail_event = 8; SettleEvent settle_event = 9; LinkFailEvent link_fail_event = 10; + SubscribedEvent subscribed_event = 11; + FinalHtlcEvent final_htlc_event = 12; } } @@ -607,6 +646,16 @@ message ForwardFailEvent { } message SettleEvent { + // The revealed preimage. + bytes preimage = 1; +} + +message FinalHtlcEvent { + bool settled = 1; + bool offchain = 2; +} + +message SubscribedEvent { } message LinkFailEvent { @@ -676,7 +725,7 @@ enum PaymentState { FAILED_NO_ROUTE = 3; /* - A non-recoverable error has occured. + A non-recoverable error has occurred. */ FAILED_ERROR = 4; @@ -753,6 +802,10 @@ message ForwardHtlcInterceptRequest { // The onion blob for the next hop bytes onion_blob = 9; + + // The block height at which this htlc will be auto-failed to prevent the + // channel from force-closing. + int32 auto_fail_height = 10; } /** @@ -774,6 +827,21 @@ message ForwardHtlcInterceptResponse { // The preimage in case the resolve action is Settle. bytes preimage = 3; + + // Encrypted failure message in case the resolve action is Fail. + // + // If failure_message is specified, the failure_code field must be set + // to zero. + bytes failure_message = 4; + + // Return the specified failure code in case the resolve action is Fail. The + // message data fields are populated automatically. + // + // If a non-zero failure_code is specified, failure_message must not be set. + // + // For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the + // default value for this field. + lnrpc.Failure.FailureCode failure_code = 5; } enum ResolveHoldForwardAction { @@ -795,4 +863,4 @@ enum ChanStatusAction { } message UpdateChanStatusResponse { -} +} \ No newline at end of file diff --git a/proto/service/methods.proto b/proto/service/methods.proto index 717cd32a..a7125bc4 100644 --- a/proto/service/methods.proto +++ b/proto/service/methods.proto @@ -89,7 +89,7 @@ service LightningPub { option (http_route) = "/api/user/auth"; } // USER - rpc NewAddress(structs.Empty) returns (structs.NewAddressResponse) { + rpc NewAddress(structs.NewAddressRequest) returns (structs.NewAddressResponse) { option (auth_type) = "User"; option (http_method) = "post"; option (http_route) = "/api/user/chain/new"; diff --git a/proto/service/structs.proto b/proto/service/structs.proto index aee6523b..fb16525f 100644 --- a/proto/service/structs.proto +++ b/proto/service/structs.proto @@ -19,7 +19,14 @@ message LndGetInfoRequest { message LndGetInfoResponse { string alias = 1; } - +enum AddressType { + WITNESS_PUBKEY_HASH = 0; + NESTED_PUBKEY_HASH = 1; + TAPROOT_PUBKEY = 2; +} +message NewAddressRequest { + AddressType address_type = 1; +} message NewAddressResponse{ string address = 1; } @@ -41,7 +48,8 @@ message NewInvoiceResponse{ } message PayInvoiceRequest{ - string invoce = 1; + string invoice = 1; + int64 amount = 2; } message PayInvoiceResponse{ @@ -50,8 +58,9 @@ message PayInvoiceResponse{ message OpenChannelRequest{ string destination = 1; - int64 channel_balance = 2; + int64 funding_amount = 2; int64 push_amount = 3; + string close_address = 4; } message OpenChannelResponse{ diff --git a/src/auth.ts b/src/auth.ts index d601af11..737f5284 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -1,10 +1,12 @@ import { ServerOptions } from "../proto/autogenerated/ts/express_server"; - -const serverOptions: ServerOptions = { - AdminAuthGuard: async (authHeader) => { console.log("admin auth login with header: " + authHeader); return { admin_token: "__Admin__" } }, - UserAuthGuard: async (authHeader) => { console.log("user auth login with header: " + authHeader); return { user_token: "__user__" } }, - GuestAuthGuard: async (_) => ({}), - encryptCallback: async (_, b) => b, - decryptCallback: async (_, b) => b, +import Main from './services/main' +const serverOptions = (mainHandler: Main): ServerOptions => { + return { + AdminAuthGuard: async (authHeader) => { console.log("admin auth login with header: " + authHeader); return { admin_id: "__Admin__" } }, + UserAuthGuard: async (authHeader) => { return { user_id: mainHandler.DecodeUserToken(authHeader) } }, + GuestAuthGuard: async (_) => ({}), + encryptCallback: async (_, b) => b, + decryptCallback: async (_, b) => b, + } } export default serverOptions \ No newline at end of file diff --git a/src/index.spec.ts b/src/index.spec.ts index 74e3bca4..923a9619 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -1,37 +1,59 @@ import 'dotenv/config' // TODO - test env -import { AfterAll, BeforeAll, expect, Test, TestSuite } from 'testyts'; +import { AfterAll, BeforeAll, expect, FTest, Test, TestSuite } from 'testyts'; import NewServer from '../proto/autogenerated/ts/express_server' import NewClient from '../proto/autogenerated/ts/http_client' import methods from './services/serverMethods'; import serverOptions from './auth'; +import GetServerMethods from './services/serverMethods' +import Main, { LoadMainSettingsFromEnv } from './services/main' +import * as Types from '../proto/autogenerated/ts/types'; const testPort = 4000 -const server = NewServer(methods, { ...serverOptions, throwErrors: true }) -const client = NewClient({ - baseUrl: `http://localhost:${testPort}`, - retrieveAdminAuth: async () => (""), - retrieveGuestAuth: async () => (""), - retrieveUserAuth: async () => (""), - decryptCallback: async (b) => b, - encryptCallback: async (b) => b, - deviceId: "device0" -}) + @TestSuite() export class ServerTestSuite { + userAuthHeader = "" + client = NewClient({ + baseUrl: `http://localhost:${testPort}`, + retrieveAdminAuth: async () => (""), + retrieveGuestAuth: async () => (""), + retrieveUserAuth: async () => this.userAuthHeader, + decryptCallback: async (b) => b, + encryptCallback: async (b) => b, + deviceId: "device0" + }) + mainHandler = new Main(LoadMainSettingsFromEnv()) // TODO - test env file + server = NewServer(GetServerMethods(this.mainHandler), { ...serverOptions(this.mainHandler), throwErrors: true }) + + @BeforeAll() - startServer() { - server.Listen(testPort) + async startServer() { + await this.mainHandler.storage.Connect() + this.server.Listen(testPort) } @AfterAll() stopServer() { - server.Close() + this.server.Close() } @Test() async health() { - await client.Health() + await this.client.Health() } @Test() async getInfo() { - console.log(await client.LndGetInfo({ node_id: 0 })) + console.log(await this.client.LndGetInfo({ node_id: 0 })) + } + @Test() + async createUser() { + const res = await this.client.AddUser({ name: "test", callback_url: "http://...", secret: "shhhhhht" }) + if (res.status === 'ERROR') throw new Error(res.reason) + console.log(res.result) + const user = await this.mainHandler.storage.GetUser(res.result.user_id) + console.log(user) + this.userAuthHeader = res.result.auth_token + } + @Test() + async newAddress() { + console.log(await this.client.NewAddress({ address_type: Types.AddressType.WITNESS_PUBKEY_HASH })) } } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 07bcc094..a75e22bd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,14 +2,10 @@ import 'dotenv/config' import NewServer from '../proto/autogenerated/ts/express_server' import GetServerMethods from './services/serverMethods' import serverOptions from './auth'; -import Storage from './services/storage' -import LND from './services/lnd' -import Main from './services/main' +import Main, { LoadMainSettingsFromEnv } from './services/main' (async () => { - const storageHandler = new Storage() - const lndHandler = new LND() - const mainHandler = new Main(storageHandler, lndHandler) - await storageHandler.Connect() - const Server = NewServer(GetServerMethods(mainHandler), serverOptions) + const mainHandler = new Main(LoadMainSettingsFromEnv()) + await mainHandler.storage.Connect() + const Server = NewServer(GetServerMethods(mainHandler), serverOptions(mainHandler)) Server.Listen(3000) })() diff --git a/src/server.ts b/src/server.ts deleted file mode 100644 index 3f65bc07..00000000 --- a/src/server.ts +++ /dev/null @@ -1,4 +0,0 @@ -import NewServer from '../proto/autogenerated/ts/express_server' -import GetServerMethods from './services/serverMethods' -import serverOptions from './auth'; -export default NewServer(GetServerMethods(), serverOptions) \ No newline at end of file diff --git a/src/services/lnd/addInvoiceReq.ts b/src/services/lnd/addInvoiceReq.ts new file mode 100644 index 00000000..f981598b --- /dev/null +++ b/src/services/lnd/addInvoiceReq.ts @@ -0,0 +1,34 @@ +import { OpenChannelRequest, Invoice } from "../../../proto/lnd/lightning"; + +export const AddInvoiceReq = (value: number, memo = "", privateHints = false, expiry = 60 * 60): Invoice => ({ + expiry: BigInt(expiry), + memo: memo, + private: privateHints, + value: BigInt(value), + + fallbackAddr: "", + cltvExpiry: 0n, + descriptionHash: Buffer.alloc(0), + features: {}, + isAmp: false, + rPreimage: Buffer.alloc(0), + routeHints: [], + valueMsat: 0n, + + addIndex: 0n, + ampInvoiceState: {}, + amtPaidMsat: 0n, + amtPaidSat: 0n, + creationDate: 0n, + htlcs: [], + isKeysend: false, + paymentAddr: Buffer.alloc(0), + paymentRequest: "", + rHash: Buffer.alloc(0), + settleDate: 0n, + settleIndex: 0n, + state: 0, + + amtPaid: 0n, + settled: false, +}) \ No newline at end of file diff --git a/src/services/lnd/index.spec.ts b/src/services/lnd/index.spec.ts new file mode 100644 index 00000000..82bb0383 --- /dev/null +++ b/src/services/lnd/index.spec.ts @@ -0,0 +1,36 @@ +import 'dotenv/config' // TODO - test env +import { AfterAll, BeforeAll, expect, FTest, FTestSuite, Test, TestSuite } from 'testyts'; +import LndHandler, { LoadLndSettingsFromEnv } from '.' +import * as Types from '../../../proto/autogenerated/ts/types'; +@TestSuite() +export class LndTestSuite { + lnd: LndHandler + @BeforeAll() + createLnd() { + this.lnd = new LndHandler(LoadLndSettingsFromEnv()) + } + @AfterAll() + stopStreams() { + } + @Test() + async getAlias() { + const res = await this.lnd.GetInfo() + expect.toBeEqual(res.alias, "alice") + } + @Test() + async newAddress() { + const res = await this.lnd.NewAddress(Types.AddressType.WITNESS_PUBKEY_HASH) + console.log(res) + } + @Test() + async newInvoice() { + const res = await this.lnd.NewInvoice(1000) + console.log(res) + } + + @Test() + async openChannel() { + //const res = await this.lnd.OpenChannel("025ed7fc85fc05a07fc5acc13a6e3836cd11c5587c1d400afcd22630a9e230eb7a", "", 20000, 0) + } + +} \ No newline at end of file diff --git a/src/services/lnd/index.ts b/src/services/lnd/index.ts index 51c610b7..dd145186 100644 --- a/src/services/lnd/index.ts +++ b/src/services/lnd/index.ts @@ -2,22 +2,72 @@ import { credentials, Metadata } from '@grpc/grpc-js' import { GrpcTransport } from "@protobuf-ts/grpc-transport"; import fs from 'fs' -import { LightningClient } from '../../../proto/lnd/rpc.client' +import * as Types from '../../../proto/autogenerated/ts/types' +import { LightningClient } from '../../../proto/lnd/lightning.client' import { InvoicesClient } from '../../../proto/lnd/invoices.client' import { RouterClient } from '../../../proto/lnd/router.client' -import { GetInfoResponse } from '../../../proto/lnd/rpc' -const DefaultMetadata = (deadline = 10 * 1000) => ({ deadline: Date.now() + deadline }) +import { GetInfoResponse, AddressType, NewAddressResponse, AddInvoiceResponse, Invoice_InvoiceState, PayReq, Payment_PaymentStatus, Payment } from '../../../proto/lnd/lightning' +import { OpenChannelReq } from './openChannelReq'; +import { AddInvoiceReq } from './addInvoiceReq'; +import { PayInvoiceReq } from './payInvoiceReq'; +const DeadLineMetadata = (deadline = 10 * 1000) => ({ deadline: Date.now() + deadline }) +export type LndSettings = { + lndAddr: string + lndCertPath: string + lndMacaroonPath: string + walletAccount: string + feeRateLimit: number + feeFixedLimit: number +} +export const LoadLndSettingsFromEnv = (test = false): LndSettings => { + const lndAddr = process.env.LND_ADDRESS; + const lndCertPath = process.env.LND_CERT_PATH; + const lndMacaroonPath = process.env.LND_MACAROON_PATH; + if (!lndAddr) throw new Error(`missing env for LND_ADDRESS`) + if (!lndCertPath) throw new Error(`missing env for LND_CERT_PATH`) + if (!lndMacaroonPath) throw new Error(`missing env for LND_MACAROON_PATH`) + + if (!process.env.LIMIT_FEE_RATE_MILLISATS) { + throw new Error(`missing env for LIMIT_FEE_RATE_MILLISATS`) + } + if (isNaN(+process.env.LIMIT_FEE_RATE_MILLISATS) || !Number.isInteger(+process.env.LIMIT_FEE_RATE_MILLISATS)) { + throw new Error("LIMIT_FEE_RATE_MILLISATS must be an integer number"); + } + + if (!process.env.LIMIT_FEE_FIXED_SATS) { + throw new Error(`missing env for LIMIT_FEE_FIXED_SATS`) + } + if (isNaN(+process.env.LIMIT_FEE_FIXED_SATS) || !Number.isInteger(+process.env.LIMIT_FEE_FIXED_SATS)) { + throw new Error("LIMIT_FEE_FIXED_SATS must be an integer number"); + } + const feeRateLimit = +process.env.LIMIT_FEE_RATE_MILLISATS / 1000 + const feeFixedLimit = +process.env.LIMIT_FEE_FIXED_SATS + + const walletAccount = process.env.LND_WALLET_ACCOUNT || "" + return { lndAddr, lndCertPath, lndMacaroonPath, walletAccount, feeRateLimit, feeFixedLimit } +} +type TxOutput = { + hash: string + index: number +} +export type AddressPaidCb = (txOutput: TxOutput, address: string, amount: number) => void +export type InvoicePaidCb = (paymentRequest: string, amount: number) => void export default class { lightning: LightningClient invoices: InvoicesClient router: RouterClient - constructor() { - const lndAddr = process.env.LND_ADDRESS; - const lndCertPath = process.env.LND_CERT_PATH; - const lndMacaroonPath = process.env.LND_MACAROON_PATH; - if (!lndAddr || !lndCertPath || !lndMacaroonPath) { - throw new Error(`Something missing from ADDR/TLS/MACAROON`); - } + settings: LndSettings + ready = false + latestKnownBlockHeigh = 0 + latestKnownSettleIndex = 0 + abortController = new AbortController() + addressPaidCb: AddressPaidCb + invoicePaidCb: InvoicePaidCb + constructor(settings: LndSettings, addressPaidCb: AddressPaidCb, invoicePaidCb: InvoicePaidCb) { + this.settings = settings + this.addressPaidCb = addressPaidCb + this.invoicePaidCb = invoicePaidCb + const { lndAddr, lndCertPath, lndMacaroonPath } = this.settings const lndCert = fs.readFileSync(lndCertPath); const macaroon = fs.readFileSync(lndMacaroonPath).toString('hex'); const sslCreds = credentials.createSsl(lndCert); @@ -36,36 +86,134 @@ export default class { this.lightning = new LightningClient(transport) this.invoices = new InvoicesClient(transport) this.router = new RouterClient(transport) + this.SubscribeAddressPaid() } + Stop() { + this.abortController.abort() + } + async Warmup() { this.ready = true } + async GetInfo(): Promise { - const res = await this.lightning.getInfo({}, DefaultMetadata()) + const res = await this.lightning.getInfo({}, DeadLineMetadata()) return res.response } - async OpenChannel(destination: string, closeAddress: string, fundingAmount: number, pushSats) { - const stream = this.lightning.openChannel({ - nodePubkey: Buffer.from(destination, 'hex'), - closeAddress: closeAddress, - localFundingAmount: fundingAmount, - pushSats: pushSats, - sa: satPerByte + checkReady() { + if (!this.ready) throw new Error("lnd not ready, warmup required before usage") + } + SubscribeAddressPaid() { + const stream = this.lightning.subscribeTransactions({ + account: this.settings.walletAccount, + endHeight: 0, + startHeight: this.latestKnownBlockHeigh, + }, { abort: this.abortController.signal }) + stream.responses.onMessage(tx => { + if (tx.blockHeight > this.latestKnownBlockHeigh) { + this.latestKnownBlockHeigh = tx.blockHeight + } + if (tx.numConfirmations > 0) { + tx.outputDetails.forEach(output => { + if (output.isOurAddress) { + this.addressPaidCb({ hash: tx.txHash, index: Number(output.outputIndex) }, output.address, Number(output.amount)) + } + }) + } }) + stream.responses.onError(error => { + // TODO... + }) + } - return new Promise(res => { - stream.on('data', response => { - if (response) { - res(true) + SubscribeInvoicePaid() { + const stream = this.lightning.subscribeInvoices({ + settleIndex: BigInt(this.latestKnownSettleIndex), + addIndex: 0n, + }, { abort: this.abortController.signal }) + stream.responses.onMessage(invoice => { + if (invoice.state === Invoice_InvoiceState.SETTLED) { + this.latestKnownSettleIndex = Number(invoice.settleIndex) + this.invoicePaidCb(invoice.paymentRequest, Number(invoice.amtPaidSat)) + } + }) + stream.responses.onError(error => { + // TODO... + }) + } + async NewAddress(addressType: Types.AddressType): Promise { + this.checkReady() + let lndAddressType: AddressType + switch (addressType) { + case Types.AddressType.NESTED_PUBKEY_HASH: + lndAddressType = AddressType.NESTED_PUBKEY_HASH + break; + case Types.AddressType.WITNESS_PUBKEY_HASH: + lndAddressType = AddressType.WITNESS_PUBKEY_HASH + break; + case Types.AddressType.TAPROOT_PUBKEY: + lndAddressType = AddressType.TAPROOT_PUBKEY + break; + default: + throw new Error("unknown address type " + addressType) + } + const res = await this.lightning.newAddress({ account: this.settings.walletAccount, type: lndAddressType }, DeadLineMetadata()) + return res.response + } + + async NewInvoice(value: number): Promise { + this.checkReady() + const res = await this.lightning.addInvoice(AddInvoiceReq(value), DeadLineMetadata()) + return res.response + } + + async DecodeInvoice(paymentRequest: string): Promise { + const res = await this.lightning.decodePayReq({ payReq: paymentRequest }, DeadLineMetadata()) + return res.response + } + + GetFeeLimitAmount(amount: number) { + return Math.ceil(amount * this.settings.feeRateLimit + this.settings.feeFixedLimit); + } + + async PayInvoice(invoice: string, amount: number, feeLimit: number): Promise { + this.checkReady() + const abortController = new AbortController() + const stream = this.router.sendPaymentV2(PayInvoiceReq(invoice, amount, feeLimit), { abort: abortController.signal }) + return new Promise((res, rej) => { + stream.responses.onError(error => { + rej(error) + }) + stream.responses.onMessage(payment => { + switch (payment.status) { + case Payment_PaymentStatus.FAILED: + rej(payment.failureReason) + return + case Payment_PaymentStatus.SUCCEEDED: + res(payment) } }) - stream.on('error', err => { - if (err) { - console.error("err") - console.error(err) - this.statusAll(true) - // move to next client after the refresh - .then(() => this.nextPreferredClient()) - res(false) + }) + } + + + async OpenChannel(destination: string, closeAddress: string, fundingAmount: number, pushSats: number): Promise { + this.checkReady() + const abortController = new AbortController() + const req = OpenChannelReq(destination, closeAddress, fundingAmount, pushSats) + const stream = this.lightning.openChannel(req, { abort: abortController.signal }) + return new Promise((res, rej) => { + stream.responses.onMessage(message => { + switch (message.update.oneofKind) { + case 'chanPending': + abortController.abort() + res(Buffer.from(message.pendingChanId).toString('base64')) + break + default: + abortController.abort() + rej("unexpected state response: " + message.update.oneofKind) } }) + stream.responses.onError(error => { + rej(error) + }) }) } } diff --git a/src/services/lnd/openChannelReq.ts b/src/services/lnd/openChannelReq.ts new file mode 100644 index 00000000..3010e96b --- /dev/null +++ b/src/services/lnd/openChannelReq.ts @@ -0,0 +1,32 @@ +import { OpenChannelRequest } from "../../../proto/lnd/lightning"; + +export const OpenChannelReq = (destination: string, closeAddress: string, fundingAmount: number, pushSats: number): OpenChannelRequest => ({ + nodePubkey: Buffer.from(destination, 'hex'), + closeAddress: closeAddress, + localFundingAmount: BigInt(fundingAmount), + pushSat: BigInt(pushSats), + + satPerVbyte: 0n, // TBD + private: false, + minConfs: 0, // TBD + baseFee: 0n, // TBD + feeRate: 0n, // TBD + zeroConf: false, + maxLocalCsv: 0, + remoteCsvDelay: 0, + spendUnconfirmed: false, + minHtlcMsat: 0n, + remoteChanReserveSat: 0n, + remoteMaxHtlcs: 0, + remoteMaxValueInFlightMsat: 0n, + targetConf: 0, + useBaseFee: false, + useFeeRate: false, + + // Default stuff + commitmentType: 0, + scidAlias: false, + nodePubkeyString: "", + satPerByte: 0n, + +}) \ No newline at end of file diff --git a/src/services/lnd/payInvoiceReq.ts b/src/services/lnd/payInvoiceReq.ts new file mode 100644 index 00000000..b8c5223e --- /dev/null +++ b/src/services/lnd/payInvoiceReq.ts @@ -0,0 +1,30 @@ +import { OpenChannelRequest } from "../../../proto/lnd/lightning"; +import { SendPaymentRequest } from "../../../proto/lnd/router"; + +export const PayInvoiceReq = (invoice: string, amount: number, feeLimit: number): SendPaymentRequest => ({ + amt: BigInt(amount), + feeLimitSat: BigInt(feeLimit), + noInflightUpdates: true, + paymentRequest: invoice, + maxParts: 3, + timeoutSeconds: 50, + + allowSelfPayment: false, + amp: false, + amtMsat: 0n, + cltvLimit: 0, + dest: Buffer.alloc(0), + destCustomRecords: {}, + destFeatures: [], + feeLimitMsat: 0n, + finalCltvDelta: 0, + lastHopPubkey: Buffer.alloc(0), + maxShardSizeMsat: 0n, + outgoingChanIds: [], + paymentAddr: Buffer.alloc(0), + paymentHash: Buffer.alloc(0), + routeHints: [], + timePref: 0, + + outgoingChanId: "" +}) \ No newline at end of file diff --git a/src/services/main/index.ts b/src/services/main/index.ts index 44b777d6..605e4771 100644 --- a/src/services/main/index.ts +++ b/src/services/main/index.ts @@ -1,25 +1,97 @@ -import Storage from '../storage' +import jwt from 'jsonwebtoken' +import Storage, { LoadStorageSettingsFromEnv, StorageSettings } from '../storage' import * as Types from '../../../proto/autogenerated/ts/types' -import LND from '../lnd' +import LND, { AddressPaidCb, InvoicePaidCb, LndSettings, LoadLndSettingsFromEnv } from '../lnd' +export type MainSettings = { + storageSettings: StorageSettings, + lndSettings: LndSettings, + jwtSecret: string +} +export const LoadMainSettingsFromEnv = (test = false): MainSettings => { + const jwtSecret = process.env.JWT_SECRET; + if (!jwtSecret) throw new Error(`missing env for JWT_SECRET`) + return { + lndSettings: LoadLndSettingsFromEnv(test), + storageSettings: LoadStorageSettingsFromEnv(test), + jwtSecret + } +} export default class { storage: Storage lnd: LND - constructor(storageHandler: Storage, lndHandler: LND) { - this.storage = storageHandler - this.lnd = lndHandler + settings: MainSettings + constructor(settings: MainSettings) { + this.settings = settings + this.storage = new Storage(settings.storageSettings) + this.lnd = new LND(settings.lndSettings, this.addressPaidCb, this.invoicePaidCb) } + addressPaidCb: AddressPaidCb = (txOutput, address, amount) => { + this.storage.StartTransaction(async tx => { + const userAddress = await this.storage.GetAddressOwner(address, tx) + if (!userAddress) { return } + // This call will fail if the transaction is already registered + const addedTx = await this.storage.AddAddressTransaction(address, txOutput.hash, txOutput.index, amount) + await this.storage.IncrementUserBalance(userAddress.user.user_id, addedTx.amount, tx) + }) + } + invoicePaidCb: InvoicePaidCb = (paymentRequest, amount) => { + this.storage.StartTransaction(async tx => { + const userInvoice = await this.storage.GetInvoiceOwner(paymentRequest, tx) + if (!userInvoice || userInvoice.paid) { return } + // This call will fail if the invoice is already registered + await this.storage.FlagInvoiceAsPaid(userInvoice.serial_id, amount, tx) + await this.storage.IncrementUserBalance(userInvoice.user.user_id, amount) + }) + } + SignUserToken(userId: string): string { + return jwt.sign({ userId }, this.settings.jwtSecret); + } + + DecodeUserToken(token?: string): string { + if (!token) throw new Error("empty auth token provided") + return (jwt.verify(token, this.settings.jwtSecret) as { userId: string }).userId + } + async AddUser(req: Types.AddUserRequest): Promise { const newUser = await this.storage.AddUser(req.name, req.callback_url, req.secret) return { user_id: newUser.user_id, - auth_token: "TMP" + auth_token: this.SignUserToken(newUser.user_id) } } - async OpenChannel(req: Types.OpenChannelRequest): Promise { + async NewAddress(userId: string, req: Types.NewAddressRequest): Promise { + const res = await this.lnd.NewAddress(req.address_type) + const userAddress = await this.storage.AddUserAddress(userId, res.address) + return { + address: userAddress.address + } } - async PayInvoice(rootToken: string, invoice: string): Promise { return "" } - async GenerateInvoice(rootToken: string, amountSats: number): Promise { return "" } - async GenerateAddress(rootToken: string): Promise { return "" } - // payment received sub + + async NewInvoice(userId: string, req: Types.NewInvoiceRequest): Promise { + const res = await this.lnd.NewInvoice(req.amount_sats) + const userInvoice = await this.storage.AddUserInvoice(userId, res.paymentRequest) + return { + invoice: userInvoice.invoice + } + } + + async PayInvoice(userId: string, req: Types.PayInvoiceRequest): Promise { + const decoded = await this.lnd.DecodeInvoice(req.invoice) + const payAmount = Number(decoded.numSatoshis) + const feeLimit = this.lnd.GetFeeLimitAmount(payAmount) + const decrement = payAmount + feeLimit + // this call will fail if the user balance is not enough + await this.storage.DecrementUserBalance(userId, decrement) + try { + await this.lnd.PayInvoice(req.invoice, req.amount, feeLimit) + + } catch (e) { + await this.storage.IncrementUserBalance(userId, decrement) + throw e + } + await this.storage.AddUserPayment(userId, req.invoice,) + } + + async OpenChannel(userId: string, req: Types.OpenChannelRequest): Promise { throw new Error("WIP") } } \ No newline at end of file diff --git a/src/services/serverMethods/index.ts b/src/services/serverMethods/index.ts index 3c70ee44..e86aca58 100644 --- a/src/services/serverMethods/index.ts +++ b/src/services/serverMethods/index.ts @@ -11,8 +11,8 @@ export default (mainHandler: Main): Types.ServerMethods => { AddUser: async (ctx: Types.GuestContext, req: Types.AddUserRequest): Promise => { const err = Types.AddUserRequestValidate(req, { callback_url_CustomCheck: url => url.startsWith("http://") || url.startsWith("https://"), - name_CustomCheck: name => req.name.length > 0, - secret_CustomCheck: secret => secret.length > 8 + name_CustomCheck: name => name.length > 0, + secret_CustomCheck: secret => secret.length >= 8 }) if (err != null) throw new Error(err.message) return mainHandler.AddUser(req) @@ -22,15 +22,15 @@ export default (mainHandler: Main): Types.ServerMethods => { }, OpenChannel: async (ctx: Types.UserContext, req: Types.OpenChannelRequest): Promise => { const err = Types.OpenChannelRequestValidate(req, { - channel_balance_CustomCheck: balance => balance > 0, + funding_amount_CustomCheck: amt => amt > 0, push_amount_CustomCheck: amt => amt > 0, destination_CustomCheck: dest => dest !== "" }) if (err != null) throw new Error(err.message) - return mainHandler.OpenChannel(req) + return mainHandler.OpenChannel(ctx.user_id, req) }, - NewAddress: async (ctx: Types.UserContext): Promise => { - throw new Error("unimplemented") + NewAddress: async (ctx: Types.UserContext, req: Types.NewAddressRequest): Promise => { + return mainHandler.NewAddress(ctx.user_id, req) }, PayAddress: async (ctx: Types.UserContext, req: Types.PayAddressRequest): Promise => { throw new Error("unimplemented") diff --git a/src/services/storage/db.ts b/src/services/storage/db.ts index f71b8117..b0db4963 100644 --- a/src/services/storage/db.ts +++ b/src/services/storage/db.ts @@ -1,13 +1,24 @@ import "reflect-metadata" import { DataSource } from "typeorm" +import { AddressTransaction } from "./entity/AddressTransaction" import { User } from "./entity/User" - -const AppDataSource = new DataSource({ - type: "sqlite", - database: `db.sqlite`, - logging: true, - entities: [User], -}) -export default async () => { - return AppDataSource.initialize() -} \ No newline at end of file +import { UserAddress } from "./entity/UserAddress" +import { UserInvoice } from "./entity/UserInvoice" +import { UserPayment } from "./entity/UserPayment" +export type DbSettings = { + databaseFile: string +} +export const LoadDbSettingsFromEnv = (test = false): DbSettings => { + const databaseFile = process.env.DATABASE_FILE + if (!databaseFile) throw new Error(`missing env for DATABASE_FILE`) + return { databaseFile: test ? ":memory:" : databaseFile } +} +export default async (settings: DbSettings) => { + return new DataSource({ + type: "sqlite", + database: settings.databaseFile, + //logging: true, + entities: [User, UserInvoice, UserAddress, AddressTransaction, UserPayment], + synchronize: true + }).initialize() +} \ No newline at end of file diff --git a/src/services/storage/entity/AddressTransaction.ts b/src/services/storage/entity/AddressTransaction.ts new file mode 100644 index 00000000..36e08133 --- /dev/null +++ b/src/services/storage/entity/AddressTransaction.ts @@ -0,0 +1,23 @@ +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne } from "typeorm" +import { User } from "./User" +import { UserAddress } from "./UserAddress" + +@Entity() +@Index("address_transaction_unique", ["tx_hash", "output_index"], { unique: true }) +export class AddressTransaction { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => UserAddress) + user_address: UserAddress + + @Column() + tx_hash: string + + @Column() + output_index: number + + @Column() + amount: number +} diff --git a/src/services/storage/entity/User.ts b/src/services/storage/entity/User.ts index 99049af7..1d26459a 100644 --- a/src/services/storage/entity/User.ts +++ b/src/services/storage/entity/User.ts @@ -21,9 +21,9 @@ export class User { @Column() callbackUrl: string - @Column({ type: 'integer' }) + @Column({ type: 'integer', default: 0 }) balance_sats: number - @Column() + @Column({ default: false }) locked: boolean } diff --git a/src/services/storage/entity/UserAddress.ts b/src/services/storage/entity/UserAddress.ts new file mode 100644 index 00000000..aa8853ae --- /dev/null +++ b/src/services/storage/entity/UserAddress.ts @@ -0,0 +1,19 @@ +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne } from "typeorm" +import { User } from "./User" + +@Entity() +export class UserAddress { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => User) + user: User + + @Column() + @Index({ unique: true }) + address: string + + @Column() + callbackUrl: string +} diff --git a/src/services/storage/entity/UserInvoice.ts b/src/services/storage/entity/UserInvoice.ts new file mode 100644 index 00000000..9d223dd8 --- /dev/null +++ b/src/services/storage/entity/UserInvoice.ts @@ -0,0 +1,25 @@ +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne } from "typeorm" +import { User } from "./User" + +@Entity() +export class UserInvoice { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => User) + user: User + + @Column() + @Index({ unique: true }) + invoice: string + + @Column({ default: false }) + paid: boolean + + @Column() + callbackUrl: string + + @Column({ default: 0 }) + settle_amount: number +} diff --git a/src/services/storage/entity/UserPayment.ts b/src/services/storage/entity/UserPayment.ts new file mode 100644 index 00000000..45d2eb2f --- /dev/null +++ b/src/services/storage/entity/UserPayment.ts @@ -0,0 +1,19 @@ +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne } from "typeorm" +import { User } from "./User" + +@Entity() +export class UserPayment { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => User) + user: User + + @Column() + @Index({ unique: true }) + invoice: string + + @Column() + amount: number +} diff --git a/src/services/storage/index.ts b/src/services/storage/index.ts index 19b13a1f..31088026 100644 --- a/src/services/storage/index.ts +++ b/src/services/storage/index.ts @@ -1,19 +1,38 @@ import { DataSource, EntityManager } from "typeorm" import crypto from 'crypto'; -import NewDB from "./db" +import NewDB, { DbSettings, LoadDbSettingsFromEnv } from "./db" import { User } from "./entity/User" +import { UserAddress } from "./entity/UserAddress"; +import { UserInvoice } from "./entity/UserInvoice"; +import { AddressTransaction } from "./entity/AddressTransaction"; +import { UserPayment } from "./entity/UserPayment"; +export type StorageSettings = { + dbSettings: DbSettings +} +export const LoadStorageSettingsFromEnv = (test = false): StorageSettings => { + return { dbSettings: LoadDbSettingsFromEnv(test) } +} export default class { - DB: DataSource - async Connect() { - this.DB = await NewDB() + DB: DataSource | EntityManager + settings: StorageSettings + constructor(settings: StorageSettings) { + this.settings = settings } - async AddUser(name: string, callbackUrl: string, secret: string, entityManager = this.DB) { - return entityManager.getRepository(User).create({ + async Connect() { + this.DB = await NewDB(this.settings.dbSettings) + } + StartTransaction(exec: (entityManager: EntityManager) => Promise) { + this.DB.transaction(exec) + } + async AddUser(name: string, callbackUrl: string, secret: string, entityManager = this.DB): Promise { + const newUser = entityManager.getRepository(User).create({ + user_id: crypto.randomBytes(32).toString('hex'), name: name, callbackUrl: callbackUrl, secret_sha256: crypto.createHash('sha256').update(secret).digest('base64') }) + return entityManager.getRepository(User).save(newUser) } FindUser(userId: string, entityManager = this.DB) { return entityManager.getRepository(User).findOne({ @@ -22,13 +41,71 @@ export default class { } }) } - async GetUser(user_id: string, entityManager = this.DB): Promise { - const user = await this.FindUser(user_id, entityManager) + async GetUser(userId: string, entityManager = this.DB): Promise { + const user = await this.FindUser(userId, entityManager) if (!user) { - throw new Error(`user ${user_id} not found`) // TODO: fix logs doxing + throw new Error(`user ${userId} not found`) // TODO: fix logs doxing } return user } + + async AddAddressTransaction(address: string, txHash: string, outputIndex: number, amount: number, entityManager = this.DB) { + const newAddressTransaction = entityManager.getRepository(AddressTransaction).create({ + user_address: { address: address }, + tx_hash: txHash, + output_index: outputIndex, + amount: amount + }) + return entityManager.getRepository(AddressTransaction).save(newAddressTransaction) + } + + async AddUserAddress(userId: string, address: string, callbackUrl = "", entityManager = this.DB): Promise { + const newUserAddress = entityManager.getRepository(UserAddress).create({ + address, + callbackUrl, + user: { user_id: userId } + }) + return entityManager.getRepository(UserAddress).save(newUserAddress) + } + + async FlagInvoiceAsPaid(invoiceSerialId: number, amount: number, entityManager = this.DB) { + return entityManager.getRepository(UserInvoice).update(invoiceSerialId, { paid: true, settle_amount: amount }) + } + + async AddUserInvoice(userId: string, invoice: string, callbackUrl = "", entityManager = this.DB): Promise { + const newUserInvoice = entityManager.getRepository(UserInvoice).create({ + invoice: invoice, + callbackUrl, + user: { user_id: userId } + }) + return entityManager.getRepository(UserInvoice).save(newUserInvoice) + } + + async GetAddressOwner(address: string, entityManager = this.DB): Promise { + return entityManager.getRepository(UserAddress).findOne({ + where: { + address + } + }) + } + + async GetInvoiceOwner(paymentRequest: string, entityManager = this.DB): Promise { + return entityManager.getRepository(UserInvoice).findOne({ + where: { + invoice: paymentRequest + } + }) + } + + async AddUserPayment(userId: string, invoice: string, amount: number, entityManager = this.DB): Promise { + const newPayment = entityManager.getRepository(UserPayment).create({ + user: { user_id: userId }, + amount, + invoice + }) + return entityManager.getRepository(UserPayment).save(newPayment) + } + LockUser(userId: string, entityManager = this.DB) { return entityManager.getRepository(User).update({ user_id: userId diff --git a/tsconfig.json b/tsconfig.json index 64839f0f..7e549e23 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ /* Visit https://aka.ms/tsconfig.json to read more about this file */ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "ES2016" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, + "target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */, "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, // "lib": [], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */