diff --git a/example.env b/example.env index 8bdf0bf2..dcd65529 100644 --- a/example.env +++ b/example.env @@ -9,6 +9,7 @@ SERVICE_FEE_INCOMING_TX_PERCENT=0 SERVICE_FEE_OUTGOING_TX_PERCENT=0 SERVICE_FEE_INCOMING_INVOICE_PERCENT=0 SERVICE_FEE_OUTGOING_INVOICE_PERCENT=0 +SERVICE_URL=http://localhost:8080 NOSTR_PUBLIC_KEY= NOSTR_PRIVATE_KEY= NOSTR_RELAYS= diff --git a/package-lock.json b/package-lock.json index d93831db..18e3f115 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@types/node": "^17.0.31", "@types/secp256k1": "^4.0.3", "axios": "^0.27.2", + "bech32": "^2.0.0", "chai": "^4.3.7", "copyfiles": "^2.4.1", "cors": "^2.8.5", @@ -48,6 +49,7 @@ "@types/lodash": "^4.14.182", "@types/node": "^16.11.10", "@types/uuid": "^8.3.4", + "nodemon": "^2.0.20", "ts-node": "10.7.0", "typescript": "4.5.2" } @@ -663,6 +665,19 @@ "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/app-root-path": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", @@ -771,6 +786,20 @@ } ] }, + "node_modules/bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/bindings": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", @@ -1018,6 +1047,33 @@ "node": "*" } }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, "node_modules/chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", @@ -1733,6 +1789,20 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -2087,6 +2157,12 @@ "node": ">= 4" } }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -2139,6 +2215,18 @@ "node": ">= 0.10" } }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2773,6 +2861,79 @@ "safe-buffer": "~5.2.0" } }, + "node_modules/nodemon": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", + "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=8.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/nodemon/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/nodemon/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==", + "dev": true + }, + "node_modules/nodemon/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/nodemon/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/noms": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", @@ -2796,6 +2957,15 @@ "node": ">=6" } }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/nostr-tools": { "version": "0.24.1", "resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-0.24.1.tgz", @@ -3125,6 +3295,12 @@ "node": ">= 0.10" } }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, "node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -3191,6 +3367,18 @@ "string_decoder": "~0.10.x" } }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, "node_modules/reflect-metadata": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", @@ -3414,6 +3602,27 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "node_modules/simple-update-notifier": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz", + "integrity": "sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==", + "dev": true, + "dependencies": { + "semver": "~7.0.0" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/simple-update-notifier/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/slash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", @@ -3676,6 +3885,33 @@ "node": ">=0.6" } }, + "node_modules/touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "dependencies": { + "nopt": "~1.0.10" + }, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, + "node_modules/touch/node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -4041,6 +4277,12 @@ "node": ">=4.2.0" } }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, "node_modules/unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", @@ -4796,6 +5038,16 @@ "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "app-root-path": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", @@ -4880,6 +5132,17 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, + "bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, "bindings": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", @@ -5078,6 +5341,22 @@ "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==" }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, "chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", @@ -5658,6 +5937,13 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -5920,6 +6206,12 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -5963,6 +6255,15 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -6470,6 +6771,62 @@ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==" }, + "nodemon": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.20.tgz", + "integrity": "sha512-Km2mWHKKY5GzRg6i1j5OxOHQtuvVsgskLfigG25yTtbyfRGn/GNvIbRyOf1PSCKJ2aT/58TiuUsuOU5UToVViw==", + "dev": true, + "requires": { + "chokidar": "^3.5.2", + "debug": "^3.2.7", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^5.7.1", + "simple-update-notifier": "^1.0.7", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "noms": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", @@ -6487,6 +6844,12 @@ "abbrev": "1" } }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, "nostr-tools": { "version": "0.24.1", "resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-0.24.1.tgz", @@ -6743,6 +7106,12 @@ "ipaddr.js": "1.9.1" } }, + "pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, "qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -6783,6 +7152,15 @@ "string_decoder": "~0.10.x" } }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, "reflect-metadata": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", @@ -6942,6 +7320,23 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "simple-update-notifier": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz", + "integrity": "sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==", + "dev": true, + "requires": { + "semver": "~7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } + } + }, "slash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", @@ -7144,6 +7539,26 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "dev": true, + "requires": { + "nopt": "~1.0.10" + }, + "dependencies": { + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==", + "dev": true, + "requires": { + "abbrev": "1" + } + } + } + }, "tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -7363,6 +7778,12 @@ "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", "devOptional": true }, + "undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, "unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", diff --git a/package.json b/package.json index 99922485..46b800f0 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,13 @@ "description": "", "main": "index.js", "scripts": { - "test": " ts-node testRunner.ts", - "start": "ts-node src/index.ts", + "test": " tsc && node build/src/testRunner.js", + "start": "tsc && cd build && node src/index.js", "build_autogenerated": "cd proto && rimraf autogenerated && protoc -I ./service --pub_out=. service/*", "build_lnd_client_1": "cd proto && protoc -I ./others --plugin=.\\node_modules\\.bin\\protoc-gen-ts_proto.cmd --ts_proto_out=./lnd --ts_proto_opt=esModuleInterop=true others/* ", "build_lnd_client": "cd proto && rimraf lnd/* && npx protoc --ts_out ./lnd --ts_opt long_type_string --proto_path others others/* ", - "typeorm": "typeorm-ts-node-commonjs" + "typeorm": "typeorm-ts-node-commonjs", + "aa": "tsc && cd build && node src/services/nostr/index.js" }, "repository": { "type": "git", @@ -31,6 +32,7 @@ "@types/node": "^17.0.31", "@types/secp256k1": "^4.0.3", "axios": "^0.27.2", + "bech32": "^2.0.0", "chai": "^4.3.7", "copyfiles": "^2.4.1", "cors": "^2.8.5", @@ -62,6 +64,7 @@ "@types/lodash": "^4.14.182", "@types/node": "^16.11.10", "@types/uuid": "^8.3.4", + "nodemon": "^2.0.20", "ts-node": "10.7.0", "typescript": "4.5.2" } diff --git a/proto/autogenerated/debug.txt b/proto/autogenerated/debug.txt index 0a3a5ab6..36cc8024 100644 --- a/proto/autogenerated/debug.txt +++ b/proto/autogenerated/debug.txt @@ -1,5 +1,5 @@ -([]*main.Method) (len=11 cap=16) { - (*main.Method)(0xc0002ba730)({ +([]*main.Method) (len=16 cap=16) { + (*main.Method)(0xc0002be730)({ 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)(0xc0003fc4e0)({ - authType: (*main.supportedAuth)(0xc00040c030)({ + opts: (*main.methodOptions)(0xc0002caa80)({ + authType: (*main.supportedAuth)(0xc000424780)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -25,7 +25,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002ba780)({ + (*main.Method)(0xc0002be780)({ 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)(0xc0003fc660)({ - authType: (*main.supportedAuth)(0xc00040c120)({ + opts: (*main.methodOptions)(0xc0002cac00)({ + authType: (*main.supportedAuth)(0xc000424870)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -51,7 +51,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002ba7d0)({ + (*main.Method)(0xc0002be7d0)({ 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)(0xc0003fc7e0)({ - authType: (*main.supportedAuth)(0xc00040c1e0)({ + opts: (*main.methodOptions)(0xc0002cad80)({ + authType: (*main.supportedAuth)(0xc000424930)({ id: (string) (len=5) "admin", name: (string) (len=5) "Admin", encrypted: (bool) true, @@ -78,7 +78,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002ba820)({ + (*main.Method)(0xc0002be820)({ 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)(0xc0003fc960)({ - authType: (*main.supportedAuth)(0xc00040c2a0)({ + opts: (*main.methodOptions)(0xc0002caf00)({ + authType: (*main.supportedAuth)(0xc0004249f0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -104,7 +104,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002ba870)({ + (*main.Method)(0xc0002be870)({ 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)(0xc0003fcae0)({ - authType: (*main.supportedAuth)(0xc00040c360)({ + opts: (*main.methodOptions)(0xc0002cb080)({ + authType: (*main.supportedAuth)(0xc000424ab0)({ id: (string) (len=5) "guest", name: (string) (len=5) "Guest", encrypted: (bool) false, @@ -130,7 +130,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002ba910)({ + (*main.Method)(0xc0002be910)({ in: (main.MethodMessage) { name: (string) (len=17) "NewAddressRequest", hasZeroFields: (bool) false @@ -140,8 +140,8 @@ name: (string) (len=18) "NewAddressResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0003fcc60)({ - authType: (*main.supportedAuth)(0xc00040c420)({ + opts: (*main.methodOptions)(0xc0002cb200)({ + authType: (*main.supportedAuth)(0xc000424b70)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -157,7 +157,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002ba9b0)({ + (*main.Method)(0xc0002be9b0)({ 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)(0xc0003fcde0)({ - authType: (*main.supportedAuth)(0xc00040c4e0)({ + opts: (*main.methodOptions)(0xc0002cb380)({ + authType: (*main.supportedAuth)(0xc000424c30)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -184,7 +184,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002baa50)({ + (*main.Method)(0xc0002bea50)({ 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)(0xc0003fcf60)({ - authType: (*main.supportedAuth)(0xc00040c5a0)({ + opts: (*main.methodOptions)(0xc0002cb500)({ + authType: (*main.supportedAuth)(0xc000424cf0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -211,7 +211,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002baaf0)({ + (*main.Method)(0xc0002beaf0)({ 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)(0xc0003fd0e0)({ - authType: (*main.supportedAuth)(0xc00040c660)({ + opts: (*main.methodOptions)(0xc0002cb680)({ + authType: (*main.supportedAuth)(0xc000424db0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -238,7 +238,7 @@ query: ([]string) }) }), - (*main.Method)(0xc0002bab90)({ + (*main.Method)(0xc0002beb90)({ 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)(0xc0003fd260)({ - authType: (*main.supportedAuth)(0xc00040c720)({ + opts: (*main.methodOptions)(0xc0002cb800)({ + authType: (*main.supportedAuth)(0xc000424e70)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -265,18 +265,159 @@ query: ([]string) }) }), - (*main.Method)(0xc0002babe0)({ + (*main.Method)(0xc0002bec30)({ in: (main.MethodMessage) { name: (string) (len=5) "Empty", hasZeroFields: (bool) true }, - name: (string) (len=19) "GetOpenChannelLNURL", + name: (string) (len=20) "GetLnurlWithdrawLink", out: (main.MethodMessage) { - name: (string) (len=27) "GetOpenChannelLNURLResponse", + name: (string) (len=17) "LnurlLinkResponse", hasZeroFields: (bool) false }, - opts: (*main.methodOptions)(0xc0003fd3e0)({ - authType: (*main.supportedAuth)(0xc00040c7e0)({ + opts: (*main.methodOptions)(0xc0002cb980)({ + authType: (*main.supportedAuth)(0xc000424f30)({ + id: (string) (len=4) "user", + name: (string) (len=4) "User", + encrypted: (bool) false, + context: (map[string]string) (len=1) { + (string) (len=7) "user_id": (string) (len=6) "string" + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=29) "/api/user/lnurl_withdraw/link", + params: ([]string) + }, + query: ([]string) + }) + }), + (*main.Method)(0xc0002becd0)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=20) "GetLnurlWithdrawInfo", + out: (main.MethodMessage) { + name: (string) (len=25) "LnurlWithdrawInfoResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc0002cbce0)({ + authType: (*main.supportedAuth)(0xc0004250b0)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + encrypted: (bool) false, + context: (map[string]string) { + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=30) "/api/guest/lnurl_withdraw/info", + params: ([]string) + }, + query: ([]string) (len=1 cap=1) { + (string) (len=2) "k1" + } + }) + }), + (*main.Method)(0xc0002bed70)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=19) "HandleLnurlWithdraw", + out: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + opts: (*main.methodOptions)(0xc00042e060)({ + authType: (*main.supportedAuth)(0xc000425230)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + encrypted: (bool) false, + context: (map[string]string) { + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=32) "/api/guest/lnurl_withdraw/handle", + params: ([]string) + }, + query: ([]string) (len=2 cap=2) { + (string) (len=2) "k1", + (string) (len=2) "pr" + } + }) + }), + (*main.Method)(0xc0002bee10)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=15) "GetLnurlPayInfo", + out: (main.MethodMessage) { + name: (string) (len=20) "LnurlPayInfoResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00042e3c0)({ + authType: (*main.supportedAuth)(0xc000425380)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + encrypted: (bool) false, + context: (map[string]string) { + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=25) "/api/guest/lnurl_pay/info", + params: ([]string) + }, + query: ([]string) (len=1 cap=1) { + (string) (len=2) "k1" + } + }) + }), + (*main.Method)(0xc0002beeb0)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=14) "HandleLnurlPay", + out: (main.MethodMessage) { + name: (string) (len=22) "HandleLnurlPayResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00042e720)({ + authType: (*main.supportedAuth)(0xc000425500)({ + id: (string) (len=5) "guest", + name: (string) (len=5) "Guest", + encrypted: (bool) false, + context: (map[string]string) { + } + }), + method: (string) (len=3) "get", + route: (main.decodedRoute) { + route: (string) (len=27) "/api/guest/lnurl_pay/handle", + params: ([]string) + }, + query: ([]string) (len=2 cap=2) { + (string) (len=2) "k1", + (string) (len=6) "amount" + } + }) + }), + (*main.Method)(0xc0002bef50)({ + in: (main.MethodMessage) { + name: (string) (len=5) "Empty", + hasZeroFields: (bool) true + }, + name: (string) (len=19) "GetLNURLChannelLink", + out: (main.MethodMessage) { + name: (string) (len=17) "LnurlLinkResponse", + hasZeroFields: (bool) false + }, + opts: (*main.methodOptions)(0xc00042e8a0)({ + authType: (*main.supportedAuth)(0xc0004255c0)({ id: (string) (len=4) "user", name: (string) (len=4) "User", encrypted: (bool) false, @@ -286,7 +427,7 @@ }), method: (string) (len=4) "post", route: (main.decodedRoute) { - route: (string) (len=23) "/api/user/lnurl_channel", + route: (string) (len=27) "/api/user/lnurl_channel/url", params: ([]string) }, query: ([]string) @@ -295,7 +436,7 @@ } ([]*main.Enum) (len=1 cap=1) { - (*main.Enum)(0xc0003cf8c0)({ + (*main.Enum)(0xc000424030)({ name: (string) (len=11) "AddressType", values: ([]main.EnumValue) (len=3 cap=4) { (main.EnumValue) { @@ -314,13 +455,18 @@ }) } -(map[string]*main.Message) (len=19) { - (string) (len=19) "OpenChannelResponse": (*main.Message)(0xc000249440)({ - fullName: (string) (len=19) "OpenChannelResponse", - name: (string) (len=19) "OpenChannelResponse", +(map[string]*main.Message) (len=22) { + (string) (len=5) "Empty": (*main.Message)(0xc000247200)({ + fullName: (string) (len=5) "Empty", + name: (string) (len=5) "Empty", + fields: ([]*main.Field) + }), + (string) (len=18) "NewAddressResponse": (*main.Message)(0xc000247340)({ + fullName: (string) (len=18) "NewAddressResponse", + name: (string) (len=18) "NewAddressResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003cf680)({ - name: (string) (len=10) "channel_id", + (*main.Field)(0xc0003df800)({ + name: (string) (len=7) "address", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -330,27 +476,12 @@ }) } }), - (string) (len=27) "GetOpenChannelLNURLResponse": (*main.Message)(0xc000249480)({ - fullName: (string) (len=27) "GetOpenChannelLNURLResponse", - name: (string) (len=27) "GetOpenChannelLNURLResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003cf6b0)({ - name: (string) (len=5) "lnurl", - 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)(0xc000249500)({ - fullName: (string) (len=15) "AddUserResponse", - name: (string) (len=15) "AddUserResponse", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003cf770)({ - name: (string) (len=7) "user_id", + (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc000247500)({ + fullName: (string) (len=18) "OpenChannelRequest", + name: (string) (len=18) "OpenChannelRequest", + fields: ([]*main.Field) (len=4 cap=4) { + (*main.Field)(0xc0003dfa10)({ + name: (string) (len=11) "destination", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -358,8 +489,26 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0003cf7a0)({ - name: (string) (len=10) "auth_token", + (*main.Field)(0xc0003dfa40)({ + name: (string) (len=13) "fundingAmount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfa70)({ + name: (string) (len=10) "pushAmount", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfaa0)({ + name: (string) (len=12) "closeAddress", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -369,12 +518,12 @@ }) } }), - (string) (len=25) "EncryptionExchangeRequest": (*main.Message)(0xc000249140)({ - fullName: (string) (len=25) "EncryptionExchangeRequest", - name: (string) (len=25) "EncryptionExchangeRequest", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003cf2f0)({ - name: (string) (len=10) "public_key", + (string) (len=20) "LnurlPayInfoResponse": (*main.Message)(0xc000247680)({ + fullName: (string) (len=20) "LnurlPayInfoResponse", + name: (string) (len=20) "LnurlPayInfoResponse", + fields: ([]*main.Field) (len=5 cap=8) { + (*main.Field)(0xc0003dfce0)({ + name: (string) (len=3) "tag", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -382,8 +531,35 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0003cf320)({ - name: (string) (len=9) "device_id", + (*main.Field)(0xc0003dfd10)({ + name: (string) (len=8) "callback", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfd40)({ + name: (string) (len=11) "maxSendable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfd70)({ + name: (string) (len=11) "minSendable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfda0)({ + name: (string) (len=8) "metadata", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -393,11 +569,11 @@ }) } }), - (string) (len=18) "NewInvoiceResponse": (*main.Message)(0xc000249340)({ - fullName: (string) (len=18) "NewInvoiceResponse", - name: (string) (len=18) "NewInvoiceResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003cf500)({ + (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000247480)({ + fullName: (string) (len=17) "PayInvoiceRequest", + name: (string) (len=17) "PayInvoiceRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0003df980)({ name: (string) (len=7) "invoice", kind: (string) (len=6) "string", isMap: (bool) false, @@ -405,14 +581,23 @@ isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false + }), + (*main.Field)(0xc0003df9b0)({ + 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=18) "PayInvoiceResponse": (*main.Message)(0xc0002493c0)({ + (string) (len=18) "PayInvoiceResponse": (*main.Message)(0xc0002474c0)({ fullName: (string) (len=18) "PayInvoiceResponse", name: (string) (len=18) "PayInvoiceResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003cf590)({ + (*main.Field)(0xc0003df9e0)({ name: (string) (len=8) "preimage", kind: (string) (len=6) "string", isMap: (bool) false, @@ -423,11 +608,44 @@ }) } }), - (string) (len=15) "AuthUserRequest": (*main.Message)(0xc000249540)({ - fullName: (string) (len=15) "AuthUserRequest", - name: (string) (len=15) "AuthUserRequest", + (string) (len=17) "LnurlLinkResponse": (*main.Message)(0xc000247580)({ + fullName: (string) (len=17) "LnurlLinkResponse", + name: (string) (len=17) "LnurlLinkResponse", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003cf7d0)({ + (*main.Field)(0xc0003dfb00)({ + name: (string) (len=5) "lnurl", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfb30)({ + name: (string) (len=2) "k1", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=14) "AddUserRequest": (*main.Message)(0xc000247700)({ + fullName: (string) (len=14) "AddUserRequest", + name: (string) (len=14) "AddUserRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0003dfe30)({ + name: (string) (len=11) "callbackUrl", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfe60)({ name: (string) (len=4) "name", kind: (string) (len=6) "string", isMap: (bool) false, @@ -436,7 +654,7 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0003cf800)({ + (*main.Field)(0xc0003dfe90)({ name: (string) (len=6) "secret", kind: (string) (len=6) "string", isMap: (bool) false, @@ -447,11 +665,185 @@ }) } }), - (string) (len=18) "LndGetInfoResponse": (*main.Message)(0xc0002491c0)({ + (string) (len=16) "AuthUserResponse": (*main.Message)(0xc0002477c0)({ + fullName: (string) (len=16) "AuthUserResponse", + name: (string) (len=16) "AuthUserResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0003dff80)({ + name: (string) (len=6) "userId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dffb0)({ + name: (string) (len=9) "authToken", + 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)(0xc000247240)({ + fullName: (string) (len=25) "EncryptionExchangeRequest", + name: (string) (len=25) "EncryptionExchangeRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0003df710)({ + name: (string) (len=9) "publicKey", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003df740)({ + name: (string) (len=8) "deviceId", + 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)(0xc000247280)({ + fullName: (string) (len=17) "LndGetInfoRequest", + name: (string) (len=17) "LndGetInfoRequest", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0003df770)({ + name: (string) (len=6) "nodeId", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=17) "PayAddressRequest": (*main.Message)(0xc000247380)({ + fullName: (string) (len=17) "PayAddressRequest", + name: (string) (len=17) "PayAddressRequest", + fields: ([]*main.Field) (len=3 cap=4) { + (*main.Field)(0xc0003df830)({ + 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)(0xc0003df860)({ + name: (string) (len=9) "amoutSats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003df890)({ + name: (string) (len=10) "targetConf", + 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)(0xc000247440)({ + fullName: (string) (len=18) "NewInvoiceResponse", + name: (string) (len=18) "NewInvoiceResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0003df950)({ + 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=19) "OpenChannelResponse": (*main.Message)(0xc000247540)({ + fullName: (string) (len=19) "OpenChannelResponse", + name: (string) (len=19) "OpenChannelResponse", + fields: ([]*main.Field) (len=1 cap=1) { + (*main.Field)(0xc0003dfad0)({ + name: (string) (len=9) "channelId", + 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)(0xc000247740)({ + fullName: (string) (len=15) "AddUserResponse", + name: (string) (len=15) "AddUserResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0003dfec0)({ + name: (string) (len=6) "userId", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfef0)({ + name: (string) (len=9) "authToken", + 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)(0xc000247780)({ + fullName: (string) (len=15) "AuthUserRequest", + name: (string) (len=15) "AuthUserRequest", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0003dff20)({ + 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)(0xc0003dff50)({ + 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=18) "LndGetInfoResponse": (*main.Message)(0xc0002472c0)({ fullName: (string) (len=18) "LndGetInfoResponse", name: (string) (len=18) "LndGetInfoResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003cf380)({ + (*main.Field)(0xc0003df7a0)({ name: (string) (len=5) "alias", kind: (string) (len=6) "string", isMap: (bool) false, @@ -462,12 +854,12 @@ }) } }), - (string) (len=17) "NewAddressRequest": (*main.Message)(0xc000249200)({ + (string) (len=17) "NewAddressRequest": (*main.Message)(0xc000247300)({ fullName: (string) (len=17) "NewAddressRequest", name: (string) (len=17) "NewAddressRequest", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003cf3b0)({ - name: (string) (len=12) "address_type", + (*main.Field)(0xc0003df7d0)({ + name: (string) (len=11) "addressType", kind: (string) (len=11) "AddressType", isMap: (bool) false, isArray: (bool) false, @@ -477,194 +869,12 @@ }) } }), - (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc000249300)({ - fullName: (string) (len=17) "NewInvoiceRequest", - name: (string) (len=17) "NewInvoiceRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003cf4d0)({ - name: (string) (len=11) "amount_sats", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "OpenChannelRequest": (*main.Message)(0xc000249400)({ - fullName: (string) (len=18) "OpenChannelRequest", - name: (string) (len=18) "OpenChannelRequest", - fields: ([]*main.Field) (len=4 cap=4) { - (*main.Field)(0xc0003cf5c0)({ - 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)(0xc0003cf5f0)({ - 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)(0xc0003cf620)({ - 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)(0xc0003cf650)({ - 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 - }) - } - }), - (string) (len=14) "AddUserRequest": (*main.Message)(0xc0002494c0)({ - fullName: (string) (len=14) "AddUserRequest", - name: (string) (len=14) "AddUserRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0003cf6e0)({ - 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)(0xc0003cf710)({ - 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)(0xc0003cf740)({ - 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)(0xc000249580)({ - fullName: (string) (len=16) "AuthUserResponse", - name: (string) (len=16) "AuthUserResponse", - fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003cf830)({ - 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)(0xc0003cf860)({ - 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)(0xc000249100)({ - fullName: (string) (len=5) "Empty", - name: (string) (len=5) "Empty", - fields: ([]*main.Field) - }), - (string) (len=17) "LndGetInfoRequest": (*main.Message)(0xc000249180)({ - fullName: (string) (len=17) "LndGetInfoRequest", - name: (string) (len=17) "LndGetInfoRequest", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003cf350)({ - name: (string) (len=7) "node_id", - kind: (string) (len=5) "int64", - isMap: (bool) false, - isArray: (bool) false, - isEnum: (bool) false, - isMessage: (bool) false, - isOptional: (bool) false - }) - } - }), - (string) (len=18) "NewAddressResponse": (*main.Message)(0xc000249240)({ - fullName: (string) (len=18) "NewAddressResponse", - name: (string) (len=18) "NewAddressResponse", - fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003cf3e0)({ - 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=17) "PayAddressRequest": (*main.Message)(0xc000249280)({ - fullName: (string) (len=17) "PayAddressRequest", - name: (string) (len=17) "PayAddressRequest", - fields: ([]*main.Field) (len=3 cap=4) { - (*main.Field)(0xc0003cf410)({ - 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)(0xc0003cf440)({ - 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 - }), - (*main.Field)(0xc0003cf470)({ - name: (string) (len=11) "target_conf", - 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)(0xc0002492c0)({ + (string) (len=18) "PayAddressResponse": (*main.Message)(0xc0002473c0)({ fullName: (string) (len=18) "PayAddressResponse", name: (string) (len=18) "PayAddressResponse", fields: ([]*main.Field) (len=1 cap=1) { - (*main.Field)(0xc0003cf4a0)({ - name: (string) (len=5) "tx_id", + (*main.Field)(0xc0003df8c0)({ + name: (string) (len=4) "txId", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -674,12 +884,36 @@ }) } }), - (string) (len=17) "PayInvoiceRequest": (*main.Message)(0xc000249380)({ - fullName: (string) (len=17) "PayInvoiceRequest", - name: (string) (len=17) "PayInvoiceRequest", + (string) (len=17) "NewInvoiceRequest": (*main.Message)(0xc000247400)({ + fullName: (string) (len=17) "NewInvoiceRequest", + name: (string) (len=17) "NewInvoiceRequest", fields: ([]*main.Field) (len=2 cap=2) { - (*main.Field)(0xc0003cf530)({ - name: (string) (len=7) "invoice", + (*main.Field)(0xc0003df8f0)({ + name: (string) (len=10) "amountSats", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003df920)({ + name: (string) (len=4) "memo", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=25) "LnurlWithdrawInfoResponse": (*main.Message)(0xc000247600)({ + fullName: (string) (len=25) "LnurlWithdrawInfoResponse", + name: (string) (len=25) "LnurlWithdrawInfoResponse", + fields: ([]*main.Field) (len=8 cap=8) { + (*main.Field)(0xc0003dfb60)({ + name: (string) (len=3) "tag", kind: (string) (len=6) "string", isMap: (bool) false, isArray: (bool) false, @@ -687,20 +921,98 @@ isMessage: (bool) false, isOptional: (bool) false }), - (*main.Field)(0xc0003cf560)({ - name: (string) (len=6) "amount", + (*main.Field)(0xc0003dfb90)({ + name: (string) (len=8) "callback", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfbc0)({ + name: (string) (len=2) "k1", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfbf0)({ + name: (string) (len=18) "defaultDescription", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfc20)({ + name: (string) (len=15) "minWithdrawable", kind: (string) (len=5) "int64", isMap: (bool) false, isArray: (bool) false, isEnum: (bool) false, isMessage: (bool) false, isOptional: (bool) false + }), + (*main.Field)(0xc0003dfc50)({ + name: (string) (len=15) "maxWithdrawable", + kind: (string) (len=5) "int64", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfc80)({ + name: (string) (len=12) "balanceCheck", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfcb0)({ + name: (string) (len=7) "payLink", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }) + } + }), + (string) (len=22) "HandleLnurlPayResponse": (*main.Message)(0xc0002476c0)({ + fullName: (string) (len=22) "HandleLnurlPayResponse", + name: (string) (len=22) "HandleLnurlPayResponse", + fields: ([]*main.Field) (len=2 cap=2) { + (*main.Field)(0xc0003dfdd0)({ + name: (string) (len=2) "pr", + kind: (string) (len=6) "string", + isMap: (bool) false, + isArray: (bool) false, + isEnum: (bool) false, + isMessage: (bool) false, + isOptional: (bool) false + }), + (*main.Field)(0xc0003dfe00)({ + name: (string) (len=6) "routes", + kind: (string) (len=5) "Empty", + isMap: (bool) false, + isArray: (bool) true, + isEnum: (bool) false, + isMessage: (bool) true, + isOptional: (bool) false }) } }) } -parsing file: structs 19 +parsing file: structs 22 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 885fc0f0..de16ef2d 100644 --- a/proto/autogenerated/ts/express_server.ts +++ b/proto/autogenerated/ts/express_server.ts @@ -21,7 +21,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const logger = opts.logger || { log: console.log, error: console.error } const app = express() if (opts.allowCors) { - app.use(cors()) + app.use(cors()) } app.use(json()) app.use(urlencoded({ extended: true })) @@ -33,7 +33,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const query = req.query const params = req.params await methods.Health({ ...authContext, ...query, ...params }) - res.json({ status: 'OK' }) + res.json({status: 'OK'}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) if (!opts.allowNotImplementedMethods && !methods.EncryptionExchange) throw new Error('method: EncryptionExchange is not implemented') @@ -47,7 +47,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const query = req.query const params = req.params await methods.EncryptionExchange({ ...authContext, ...query, ...params }, request) - res.json({ status: 'OK' }) + res.json({status: 'OK'}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) if (!opts.allowNotImplementedMethods && !methods.LndGetInfo) throw new Error('method: LndGetInfo is not implemented') @@ -63,7 +63,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const query = req.query const params = req.params const response = await methods.LndGetInfo({ ...authContext, ...query, ...params }, request) - res.json({ status: 'OK', result: await opts.encryptCallback(encryptionDeviceId, response) }) + res.json({status: 'OK', ...await opts.encryptCallback(encryptionDeviceId, response)}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) if (!opts.allowNotImplementedMethods && !methods.AddUser) throw new Error('method: AddUser is not implemented') @@ -77,7 +77,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const query = req.query const params = req.params const response = await methods.AddUser({ ...authContext, ...query, ...params }, request) - res.json({ status: 'OK', result: response }) + res.json({status: 'OK', ...response}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) if (!opts.allowNotImplementedMethods && !methods.AuthUser) throw new Error('method: AuthUser is not implemented') @@ -91,7 +91,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const query = req.query const params = req.params const response = await methods.AuthUser({ ...authContext, ...query, ...params }, request) - res.json({ status: 'OK', result: response }) + res.json({status: 'OK', ...response}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) if (!opts.allowNotImplementedMethods && !methods.NewAddress) throw new Error('method: NewAddress is not implemented') @@ -105,7 +105,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const query = req.query const params = req.params const response = await methods.NewAddress({ ...authContext, ...query, ...params }, request) - res.json({ status: 'OK', result: response }) + res.json({status: 'OK', ...response}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) if (!opts.allowNotImplementedMethods && !methods.PayAddress) throw new Error('method: PayAddress is not implemented') @@ -119,7 +119,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const query = req.query const params = req.params const response = await methods.PayAddress({ ...authContext, ...query, ...params }, request) - res.json({ status: 'OK', result: response }) + res.json({status: 'OK', ...response}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) if (!opts.allowNotImplementedMethods && !methods.NewInvoice) throw new Error('method: NewInvoice is not implemented') @@ -133,7 +133,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const query = req.query const params = req.params const response = await methods.NewInvoice({ ...authContext, ...query, ...params }, request) - res.json({ status: 'OK', result: response }) + res.json({status: 'OK', ...response}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) if (!opts.allowNotImplementedMethods && !methods.PayInvoice) throw new Error('method: PayInvoice is not implemented') @@ -147,7 +147,7 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const query = req.query const params = req.params const response = await methods.PayInvoice({ ...authContext, ...query, ...params }, request) - res.json({ status: 'OK', result: response }) + res.json({status: 'OK', ...response}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) if (!opts.allowNotImplementedMethods && !methods.OpenChannel) throw new Error('method: OpenChannel is not implemented') @@ -161,22 +161,77 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => { const query = req.query const params = req.params const response = await methods.OpenChannel({ ...authContext, ...query, ...params }, request) - res.json({ status: 'OK', result: response }) + res.json({status: 'OK', ...response}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) - if (!opts.allowNotImplementedMethods && !methods.GetOpenChannelLNURL) throw new Error('method: GetOpenChannelLNURL is not implemented') - app.post('/api/user/lnurl_channel', async (req, res) => { + if (!opts.allowNotImplementedMethods && !methods.GetLnurlWithdrawLink) throw new Error('method: GetLnurlWithdrawLink is not implemented') + app.get('/api/user/lnurl_withdraw/link', async (req, res) => { try { - if (!methods.GetOpenChannelLNURL) throw new Error('method: GetOpenChannelLNURL is not implemented') + if (!methods.GetLnurlWithdrawLink) throw new Error('method: GetLnurlWithdrawLink is not implemented') const authContext = await opts.UserAuthGuard(req.headers['authorization']) const query = req.query const params = req.params - const response = await methods.GetOpenChannelLNURL({ ...authContext, ...query, ...params }) - res.json({ status: 'OK', result: response }) + const response = await methods.GetLnurlWithdrawLink({ ...authContext, ...query, ...params }) + res.json({status: 'OK', ...response}) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetLnurlWithdrawInfo) throw new Error('method: GetLnurlWithdrawInfo is not implemented') + app.get('/api/guest/lnurl_withdraw/info', async (req, res) => { + try { + if (!methods.GetLnurlWithdrawInfo) throw new Error('method: GetLnurlWithdrawInfo is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + const query = req.query + const params = req.params + const response = await methods.GetLnurlWithdrawInfo({ ...authContext, ...query, ...params }) + res.json({status: 'OK', ...response}) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.HandleLnurlWithdraw) throw new Error('method: HandleLnurlWithdraw is not implemented') + app.get('/api/guest/lnurl_withdraw/handle', async (req, res) => { + try { + if (!methods.HandleLnurlWithdraw) throw new Error('method: HandleLnurlWithdraw is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + const query = req.query + const params = req.params + await methods.HandleLnurlWithdraw({ ...authContext, ...query, ...params }) + res.json({status: 'OK'}) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetLnurlPayInfo) throw new Error('method: GetLnurlPayInfo is not implemented') + app.get('/api/guest/lnurl_pay/info', async (req, res) => { + try { + if (!methods.GetLnurlPayInfo) throw new Error('method: GetLnurlPayInfo is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + const query = req.query + const params = req.params + const response = await methods.GetLnurlPayInfo({ ...authContext, ...query, ...params }) + res.json({status: 'OK', ...response}) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.HandleLnurlPay) throw new Error('method: HandleLnurlPay is not implemented') + app.get('/api/guest/lnurl_pay/handle', async (req, res) => { + try { + if (!methods.HandleLnurlPay) throw new Error('method: HandleLnurlPay is not implemented') + const authContext = await opts.GuestAuthGuard(req.headers['authorization']) + const query = req.query + const params = req.params + const response = await methods.HandleLnurlPay({ ...authContext, ...query, ...params }) + res.json({status: 'OK', ...response}) + } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } + }) + if (!opts.allowNotImplementedMethods && !methods.GetLNURLChannelLink) throw new Error('method: GetLNURLChannelLink is not implemented') + app.post('/api/user/lnurl_channel/url', async (req, res) => { + try { + if (!methods.GetLNURLChannelLink) throw new Error('method: GetLNURLChannelLink is not implemented') + const authContext = await opts.UserAuthGuard(req.headers['authorization']) + const query = req.query + const params = req.params + const response = await methods.GetLNURLChannelLink({ ...authContext, ...query, ...params }) + res.json({status: 'OK', ...response}) } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger); if (opts.throwErrors) throw e } }) if (opts.staticFiles) { - app.use(express.static(opts.staticFiles)) + app.use(express.static(opts.staticFiles)) } var server: { close: () => void } | undefined return { diff --git a/proto/autogenerated/ts/http_client.ts b/proto/autogenerated/ts/http_client.ts index b563440d..fdd6aac4 100644 --- a/proto/autogenerated/ts/http_client.ts +++ b/proto/autogenerated/ts/http_client.ts @@ -11,144 +11,229 @@ export type ClientParams = { encryptCallback: (plain: any) => Promise decryptCallback: (encrypted: any) => Promise deviceId: string + checkResult?: true } export default (params: ClientParams) => ({ - Health: async (): Promise => { + Health: async (): Promise => { const auth = await params.retrieveGuestAuth() if (auth === null) throw new Error('retrieveGuestAuth() returned null') let finalRoute = '/api/health' const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { + if (data.status === 'OK') { return data } return { status: 'ERROR', reason: 'invalid response' } }, - EncryptionExchange: async (request: Types.EncryptionExchangeRequest): Promise => { + EncryptionExchange: async (request: Types.EncryptionExchangeRequest): Promise => { const auth = await params.retrieveGuestAuth() if (auth === null) throw new Error('retrieveGuestAuth() returned null') let finalRoute = '/api/encryption/exchange' 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') { + if (data.status === 'OK') { return data } return { status: 'ERROR', reason: 'invalid response' } }, - LndGetInfo: async (request: Types.LndGetInfoRequest): Promise => { + LndGetInfo: async (request: Types.LndGetInfoRequest): Promise => { const auth = await params.retrieveAdminAuth() if (auth === null) throw new Error('retrieveAdminAuth() returned null') let finalRoute = '/api/lnd/getinfo' - const { data } = await axios.post(params.baseUrl + finalRoute, await params.encryptCallback(request), { headers: { 'authorization': auth, 'x-e2ee-device-id-x': params.deviceId } }) + const { data } = await axios.post(params.baseUrl + finalRoute, await params.encryptCallback(request), { headers: { 'authorization': auth, 'x-e2ee-device-id-x': params.deviceId } }) if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = await params.decryptCallback(data.result) + if (data.status === 'OK') { + const result = await params.decryptCallback(data) + if(!params.checkResult) return { status: 'OK', ...result } const error = Types.LndGetInfoResponseValidate(result) - if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message } + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } } return { status: 'ERROR', reason: 'invalid response' } }, - AddUser: async (request: Types.AddUserRequest): Promise => { + AddUser: async (request: Types.AddUserRequest): Promise => { const auth = await params.retrieveGuestAuth() if (auth === null) throw new Error('retrieveGuestAuth() returned null') let finalRoute = '/api/user/add' 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 + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } const error = Types.AddUserResponseValidate(result) - if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message } + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } } return { status: 'ERROR', reason: 'invalid response' } }, - AuthUser: async (request: Types.AuthUserRequest): Promise => { + AuthUser: async (request: Types.AuthUserRequest): Promise => { const auth = await params.retrieveGuestAuth() if (auth === null) throw new Error('retrieveGuestAuth() returned null') let finalRoute = '/api/user/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 + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } const error = Types.AuthUserResponseValidate(result) - if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message } + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } } return { status: 'ERROR', reason: 'invalid response' } }, - NewAddress: async (request: Types.NewAddressRequest): 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, request, { headers: { 'authorization': auth } }) if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data.result + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } const error = Types.NewAddressResponseValidate(result) - if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message } + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } } return { status: 'ERROR', reason: 'invalid response' } }, - PayAddress: async (request: Types.PayAddressRequest): Promise => { + PayAddress: async (request: Types.PayAddressRequest): Promise => { const auth = await params.retrieveUserAuth() if (auth === null) throw new Error('retrieveUserAuth() returned null') let finalRoute = '/api/user/chain/pay' 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 + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } const error = Types.PayAddressResponseValidate(result) - if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message } + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } } return { status: 'ERROR', reason: 'invalid response' } }, - NewInvoice: async (request: Types.NewInvoiceRequest): Promise => { + NewInvoice: async (request: Types.NewInvoiceRequest): Promise => { const auth = await params.retrieveUserAuth() if (auth === null) throw new Error('retrieveUserAuth() returned null') let finalRoute = '/api/user/invoice/new' 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 + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } const error = Types.NewInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message } + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } } return { status: 'ERROR', reason: 'invalid response' } }, - PayInvoice: async (request: Types.PayInvoiceRequest): Promise => { + PayInvoice: async (request: Types.PayInvoiceRequest): Promise => { const auth = await params.retrieveUserAuth() if (auth === null) throw new Error('retrieveUserAuth() returned null') let finalRoute = '/api/user/invoice/pay' 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 + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } const error = Types.PayInvoiceResponseValidate(result) - if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message } + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } } return { status: 'ERROR', reason: 'invalid response' } }, - OpenChannel: async (request: Types.OpenChannelRequest): Promise => { + OpenChannel: async (request: Types.OpenChannelRequest): Promise => { const auth = await params.retrieveUserAuth() if (auth === null) throw new Error('retrieveUserAuth() returned null') let finalRoute = '/api/user/open/channel' 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 + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } const error = Types.OpenChannelResponseValidate(result) - if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message } + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } } return { status: 'ERROR', reason: 'invalid response' } }, - GetOpenChannelLNURL: async (): Promise => { + GetLnurlWithdrawLink: async (): Promise => { const auth = await params.retrieveUserAuth() if (auth === null) throw new Error('retrieveUserAuth() returned null') - let finalRoute = '/api/user/lnurl_channel' + let finalRoute = '/api/user/lnurl_withdraw/link' + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlLinkResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLnurlWithdrawInfo: async (query: Types.GetLnurlWithdrawInfo_Query): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/api/guest/lnurl_withdraw/info' + const q = (new URLSearchParams(query)).toString() + finalRoute = finalRoute + (q === '' ? '' : '?' + q) + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlWithdrawInfoResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + HandleLnurlWithdraw: async (query: Types.HandleLnurlWithdraw_Query): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/api/guest/lnurl_withdraw/handle' + const q = (new URLSearchParams(query)).toString() + finalRoute = finalRoute + (q === '' ? '' : '?' + q) + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + return data + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLnurlPayInfo: async (query: Types.GetLnurlPayInfo_Query): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/api/guest/lnurl_pay/info' + const q = (new URLSearchParams(query)).toString() + finalRoute = finalRoute + (q === '' ? '' : '?' + q) + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlPayInfoResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + HandleLnurlPay: async (query: Types.HandleLnurlPay_Query): Promise => { + const auth = await params.retrieveGuestAuth() + if (auth === null) throw new Error('retrieveGuestAuth() returned null') + let finalRoute = '/api/guest/lnurl_pay/handle' + const q = (new URLSearchParams(query)).toString() + finalRoute = finalRoute + (q === '' ? '' : '?' + q) + const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } }) + if (data.status === 'ERROR' && typeof data.reason === 'string') return data + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.HandleLnurlPayResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } + } + return { status: 'ERROR', reason: 'invalid response' } + }, + GetLNURLChannelLink: async (): Promise => { + const auth = await params.retrieveUserAuth() + if (auth === null) throw new Error('retrieveUserAuth() returned null') + let finalRoute = '/api/user/lnurl_channel/url' const { data } = await axios.post(params.baseUrl + finalRoute, {}, { headers: { 'authorization': auth } }) if (data.status === 'ERROR' && typeof data.reason === 'string') return data - if (data.status === 'OK') { - const result = data.result - const error = Types.GetOpenChannelLNURLResponseValidate(result) - if (error === null) { return { status: 'OK', result: result } } else return { status: 'ERROR', reason: error.message } + if (data.status === 'OK') { + const result = data + if(!params.checkResult) return { status: 'OK', ...result } + const error = Types.LnurlLinkResponseValidate(result) + if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message } } return { status: 'ERROR', reason: 'invalid response' } }, diff --git a/proto/autogenerated/ts/types.ts b/proto/autogenerated/ts/types.ts index 87eaadaa..a198cf78 100644 --- a/proto/autogenerated/ts/types.ts +++ b/proto/autogenerated/ts/types.ts @@ -60,11 +60,42 @@ export type OpenChannel_Query = { export type OpenChannel_RouteParams = { } export type OpenChannel_Context = OpenChannel_Query & OpenChannel_RouteParams & UserContext -export type GetOpenChannelLNURL_Query = { +export type GetLnurlWithdrawLink_Query = { } -export type GetOpenChannelLNURL_RouteParams = { +export type GetLnurlWithdrawLink_RouteParams = { } -export type GetOpenChannelLNURL_Context = GetOpenChannelLNURL_Query & GetOpenChannelLNURL_RouteParams & UserContext +export type GetLnurlWithdrawLink_Context = GetLnurlWithdrawLink_Query & GetLnurlWithdrawLink_RouteParams & UserContext +export type GetLnurlWithdrawInfo_Query = { + k1?: string +} +export type GetLnurlWithdrawInfo_RouteParams = { +} +export type GetLnurlWithdrawInfo_Context = GetLnurlWithdrawInfo_Query & GetLnurlWithdrawInfo_RouteParams & GuestContext +export type HandleLnurlWithdraw_Query = { + k1?: string + pr?: string +} +export type HandleLnurlWithdraw_RouteParams = { +} +export type HandleLnurlWithdraw_Context = HandleLnurlWithdraw_Query & HandleLnurlWithdraw_RouteParams & GuestContext +export type GetLnurlPayInfo_Query = { + k1?: string +} +export type GetLnurlPayInfo_RouteParams = { +} +export type GetLnurlPayInfo_Context = GetLnurlPayInfo_Query & GetLnurlPayInfo_RouteParams & GuestContext +export type HandleLnurlPay_Query = { + k1?: string + amount?: string +} +export type HandleLnurlPay_RouteParams = { +} +export type HandleLnurlPay_Context = HandleLnurlPay_Query & HandleLnurlPay_RouteParams & GuestContext +export type GetLNURLChannelLink_Query = { +} +export type GetLNURLChannelLink_RouteParams = { +} +export type GetLNURLChannelLink_Context = GetLNURLChannelLink_Query & GetLNURLChannelLink_RouteParams & UserContext export type ServerMethods = { Health?: (ctx: Health_Context) => Promise EncryptionExchange?: (ctx: EncryptionExchange_Context, req: EncryptionExchangeRequest) => Promise @@ -76,7 +107,12 @@ export type ServerMethods = { NewInvoice?: (ctx: NewInvoice_Context, req: NewInvoiceRequest) => Promise PayInvoice?: (ctx: PayInvoice_Context, req: PayInvoiceRequest) => Promise OpenChannel?: (ctx: OpenChannel_Context, req: OpenChannelRequest) => Promise - GetOpenChannelLNURL?: (ctx: GetOpenChannelLNURL_Context) => Promise + GetLnurlWithdrawLink?: (ctx: GetLnurlWithdrawLink_Context) => Promise + GetLnurlWithdrawInfo?: (ctx: GetLnurlWithdrawInfo_Context) => Promise + HandleLnurlWithdraw?: (ctx: HandleLnurlWithdraw_Context) => Promise + GetLnurlPayInfo?: (ctx: GetLnurlPayInfo_Context) => Promise + HandleLnurlPay?: (ctx: HandleLnurlPay_Context) => Promise + GetLNURLChannelLink?: (ctx: GetLNURLChannelLink_Context) => Promise } export enum AddressType { @@ -93,6 +129,202 @@ export type OptionsBaseMessage = { allOptionalsAreSet?: true } +export type NewInvoiceRequest = { + amountSats: number + memo: string +} +export const NewInvoiceRequestOptionalFields: [] = [] +export type NewInvoiceRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + amountSats_CustomCheck?: (v: number) => boolean + memo_CustomCheck?: (v: string) => boolean +} +export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoiceRequestOptions = {}, path: string = 'NewInvoiceRequest::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.amountSats !== 'number') return new Error(`${path}.amountSats: is not a number`) + if (opts.amountSats_CustomCheck && !opts.amountSats_CustomCheck(o.amountSats)) return new Error(`${path}.amountSats: custom check failed`) + + if (typeof o.memo !== 'string') return new Error(`${path}.memo: is not a string`) + if (opts.memo_CustomCheck && !opts.memo_CustomCheck(o.memo)) return new Error(`${path}.memo: custom check failed`) + + return null +} + +export type LnurlWithdrawInfoResponse = { + tag: string + callback: string + k1: string + defaultDescription: string + minWithdrawable: number + maxWithdrawable: number + balanceCheck: string + payLink: string +} +export const LnurlWithdrawInfoResponseOptionalFields: [] = [] +export type LnurlWithdrawInfoResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + tag_CustomCheck?: (v: string) => boolean + callback_CustomCheck?: (v: string) => boolean + k1_CustomCheck?: (v: string) => boolean + defaultDescription_CustomCheck?: (v: string) => boolean + minWithdrawable_CustomCheck?: (v: number) => boolean + maxWithdrawable_CustomCheck?: (v: number) => boolean + balanceCheck_CustomCheck?: (v: string) => boolean + payLink_CustomCheck?: (v: string) => boolean +} +export const LnurlWithdrawInfoResponseValidate = (o?: LnurlWithdrawInfoResponse, opts: LnurlWithdrawInfoResponseOptions = {}, path: string = 'LnurlWithdrawInfoResponse::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.tag !== 'string') return new Error(`${path}.tag: is not a string`) + if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) + + if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) + if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) + + if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) + if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) + + if (typeof o.defaultDescription !== 'string') return new Error(`${path}.defaultDescription: is not a string`) + if (opts.defaultDescription_CustomCheck && !opts.defaultDescription_CustomCheck(o.defaultDescription)) return new Error(`${path}.defaultDescription: custom check failed`) + + if (typeof o.minWithdrawable !== 'number') return new Error(`${path}.minWithdrawable: is not a number`) + if (opts.minWithdrawable_CustomCheck && !opts.minWithdrawable_CustomCheck(o.minWithdrawable)) return new Error(`${path}.minWithdrawable: custom check failed`) + + if (typeof o.maxWithdrawable !== 'number') return new Error(`${path}.maxWithdrawable: is not a number`) + if (opts.maxWithdrawable_CustomCheck && !opts.maxWithdrawable_CustomCheck(o.maxWithdrawable)) return new Error(`${path}.maxWithdrawable: custom check failed`) + + if (typeof o.balanceCheck !== 'string') return new Error(`${path}.balanceCheck: is not a string`) + if (opts.balanceCheck_CustomCheck && !opts.balanceCheck_CustomCheck(o.balanceCheck)) return new Error(`${path}.balanceCheck: custom check failed`) + + if (typeof o.payLink !== 'string') return new Error(`${path}.payLink: is not a string`) + if (opts.payLink_CustomCheck && !opts.payLink_CustomCheck(o.payLink)) return new Error(`${path}.payLink: custom check failed`) + + return null +} + +export type HandleLnurlPayResponse = { + pr: string + routes: Empty[] +} +export const HandleLnurlPayResponseOptionalFields: [] = [] +export type HandleLnurlPayResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + pr_CustomCheck?: (v: string) => boolean + routes_ItemOptions?: EmptyOptions + routes_CustomCheck?: (v: Empty[]) => boolean +} +export const HandleLnurlPayResponseValidate = (o?: HandleLnurlPayResponse, opts: HandleLnurlPayResponseOptions = {}, path: string = 'HandleLnurlPayResponse::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.pr !== 'string') return new Error(`${path}.pr: is not a string`) + if (opts.pr_CustomCheck && !opts.pr_CustomCheck(o.pr)) return new Error(`${path}.pr: custom check failed`) + + if (!Array.isArray(o.routes)) return new Error(`${path}.routes: is not an array`) + for (let index = 0; index < o.routes.length; index++) { + const routesErr = EmptyValidate(o.routes[index], opts.routes_ItemOptions, `${path}.routes[${index}]`) + if (routesErr !== null) return routesErr + } + if (opts.routes_CustomCheck && !opts.routes_CustomCheck(o.routes)) return new Error(`${path}.routes: custom check failed`) + + return null +} + +export type LndGetInfoResponse = { + alias: string +} +export const LndGetInfoResponseOptionalFields: [] = [] +export type LndGetInfoResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + alias_CustomCheck?: (v: string) => boolean +} +export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetInfoResponseOptions = {}, path: string = 'LndGetInfoResponse::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.alias !== 'string') return new Error(`${path}.alias: is not a string`) + if (opts.alias_CustomCheck && !opts.alias_CustomCheck(o.alias)) return new Error(`${path}.alias: custom check failed`) + + return null +} + +export type NewAddressRequest = { + addressType: AddressType +} +export const NewAddressRequestOptionalFields: [] = [] +export type NewAddressRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + addressType_CustomCheck?: (v: AddressType) => boolean +} +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 (!enumCheckAddressType(o.addressType)) return new Error(`${path}.addressType: is not a valid AddressType`) + if (opts.addressType_CustomCheck && !opts.addressType_CustomCheck(o.addressType)) return new Error(`${path}.addressType: custom check failed`) + + return null +} + +export type PayAddressResponse = { + txId: string +} +export const PayAddressResponseOptionalFields: [] = [] +export type PayAddressResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + txId_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.txId !== 'string') return new Error(`${path}.txId: is not a string`) + if (opts.txId_CustomCheck && !opts.txId_CustomCheck(o.txId)) return new Error(`${path}.txId: custom check failed`) + + return null +} + +export type LnurlPayInfoResponse = { + tag: string + callback: string + maxSendable: number + minSendable: number + metadata: string +} +export const LnurlPayInfoResponseOptionalFields: [] = [] +export type LnurlPayInfoResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + tag_CustomCheck?: (v: string) => boolean + callback_CustomCheck?: (v: string) => boolean + maxSendable_CustomCheck?: (v: number) => boolean + minSendable_CustomCheck?: (v: number) => boolean + metadata_CustomCheck?: (v: string) => boolean +} +export const LnurlPayInfoResponseValidate = (o?: LnurlPayInfoResponse, opts: LnurlPayInfoResponseOptions = {}, path: string = 'LnurlPayInfoResponse::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.tag !== 'string') return new Error(`${path}.tag: is not a string`) + if (opts.tag_CustomCheck && !opts.tag_CustomCheck(o.tag)) return new Error(`${path}.tag: custom check failed`) + + if (typeof o.callback !== 'string') return new Error(`${path}.callback: is not a string`) + if (opts.callback_CustomCheck && !opts.callback_CustomCheck(o.callback)) return new Error(`${path}.callback: custom check failed`) + + if (typeof o.maxSendable !== 'number') return new Error(`${path}.maxSendable: is not a number`) + if (opts.maxSendable_CustomCheck && !opts.maxSendable_CustomCheck(o.maxSendable)) return new Error(`${path}.maxSendable: custom check failed`) + + if (typeof o.minSendable !== 'number') return new Error(`${path}.minSendable: is not a number`) + if (opts.minSendable_CustomCheck && !opts.minSendable_CustomCheck(o.minSendable)) return new Error(`${path}.minSendable: custom check failed`) + + if (typeof o.metadata !== 'string') return new Error(`${path}.metadata: is not a string`) + if (opts.metadata_CustomCheck && !opts.metadata_CustomCheck(o.metadata)) return new Error(`${path}.metadata: custom check failed`) + + return null +} + export type Empty = { } export const EmptyOptionalFields: [] = [] @@ -106,24 +338,6 @@ export const EmptyValidate = (o?: Empty, opts: EmptyOptions = {}, path: string = 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`) - - return null -} - export type NewAddressResponse = { address: string } @@ -142,48 +356,63 @@ export const NewAddressResponseValidate = (o?: NewAddressResponse, opts: NewAddr return null } -export type PayAddressRequest = { - address: string - amout_sats: number - target_conf: number +export type OpenChannelRequest = { + destination: string + fundingAmount: number + pushAmount: number + closeAddress: string } -export const PayAddressRequestOptionalFields: [] = [] -export type PayAddressRequestOptions = OptionsBaseMessage & { +export const OpenChannelRequestOptionalFields: [] = [] +export type OpenChannelRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - address_CustomCheck?: (v: string) => boolean - amout_sats_CustomCheck?: (v: number) => boolean - target_conf_CustomCheck?: (v: number) => boolean + destination_CustomCheck?: (v: string) => boolean + fundingAmount_CustomCheck?: (v: number) => boolean + pushAmount_CustomCheck?: (v: number) => boolean + closeAddress_CustomCheck?: (v: string) => boolean } -export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddressRequestOptions = {}, path: string = 'PayAddressRequest::root.'): Error | null => { +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.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 (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.amout_sats !== 'number') return new Error(`${path}.amout_sats: is not a number`) - if (opts.amout_sats_CustomCheck && !opts.amout_sats_CustomCheck(o.amout_sats)) return new Error(`${path}.amout_sats: custom check failed`) + if (typeof o.fundingAmount !== 'number') return new Error(`${path}.fundingAmount: is not a number`) + if (opts.fundingAmount_CustomCheck && !opts.fundingAmount_CustomCheck(o.fundingAmount)) return new Error(`${path}.fundingAmount: custom check failed`) - if (typeof o.target_conf !== 'number') return new Error(`${path}.target_conf: is not a number`) - if (opts.target_conf_CustomCheck && !opts.target_conf_CustomCheck(o.target_conf)) return new Error(`${path}.target_conf: custom check failed`) + if (typeof o.pushAmount !== 'number') return new Error(`${path}.pushAmount: is not a number`) + if (opts.pushAmount_CustomCheck && !opts.pushAmount_CustomCheck(o.pushAmount)) return new Error(`${path}.pushAmount: custom check failed`) + + if (typeof o.closeAddress !== 'string') return new Error(`${path}.closeAddress: is not a string`) + if (opts.closeAddress_CustomCheck && !opts.closeAddress_CustomCheck(o.closeAddress)) return new Error(`${path}.closeAddress: custom check failed`) return null } -export type PayAddressResponse = { - tx_id: string +export type AddUserRequest = { + callbackUrl: string + name: string + secret: string } -export const PayAddressResponseOptionalFields: [] = [] -export type PayAddressResponseOptions = OptionsBaseMessage & { +export const AddUserRequestOptionalFields: [] = [] +export type AddUserRequestOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - tx_id_CustomCheck?: (v: string) => boolean + callbackUrl_CustomCheck?: (v: string) => boolean + name_CustomCheck?: (v: string) => boolean + secret_CustomCheck?: (v: string) => boolean } -export const PayAddressResponseValidate = (o?: PayAddressResponse, opts: PayAddressResponseOptions = {}, path: string = 'PayAddressResponse::root.'): Error | null => { +export const AddUserRequestValidate = (o?: AddUserRequest, opts: AddUserRequestOptions = {}, path: string = 'AddUserRequest::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.callbackUrl !== 'string') return new Error(`${path}.callbackUrl: is not a string`) + if (opts.callbackUrl_CustomCheck && !opts.callbackUrl_CustomCheck(o.callbackUrl)) return new Error(`${path}.callbackUrl: custom check failed`) + + 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 } @@ -211,84 +440,43 @@ export const PayInvoiceRequestValidate = (o?: PayInvoiceRequest, opts: PayInvoic return null } -export type OpenChannelResponse = { - channel_id: string +export type PayInvoiceResponse = { + preimage: string } -export const OpenChannelResponseOptionalFields: [] = [] -export type OpenChannelResponseOptions = OptionsBaseMessage & { +export const PayInvoiceResponseOptionalFields: [] = [] +export type PayInvoiceResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - channel_id_CustomCheck?: (v: string) => boolean + preimage_CustomCheck?: (v: string) => boolean } -export const OpenChannelResponseValidate = (o?: OpenChannelResponse, opts: OpenChannelResponseOptions = {}, path: string = 'OpenChannelResponse::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.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) - if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: 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`) return null } -export type GetOpenChannelLNURLResponse = { +export type LnurlLinkResponse = { lnurl: string + k1: string } -export const GetOpenChannelLNURLResponseOptionalFields: [] = [] -export type GetOpenChannelLNURLResponseOptions = OptionsBaseMessage & { +export const LnurlLinkResponseOptionalFields: [] = [] +export type LnurlLinkResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] lnurl_CustomCheck?: (v: string) => boolean + k1_CustomCheck?: (v: string) => boolean } -export const GetOpenChannelLNURLResponseValidate = (o?: GetOpenChannelLNURLResponse, opts: GetOpenChannelLNURLResponseOptions = {}, path: string = 'GetOpenChannelLNURLResponse::root.'): Error | null => { +export const LnurlLinkResponseValidate = (o?: LnurlLinkResponse, opts: LnurlLinkResponseOptions = {}, path: string = 'LnurlLinkResponse::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 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`) + if (typeof o.k1 !== 'string') return new Error(`${path}.k1: is not a string`) + if (opts.k1_CustomCheck && !opts.k1_CustomCheck(o.k1)) return new Error(`${path}.k1: custom check failed`) return null } @@ -311,20 +499,43 @@ export const NewInvoiceResponseValidate = (o?: NewInvoiceResponse, opts: NewInvo return null } -export type PayInvoiceResponse = { - preimage: string +export type OpenChannelResponse = { + channelId: string } -export const PayInvoiceResponseOptionalFields: [] = [] -export type PayInvoiceResponseOptions = OptionsBaseMessage & { +export const OpenChannelResponseOptionalFields: [] = [] +export type OpenChannelResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - preimage_CustomCheck?: (v: string) => boolean + channelId_CustomCheck?: (v: string) => boolean } -export const PayInvoiceResponseValidate = (o?: PayInvoiceResponse, opts: PayInvoiceResponseOptions = {}, path: string = 'PayInvoiceResponse::root.'): Error | null => { +export const OpenChannelResponseValidate = (o?: OpenChannelResponse, opts: OpenChannelResponseOptions = {}, path: string = 'OpenChannelResponse::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`) + if (typeof o.channelId !== 'string') return new Error(`${path}.channelId: is not a string`) + if (opts.channelId_CustomCheck && !opts.channelId_CustomCheck(o.channelId)) return new Error(`${path}.channelId: custom check failed`) + + return null +} + +export type AddUserResponse = { + userId: string + authToken: string +} +export const AddUserResponseOptionalFields: [] = [] +export type AddUserResponseOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + userId_CustomCheck?: (v: string) => boolean + authToken_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.userId !== 'string') return new Error(`${path}.userId: is not a string`) + if (opts.userId_CustomCheck && !opts.userId_CustomCheck(o.userId)) return new Error(`${path}.userId: custom check failed`) + + if (typeof o.authToken !== 'string') return new Error(`${path}.authToken: is not a string`) + if (opts.authToken_CustomCheck && !opts.authToken_CustomCheck(o.authToken)) return new Error(`${path}.authToken: custom check failed`) return null } @@ -352,140 +563,94 @@ export const AuthUserRequestValidate = (o?: AuthUserRequest, opts: AuthUserReque return null } -export type LndGetInfoResponse = { - alias: string -} -export const LndGetInfoResponseOptionalFields: [] = [] -export type LndGetInfoResponseOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - alias_CustomCheck?: (v: string) => boolean -} -export const LndGetInfoResponseValidate = (o?: LndGetInfoResponse, opts: LndGetInfoResponseOptions = {}, path: string = 'LndGetInfoResponse::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.alias !== 'string') return new Error(`${path}.alias: is not a string`) - if (opts.alias_CustomCheck && !opts.alias_CustomCheck(o.alias)) return new Error(`${path}.alias: custom check failed`) - - return null -} - -export type NewAddressRequest = { - address_type: AddressType -} -export const NewAddressRequestOptionalFields: [] = [] -export type NewAddressRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - address_type_CustomCheck?: (v: AddressType) => boolean -} -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 (!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 -} - -export type NewInvoiceRequest = { - amount_sats: number -} -export const NewInvoiceRequestOptionalFields: [] = [] -export type NewInvoiceRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - amount_sats_CustomCheck?: (v: number) => boolean -} -export const NewInvoiceRequestValidate = (o?: NewInvoiceRequest, opts: NewInvoiceRequestOptions = {}, path: string = 'NewInvoiceRequest::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.amount_sats !== 'number') return new Error(`${path}.amount_sats: is not a number`) - if (opts.amount_sats_CustomCheck && !opts.amount_sats_CustomCheck(o.amount_sats)) return new Error(`${path}.amount_sats: 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 -} - -export type AddUserRequest = { - callback_url: string - name: string - secret: string -} -export const AddUserRequestOptionalFields: [] = [] -export type AddUserRequestOptions = OptionsBaseMessage & { - checkOptionalsAreSet?: [] - callback_url_CustomCheck?: (v: string) => boolean - name_CustomCheck?: (v: string) => boolean - secret_CustomCheck?: (v: string) => boolean -} -export const AddUserRequestValidate = (o?: AddUserRequest, opts: AddUserRequestOptions = {}, path: string = 'AddUserRequest::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.callback_url !== 'string') return new Error(`${path}.callback_url: is not a string`) - if (opts.callback_url_CustomCheck && !opts.callback_url_CustomCheck(o.callback_url)) return new Error(`${path}.callback_url: custom check failed`) - - 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 + userId: string + authToken: string } export const AuthUserResponseOptionalFields: [] = [] export type AuthUserResponseOptions = OptionsBaseMessage & { checkOptionalsAreSet?: [] - user_id_CustomCheck?: (v: string) => boolean - auth_token_CustomCheck?: (v: string) => boolean + userId_CustomCheck?: (v: string) => boolean + authToken_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.userId !== 'string') return new Error(`${path}.userId: is not a string`) + if (opts.userId_CustomCheck && !opts.userId_CustomCheck(o.userId)) return new Error(`${path}.userId: 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`) + if (typeof o.authToken !== 'string') return new Error(`${path}.authToken: is not a string`) + if (opts.authToken_CustomCheck && !opts.authToken_CustomCheck(o.authToken)) return new Error(`${path}.authToken: custom check failed`) + + return null +} + +export type EncryptionExchangeRequest = { + publicKey: string + deviceId: string +} +export const EncryptionExchangeRequestOptionalFields: [] = [] +export type EncryptionExchangeRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + publicKey_CustomCheck?: (v: string) => boolean + deviceId_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.publicKey !== 'string') return new Error(`${path}.publicKey: is not a string`) + if (opts.publicKey_CustomCheck && !opts.publicKey_CustomCheck(o.publicKey)) return new Error(`${path}.publicKey: custom check failed`) + + if (typeof o.deviceId !== 'string') return new Error(`${path}.deviceId: is not a string`) + if (opts.deviceId_CustomCheck && !opts.deviceId_CustomCheck(o.deviceId)) return new Error(`${path}.deviceId: custom check failed`) + + return null +} + +export type LndGetInfoRequest = { + nodeId: number +} +export const LndGetInfoRequestOptionalFields: [] = [] +export type LndGetInfoRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + nodeId_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.nodeId !== 'number') return new Error(`${path}.nodeId: is not a number`) + if (opts.nodeId_CustomCheck && !opts.nodeId_CustomCheck(o.nodeId)) return new Error(`${path}.nodeId: custom check failed`) + + return null +} + +export type PayAddressRequest = { + address: string + amoutSats: number + targetConf: number +} +export const PayAddressRequestOptionalFields: [] = [] +export type PayAddressRequestOptions = OptionsBaseMessage & { + checkOptionalsAreSet?: [] + address_CustomCheck?: (v: string) => boolean + amoutSats_CustomCheck?: (v: number) => boolean + targetConf_CustomCheck?: (v: number) => boolean +} +export const PayAddressRequestValidate = (o?: PayAddressRequest, opts: PayAddressRequestOptions = {}, path: string = 'PayAddressRequest::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 (typeof o.amoutSats !== 'number') return new Error(`${path}.amoutSats: is not a number`) + if (opts.amoutSats_CustomCheck && !opts.amoutSats_CustomCheck(o.amoutSats)) return new Error(`${path}.amoutSats: custom check failed`) + + if (typeof o.targetConf !== 'number') return new Error(`${path}.targetConf: is not a number`) + if (opts.targetConf_CustomCheck && !opts.targetConf_CustomCheck(o.targetConf)) return new Error(`${path}.targetConf: custom check failed`) return null } diff --git a/proto/lnd/invoices.client.d.ts b/proto/lnd/invoices.client.d.ts deleted file mode 100644 index 00dca87d..00000000 --- a/proto/lnd/invoices.client.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @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 type { LookupInvoiceMsg } from "./invoices"; -import type { SettleInvoiceResp } from "./invoices"; -import type { SettleInvoiceMsg } from "./invoices"; -import type { AddHoldInvoiceResp } from "./invoices"; -import type { AddHoldInvoiceRequest } from "./invoices"; -import type { CancelInvoiceResp } from "./invoices"; -import type { CancelInvoiceMsg } from "./invoices"; -import type { UnaryCall } from "@protobuf-ts/runtime-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"; -/** - * Invoices is a service that can be used to create, accept, settle and cancel - * invoices. - * - * @generated from protobuf service invoicesrpc.Invoices - */ -export interface IInvoicesClient { - /** - * - * SubscribeSingleInvoice returns a uni-directional stream (server -> client) - * to notify the client of state transitions of the specified invoice. - * Initially the current invoice state is always sent out. - * - * @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice); - */ - subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * CancelInvoice cancels a currently open invoice. If the invoice is already - * canceled, this call will succeed. If the invoice is already settled, it will - * fail. - * - * @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp); - */ - cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall; - /** - * - * AddHoldInvoice creates a hold invoice. It ties the invoice to the hash - * supplied in the request. - * - * @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp); - */ - addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall; - /** - * - * SettleInvoice settles an accepted invoice. If the invoice is already - * settled, this call will succeed. - * - * @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 - * invoices. - * - * @generated from protobuf service invoicesrpc.Invoices - */ -export declare class InvoicesClient implements IInvoicesClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * - * SubscribeSingleInvoice returns a uni-directional stream (server -> client) - * to notify the client of state transitions of the specified invoice. - * Initially the current invoice state is always sent out. - * - * @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice); - */ - subscribeSingleInvoice(input: SubscribeSingleInvoiceRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * CancelInvoice cancels a currently open invoice. If the invoice is already - * canceled, this call will succeed. If the invoice is already settled, it will - * fail. - * - * @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp); - */ - cancelInvoice(input: CancelInvoiceMsg, options?: RpcOptions): UnaryCall; - /** - * - * AddHoldInvoice creates a hold invoice. It ties the invoice to the hash - * supplied in the request. - * - * @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp); - */ - addHoldInvoice(input: AddHoldInvoiceRequest, options?: RpcOptions): UnaryCall; - /** - * - * SettleInvoice settles an accepted invoice. If the invoice is already - * settled, this call will succeed. - * - * @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; -} diff --git a/proto/lnd/invoices.client.js b/proto/lnd/invoices.client.js deleted file mode 100644 index a4130b7c..00000000 --- a/proto/lnd/invoices.client.js +++ /dev/null @@ -1,76 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) -// tslint:disable -import { Invoices } from "./invoices.js"; -import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -/** - * Invoices is a service that can be used to create, accept, settle and cancel - * invoices. - * - * @generated from protobuf service invoicesrpc.Invoices - */ -export class InvoicesClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = Invoices.typeName; - this.methods = Invoices.methods; - this.options = Invoices.options; - } - /** - * - * SubscribeSingleInvoice returns a uni-directional stream (server -> client) - * to notify the client of state transitions of the specified invoice. - * Initially the current invoice state is always sent out. - * - * @generated from protobuf rpc: SubscribeSingleInvoice(invoicesrpc.SubscribeSingleInvoiceRequest) returns (stream lnrpc.Invoice); - */ - subscribeSingleInvoice(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * CancelInvoice cancels a currently open invoice. If the invoice is already - * canceled, this call will succeed. If the invoice is already settled, it will - * fail. - * - * @generated from protobuf rpc: CancelInvoice(invoicesrpc.CancelInvoiceMsg) returns (invoicesrpc.CancelInvoiceResp); - */ - cancelInvoice(input, options) { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * AddHoldInvoice creates a hold invoice. It ties the invoice to the hash - * supplied in the request. - * - * @generated from protobuf rpc: AddHoldInvoice(invoicesrpc.AddHoldInvoiceRequest) returns (invoicesrpc.AddHoldInvoiceResp); - */ - addHoldInvoice(input, options) { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SettleInvoice settles an accepted invoice. If the invoice is already - * settled, this call will succeed. - * - * @generated from protobuf rpc: SettleInvoice(invoicesrpc.SettleInvoiceMsg) returns (invoicesrpc.SettleInvoiceResp); - */ - settleInvoice(input, options) { - 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, options) { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } -} diff --git a/proto/lnd/invoices.client.ts b/proto/lnd/invoices.client.ts index 1ce32b68..54fc20e2 100644 --- a/proto/lnd/invoices.client.ts +++ b/proto/lnd/invoices.client.ts @@ -3,18 +3,18 @@ // 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"; -import type { AddHoldInvoiceRequest } from "./invoices"; -import type { CancelInvoiceResp } from "./invoices"; -import type { CancelInvoiceMsg } from "./invoices"; +import { Invoices } from "./invoices.js"; +import type { LookupInvoiceMsg } from "./invoices.js"; +import type { SettleInvoiceResp } from "./invoices.js"; +import type { SettleInvoiceMsg } from "./invoices.js"; +import type { AddHoldInvoiceResp } from "./invoices.js"; +import type { AddHoldInvoiceRequest } from "./invoices.js"; +import type { CancelInvoiceResp } from "./invoices.js"; +import type { CancelInvoiceMsg } from "./invoices.js"; import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -import type { Invoice } from "./lightning"; -import type { SubscribeSingleInvoiceRequest } from "./invoices"; +import type { Invoice } from "./lightning.js"; +import type { SubscribeSingleInvoiceRequest } from "./invoices.js"; import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; /** diff --git a/proto/lnd/invoices.d.ts b/proto/lnd/invoices.d.ts deleted file mode 100644 index 19c87f2c..00000000 --- a/proto/lnd/invoices.d.ts +++ /dev/null @@ -1,318 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) -// tslint:disable -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -import { RouteHint } from "./lightning"; -/** - * @generated from protobuf message invoicesrpc.CancelInvoiceMsg - */ -export interface CancelInvoiceMsg { - /** - * 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; - */ - paymentHash: Uint8Array; -} -/** - * @generated from protobuf message invoicesrpc.CancelInvoiceResp - */ -export interface CancelInvoiceResp { -} -/** - * @generated from protobuf message invoicesrpc.AddHoldInvoiceRequest - */ -export interface AddHoldInvoiceRequest { - /** - * - * An optional memo to attach along with the invoice. Used for record keeping - * purposes for the invoice's creator, and will also be set in the description - * field of the encoded payment request if the description_hash field is not - * being used. - * - * @generated from protobuf field: string memo = 1; - */ - memo: string; - /** - * The hash of the preimage - * - * @generated from protobuf field: bytes hash = 2; - */ - hash: Uint8Array; - /** - * - * The value of this invoice in satoshis - * - * The fields value and value_msat are mutually exclusive. - * - * @generated from protobuf field: int64 value = 3; - */ - value: number; - /** - * - * The value of this invoice in millisatoshis - * - * The fields value and value_msat are mutually exclusive. - * - * @generated from protobuf field: int64 value_msat = 10; - */ - valueMsat: number; - /** - * - * Hash (SHA-256) of a description of the payment. Used if the description of - * payment (memo) is too long to naturally fit within the description field - * of an encoded payment request. - * - * @generated from protobuf field: bytes description_hash = 4; - */ - descriptionHash: Uint8Array; - /** - * Payment request expiry time in seconds. Default is 3600 (1 hour). - * - * @generated from protobuf field: int64 expiry = 5; - */ - expiry: number; - /** - * Fallback on-chain address. - * - * @generated from protobuf field: string fallback_addr = 6; - */ - fallbackAddr: string; - /** - * Delta to use for the time-lock of the CLTV extended to the final hop. - * - * @generated from protobuf field: uint64 cltv_expiry = 7; - */ - cltvExpiry: number; - /** - * - * Route hints that can each be individually used to assist in reaching the - * invoice's destination. - * - * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 8; - */ - routeHints: RouteHint[]; - /** - * Whether this invoice should include routing hints for private channels. - * - * @generated from protobuf field: bool private = 9; - */ - private: boolean; -} -/** - * @generated from protobuf message invoicesrpc.AddHoldInvoiceResp - */ -export interface AddHoldInvoiceResp { - /** - * - * 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: number; - /** - * - * 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 - */ -export interface SettleInvoiceMsg { - /** - * Externally discovered pre-image that should be used to settle the hold - * invoice. - * - * @generated from protobuf field: bytes preimage = 1; - */ - preimage: Uint8Array; -} -/** - * @generated from protobuf message invoicesrpc.SettleInvoiceResp - */ -export interface SettleInvoiceResp { -} -/** - * @generated from protobuf message invoicesrpc.SubscribeSingleInvoiceRequest - */ -export interface SubscribeSingleInvoiceRequest { - /** - * 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 declare 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 -} -declare class CancelInvoiceMsg$Type extends MessageType { - constructor(); - create(value?: PartialMessage): CancelInvoiceMsg; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CancelInvoiceMsg): CancelInvoiceMsg; - internalBinaryWrite(message: CancelInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message invoicesrpc.CancelInvoiceMsg - */ -export declare const CancelInvoiceMsg: CancelInvoiceMsg$Type; -declare class CancelInvoiceResp$Type extends MessageType { - constructor(); - create(value?: PartialMessage): CancelInvoiceResp; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CancelInvoiceResp): CancelInvoiceResp; - internalBinaryWrite(message: CancelInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message invoicesrpc.CancelInvoiceResp - */ -export declare const CancelInvoiceResp: CancelInvoiceResp$Type; -declare class AddHoldInvoiceRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AddHoldInvoiceRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddHoldInvoiceRequest): AddHoldInvoiceRequest; - internalBinaryWrite(message: AddHoldInvoiceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceRequest - */ -export declare const AddHoldInvoiceRequest: AddHoldInvoiceRequest$Type; -declare class AddHoldInvoiceResp$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AddHoldInvoiceResp; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddHoldInvoiceResp): AddHoldInvoiceResp; - internalBinaryWrite(message: AddHoldInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceResp - */ -export declare const AddHoldInvoiceResp: AddHoldInvoiceResp$Type; -declare class SettleInvoiceMsg$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SettleInvoiceMsg; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleInvoiceMsg): SettleInvoiceMsg; - internalBinaryWrite(message: SettleInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message invoicesrpc.SettleInvoiceMsg - */ -export declare const SettleInvoiceMsg: SettleInvoiceMsg$Type; -declare class SettleInvoiceResp$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SettleInvoiceResp; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleInvoiceResp): SettleInvoiceResp; - internalBinaryWrite(message: SettleInvoiceResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message invoicesrpc.SettleInvoiceResp - */ -export declare const SettleInvoiceResp: SettleInvoiceResp$Type; -declare class SubscribeSingleInvoiceRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SubscribeSingleInvoiceRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeSingleInvoiceRequest): SubscribeSingleInvoiceRequest; - internalBinaryWrite(message: SubscribeSingleInvoiceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message invoicesrpc.SubscribeSingleInvoiceRequest - */ -export declare const SubscribeSingleInvoiceRequest: SubscribeSingleInvoiceRequest$Type; -declare class LookupInvoiceMsg$Type extends MessageType { - constructor(); - create(value?: PartialMessage): LookupInvoiceMsg; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupInvoiceMsg): LookupInvoiceMsg; - internalBinaryWrite(message: LookupInvoiceMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message invoicesrpc.LookupInvoiceMsg - */ -export declare const LookupInvoiceMsg: LookupInvoiceMsg$Type; -/** - * @generated ServiceType for protobuf service invoicesrpc.Invoices - */ -export declare const Invoices: any; -export {}; diff --git a/proto/lnd/invoices.js b/proto/lnd/invoices.js deleted file mode 100644 index 4f3f7d6b..00000000 --- a/proto/lnd/invoices.js +++ /dev/null @@ -1,495 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) -// tslint:disable -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) -// tslint:disable -import { Invoice } from "./lightning.js"; -import { ServiceType } from "@protobuf-ts/runtime-rpc"; -import { WireType } from "@protobuf-ts/runtime"; -import { UnknownFieldHandler } 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 "./lightning.js"; -/** - * @generated from protobuf enum invoicesrpc.LookupModifier - */ -export var LookupModifier; -(function (LookupModifier) { - /** - * The default look up modifier, no look up behavior is changed. - * - * @generated from protobuf enum value: DEFAULT = 0; - */ - LookupModifier[LookupModifier["DEFAULT"] = 0] = "DEFAULT"; - /** - * - * 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; - */ - LookupModifier[LookupModifier["HTLC_SET_ONLY"] = 1] = "HTLC_SET_ONLY"; - /** - * - * 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; - */ - LookupModifier[LookupModifier["HTLC_SET_BLANK"] = 2] = "HTLC_SET_BLANK"; -})(LookupModifier || (LookupModifier = {})); -// @generated message type with reflection information, may provide speed optimized methods -class CancelInvoiceMsg$Type extends MessageType { - constructor() { - super("invoicesrpc.CancelInvoiceMsg", [ - { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { paymentHash: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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; - 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, writer, options) { - /* bytes payment_hash = 1; */ - if (message.paymentHash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.CancelInvoiceMsg - */ -export const CancelInvoiceMsg = new CancelInvoiceMsg$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CancelInvoiceResp$Type extends MessageType { - constructor() { - super("invoicesrpc.CancelInvoiceResp", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.CancelInvoiceResp - */ -export const CancelInvoiceResp = new CancelInvoiceResp$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AddHoldInvoiceRequest$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 10, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "description_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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) { - const message = { memo: "", hash: new Uint8Array(0), value: 0, valueMsat: 0, descriptionHash: new Uint8Array(0), expiry: 0, fallbackAddr: "", cltvExpiry: 0, routeHints: [], private: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string memo */ 1: - message.memo = reader.string(); - break; - case /* bytes hash */ 2: - message.hash = reader.bytes(); - break; - case /* int64 value */ 3: - message.value = reader.int64().toNumber(); - break; - case /* int64 value_msat */ 10: - message.valueMsat = reader.int64().toNumber(); - break; - case /* bytes description_hash */ 4: - message.descriptionHash = reader.bytes(); - break; - case /* int64 expiry */ 5: - message.expiry = reader.int64().toNumber(); - break; - case /* string fallback_addr */ 6: - message.fallbackAddr = reader.string(); - break; - case /* uint64 cltv_expiry */ 7: - message.cltvExpiry = reader.uint64().toNumber(); - break; - case /* repeated lnrpc.RouteHint route_hints */ 8: - message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* bool private */ 9: - message.private = 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, writer, options) { - /* string memo = 1; */ - if (message.memo !== "") - writer.tag(1, WireType.LengthDelimited).string(message.memo); - /* bytes hash = 2; */ - if (message.hash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.hash); - /* int64 value = 3; */ - if (message.value !== 0) - writer.tag(3, WireType.Varint).int64(message.value); - /* int64 value_msat = 10; */ - if (message.valueMsat !== 0) - 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) - 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) - writer.tag(7, WireType.Varint).uint64(message.cltvExpiry); - /* repeated lnrpc.RouteHint route_hints = 8; */ - for (let i = 0; i < message.routeHints.length; i++) - RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join(); - /* bool private = 9; */ - if (message.private !== false) - writer.tag(9, WireType.Varint).bool(message.private); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceRequest - */ -export const AddHoldInvoiceRequest = new AddHoldInvoiceRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AddHoldInvoiceResp$Type extends MessageType { - constructor() { - super("invoicesrpc.AddHoldInvoiceResp", [ - { no: 1, name: "payment_request", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { paymentRequest: "", addIndex: 0, paymentAddr: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string payment_request */ 1: - message.paymentRequest = reader.string(); - break; - case /* uint64 add_index */ 2: - message.addIndex = reader.uint64().toNumber(); - break; - case /* bytes payment_addr */ 3: - message.paymentAddr = 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, writer, options) { - /* string payment_request = 1; */ - if (message.paymentRequest !== "") - writer.tag(1, WireType.LengthDelimited).string(message.paymentRequest); - /* uint64 add_index = 2; */ - if (message.addIndex !== 0) - 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.AddHoldInvoiceResp - */ -export const AddHoldInvoiceResp = new AddHoldInvoiceResp$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SettleInvoiceMsg$Type extends MessageType { - constructor() { - super("invoicesrpc.SettleInvoiceMsg", [ - { no: 1, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - 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, length, options, target) { - 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, writer, options) { - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.SettleInvoiceMsg - */ -export const SettleInvoiceMsg = new SettleInvoiceMsg$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SettleInvoiceResp$Type extends MessageType { - constructor() { - super("invoicesrpc.SettleInvoiceResp", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.SettleInvoiceResp - */ -export const SettleInvoiceResp = new SettleInvoiceResp$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SubscribeSingleInvoiceRequest$Type extends MessageType { - constructor() { - super("invoicesrpc.SubscribeSingleInvoiceRequest", [ - { no: 2, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { rHash: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes r_hash */ 2: - message.rHash = 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, writer, options) { - /* bytes r_hash = 2; */ - if (message.rHash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.rHash); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message invoicesrpc.SubscribeSingleInvoiceRequest - */ -export const SubscribeSingleInvoiceRequest = new SubscribeSingleInvoiceRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LookupInvoiceMsg$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) { - 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, length, options, target) { - 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, writer, options) { - /* 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 - */ -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: "LookupInvoiceV2", options: {}, I: LookupInvoiceMsg, O: Invoice } -]); diff --git a/proto/lnd/invoices.ts b/proto/lnd/invoices.ts index d9e8f5b8..a42660cb 100644 --- a/proto/lnd/invoices.ts +++ b/proto/lnd/invoices.ts @@ -1,7 +1,7 @@ // @generated by protobuf-ts 2.8.1 with parameter long_type_number // @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) // tslint:disable -import { Invoice } from "./lightning"; +import { Invoice } from "./lightning.js"; import { ServiceType } from "@protobuf-ts/runtime-rpc"; import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; import type { IBinaryWriter } from "@protobuf-ts/runtime"; @@ -13,7 +13,7 @@ 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 "./lightning"; +import { RouteHint } from "./lightning.js"; /** * @generated from protobuf message invoicesrpc.CancelInvoiceMsg */ diff --git a/proto/lnd/lightning.client.d.ts b/proto/lnd/lightning.client.d.ts deleted file mode 100644 index 67e3176a..00000000 --- a/proto/lnd/lightning.client.d.ts +++ /dev/null @@ -1,1481 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @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 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 "./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 "./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 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"; -/** - * Lightning is the main RPC server of the daemon. - * - * @generated from protobuf service lnrpc.Lightning - */ -export interface ILightningClient { - /** - * lncli: `walletbalance` - * WalletBalance returns total unspent outputs(confirmed and unconfirmed), all - * confirmed unspent outputs and all unconfirmed unspent outputs under control - * of the wallet. - * - * @generated from protobuf rpc: WalletBalance(lnrpc.WalletBalanceRequest) returns (lnrpc.WalletBalanceResponse); - */ - walletBalance(input: WalletBalanceRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `channelbalance` - * ChannelBalance returns a report on the total funds across all open channels, - * categorized in local/remote, pending local/remote and unsettled local/remote - * balances. - * - * @generated from protobuf rpc: ChannelBalance(lnrpc.ChannelBalanceRequest) returns (lnrpc.ChannelBalanceResponse); - */ - channelBalance(input: ChannelBalanceRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listchaintxns` - * GetTransactions returns a list describing all the known transactions - * relevant to the wallet. - * - * @generated from protobuf rpc: GetTransactions(lnrpc.GetTransactionsRequest) returns (lnrpc.TransactionDetails); - */ - getTransactions(input: GetTransactionsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `estimatefee` - * EstimateFee asks the chain backend to estimate the fee rate and total fees - * for a transaction that pays to multiple specified outputs. - * - * When using REST, the `AddrToAmount` map type can be set by appending - * `&AddrToAmount[
]=` to the URL. Unfortunately this - * map type doesn't appear in the REST API documentation because of a bug in - * the grpc-gateway library. - * - * @generated from protobuf rpc: EstimateFee(lnrpc.EstimateFeeRequest) returns (lnrpc.EstimateFeeResponse); - */ - estimateFee(input: EstimateFeeRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `sendcoins` - * SendCoins executes a request to send coins to a particular address. Unlike - * SendMany, this RPC call only allows creating a single output at a time. If - * neither target_conf, or sat_per_vbyte are set, then the internal wallet will - * consult its fee model to determine a fee for the default confirmation - * target. - * - * @generated from protobuf rpc: SendCoins(lnrpc.SendCoinsRequest) returns (lnrpc.SendCoinsResponse); - */ - sendCoins(input: SendCoinsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listunspent` - * Deprecated, use walletrpc.ListUnspent instead. - * - * ListUnspent returns a list of all utxos spendable by the wallet with a - * number of confirmations between the specified minimum and maximum. - * - * @generated from protobuf rpc: ListUnspent(lnrpc.ListUnspentRequest) returns (lnrpc.ListUnspentResponse); - */ - listUnspent(input: ListUnspentRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeTransactions creates a uni-directional stream from the server to - * the client in which any newly discovered transactions relevant to the - * wallet are sent over. - * - * @generated from protobuf rpc: SubscribeTransactions(lnrpc.GetTransactionsRequest) returns (stream lnrpc.Transaction); - */ - subscribeTransactions(input: GetTransactionsRequest, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `sendmany` - * SendMany handles a request for a transaction that creates multiple specified - * outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then - * the internal wallet will consult its fee model to determine a fee for the - * default confirmation target. - * - * @generated from protobuf rpc: SendMany(lnrpc.SendManyRequest) returns (lnrpc.SendManyResponse); - */ - sendMany(input: SendManyRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `newaddress` - * NewAddress creates a new address under control of the local wallet. - * - * @generated from protobuf rpc: NewAddress(lnrpc.NewAddressRequest) returns (lnrpc.NewAddressResponse); - */ - newAddress(input: NewAddressRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `signmessage` - * SignMessage signs a message with this node's private key. The returned - * signature string is `zbase32` encoded and pubkey recoverable, meaning that - * only the message digest and signature are needed for verification. - * - * @generated from protobuf rpc: SignMessage(lnrpc.SignMessageRequest) returns (lnrpc.SignMessageResponse); - */ - signMessage(input: SignMessageRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `verifymessage` - * VerifyMessage verifies a signature over a msg. The signature must be - * zbase32 encoded and signed by an active node in the resident node's - * channel database. In addition to returning the validity of the signature, - * VerifyMessage also returns the recovered pubkey from the signature. - * - * @generated from protobuf rpc: VerifyMessage(lnrpc.VerifyMessageRequest) returns (lnrpc.VerifyMessageResponse); - */ - verifyMessage(input: VerifyMessageRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `connect` - * ConnectPeer attempts to establish a connection to a remote peer. This is at - * the networking level, and is used for communication between nodes. This is - * distinct from establishing a channel with a peer. - * - * @generated from protobuf rpc: ConnectPeer(lnrpc.ConnectPeerRequest) returns (lnrpc.ConnectPeerResponse); - */ - connectPeer(input: ConnectPeerRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `disconnect` - * DisconnectPeer attempts to disconnect one peer from another identified by a - * given pubKey. In the case that we currently have a pending or active channel - * with the target peer, then this action will be not be allowed. - * - * @generated from protobuf rpc: DisconnectPeer(lnrpc.DisconnectPeerRequest) returns (lnrpc.DisconnectPeerResponse); - */ - disconnectPeer(input: DisconnectPeerRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listpeers` - * ListPeers returns a verbose listing of all currently active peers. - * - * @generated from protobuf rpc: ListPeers(lnrpc.ListPeersRequest) returns (lnrpc.ListPeersResponse); - */ - listPeers(input: ListPeersRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribePeerEvents creates a uni-directional stream from the server to - * the client in which any events relevant to the state of peers are sent - * over. Events include peers going online and offline. - * - * @generated from protobuf rpc: SubscribePeerEvents(lnrpc.PeerEventSubscription) returns (stream lnrpc.PeerEvent); - */ - subscribePeerEvents(input: PeerEventSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `getinfo` - * GetInfo returns general information concerning the lightning node including - * it's identity pubkey, alias, the chains it is connected to, and information - * concerning the number of open+pending channels. - * - * @generated from protobuf rpc: GetInfo(lnrpc.GetInfoRequest) returns (lnrpc.GetInfoResponse); - */ - getInfo(input: GetInfoRequest, options?: RpcOptions): UnaryCall; - /** - * * lncli: `getrecoveryinfo` - * GetRecoveryInfo returns information concerning the recovery mode including - * whether it's in a recovery mode, whether the recovery is finished, and the - * progress made so far. - * - * @generated from protobuf rpc: GetRecoveryInfo(lnrpc.GetRecoveryInfoRequest) returns (lnrpc.GetRecoveryInfoResponse); - */ - getRecoveryInfo(input: GetRecoveryInfoRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `pendingchannels` - * PendingChannels returns a list of all the channels that are currently - * considered "pending". A channel is pending if it has finished the funding - * workflow and is waiting for confirmations for the funding txn, or is in the - * process of closure, either initiated cooperatively or non-cooperatively. - * - * @generated from protobuf rpc: PendingChannels(lnrpc.PendingChannelsRequest) returns (lnrpc.PendingChannelsResponse); - */ - pendingChannels(input: PendingChannelsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listchannels` - * ListChannels returns a description of all the open channels that this node - * is a participant in. - * - * @generated from protobuf rpc: ListChannels(lnrpc.ListChannelsRequest) returns (lnrpc.ListChannelsResponse); - */ - listChannels(input: ListChannelsRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeChannelEvents creates a uni-directional stream from the server to - * the client in which any updates relevant to the state of the channels are - * sent over. Events include new active channels, inactive channels, and closed - * channels. - * - * @generated from protobuf rpc: SubscribeChannelEvents(lnrpc.ChannelEventSubscription) returns (stream lnrpc.ChannelEventUpdate); - */ - subscribeChannelEvents(input: ChannelEventSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `closedchannels` - * ClosedChannels returns a description of all the closed channels that - * this node was a participant in. - * - * @generated from protobuf rpc: ClosedChannels(lnrpc.ClosedChannelsRequest) returns (lnrpc.ClosedChannelsResponse); - */ - closedChannels(input: ClosedChannelsRequest, options?: RpcOptions): UnaryCall; - /** - * - * OpenChannelSync is a synchronous version of the OpenChannel RPC call. This - * call is meant to be consumed by clients to the REST proxy. As with all - * other sync calls, all byte slices are intended to be populated as hex - * encoded strings. - * - * @generated from protobuf rpc: OpenChannelSync(lnrpc.OpenChannelRequest) returns (lnrpc.ChannelPoint); - */ - openChannelSync(input: OpenChannelRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `openchannel` - * OpenChannel attempts to open a singly funded channel specified in the - * request to a remote peer. Users are able to specify a target number of - * blocks that the funding transaction should be confirmed in, or a manual fee - * rate to us for the funding transaction. If neither are specified, then a - * lax block confirmation target is used. Each OpenStatusUpdate will return - * the pending channel ID of the in-progress channel. Depending on the - * arguments specified in the OpenChannelRequest, this pending channel ID can - * then be used to manually progress the channel funding flow. - * - * @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 - * to either execute some preparatory steps for a funding workflow, or - * manually progress a funding workflow. The primary way a funding flow is - * identified is via its pending channel ID. As an example, this method can be - * used to specify that we're expecting a funding flow for a particular - * pending channel ID, for which we need to use specific parameters. - * Alternatively, this can be used to interactively drive PSBT signing for - * funding for partially complete funding transactions. - * - * @generated from protobuf rpc: FundingStateStep(lnrpc.FundingTransitionMsg) returns (lnrpc.FundingStateStepResp); - */ - fundingStateStep(input: FundingTransitionMsg, options?: RpcOptions): UnaryCall; - /** - * - * ChannelAcceptor dispatches a bi-directional streaming RPC in which - * OpenChannel requests are sent to the client and the client responds with - * a boolean that tells LND whether or not to accept the channel. This allows - * node operators to specify their own criteria for accepting inbound channels - * through a single persistent connection. - * - * @generated from protobuf rpc: ChannelAcceptor(stream lnrpc.ChannelAcceptResponse) returns (stream lnrpc.ChannelAcceptRequest); - */ - channelAcceptor(options?: RpcOptions): DuplexStreamingCall; - /** - * lncli: `closechannel` - * CloseChannel attempts to close an active channel identified by its channel - * outpoint (ChannelPoint). The actions of this method can additionally be - * augmented to attempt a force close after a timeout period in the case of an - * inactive peer. If a non-force close (cooperative closure) is requested, - * then the user can specify either a target number of blocks until the - * closure transaction is confirmed, or a manual fee rate. If neither are - * specified, then a default lax, block confirmation target is used. - * - * @generated from protobuf rpc: CloseChannel(lnrpc.CloseChannelRequest) returns (stream lnrpc.CloseStatusUpdate); - */ - closeChannel(input: CloseChannelRequest, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `abandonchannel` - * AbandonChannel removes all channel state from the database except for a - * close summary. This method can be used to get rid of permanently unusable - * channels due to bugs fixed in newer versions of lnd. This method can also be - * used to remove externally funded channels where the funding transaction was - * never broadcast. Only available for non-externally funded channels in dev - * build. - * - * @generated from protobuf rpc: AbandonChannel(lnrpc.AbandonChannelRequest) returns (lnrpc.AbandonChannelResponse); - */ - abandonChannel(input: AbandonChannelRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `sendpayment` - * Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a - * bi-directional streaming RPC for sending payments through the Lightning - * Network. A single RPC invocation creates a persistent bi-directional - * stream allowing clients to rapidly send payments through the Lightning - * Network with a single persistent connection. - * - * @deprecated - * @generated from protobuf rpc: SendPayment(stream lnrpc.SendRequest) returns (stream lnrpc.SendResponse); - */ - sendPayment(options?: RpcOptions): DuplexStreamingCall; - /** - * - * SendPaymentSync is the synchronous non-streaming version of SendPayment. - * This RPC is intended to be consumed by clients of the REST proxy. - * Additionally, this RPC expects the destination's public key and the payment - * hash (if any) to be encoded as hex strings. - * - * @generated from protobuf rpc: SendPaymentSync(lnrpc.SendRequest) returns (lnrpc.SendResponse); - */ - sendPaymentSync(input: SendRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `sendtoroute` - * Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional - * streaming RPC for sending payment through the Lightning Network. This - * method differs from SendPayment in that it allows users to specify a full - * route manually. This can be used for things like rebalancing, and atomic - * swaps. - * - * @deprecated - * @generated from protobuf rpc: SendToRoute(stream lnrpc.SendToRouteRequest) returns (stream lnrpc.SendResponse); - */ - sendToRoute(options?: RpcOptions): DuplexStreamingCall; - /** - * - * SendToRouteSync is a synchronous version of SendToRoute. It Will block - * until the payment either fails or succeeds. - * - * @generated from protobuf rpc: SendToRouteSync(lnrpc.SendToRouteRequest) returns (lnrpc.SendResponse); - */ - sendToRouteSync(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `addinvoice` - * AddInvoice attempts to add a new invoice to the invoice database. Any - * duplicated invoices are rejected, therefore all invoices *must* have a - * unique payment preimage. - * - * @generated from protobuf rpc: AddInvoice(lnrpc.Invoice) returns (lnrpc.AddInvoiceResponse); - */ - addInvoice(input: Invoice, options?: RpcOptions): UnaryCall; - /** - * lncli: `listinvoices` - * ListInvoices returns a list of all the invoices currently stored within the - * database. Any active debug invoices are ignored. It has full support for - * paginated responses, allowing users to query for specific invoices through - * their add_index. This can be done by using either the first_index_offset or - * last_index_offset fields included in the response as the index_offset of the - * next request. By default, the first 100 invoices created will be returned. - * Backwards pagination is also supported through the Reversed flag. - * - * @generated from protobuf rpc: ListInvoices(lnrpc.ListInvoiceRequest) returns (lnrpc.ListInvoiceResponse); - */ - listInvoices(input: ListInvoiceRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `lookupinvoice` - * LookupInvoice attempts to look up an invoice according to its payment hash. - * The passed payment hash *must* be exactly 32 bytes, if not, an error is - * returned. - * - * @generated from protobuf rpc: LookupInvoice(lnrpc.PaymentHash) returns (lnrpc.Invoice); - */ - lookupInvoice(input: PaymentHash, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeInvoices returns a uni-directional stream (server -> client) for - * notifying the client of newly added/settled invoices. The caller can - * optionally specify the add_index and/or the settle_index. If the add_index - * is specified, then we'll first start by sending add invoice events for all - * invoices with an add_index greater than the specified value. If the - * settle_index is specified, the next, we'll send out all settle events for - * invoices with a settle_index greater than the specified value. One or both - * of these fields can be set. If no fields are set, then we'll only send out - * the latest add/settle events. - * - * @generated from protobuf rpc: SubscribeInvoices(lnrpc.InvoiceSubscription) returns (stream lnrpc.Invoice); - */ - subscribeInvoices(input: InvoiceSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `decodepayreq` - * DecodePayReq takes an encoded payment request string and attempts to decode - * it, returning a full description of the conditions encoded within the - * payment request. - * - * @generated from protobuf rpc: DecodePayReq(lnrpc.PayReqString) returns (lnrpc.PayReq); - */ - decodePayReq(input: PayReqString, options?: RpcOptions): UnaryCall; - /** - * lncli: `listpayments` - * ListPayments returns a list of all outgoing payments. - * - * @generated from protobuf rpc: ListPayments(lnrpc.ListPaymentsRequest) returns (lnrpc.ListPaymentsResponse); - */ - listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall; - /** - * - * 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); - */ - deleteAllPayments(input: DeleteAllPaymentsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `describegraph` - * DescribeGraph returns a description of the latest graph state from the - * point of view of the node. The graph information is partitioned into two - * components: all the nodes/vertexes, and all the edges that connect the - * vertexes themselves. As this is a directed graph, the edges also contain - * the node directional specific routing policy which includes: the time lock - * delta, fee information, etc. - * - * @generated from protobuf rpc: DescribeGraph(lnrpc.ChannelGraphRequest) returns (lnrpc.ChannelGraph); - */ - describeGraph(input: ChannelGraphRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getnodemetrics` - * GetNodeMetrics returns node metrics calculated from the graph. Currently - * the only supported metric is betweenness centrality of individual nodes. - * - * @generated from protobuf rpc: GetNodeMetrics(lnrpc.NodeMetricsRequest) returns (lnrpc.NodeMetricsResponse); - */ - getNodeMetrics(input: NodeMetricsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getchaninfo` - * GetChanInfo returns the latest authenticated network announcement for the - * given channel identified by its channel ID: an 8-byte integer which - * uniquely identifies the location of transaction's funding output within the - * blockchain. - * - * @generated from protobuf rpc: GetChanInfo(lnrpc.ChanInfoRequest) returns (lnrpc.ChannelEdge); - */ - getChanInfo(input: ChanInfoRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getnodeinfo` - * GetNodeInfo returns the latest advertised, aggregated, and authenticated - * channel information for the specified node identified by its public key. - * - * @generated from protobuf rpc: GetNodeInfo(lnrpc.NodeInfoRequest) returns (lnrpc.NodeInfo); - */ - getNodeInfo(input: NodeInfoRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `queryroutes` - * QueryRoutes attempts to query the daemon's Channel Router for a possible - * route to a target destination capable of carrying a specific amount of - * satoshis. The returned route contains the full details required to craft and - * send an HTLC, also including the necessary information that should be - * present within the Sphinx packet encapsulated within the HTLC. - * - * When using REST, the `dest_custom_records` map type can be set by appending - * `&dest_custom_records[]=` - * to the URL. Unfortunately this map type doesn't appear in the REST API - * documentation because of a bug in the grpc-gateway library. - * - * @generated from protobuf rpc: QueryRoutes(lnrpc.QueryRoutesRequest) returns (lnrpc.QueryRoutesResponse); - */ - queryRoutes(input: QueryRoutesRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getnetworkinfo` - * GetNetworkInfo returns some basic stats about the known channel graph from - * the point of view of the node. - * - * @generated from protobuf rpc: GetNetworkInfo(lnrpc.NetworkInfoRequest) returns (lnrpc.NetworkInfo); - */ - getNetworkInfo(input: NetworkInfoRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `stop` - * StopDaemon will send a shutdown request to the interrupt handler, triggering - * a graceful shutdown of the daemon. - * - * @generated from protobuf rpc: StopDaemon(lnrpc.StopRequest) returns (lnrpc.StopResponse); - */ - stopDaemon(input: StopRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeChannelGraph launches a streaming RPC that allows the caller to - * receive notifications upon any changes to the channel graph topology from - * the point of view of the responding node. Events notified include: new - * nodes coming online, nodes updating their authenticated attributes, new - * channels being advertised, updates in the routing policy for a directional - * channel edge, and when channels are closed on-chain. - * - * @generated from protobuf rpc: SubscribeChannelGraph(lnrpc.GraphTopologySubscription) returns (stream lnrpc.GraphTopologyUpdate); - */ - subscribeChannelGraph(input: GraphTopologySubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `debuglevel` - * DebugLevel allows a caller to programmatically set the logging verbosity of - * lnd. The logging can be targeted according to a coarse daemon-wide logging - * level, or in a granular fashion to specify the logging for a target - * sub-system. - * - * @generated from protobuf rpc: DebugLevel(lnrpc.DebugLevelRequest) returns (lnrpc.DebugLevelResponse); - */ - debugLevel(input: DebugLevelRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `feereport` - * FeeReport allows the caller to obtain a report detailing the current fee - * schedule enforced by the node globally for each channel. - * - * @generated from protobuf rpc: FeeReport(lnrpc.FeeReportRequest) returns (lnrpc.FeeReportResponse); - */ - feeReport(input: FeeReportRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `updatechanpolicy` - * UpdateChannelPolicy allows the caller to update the fee schedule and - * channel policies for all channels globally, or a particular channel. - * - * @generated from protobuf rpc: UpdateChannelPolicy(lnrpc.PolicyUpdateRequest) returns (lnrpc.PolicyUpdateResponse); - */ - updateChannelPolicy(input: PolicyUpdateRequest, options?: RpcOptions): UnaryCall; - /** - * 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, 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. - * As a result each message can only contain 50k entries. Each response has - * the index offset of the last entry. The index offset can be provided to the - * request to allow the caller to skip a series of records. - * - * @generated from protobuf rpc: ForwardingHistory(lnrpc.ForwardingHistoryRequest) returns (lnrpc.ForwardingHistoryResponse); - */ - forwardingHistory(input: ForwardingHistoryRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `exportchanbackup` - * ExportChannelBackup attempts to return an encrypted static channel backup - * for the target channel identified by it channel point. The backup is - * encrypted with a key generated from the aezeed seed of the user. The - * returned backup can either be restored using the RestoreChannelBackup - * method once lnd is running, or via the InitWallet and UnlockWallet methods - * from the WalletUnlocker service. - * - * @generated from protobuf rpc: ExportChannelBackup(lnrpc.ExportChannelBackupRequest) returns (lnrpc.ChannelBackup); - */ - exportChannelBackup(input: ExportChannelBackupRequest, options?: RpcOptions): UnaryCall; - /** - * - * ExportAllChannelBackups returns static channel backups for all existing - * channels known to lnd. A set of regular singular static channel backups for - * each channel are returned. Additionally, a multi-channel backup is returned - * as well, which contains a single encrypted blob containing the backups of - * each channel. - * - * @generated from protobuf rpc: ExportAllChannelBackups(lnrpc.ChanBackupExportRequest) returns (lnrpc.ChanBackupSnapshot); - */ - exportAllChannelBackups(input: ChanBackupExportRequest, options?: RpcOptions): UnaryCall; - /** - * - * VerifyChanBackup allows a caller to verify the integrity of a channel backup - * snapshot. This method will accept either a packed Single or a packed Multi. - * Specifying both will result in an error. - * - * @generated from protobuf rpc: VerifyChanBackup(lnrpc.ChanBackupSnapshot) returns (lnrpc.VerifyChanBackupResponse); - */ - verifyChanBackup(input: ChanBackupSnapshot, options?: RpcOptions): UnaryCall; - /** - * lncli: `restorechanbackup` - * RestoreChannelBackups accepts a set of singular channel backups, or a - * single encrypted multi-chan backup and attempts to recover any funds - * remaining within the channel. If we are able to unpack the backup, then the - * new channel will be shown under listchannels, as well as pending channels. - * - * @generated from protobuf rpc: RestoreChannelBackups(lnrpc.RestoreChanBackupRequest) returns (lnrpc.RestoreBackupResponse); - */ - restoreChannelBackups(input: RestoreChanBackupRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeChannelBackups allows a client to sub-subscribe to the most up to - * date information concerning the state of all channel backups. Each time a - * new channel is added, we return the new set of channels, along with a - * multi-chan backup containing the backup info for all channels. Each time a - * channel is closed, we send a new update, which contains new new chan back - * ups, but the updated set of encrypted multi-chan backups with the closed - * channel(s) removed. - * - * @generated from protobuf rpc: SubscribeChannelBackups(lnrpc.ChannelBackupSubscription) returns (stream lnrpc.ChanBackupSnapshot); - */ - subscribeChannelBackups(input: ChannelBackupSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `bakemacaroon` - * BakeMacaroon allows the creation of a new macaroon with custom read and - * write permissions. No first-party caveats are added since this can be done - * offline. - * - * @generated from protobuf rpc: BakeMacaroon(lnrpc.BakeMacaroonRequest) returns (lnrpc.BakeMacaroonResponse); - */ - bakeMacaroon(input: BakeMacaroonRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listmacaroonids` - * ListMacaroonIDs returns all root key IDs that are in use. - * - * @generated from protobuf rpc: ListMacaroonIDs(lnrpc.ListMacaroonIDsRequest) returns (lnrpc.ListMacaroonIDsResponse); - */ - listMacaroonIDs(input: ListMacaroonIDsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `deletemacaroonid` - * DeleteMacaroonID deletes the specified macaroon ID and invalidates all - * macaroons derived from that ID. - * - * @generated from protobuf rpc: DeleteMacaroonID(lnrpc.DeleteMacaroonIDRequest) returns (lnrpc.DeleteMacaroonIDResponse); - */ - deleteMacaroonID(input: DeleteMacaroonIDRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listpermissions` - * ListPermissions lists all RPC method URIs and their required macaroon - * permissions to access them. - * - * @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; -} -/** - * Lightning is the main RPC server of the daemon. - * - * @generated from protobuf service lnrpc.Lightning - */ -export declare class LightningClient implements ILightningClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * lncli: `walletbalance` - * WalletBalance returns total unspent outputs(confirmed and unconfirmed), all - * confirmed unspent outputs and all unconfirmed unspent outputs under control - * of the wallet. - * - * @generated from protobuf rpc: WalletBalance(lnrpc.WalletBalanceRequest) returns (lnrpc.WalletBalanceResponse); - */ - walletBalance(input: WalletBalanceRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `channelbalance` - * ChannelBalance returns a report on the total funds across all open channels, - * categorized in local/remote, pending local/remote and unsettled local/remote - * balances. - * - * @generated from protobuf rpc: ChannelBalance(lnrpc.ChannelBalanceRequest) returns (lnrpc.ChannelBalanceResponse); - */ - channelBalance(input: ChannelBalanceRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listchaintxns` - * GetTransactions returns a list describing all the known transactions - * relevant to the wallet. - * - * @generated from protobuf rpc: GetTransactions(lnrpc.GetTransactionsRequest) returns (lnrpc.TransactionDetails); - */ - getTransactions(input: GetTransactionsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `estimatefee` - * EstimateFee asks the chain backend to estimate the fee rate and total fees - * for a transaction that pays to multiple specified outputs. - * - * When using REST, the `AddrToAmount` map type can be set by appending - * `&AddrToAmount[
]=` to the URL. Unfortunately this - * map type doesn't appear in the REST API documentation because of a bug in - * the grpc-gateway library. - * - * @generated from protobuf rpc: EstimateFee(lnrpc.EstimateFeeRequest) returns (lnrpc.EstimateFeeResponse); - */ - estimateFee(input: EstimateFeeRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `sendcoins` - * SendCoins executes a request to send coins to a particular address. Unlike - * SendMany, this RPC call only allows creating a single output at a time. If - * neither target_conf, or sat_per_vbyte are set, then the internal wallet will - * consult its fee model to determine a fee for the default confirmation - * target. - * - * @generated from protobuf rpc: SendCoins(lnrpc.SendCoinsRequest) returns (lnrpc.SendCoinsResponse); - */ - sendCoins(input: SendCoinsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listunspent` - * Deprecated, use walletrpc.ListUnspent instead. - * - * ListUnspent returns a list of all utxos spendable by the wallet with a - * number of confirmations between the specified minimum and maximum. - * - * @generated from protobuf rpc: ListUnspent(lnrpc.ListUnspentRequest) returns (lnrpc.ListUnspentResponse); - */ - listUnspent(input: ListUnspentRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeTransactions creates a uni-directional stream from the server to - * the client in which any newly discovered transactions relevant to the - * wallet are sent over. - * - * @generated from protobuf rpc: SubscribeTransactions(lnrpc.GetTransactionsRequest) returns (stream lnrpc.Transaction); - */ - subscribeTransactions(input: GetTransactionsRequest, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `sendmany` - * SendMany handles a request for a transaction that creates multiple specified - * outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then - * the internal wallet will consult its fee model to determine a fee for the - * default confirmation target. - * - * @generated from protobuf rpc: SendMany(lnrpc.SendManyRequest) returns (lnrpc.SendManyResponse); - */ - sendMany(input: SendManyRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `newaddress` - * NewAddress creates a new address under control of the local wallet. - * - * @generated from protobuf rpc: NewAddress(lnrpc.NewAddressRequest) returns (lnrpc.NewAddressResponse); - */ - newAddress(input: NewAddressRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `signmessage` - * SignMessage signs a message with this node's private key. The returned - * signature string is `zbase32` encoded and pubkey recoverable, meaning that - * only the message digest and signature are needed for verification. - * - * @generated from protobuf rpc: SignMessage(lnrpc.SignMessageRequest) returns (lnrpc.SignMessageResponse); - */ - signMessage(input: SignMessageRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `verifymessage` - * VerifyMessage verifies a signature over a msg. The signature must be - * zbase32 encoded and signed by an active node in the resident node's - * channel database. In addition to returning the validity of the signature, - * VerifyMessage also returns the recovered pubkey from the signature. - * - * @generated from protobuf rpc: VerifyMessage(lnrpc.VerifyMessageRequest) returns (lnrpc.VerifyMessageResponse); - */ - verifyMessage(input: VerifyMessageRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `connect` - * ConnectPeer attempts to establish a connection to a remote peer. This is at - * the networking level, and is used for communication between nodes. This is - * distinct from establishing a channel with a peer. - * - * @generated from protobuf rpc: ConnectPeer(lnrpc.ConnectPeerRequest) returns (lnrpc.ConnectPeerResponse); - */ - connectPeer(input: ConnectPeerRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `disconnect` - * DisconnectPeer attempts to disconnect one peer from another identified by a - * given pubKey. In the case that we currently have a pending or active channel - * with the target peer, then this action will be not be allowed. - * - * @generated from protobuf rpc: DisconnectPeer(lnrpc.DisconnectPeerRequest) returns (lnrpc.DisconnectPeerResponse); - */ - disconnectPeer(input: DisconnectPeerRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listpeers` - * ListPeers returns a verbose listing of all currently active peers. - * - * @generated from protobuf rpc: ListPeers(lnrpc.ListPeersRequest) returns (lnrpc.ListPeersResponse); - */ - listPeers(input: ListPeersRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribePeerEvents creates a uni-directional stream from the server to - * the client in which any events relevant to the state of peers are sent - * over. Events include peers going online and offline. - * - * @generated from protobuf rpc: SubscribePeerEvents(lnrpc.PeerEventSubscription) returns (stream lnrpc.PeerEvent); - */ - subscribePeerEvents(input: PeerEventSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `getinfo` - * GetInfo returns general information concerning the lightning node including - * it's identity pubkey, alias, the chains it is connected to, and information - * concerning the number of open+pending channels. - * - * @generated from protobuf rpc: GetInfo(lnrpc.GetInfoRequest) returns (lnrpc.GetInfoResponse); - */ - getInfo(input: GetInfoRequest, options?: RpcOptions): UnaryCall; - /** - * * lncli: `getrecoveryinfo` - * GetRecoveryInfo returns information concerning the recovery mode including - * whether it's in a recovery mode, whether the recovery is finished, and the - * progress made so far. - * - * @generated from protobuf rpc: GetRecoveryInfo(lnrpc.GetRecoveryInfoRequest) returns (lnrpc.GetRecoveryInfoResponse); - */ - getRecoveryInfo(input: GetRecoveryInfoRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `pendingchannels` - * PendingChannels returns a list of all the channels that are currently - * considered "pending". A channel is pending if it has finished the funding - * workflow and is waiting for confirmations for the funding txn, or is in the - * process of closure, either initiated cooperatively or non-cooperatively. - * - * @generated from protobuf rpc: PendingChannels(lnrpc.PendingChannelsRequest) returns (lnrpc.PendingChannelsResponse); - */ - pendingChannels(input: PendingChannelsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listchannels` - * ListChannels returns a description of all the open channels that this node - * is a participant in. - * - * @generated from protobuf rpc: ListChannels(lnrpc.ListChannelsRequest) returns (lnrpc.ListChannelsResponse); - */ - listChannels(input: ListChannelsRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeChannelEvents creates a uni-directional stream from the server to - * the client in which any updates relevant to the state of the channels are - * sent over. Events include new active channels, inactive channels, and closed - * channels. - * - * @generated from protobuf rpc: SubscribeChannelEvents(lnrpc.ChannelEventSubscription) returns (stream lnrpc.ChannelEventUpdate); - */ - subscribeChannelEvents(input: ChannelEventSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `closedchannels` - * ClosedChannels returns a description of all the closed channels that - * this node was a participant in. - * - * @generated from protobuf rpc: ClosedChannels(lnrpc.ClosedChannelsRequest) returns (lnrpc.ClosedChannelsResponse); - */ - closedChannels(input: ClosedChannelsRequest, options?: RpcOptions): UnaryCall; - /** - * - * OpenChannelSync is a synchronous version of the OpenChannel RPC call. This - * call is meant to be consumed by clients to the REST proxy. As with all - * other sync calls, all byte slices are intended to be populated as hex - * encoded strings. - * - * @generated from protobuf rpc: OpenChannelSync(lnrpc.OpenChannelRequest) returns (lnrpc.ChannelPoint); - */ - openChannelSync(input: OpenChannelRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `openchannel` - * OpenChannel attempts to open a singly funded channel specified in the - * request to a remote peer. Users are able to specify a target number of - * blocks that the funding transaction should be confirmed in, or a manual fee - * rate to us for the funding transaction. If neither are specified, then a - * lax block confirmation target is used. Each OpenStatusUpdate will return - * the pending channel ID of the in-progress channel. Depending on the - * arguments specified in the OpenChannelRequest, this pending channel ID can - * then be used to manually progress the channel funding flow. - * - * @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 - * to either execute some preparatory steps for a funding workflow, or - * manually progress a funding workflow. The primary way a funding flow is - * identified is via its pending channel ID. As an example, this method can be - * used to specify that we're expecting a funding flow for a particular - * pending channel ID, for which we need to use specific parameters. - * Alternatively, this can be used to interactively drive PSBT signing for - * funding for partially complete funding transactions. - * - * @generated from protobuf rpc: FundingStateStep(lnrpc.FundingTransitionMsg) returns (lnrpc.FundingStateStepResp); - */ - fundingStateStep(input: FundingTransitionMsg, options?: RpcOptions): UnaryCall; - /** - * - * ChannelAcceptor dispatches a bi-directional streaming RPC in which - * OpenChannel requests are sent to the client and the client responds with - * a boolean that tells LND whether or not to accept the channel. This allows - * node operators to specify their own criteria for accepting inbound channels - * through a single persistent connection. - * - * @generated from protobuf rpc: ChannelAcceptor(stream lnrpc.ChannelAcceptResponse) returns (stream lnrpc.ChannelAcceptRequest); - */ - channelAcceptor(options?: RpcOptions): DuplexStreamingCall; - /** - * lncli: `closechannel` - * CloseChannel attempts to close an active channel identified by its channel - * outpoint (ChannelPoint). The actions of this method can additionally be - * augmented to attempt a force close after a timeout period in the case of an - * inactive peer. If a non-force close (cooperative closure) is requested, - * then the user can specify either a target number of blocks until the - * closure transaction is confirmed, or a manual fee rate. If neither are - * specified, then a default lax, block confirmation target is used. - * - * @generated from protobuf rpc: CloseChannel(lnrpc.CloseChannelRequest) returns (stream lnrpc.CloseStatusUpdate); - */ - closeChannel(input: CloseChannelRequest, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `abandonchannel` - * AbandonChannel removes all channel state from the database except for a - * close summary. This method can be used to get rid of permanently unusable - * channels due to bugs fixed in newer versions of lnd. This method can also be - * used to remove externally funded channels where the funding transaction was - * never broadcast. Only available for non-externally funded channels in dev - * build. - * - * @generated from protobuf rpc: AbandonChannel(lnrpc.AbandonChannelRequest) returns (lnrpc.AbandonChannelResponse); - */ - abandonChannel(input: AbandonChannelRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `sendpayment` - * Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a - * bi-directional streaming RPC for sending payments through the Lightning - * Network. A single RPC invocation creates a persistent bi-directional - * stream allowing clients to rapidly send payments through the Lightning - * Network with a single persistent connection. - * - * @deprecated - * @generated from protobuf rpc: SendPayment(stream lnrpc.SendRequest) returns (stream lnrpc.SendResponse); - */ - sendPayment(options?: RpcOptions): DuplexStreamingCall; - /** - * - * SendPaymentSync is the synchronous non-streaming version of SendPayment. - * This RPC is intended to be consumed by clients of the REST proxy. - * Additionally, this RPC expects the destination's public key and the payment - * hash (if any) to be encoded as hex strings. - * - * @generated from protobuf rpc: SendPaymentSync(lnrpc.SendRequest) returns (lnrpc.SendResponse); - */ - sendPaymentSync(input: SendRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `sendtoroute` - * Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional - * streaming RPC for sending payment through the Lightning Network. This - * method differs from SendPayment in that it allows users to specify a full - * route manually. This can be used for things like rebalancing, and atomic - * swaps. - * - * @deprecated - * @generated from protobuf rpc: SendToRoute(stream lnrpc.SendToRouteRequest) returns (stream lnrpc.SendResponse); - */ - sendToRoute(options?: RpcOptions): DuplexStreamingCall; - /** - * - * SendToRouteSync is a synchronous version of SendToRoute. It Will block - * until the payment either fails or succeeds. - * - * @generated from protobuf rpc: SendToRouteSync(lnrpc.SendToRouteRequest) returns (lnrpc.SendResponse); - */ - sendToRouteSync(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `addinvoice` - * AddInvoice attempts to add a new invoice to the invoice database. Any - * duplicated invoices are rejected, therefore all invoices *must* have a - * unique payment preimage. - * - * @generated from protobuf rpc: AddInvoice(lnrpc.Invoice) returns (lnrpc.AddInvoiceResponse); - */ - addInvoice(input: Invoice, options?: RpcOptions): UnaryCall; - /** - * lncli: `listinvoices` - * ListInvoices returns a list of all the invoices currently stored within the - * database. Any active debug invoices are ignored. It has full support for - * paginated responses, allowing users to query for specific invoices through - * their add_index. This can be done by using either the first_index_offset or - * last_index_offset fields included in the response as the index_offset of the - * next request. By default, the first 100 invoices created will be returned. - * Backwards pagination is also supported through the Reversed flag. - * - * @generated from protobuf rpc: ListInvoices(lnrpc.ListInvoiceRequest) returns (lnrpc.ListInvoiceResponse); - */ - listInvoices(input: ListInvoiceRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `lookupinvoice` - * LookupInvoice attempts to look up an invoice according to its payment hash. - * The passed payment hash *must* be exactly 32 bytes, if not, an error is - * returned. - * - * @generated from protobuf rpc: LookupInvoice(lnrpc.PaymentHash) returns (lnrpc.Invoice); - */ - lookupInvoice(input: PaymentHash, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeInvoices returns a uni-directional stream (server -> client) for - * notifying the client of newly added/settled invoices. The caller can - * optionally specify the add_index and/or the settle_index. If the add_index - * is specified, then we'll first start by sending add invoice events for all - * invoices with an add_index greater than the specified value. If the - * settle_index is specified, the next, we'll send out all settle events for - * invoices with a settle_index greater than the specified value. One or both - * of these fields can be set. If no fields are set, then we'll only send out - * the latest add/settle events. - * - * @generated from protobuf rpc: SubscribeInvoices(lnrpc.InvoiceSubscription) returns (stream lnrpc.Invoice); - */ - subscribeInvoices(input: InvoiceSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `decodepayreq` - * DecodePayReq takes an encoded payment request string and attempts to decode - * it, returning a full description of the conditions encoded within the - * payment request. - * - * @generated from protobuf rpc: DecodePayReq(lnrpc.PayReqString) returns (lnrpc.PayReq); - */ - decodePayReq(input: PayReqString, options?: RpcOptions): UnaryCall; - /** - * lncli: `listpayments` - * ListPayments returns a list of all outgoing payments. - * - * @generated from protobuf rpc: ListPayments(lnrpc.ListPaymentsRequest) returns (lnrpc.ListPaymentsResponse); - */ - listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall; - /** - * - * 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); - */ - deleteAllPayments(input: DeleteAllPaymentsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `describegraph` - * DescribeGraph returns a description of the latest graph state from the - * point of view of the node. The graph information is partitioned into two - * components: all the nodes/vertexes, and all the edges that connect the - * vertexes themselves. As this is a directed graph, the edges also contain - * the node directional specific routing policy which includes: the time lock - * delta, fee information, etc. - * - * @generated from protobuf rpc: DescribeGraph(lnrpc.ChannelGraphRequest) returns (lnrpc.ChannelGraph); - */ - describeGraph(input: ChannelGraphRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getnodemetrics` - * GetNodeMetrics returns node metrics calculated from the graph. Currently - * the only supported metric is betweenness centrality of individual nodes. - * - * @generated from protobuf rpc: GetNodeMetrics(lnrpc.NodeMetricsRequest) returns (lnrpc.NodeMetricsResponse); - */ - getNodeMetrics(input: NodeMetricsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getchaninfo` - * GetChanInfo returns the latest authenticated network announcement for the - * given channel identified by its channel ID: an 8-byte integer which - * uniquely identifies the location of transaction's funding output within the - * blockchain. - * - * @generated from protobuf rpc: GetChanInfo(lnrpc.ChanInfoRequest) returns (lnrpc.ChannelEdge); - */ - getChanInfo(input: ChanInfoRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getnodeinfo` - * GetNodeInfo returns the latest advertised, aggregated, and authenticated - * channel information for the specified node identified by its public key. - * - * @generated from protobuf rpc: GetNodeInfo(lnrpc.NodeInfoRequest) returns (lnrpc.NodeInfo); - */ - getNodeInfo(input: NodeInfoRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `queryroutes` - * QueryRoutes attempts to query the daemon's Channel Router for a possible - * route to a target destination capable of carrying a specific amount of - * satoshis. The returned route contains the full details required to craft and - * send an HTLC, also including the necessary information that should be - * present within the Sphinx packet encapsulated within the HTLC. - * - * When using REST, the `dest_custom_records` map type can be set by appending - * `&dest_custom_records[]=` - * to the URL. Unfortunately this map type doesn't appear in the REST API - * documentation because of a bug in the grpc-gateway library. - * - * @generated from protobuf rpc: QueryRoutes(lnrpc.QueryRoutesRequest) returns (lnrpc.QueryRoutesResponse); - */ - queryRoutes(input: QueryRoutesRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `getnetworkinfo` - * GetNetworkInfo returns some basic stats about the known channel graph from - * the point of view of the node. - * - * @generated from protobuf rpc: GetNetworkInfo(lnrpc.NetworkInfoRequest) returns (lnrpc.NetworkInfo); - */ - getNetworkInfo(input: NetworkInfoRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `stop` - * StopDaemon will send a shutdown request to the interrupt handler, triggering - * a graceful shutdown of the daemon. - * - * @generated from protobuf rpc: StopDaemon(lnrpc.StopRequest) returns (lnrpc.StopResponse); - */ - stopDaemon(input: StopRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeChannelGraph launches a streaming RPC that allows the caller to - * receive notifications upon any changes to the channel graph topology from - * the point of view of the responding node. Events notified include: new - * nodes coming online, nodes updating their authenticated attributes, new - * channels being advertised, updates in the routing policy for a directional - * channel edge, and when channels are closed on-chain. - * - * @generated from protobuf rpc: SubscribeChannelGraph(lnrpc.GraphTopologySubscription) returns (stream lnrpc.GraphTopologyUpdate); - */ - subscribeChannelGraph(input: GraphTopologySubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `debuglevel` - * DebugLevel allows a caller to programmatically set the logging verbosity of - * lnd. The logging can be targeted according to a coarse daemon-wide logging - * level, or in a granular fashion to specify the logging for a target - * sub-system. - * - * @generated from protobuf rpc: DebugLevel(lnrpc.DebugLevelRequest) returns (lnrpc.DebugLevelResponse); - */ - debugLevel(input: DebugLevelRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `feereport` - * FeeReport allows the caller to obtain a report detailing the current fee - * schedule enforced by the node globally for each channel. - * - * @generated from protobuf rpc: FeeReport(lnrpc.FeeReportRequest) returns (lnrpc.FeeReportResponse); - */ - feeReport(input: FeeReportRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `updatechanpolicy` - * UpdateChannelPolicy allows the caller to update the fee schedule and - * channel policies for all channels globally, or a particular channel. - * - * @generated from protobuf rpc: UpdateChannelPolicy(lnrpc.PolicyUpdateRequest) returns (lnrpc.PolicyUpdateResponse); - */ - updateChannelPolicy(input: PolicyUpdateRequest, options?: RpcOptions): UnaryCall; - /** - * 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, 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. - * As a result each message can only contain 50k entries. Each response has - * the index offset of the last entry. The index offset can be provided to the - * request to allow the caller to skip a series of records. - * - * @generated from protobuf rpc: ForwardingHistory(lnrpc.ForwardingHistoryRequest) returns (lnrpc.ForwardingHistoryResponse); - */ - forwardingHistory(input: ForwardingHistoryRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `exportchanbackup` - * ExportChannelBackup attempts to return an encrypted static channel backup - * for the target channel identified by it channel point. The backup is - * encrypted with a key generated from the aezeed seed of the user. The - * returned backup can either be restored using the RestoreChannelBackup - * method once lnd is running, or via the InitWallet and UnlockWallet methods - * from the WalletUnlocker service. - * - * @generated from protobuf rpc: ExportChannelBackup(lnrpc.ExportChannelBackupRequest) returns (lnrpc.ChannelBackup); - */ - exportChannelBackup(input: ExportChannelBackupRequest, options?: RpcOptions): UnaryCall; - /** - * - * ExportAllChannelBackups returns static channel backups for all existing - * channels known to lnd. A set of regular singular static channel backups for - * each channel are returned. Additionally, a multi-channel backup is returned - * as well, which contains a single encrypted blob containing the backups of - * each channel. - * - * @generated from protobuf rpc: ExportAllChannelBackups(lnrpc.ChanBackupExportRequest) returns (lnrpc.ChanBackupSnapshot); - */ - exportAllChannelBackups(input: ChanBackupExportRequest, options?: RpcOptions): UnaryCall; - /** - * - * VerifyChanBackup allows a caller to verify the integrity of a channel backup - * snapshot. This method will accept either a packed Single or a packed Multi. - * Specifying both will result in an error. - * - * @generated from protobuf rpc: VerifyChanBackup(lnrpc.ChanBackupSnapshot) returns (lnrpc.VerifyChanBackupResponse); - */ - verifyChanBackup(input: ChanBackupSnapshot, options?: RpcOptions): UnaryCall; - /** - * lncli: `restorechanbackup` - * RestoreChannelBackups accepts a set of singular channel backups, or a - * single encrypted multi-chan backup and attempts to recover any funds - * remaining within the channel. If we are able to unpack the backup, then the - * new channel will be shown under listchannels, as well as pending channels. - * - * @generated from protobuf rpc: RestoreChannelBackups(lnrpc.RestoreChanBackupRequest) returns (lnrpc.RestoreBackupResponse); - */ - restoreChannelBackups(input: RestoreChanBackupRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeChannelBackups allows a client to sub-subscribe to the most up to - * date information concerning the state of all channel backups. Each time a - * new channel is added, we return the new set of channels, along with a - * multi-chan backup containing the backup info for all channels. Each time a - * channel is closed, we send a new update, which contains new new chan back - * ups, but the updated set of encrypted multi-chan backups with the closed - * channel(s) removed. - * - * @generated from protobuf rpc: SubscribeChannelBackups(lnrpc.ChannelBackupSubscription) returns (stream lnrpc.ChanBackupSnapshot); - */ - subscribeChannelBackups(input: ChannelBackupSubscription, options?: RpcOptions): ServerStreamingCall; - /** - * lncli: `bakemacaroon` - * BakeMacaroon allows the creation of a new macaroon with custom read and - * write permissions. No first-party caveats are added since this can be done - * offline. - * - * @generated from protobuf rpc: BakeMacaroon(lnrpc.BakeMacaroonRequest) returns (lnrpc.BakeMacaroonResponse); - */ - bakeMacaroon(input: BakeMacaroonRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listmacaroonids` - * ListMacaroonIDs returns all root key IDs that are in use. - * - * @generated from protobuf rpc: ListMacaroonIDs(lnrpc.ListMacaroonIDsRequest) returns (lnrpc.ListMacaroonIDsResponse); - */ - listMacaroonIDs(input: ListMacaroonIDsRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `deletemacaroonid` - * DeleteMacaroonID deletes the specified macaroon ID and invalidates all - * macaroons derived from that ID. - * - * @generated from protobuf rpc: DeleteMacaroonID(lnrpc.DeleteMacaroonIDRequest) returns (lnrpc.DeleteMacaroonIDResponse); - */ - deleteMacaroonID(input: DeleteMacaroonIDRequest, options?: RpcOptions): UnaryCall; - /** - * lncli: `listpermissions` - * ListPermissions lists all RPC method URIs and their required macaroon - * permissions to access them. - * - * @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; -} diff --git a/proto/lnd/lightning.client.js b/proto/lnd/lightning.client.js deleted file mode 100644 index 89474e5b..00000000 --- a/proto/lnd/lightning.client.js +++ /dev/null @@ -1,901 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3) -// tslint:disable -import { Lightning } from "./lightning.js"; -import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -// -// Comments in this file will be directly parsed into the API -// Documentation as descriptions of the associated method, message, or field. -// These descriptions should go right above the definition of the object, and -// can be in either block or // comment format. -// -// An RPC method can be matched to an lncli command by placing a line in the -// beginning of the description in exactly the following format: -// lncli: `methodname` -// -// Failure to specify the exact name of the command will cause documentation -// generation to fail. -// -// More information on how exactly the gRPC documentation is generated from -// this proto file can be found here: -// https://github.com/lightninglabs/lightning-api -/** - * Lightning is the main RPC server of the daemon. - * - * @generated from protobuf service lnrpc.Lightning - */ -export class LightningClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = Lightning.typeName; - this.methods = Lightning.methods; - this.options = Lightning.options; - } - /** - * lncli: `walletbalance` - * WalletBalance returns total unspent outputs(confirmed and unconfirmed), all - * confirmed unspent outputs and all unconfirmed unspent outputs under control - * of the wallet. - * - * @generated from protobuf rpc: WalletBalance(lnrpc.WalletBalanceRequest) returns (lnrpc.WalletBalanceResponse); - */ - walletBalance(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `channelbalance` - * ChannelBalance returns a report on the total funds across all open channels, - * categorized in local/remote, pending local/remote and unsettled local/remote - * balances. - * - * @generated from protobuf rpc: ChannelBalance(lnrpc.ChannelBalanceRequest) returns (lnrpc.ChannelBalanceResponse); - */ - channelBalance(input, options) { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listchaintxns` - * GetTransactions returns a list describing all the known transactions - * relevant to the wallet. - * - * @generated from protobuf rpc: GetTransactions(lnrpc.GetTransactionsRequest) returns (lnrpc.TransactionDetails); - */ - getTransactions(input, options) { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `estimatefee` - * EstimateFee asks the chain backend to estimate the fee rate and total fees - * for a transaction that pays to multiple specified outputs. - * - * When using REST, the `AddrToAmount` map type can be set by appending - * `&AddrToAmount[
]=` to the URL. Unfortunately this - * map type doesn't appear in the REST API documentation because of a bug in - * the grpc-gateway library. - * - * @generated from protobuf rpc: EstimateFee(lnrpc.EstimateFeeRequest) returns (lnrpc.EstimateFeeResponse); - */ - estimateFee(input, options) { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `sendcoins` - * SendCoins executes a request to send coins to a particular address. Unlike - * SendMany, this RPC call only allows creating a single output at a time. If - * neither target_conf, or sat_per_vbyte are set, then the internal wallet will - * consult its fee model to determine a fee for the default confirmation - * target. - * - * @generated from protobuf rpc: SendCoins(lnrpc.SendCoinsRequest) returns (lnrpc.SendCoinsResponse); - */ - sendCoins(input, options) { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listunspent` - * Deprecated, use walletrpc.ListUnspent instead. - * - * ListUnspent returns a list of all utxos spendable by the wallet with a - * number of confirmations between the specified minimum and maximum. - * - * @generated from protobuf rpc: ListUnspent(lnrpc.ListUnspentRequest) returns (lnrpc.ListUnspentResponse); - */ - listUnspent(input, options) { - const method = this.methods[5], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeTransactions creates a uni-directional stream from the server to - * the client in which any newly discovered transactions relevant to the - * wallet are sent over. - * - * @generated from protobuf rpc: SubscribeTransactions(lnrpc.GetTransactionsRequest) returns (stream lnrpc.Transaction); - */ - subscribeTransactions(input, options) { - const method = this.methods[6], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `sendmany` - * SendMany handles a request for a transaction that creates multiple specified - * outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then - * the internal wallet will consult its fee model to determine a fee for the - * default confirmation target. - * - * @generated from protobuf rpc: SendMany(lnrpc.SendManyRequest) returns (lnrpc.SendManyResponse); - */ - sendMany(input, options) { - const method = this.methods[7], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `newaddress` - * NewAddress creates a new address under control of the local wallet. - * - * @generated from protobuf rpc: NewAddress(lnrpc.NewAddressRequest) returns (lnrpc.NewAddressResponse); - */ - newAddress(input, options) { - const method = this.methods[8], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `signmessage` - * SignMessage signs a message with this node's private key. The returned - * signature string is `zbase32` encoded and pubkey recoverable, meaning that - * only the message digest and signature are needed for verification. - * - * @generated from protobuf rpc: SignMessage(lnrpc.SignMessageRequest) returns (lnrpc.SignMessageResponse); - */ - signMessage(input, options) { - const method = this.methods[9], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `verifymessage` - * VerifyMessage verifies a signature over a msg. The signature must be - * zbase32 encoded and signed by an active node in the resident node's - * channel database. In addition to returning the validity of the signature, - * VerifyMessage also returns the recovered pubkey from the signature. - * - * @generated from protobuf rpc: VerifyMessage(lnrpc.VerifyMessageRequest) returns (lnrpc.VerifyMessageResponse); - */ - verifyMessage(input, options) { - const method = this.methods[10], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `connect` - * ConnectPeer attempts to establish a connection to a remote peer. This is at - * the networking level, and is used for communication between nodes. This is - * distinct from establishing a channel with a peer. - * - * @generated from protobuf rpc: ConnectPeer(lnrpc.ConnectPeerRequest) returns (lnrpc.ConnectPeerResponse); - */ - connectPeer(input, options) { - const method = this.methods[11], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `disconnect` - * DisconnectPeer attempts to disconnect one peer from another identified by a - * given pubKey. In the case that we currently have a pending or active channel - * with the target peer, then this action will be not be allowed. - * - * @generated from protobuf rpc: DisconnectPeer(lnrpc.DisconnectPeerRequest) returns (lnrpc.DisconnectPeerResponse); - */ - disconnectPeer(input, options) { - const method = this.methods[12], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listpeers` - * ListPeers returns a verbose listing of all currently active peers. - * - * @generated from protobuf rpc: ListPeers(lnrpc.ListPeersRequest) returns (lnrpc.ListPeersResponse); - */ - listPeers(input, options) { - const method = this.methods[13], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribePeerEvents creates a uni-directional stream from the server to - * the client in which any events relevant to the state of peers are sent - * over. Events include peers going online and offline. - * - * @generated from protobuf rpc: SubscribePeerEvents(lnrpc.PeerEventSubscription) returns (stream lnrpc.PeerEvent); - */ - subscribePeerEvents(input, options) { - const method = this.methods[14], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `getinfo` - * GetInfo returns general information concerning the lightning node including - * it's identity pubkey, alias, the chains it is connected to, and information - * concerning the number of open+pending channels. - * - * @generated from protobuf rpc: GetInfo(lnrpc.GetInfoRequest) returns (lnrpc.GetInfoResponse); - */ - getInfo(input, options) { - const method = this.methods[15], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * * lncli: `getrecoveryinfo` - * GetRecoveryInfo returns information concerning the recovery mode including - * whether it's in a recovery mode, whether the recovery is finished, and the - * progress made so far. - * - * @generated from protobuf rpc: GetRecoveryInfo(lnrpc.GetRecoveryInfoRequest) returns (lnrpc.GetRecoveryInfoResponse); - */ - getRecoveryInfo(input, options) { - const method = this.methods[16], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - // TODO(roasbeef): merge with below with bool? - /** - * lncli: `pendingchannels` - * PendingChannels returns a list of all the channels that are currently - * considered "pending". A channel is pending if it has finished the funding - * workflow and is waiting for confirmations for the funding txn, or is in the - * process of closure, either initiated cooperatively or non-cooperatively. - * - * @generated from protobuf rpc: PendingChannels(lnrpc.PendingChannelsRequest) returns (lnrpc.PendingChannelsResponse); - */ - pendingChannels(input, options) { - const method = this.methods[17], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listchannels` - * ListChannels returns a description of all the open channels that this node - * is a participant in. - * - * @generated from protobuf rpc: ListChannels(lnrpc.ListChannelsRequest) returns (lnrpc.ListChannelsResponse); - */ - listChannels(input, options) { - const method = this.methods[18], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeChannelEvents creates a uni-directional stream from the server to - * the client in which any updates relevant to the state of the channels are - * sent over. Events include new active channels, inactive channels, and closed - * channels. - * - * @generated from protobuf rpc: SubscribeChannelEvents(lnrpc.ChannelEventSubscription) returns (stream lnrpc.ChannelEventUpdate); - */ - subscribeChannelEvents(input, options) { - const method = this.methods[19], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `closedchannels` - * ClosedChannels returns a description of all the closed channels that - * this node was a participant in. - * - * @generated from protobuf rpc: ClosedChannels(lnrpc.ClosedChannelsRequest) returns (lnrpc.ClosedChannelsResponse); - */ - closedChannels(input, options) { - const method = this.methods[20], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * OpenChannelSync is a synchronous version of the OpenChannel RPC call. This - * call is meant to be consumed by clients to the REST proxy. As with all - * other sync calls, all byte slices are intended to be populated as hex - * encoded strings. - * - * @generated from protobuf rpc: OpenChannelSync(lnrpc.OpenChannelRequest) returns (lnrpc.ChannelPoint); - */ - openChannelSync(input, options) { - const method = this.methods[21], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `openchannel` - * OpenChannel attempts to open a singly funded channel specified in the - * request to a remote peer. Users are able to specify a target number of - * blocks that the funding transaction should be confirmed in, or a manual fee - * rate to us for the funding transaction. If neither are specified, then a - * lax block confirmation target is used. Each OpenStatusUpdate will return - * the pending channel ID of the in-progress channel. Depending on the - * arguments specified in the OpenChannelRequest, this pending channel ID can - * then be used to manually progress the channel funding flow. - * - * @generated from protobuf rpc: OpenChannel(lnrpc.OpenChannelRequest) returns (stream lnrpc.OpenStatusUpdate); - */ - openChannel(input, options) { - 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, options) { - 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 - * to either execute some preparatory steps for a funding workflow, or - * manually progress a funding workflow. The primary way a funding flow is - * identified is via its pending channel ID. As an example, this method can be - * used to specify that we're expecting a funding flow for a particular - * pending channel ID, for which we need to use specific parameters. - * Alternatively, this can be used to interactively drive PSBT signing for - * funding for partially complete funding transactions. - * - * @generated from protobuf rpc: FundingStateStep(lnrpc.FundingTransitionMsg) returns (lnrpc.FundingStateStepResp); - */ - fundingStateStep(input, options) { - const method = this.methods[24], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * ChannelAcceptor dispatches a bi-directional streaming RPC in which - * OpenChannel requests are sent to the client and the client responds with - * a boolean that tells LND whether or not to accept the channel. This allows - * node operators to specify their own criteria for accepting inbound channels - * through a single persistent connection. - * - * @generated from protobuf rpc: ChannelAcceptor(stream lnrpc.ChannelAcceptResponse) returns (stream lnrpc.ChannelAcceptRequest); - */ - channelAcceptor(options) { - const method = this.methods[25], opt = this._transport.mergeOptions(options); - return stackIntercept("duplex", this._transport, method, opt); - } - /** - * lncli: `closechannel` - * CloseChannel attempts to close an active channel identified by its channel - * outpoint (ChannelPoint). The actions of this method can additionally be - * augmented to attempt a force close after a timeout period in the case of an - * inactive peer. If a non-force close (cooperative closure) is requested, - * then the user can specify either a target number of blocks until the - * closure transaction is confirmed, or a manual fee rate. If neither are - * specified, then a default lax, block confirmation target is used. - * - * @generated from protobuf rpc: CloseChannel(lnrpc.CloseChannelRequest) returns (stream lnrpc.CloseStatusUpdate); - */ - closeChannel(input, options) { - const method = this.methods[26], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `abandonchannel` - * AbandonChannel removes all channel state from the database except for a - * close summary. This method can be used to get rid of permanently unusable - * channels due to bugs fixed in newer versions of lnd. This method can also be - * used to remove externally funded channels where the funding transaction was - * never broadcast. Only available for non-externally funded channels in dev - * build. - * - * @generated from protobuf rpc: AbandonChannel(lnrpc.AbandonChannelRequest) returns (lnrpc.AbandonChannelResponse); - */ - abandonChannel(input, options) { - const method = this.methods[27], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `sendpayment` - * Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a - * bi-directional streaming RPC for sending payments through the Lightning - * Network. A single RPC invocation creates a persistent bi-directional - * stream allowing clients to rapidly send payments through the Lightning - * Network with a single persistent connection. - * - * @deprecated - * @generated from protobuf rpc: SendPayment(stream lnrpc.SendRequest) returns (stream lnrpc.SendResponse); - */ - sendPayment(options) { - const method = this.methods[28], opt = this._transport.mergeOptions(options); - return stackIntercept("duplex", this._transport, method, opt); - } - /** - * - * SendPaymentSync is the synchronous non-streaming version of SendPayment. - * This RPC is intended to be consumed by clients of the REST proxy. - * Additionally, this RPC expects the destination's public key and the payment - * hash (if any) to be encoded as hex strings. - * - * @generated from protobuf rpc: SendPaymentSync(lnrpc.SendRequest) returns (lnrpc.SendResponse); - */ - sendPaymentSync(input, options) { - const method = this.methods[29], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `sendtoroute` - * Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional - * streaming RPC for sending payment through the Lightning Network. This - * method differs from SendPayment in that it allows users to specify a full - * route manually. This can be used for things like rebalancing, and atomic - * swaps. - * - * @deprecated - * @generated from protobuf rpc: SendToRoute(stream lnrpc.SendToRouteRequest) returns (stream lnrpc.SendResponse); - */ - sendToRoute(options) { - const method = this.methods[30], opt = this._transport.mergeOptions(options); - return stackIntercept("duplex", this._transport, method, opt); - } - /** - * - * SendToRouteSync is a synchronous version of SendToRoute. It Will block - * until the payment either fails or succeeds. - * - * @generated from protobuf rpc: SendToRouteSync(lnrpc.SendToRouteRequest) returns (lnrpc.SendResponse); - */ - sendToRouteSync(input, options) { - const method = this.methods[31], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `addinvoice` - * AddInvoice attempts to add a new invoice to the invoice database. Any - * duplicated invoices are rejected, therefore all invoices *must* have a - * unique payment preimage. - * - * @generated from protobuf rpc: AddInvoice(lnrpc.Invoice) returns (lnrpc.AddInvoiceResponse); - */ - addInvoice(input, options) { - const method = this.methods[32], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listinvoices` - * ListInvoices returns a list of all the invoices currently stored within the - * database. Any active debug invoices are ignored. It has full support for - * paginated responses, allowing users to query for specific invoices through - * their add_index. This can be done by using either the first_index_offset or - * last_index_offset fields included in the response as the index_offset of the - * next request. By default, the first 100 invoices created will be returned. - * Backwards pagination is also supported through the Reversed flag. - * - * @generated from protobuf rpc: ListInvoices(lnrpc.ListInvoiceRequest) returns (lnrpc.ListInvoiceResponse); - */ - listInvoices(input, options) { - const method = this.methods[33], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `lookupinvoice` - * LookupInvoice attempts to look up an invoice according to its payment hash. - * The passed payment hash *must* be exactly 32 bytes, if not, an error is - * returned. - * - * @generated from protobuf rpc: LookupInvoice(lnrpc.PaymentHash) returns (lnrpc.Invoice); - */ - lookupInvoice(input, options) { - const method = this.methods[34], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeInvoices returns a uni-directional stream (server -> client) for - * notifying the client of newly added/settled invoices. The caller can - * optionally specify the add_index and/or the settle_index. If the add_index - * is specified, then we'll first start by sending add invoice events for all - * invoices with an add_index greater than the specified value. If the - * settle_index is specified, the next, we'll send out all settle events for - * invoices with a settle_index greater than the specified value. One or both - * of these fields can be set. If no fields are set, then we'll only send out - * the latest add/settle events. - * - * @generated from protobuf rpc: SubscribeInvoices(lnrpc.InvoiceSubscription) returns (stream lnrpc.Invoice); - */ - subscribeInvoices(input, options) { - const method = this.methods[35], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `decodepayreq` - * DecodePayReq takes an encoded payment request string and attempts to decode - * it, returning a full description of the conditions encoded within the - * payment request. - * - * @generated from protobuf rpc: DecodePayReq(lnrpc.PayReqString) returns (lnrpc.PayReq); - */ - decodePayReq(input, options) { - const method = this.methods[36], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listpayments` - * ListPayments returns a list of all outgoing payments. - * - * @generated from protobuf rpc: ListPayments(lnrpc.ListPaymentsRequest) returns (lnrpc.ListPaymentsResponse); - */ - listPayments(input, options) { - const method = this.methods[37], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * 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, options) { - 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, options) { - const method = this.methods[39], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `describegraph` - * DescribeGraph returns a description of the latest graph state from the - * point of view of the node. The graph information is partitioned into two - * components: all the nodes/vertexes, and all the edges that connect the - * vertexes themselves. As this is a directed graph, the edges also contain - * the node directional specific routing policy which includes: the time lock - * delta, fee information, etc. - * - * @generated from protobuf rpc: DescribeGraph(lnrpc.ChannelGraphRequest) returns (lnrpc.ChannelGraph); - */ - describeGraph(input, options) { - const method = this.methods[40], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `getnodemetrics` - * GetNodeMetrics returns node metrics calculated from the graph. Currently - * the only supported metric is betweenness centrality of individual nodes. - * - * @generated from protobuf rpc: GetNodeMetrics(lnrpc.NodeMetricsRequest) returns (lnrpc.NodeMetricsResponse); - */ - getNodeMetrics(input, options) { - const method = this.methods[41], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `getchaninfo` - * GetChanInfo returns the latest authenticated network announcement for the - * given channel identified by its channel ID: an 8-byte integer which - * uniquely identifies the location of transaction's funding output within the - * blockchain. - * - * @generated from protobuf rpc: GetChanInfo(lnrpc.ChanInfoRequest) returns (lnrpc.ChannelEdge); - */ - getChanInfo(input, options) { - const method = this.methods[42], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `getnodeinfo` - * GetNodeInfo returns the latest advertised, aggregated, and authenticated - * channel information for the specified node identified by its public key. - * - * @generated from protobuf rpc: GetNodeInfo(lnrpc.NodeInfoRequest) returns (lnrpc.NodeInfo); - */ - getNodeInfo(input, options) { - const method = this.methods[43], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `queryroutes` - * QueryRoutes attempts to query the daemon's Channel Router for a possible - * route to a target destination capable of carrying a specific amount of - * satoshis. The returned route contains the full details required to craft and - * send an HTLC, also including the necessary information that should be - * present within the Sphinx packet encapsulated within the HTLC. - * - * When using REST, the `dest_custom_records` map type can be set by appending - * `&dest_custom_records[]=` - * to the URL. Unfortunately this map type doesn't appear in the REST API - * documentation because of a bug in the grpc-gateway library. - * - * @generated from protobuf rpc: QueryRoutes(lnrpc.QueryRoutesRequest) returns (lnrpc.QueryRoutesResponse); - */ - queryRoutes(input, options) { - const method = this.methods[44], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `getnetworkinfo` - * GetNetworkInfo returns some basic stats about the known channel graph from - * the point of view of the node. - * - * @generated from protobuf rpc: GetNetworkInfo(lnrpc.NetworkInfoRequest) returns (lnrpc.NetworkInfo); - */ - getNetworkInfo(input, options) { - const method = this.methods[45], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `stop` - * StopDaemon will send a shutdown request to the interrupt handler, triggering - * a graceful shutdown of the daemon. - * - * @generated from protobuf rpc: StopDaemon(lnrpc.StopRequest) returns (lnrpc.StopResponse); - */ - stopDaemon(input, options) { - const method = this.methods[46], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeChannelGraph launches a streaming RPC that allows the caller to - * receive notifications upon any changes to the channel graph topology from - * the point of view of the responding node. Events notified include: new - * nodes coming online, nodes updating their authenticated attributes, new - * channels being advertised, updates in the routing policy for a directional - * channel edge, and when channels are closed on-chain. - * - * @generated from protobuf rpc: SubscribeChannelGraph(lnrpc.GraphTopologySubscription) returns (stream lnrpc.GraphTopologyUpdate); - */ - subscribeChannelGraph(input, options) { - const method = this.methods[47], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `debuglevel` - * DebugLevel allows a caller to programmatically set the logging verbosity of - * lnd. The logging can be targeted according to a coarse daemon-wide logging - * level, or in a granular fashion to specify the logging for a target - * sub-system. - * - * @generated from protobuf rpc: DebugLevel(lnrpc.DebugLevelRequest) returns (lnrpc.DebugLevelResponse); - */ - debugLevel(input, options) { - const method = this.methods[48], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `feereport` - * FeeReport allows the caller to obtain a report detailing the current fee - * schedule enforced by the node globally for each channel. - * - * @generated from protobuf rpc: FeeReport(lnrpc.FeeReportRequest) returns (lnrpc.FeeReportResponse); - */ - feeReport(input, options) { - const method = this.methods[49], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `updatechanpolicy` - * UpdateChannelPolicy allows the caller to update the fee schedule and - * channel policies for all channels globally, or a particular channel. - * - * @generated from protobuf rpc: UpdateChannelPolicy(lnrpc.PolicyUpdateRequest) returns (lnrpc.PolicyUpdateResponse); - */ - updateChannelPolicy(input, 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, 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. - * As a result each message can only contain 50k entries. Each response has - * the index offset of the last entry. The index offset can be provided to the - * request to allow the caller to skip a series of records. - * - * @generated from protobuf rpc: ForwardingHistory(lnrpc.ForwardingHistoryRequest) returns (lnrpc.ForwardingHistoryResponse); - */ - forwardingHistory(input, options) { - const method = this.methods[51], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `exportchanbackup` - * ExportChannelBackup attempts to return an encrypted static channel backup - * for the target channel identified by it channel point. The backup is - * encrypted with a key generated from the aezeed seed of the user. The - * returned backup can either be restored using the RestoreChannelBackup - * method once lnd is running, or via the InitWallet and UnlockWallet methods - * from the WalletUnlocker service. - * - * @generated from protobuf rpc: ExportChannelBackup(lnrpc.ExportChannelBackupRequest) returns (lnrpc.ChannelBackup); - */ - exportChannelBackup(input, options) { - const method = this.methods[52], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * ExportAllChannelBackups returns static channel backups for all existing - * channels known to lnd. A set of regular singular static channel backups for - * each channel are returned. Additionally, a multi-channel backup is returned - * as well, which contains a single encrypted blob containing the backups of - * each channel. - * - * @generated from protobuf rpc: ExportAllChannelBackups(lnrpc.ChanBackupExportRequest) returns (lnrpc.ChanBackupSnapshot); - */ - exportAllChannelBackups(input, options) { - const method = this.methods[53], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * VerifyChanBackup allows a caller to verify the integrity of a channel backup - * snapshot. This method will accept either a packed Single or a packed Multi. - * Specifying both will result in an error. - * - * @generated from protobuf rpc: VerifyChanBackup(lnrpc.ChanBackupSnapshot) returns (lnrpc.VerifyChanBackupResponse); - */ - verifyChanBackup(input, options) { - const method = this.methods[54], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `restorechanbackup` - * RestoreChannelBackups accepts a set of singular channel backups, or a - * single encrypted multi-chan backup and attempts to recover any funds - * remaining within the channel. If we are able to unpack the backup, then the - * new channel will be shown under listchannels, as well as pending channels. - * - * @generated from protobuf rpc: RestoreChannelBackups(lnrpc.RestoreChanBackupRequest) returns (lnrpc.RestoreBackupResponse); - */ - restoreChannelBackups(input, options) { - const method = this.methods[55], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeChannelBackups allows a client to sub-subscribe to the most up to - * date information concerning the state of all channel backups. Each time a - * new channel is added, we return the new set of channels, along with a - * multi-chan backup containing the backup info for all channels. Each time a - * channel is closed, we send a new update, which contains new new chan back - * ups, but the updated set of encrypted multi-chan backups with the closed - * channel(s) removed. - * - * @generated from protobuf rpc: SubscribeChannelBackups(lnrpc.ChannelBackupSubscription) returns (stream lnrpc.ChanBackupSnapshot); - */ - subscribeChannelBackups(input, options) { - const method = this.methods[56], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * lncli: `bakemacaroon` - * BakeMacaroon allows the creation of a new macaroon with custom read and - * write permissions. No first-party caveats are added since this can be done - * offline. - * - * @generated from protobuf rpc: BakeMacaroon(lnrpc.BakeMacaroonRequest) returns (lnrpc.BakeMacaroonResponse); - */ - bakeMacaroon(input, options) { - const method = this.methods[57], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listmacaroonids` - * ListMacaroonIDs returns all root key IDs that are in use. - * - * @generated from protobuf rpc: ListMacaroonIDs(lnrpc.ListMacaroonIDsRequest) returns (lnrpc.ListMacaroonIDsResponse); - */ - listMacaroonIDs(input, options) { - const method = this.methods[58], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `deletemacaroonid` - * DeleteMacaroonID deletes the specified macaroon ID and invalidates all - * macaroons derived from that ID. - * - * @generated from protobuf rpc: DeleteMacaroonID(lnrpc.DeleteMacaroonIDRequest) returns (lnrpc.DeleteMacaroonIDResponse); - */ - deleteMacaroonID(input, options) { - const method = this.methods[59], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * lncli: `listpermissions` - * ListPermissions lists all RPC method URIs and their required macaroon - * permissions to access them. - * - * @generated from protobuf rpc: ListPermissions(lnrpc.ListPermissionsRequest) returns (lnrpc.ListPermissionsResponse); - */ - listPermissions(input, 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, options) { - 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) { - 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, options) { - 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, options) { - 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, options) { - 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, options) { - const method = this.methods[66], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } -} diff --git a/proto/lnd/lightning.client.ts b/proto/lnd/lightning.client.ts index 2226841e..53442dba 100644 --- a/proto/lnd/lightning.client.ts +++ b/proto/lnd/lightning.client.ts @@ -3,133 +3,133 @@ // tslint:disable import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; import type { ServiceInfo } from "@protobuf-ts/runtime-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 { Lightning } from "./lightning.js"; +import type { LookupHtlcResponse } from "./lightning.js"; +import type { LookupHtlcRequest } from "./lightning.js"; +import type { ListAliasesResponse } from "./lightning.js"; +import type { ListAliasesRequest } from "./lightning.js"; +import type { CustomMessage } from "./lightning.js"; +import type { SubscribeCustomMessagesRequest } from "./lightning.js"; +import type { SendCustomMessageResponse } from "./lightning.js"; +import type { SendCustomMessageRequest } from "./lightning.js"; +import type { RPCMiddlewareRequest } from "./lightning.js"; +import type { RPCMiddlewareResponse } from "./lightning.js"; +import type { CheckMacPermResponse } from "./lightning.js"; +import type { CheckMacPermRequest } from "./lightning.js"; +import type { ListPermissionsResponse } from "./lightning.js"; +import type { ListPermissionsRequest } from "./lightning.js"; +import type { DeleteMacaroonIDResponse } from "./lightning.js"; +import type { DeleteMacaroonIDRequest } from "./lightning.js"; +import type { ListMacaroonIDsResponse } from "./lightning.js"; +import type { ListMacaroonIDsRequest } from "./lightning.js"; +import type { BakeMacaroonResponse } from "./lightning.js"; +import type { BakeMacaroonRequest } from "./lightning.js"; +import type { ChannelBackupSubscription } from "./lightning.js"; +import type { RestoreBackupResponse } from "./lightning.js"; +import type { RestoreChanBackupRequest } from "./lightning.js"; +import type { VerifyChanBackupResponse } from "./lightning.js"; +import type { ChanBackupSnapshot } from "./lightning.js"; +import type { ChanBackupExportRequest } from "./lightning.js"; +import type { ChannelBackup } from "./lightning.js"; +import type { ExportChannelBackupRequest } from "./lightning.js"; +import type { ForwardingHistoryResponse } from "./lightning.js"; +import type { ForwardingHistoryRequest } from "./lightning.js"; +import type { PolicyUpdateResponse } from "./lightning.js"; +import type { PolicyUpdateRequest } from "./lightning.js"; +import type { FeeReportResponse } from "./lightning.js"; +import type { FeeReportRequest } from "./lightning.js"; +import type { DebugLevelResponse } from "./lightning.js"; +import type { DebugLevelRequest } from "./lightning.js"; +import type { GraphTopologyUpdate } from "./lightning.js"; +import type { GraphTopologySubscription } from "./lightning.js"; +import type { StopResponse } from "./lightning.js"; +import type { StopRequest } from "./lightning.js"; +import type { NetworkInfo } from "./lightning.js"; +import type { NetworkInfoRequest } from "./lightning.js"; +import type { QueryRoutesResponse } from "./lightning.js"; +import type { QueryRoutesRequest } from "./lightning.js"; +import type { NodeInfo } from "./lightning.js"; +import type { NodeInfoRequest } from "./lightning.js"; +import type { ChannelEdge } from "./lightning.js"; +import type { ChanInfoRequest } from "./lightning.js"; +import type { NodeMetricsResponse } from "./lightning.js"; +import type { NodeMetricsRequest } from "./lightning.js"; +import type { ChannelGraph } from "./lightning.js"; +import type { ChannelGraphRequest } from "./lightning.js"; +import type { DeleteAllPaymentsResponse } from "./lightning.js"; +import type { DeleteAllPaymentsRequest } from "./lightning.js"; +import type { DeletePaymentResponse } from "./lightning.js"; +import type { DeletePaymentRequest } from "./lightning.js"; +import type { ListPaymentsResponse } from "./lightning.js"; +import type { ListPaymentsRequest } from "./lightning.js"; +import type { PayReq } from "./lightning.js"; +import type { PayReqString } from "./lightning.js"; +import type { InvoiceSubscription } from "./lightning.js"; +import type { PaymentHash } from "./lightning.js"; +import type { ListInvoiceResponse } from "./lightning.js"; +import type { ListInvoiceRequest } from "./lightning.js"; +import type { AddInvoiceResponse } from "./lightning.js"; +import type { Invoice } from "./lightning.js"; +import type { SendToRouteRequest } from "./lightning.js"; +import type { SendResponse } from "./lightning.js"; +import type { SendRequest } from "./lightning.js"; +import type { AbandonChannelResponse } from "./lightning.js"; +import type { AbandonChannelRequest } from "./lightning.js"; +import type { CloseStatusUpdate } from "./lightning.js"; +import type { CloseChannelRequest } from "./lightning.js"; +import type { ChannelAcceptRequest } from "./lightning.js"; +import type { ChannelAcceptResponse } from "./lightning.js"; import type { DuplexStreamingCall } from "@protobuf-ts/runtime-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 { FundingStateStepResp } from "./lightning.js"; +import type { FundingTransitionMsg } from "./lightning.js"; +import type { BatchOpenChannelResponse } from "./lightning.js"; +import type { BatchOpenChannelRequest } from "./lightning.js"; +import type { OpenStatusUpdate } from "./lightning.js"; +import type { ChannelPoint } from "./lightning.js"; +import type { OpenChannelRequest } from "./lightning.js"; +import type { ClosedChannelsResponse } from "./lightning.js"; +import type { ClosedChannelsRequest } from "./lightning.js"; +import type { ChannelEventUpdate } from "./lightning.js"; +import type { ChannelEventSubscription } from "./lightning.js"; +import type { ListChannelsResponse } from "./lightning.js"; +import type { ListChannelsRequest } from "./lightning.js"; +import type { PendingChannelsResponse } from "./lightning.js"; +import type { PendingChannelsRequest } from "./lightning.js"; +import type { GetRecoveryInfoResponse } from "./lightning.js"; +import type { GetRecoveryInfoRequest } from "./lightning.js"; +import type { GetInfoResponse } from "./lightning.js"; +import type { GetInfoRequest } from "./lightning.js"; +import type { PeerEvent } from "./lightning.js"; +import type { PeerEventSubscription } from "./lightning.js"; +import type { ListPeersResponse } from "./lightning.js"; +import type { ListPeersRequest } from "./lightning.js"; +import type { DisconnectPeerResponse } from "./lightning.js"; +import type { DisconnectPeerRequest } from "./lightning.js"; +import type { ConnectPeerResponse } from "./lightning.js"; +import type { ConnectPeerRequest } from "./lightning.js"; +import type { VerifyMessageResponse } from "./lightning.js"; +import type { VerifyMessageRequest } from "./lightning.js"; +import type { SignMessageResponse } from "./lightning.js"; +import type { SignMessageRequest } from "./lightning.js"; +import type { NewAddressResponse } from "./lightning.js"; +import type { NewAddressRequest } from "./lightning.js"; +import type { SendManyResponse } from "./lightning.js"; +import type { SendManyRequest } from "./lightning.js"; +import type { Transaction } from "./lightning.js"; import type { ServerStreamingCall } from "@protobuf-ts/runtime-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 type { ListUnspentResponse } from "./lightning.js"; +import type { ListUnspentRequest } from "./lightning.js"; +import type { SendCoinsResponse } from "./lightning.js"; +import type { SendCoinsRequest } from "./lightning.js"; +import type { EstimateFeeResponse } from "./lightning.js"; +import type { EstimateFeeRequest } from "./lightning.js"; +import type { TransactionDetails } from "./lightning.js"; +import type { GetTransactionsRequest } from "./lightning.js"; +import type { ChannelBalanceResponse } from "./lightning.js"; +import type { ChannelBalanceRequest } from "./lightning.js"; import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -import type { WalletBalanceResponse } from "./lightning"; -import type { WalletBalanceRequest } from "./lightning"; +import type { WalletBalanceResponse } from "./lightning.js"; +import type { WalletBalanceRequest } from "./lightning.js"; import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; // diff --git a/proto/lnd/lightning.d.ts b/proto/lnd/lightning.d.ts deleted file mode 100644 index d8d902af..00000000 --- a/proto/lnd/lightning.d.ts +++ /dev/null @@ -1,9340 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3) -// tslint:disable -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } 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: number; - /** - * @generated from protobuf field: uint64 htlc_index = 2; - */ - htlcIndex: number; -} -/** - * @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 - */ -export interface Utxo { - /** - * The type of address - * - * @generated from protobuf field: lnrpc.AddressType address_type = 1; - */ - addressType: AddressType; - /** - * The address - * - * @generated from protobuf field: string address = 2; - */ - address: string; - /** - * The value of the unspent coin in satoshis - * - * @generated from protobuf field: int64 amount_sat = 3; - */ - amountSat: number; - /** - * The pkscript in hex - * - * @generated from protobuf field: string pk_script = 4; - */ - pkScript: string; - /** - * The outpoint in format txid:n - * - * @generated from protobuf field: lnrpc.OutPoint outpoint = 5; - */ - outpoint?: OutPoint; - /** - * The number of confirmations for the Utxo - * - * @generated from protobuf field: int64 confirmations = 6; - */ - confirmations: number; -} -/** - * @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: number; - /** - * The value of the output coin in satoshis - * - * @generated from protobuf field: int64 amount = 5; - */ - amount: number; - /** - * 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 - */ -export interface Transaction { - /** - * The transaction hash - * - * @generated from protobuf field: string tx_hash = 1; - */ - txHash: string; - /** - * The transaction amount, denominated in satoshis - * - * @generated from protobuf field: int64 amount = 2; - */ - amount: number; - /** - * The number of confirmations - * - * @generated from protobuf field: int32 num_confirmations = 3; - */ - numConfirmations: number; - /** - * The hash of the block this transaction was included in - * - * @generated from protobuf field: string block_hash = 4; - */ - blockHash: string; - /** - * The height of the block this transaction was included in - * - * @generated from protobuf field: int32 block_height = 5; - */ - blockHeight: number; - /** - * Timestamp of this transaction - * - * @generated from protobuf field: int64 time_stamp = 6; - */ - timeStamp: number; - /** - * Fees paid for this transaction - * - * @generated from protobuf field: int64 total_fees = 7; - */ - totalFees: number; - /** - * Addresses that received funds for this transaction. Deprecated as it is - * now incorporated in the output_details field. - * - * @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. - * - * @generated from protobuf field: string raw_tx_hex = 9; - */ - rawTxHex: string; - /** - * A label that was optionally set on transaction broadcast. - * - * @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 - */ -export interface GetTransactionsRequest { - /** - * - * The height from which to list transactions, inclusive. If this value is - * greater than end_height, transactions will be read in reverse. - * - * @generated from protobuf field: int32 start_height = 1; - */ - startHeight: number; - /** - * - * The height until which to list transactions, inclusive. To include - * unconfirmed transactions, this value should be set to -1, which will - * return transactions from start_height until the current chain tip and - * unconfirmed transactions. If no end_height is provided, the call will - * default to this option. - * - * @generated from protobuf field: int32 end_height = 2; - */ - endHeight: number; - /** - * An optional filter to only include transactions relevant to an account. - * - * @generated from protobuf field: string account = 3; - */ - account: string; -} -/** - * @generated from protobuf message lnrpc.TransactionDetails - */ -export interface TransactionDetails { - /** - * The list of transactions relevant to the wallet. - * - * @generated from protobuf field: repeated lnrpc.Transaction transactions = 1; - */ - transactions: Transaction[]; -} -/** - * @generated from protobuf message lnrpc.FeeLimit - */ -export interface FeeLimit { - /** - * @generated from protobuf oneof: limit - */ - limit: { - oneofKind: "fixed"; - /** - * - * The fee limit expressed as a fixed amount of satoshis. - * - * The fields fixed and fixed_msat are mutually exclusive. - * - * @generated from protobuf field: int64 fixed = 1; - */ - fixed: number; - } | { - oneofKind: "fixedMsat"; - /** - * - * The fee limit expressed as a fixed amount of millisatoshis. - * - * The fields fixed and fixed_msat are mutually exclusive. - * - * @generated from protobuf field: int64 fixed_msat = 3; - */ - fixedMsat: number; - } | { - oneofKind: "percent"; - /** - * The fee limit expressed as a percentage of the payment amount. - * - * @generated from protobuf field: int64 percent = 2; - */ - percent: number; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message lnrpc.SendRequest - */ -export interface SendRequest { - /** - * - * The identity pubkey of the payment recipient. When using REST, this field - * must be encoded as base64. - * - * @generated from protobuf field: bytes dest = 1; - */ - dest: Uint8Array; - /** - * - * The hex-encoded identity pubkey of the payment recipient. Deprecated now - * that the REST gateway supports base64 encoding of bytes fields. - * - * @deprecated - * @generated from protobuf field: string dest_string = 2 [deprecated = true]; - */ - destString: string; - /** - * - * The amount to send expressed in satoshis. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt = 3; - */ - amt: number; - /** - * - * The amount to send expressed in millisatoshis. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt_msat = 12; - */ - amtMsat: number; - /** - * - * The hash to use within the payment's HTLC. When using REST, this field - * must be encoded as base64. - * - * @generated from protobuf field: bytes payment_hash = 4; - */ - paymentHash: Uint8Array; - /** - * - * The hex-encoded hash to use within the payment's HTLC. Deprecated now - * that the REST gateway supports base64 encoding of bytes fields. - * - * @deprecated - * @generated from protobuf field: string payment_hash_string = 5 [deprecated = true]; - */ - paymentHashString: string; - /** - * - * 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 = 6; - */ - paymentRequest: string; - /** - * - * The CLTV delta from the current height that should be used to set the - * timelock for the final hop. - * - * @generated from protobuf field: int32 final_cltv_delta = 7; - */ - finalCltvDelta: number; - /** - * - * 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. 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; - */ - feeLimit?: FeeLimit; - /** - * - * The channel id of the channel that must be taken to the first hop. If zero, - * any channel may be used. - * - * @generated from protobuf field: uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; - */ - outgoingChanId: string; - /** - * - * The pubkey of the last hop of the route. If empty, any hop may be used. - * - * @generated from protobuf field: bytes last_hop_pubkey = 13; - */ - lastHopPubkey: Uint8Array; - /** - * - * An optional maximum total time lock for the route. This should not exceed - * lnd's `--max-cltv-expiry` setting. If zero, then the value of - * `--max-cltv-expiry` is enforced. - * - * @generated from protobuf field: uint32 cltv_limit = 10; - */ - cltvLimit: number; - /** - * - * 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. Record types are - * required to be in the custom range >= 65536. When using REST, the values - * must be encoded as base64. - * - * @generated from protobuf field: map dest_custom_records = 11; - */ - destCustomRecords: { - [key: string]: Uint8Array; - }; - /** - * If set, circular payments to self are permitted. - * - * @generated from protobuf field: bool allow_self_payment = 14; - */ - allowSelfPayment: boolean; - /** - * - * Features assumed to be supported by the final node. All transitive feature - * dependencies must also be set properly. For a given feature bit pair, either - * optional or remote may be set, but not both. If this field is nil or empty, - * the router will try to load destination features from the graph as a - * fallback. - * - * @generated from protobuf field: repeated lnrpc.FeatureBit dest_features = 15; - */ - destFeatures: FeatureBit[]; - /** - * - * The payment address of the generated invoice. - * - * @generated from protobuf field: bytes payment_addr = 16; - */ - paymentAddr: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.SendResponse - */ -export interface SendResponse { - /** - * @generated from protobuf field: string payment_error = 1; - */ - paymentError: string; - /** - * @generated from protobuf field: bytes payment_preimage = 2; - */ - paymentPreimage: Uint8Array; - /** - * @generated from protobuf field: lnrpc.Route payment_route = 3; - */ - paymentRoute?: Route; - /** - * @generated from protobuf field: bytes payment_hash = 4; - */ - paymentHash: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.SendToRouteRequest - */ -export interface SendToRouteRequest { - /** - * - * The payment hash to use for the HTLC. When using REST, this field must be - * encoded as base64. - * - * @generated from protobuf field: bytes payment_hash = 1; - */ - paymentHash: Uint8Array; - /** - * - * An optional hex-encoded payment hash to be used for the HTLC. Deprecated now - * that the REST gateway supports base64 encoding of bytes fields. - * - * @deprecated - * @generated from protobuf field: string payment_hash_string = 2 [deprecated = true]; - */ - paymentHashString: string; - /** - * Route that should be used to attempt to complete the payment. - * - * @generated from protobuf field: lnrpc.Route route = 4; - */ - route?: Route; -} -/** - * @generated from protobuf message lnrpc.ChannelAcceptRequest - */ -export interface ChannelAcceptRequest { - /** - * The pubkey of the node that wishes to open an inbound channel. - * - * @generated from protobuf field: bytes node_pubkey = 1; - */ - nodePubkey: Uint8Array; - /** - * The hash of the genesis block that the proposed channel resides in. - * - * @generated from protobuf field: bytes chain_hash = 2; - */ - chainHash: Uint8Array; - /** - * The pending channel id. - * - * @generated from protobuf field: bytes pending_chan_id = 3; - */ - pendingChanId: Uint8Array; - /** - * The funding amount in satoshis that initiator wishes to use in the - * channel. - * - * @generated from protobuf field: uint64 funding_amt = 4; - */ - fundingAmt: number; - /** - * The push amount of the proposed channel in millisatoshis. - * - * @generated from protobuf field: uint64 push_amt = 5; - */ - pushAmt: number; - /** - * The dust limit of the initiator's commitment tx. - * - * @generated from protobuf field: uint64 dust_limit = 6; - */ - dustLimit: number; - /** - * 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: number; - /** - * The minimum amount of satoshis the initiator requires us to have at all - * times. - * - * @generated from protobuf field: uint64 channel_reserve = 8; - */ - channelReserve: number; - /** - * The smallest HTLC in millisatoshis that the initiator will accept. - * - * @generated from protobuf field: uint64 min_htlc = 9; - */ - minHtlc: number; - /** - * The initial fee rate that the initiator suggests for both commitment - * transactions. - * - * @generated from protobuf field: uint64 fee_per_kw = 10; - */ - feePerKw: number; - /** - * - * The number of blocks to use for the relative time lock in the pay-to-self - * output of both commitment transactions. - * - * @generated from protobuf field: uint32 csv_delay = 11; - */ - csvDelay: number; - /** - * The total number of incoming HTLC's that the initiator will accept. - * - * @generated from protobuf field: uint32 max_accepted_htlcs = 12; - */ - maxAcceptedHtlcs: number; - /** - * A bit-field which the initiator uses to specify proposed channel - * behavior. - * - * @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 - */ -export interface ChannelAcceptResponse { - /** - * Whether or not the client accepts the channel. - * - * @generated from protobuf field: bool accept = 1; - */ - accept: boolean; - /** - * The pending channel id to which this response applies. - * - * @generated from protobuf field: bytes pending_chan_id = 2; - */ - pendingChanId: Uint8Array; - /** - * - * An optional error to send the initiating party to indicate why the channel - * was rejected. This field *should not* contain sensitive information, it will - * be sent to the initiating party. This field should only be set if accept is - * false, the channel will be rejected if an error is set with accept=true - * because the meaning of this response is ambiguous. Limited to 500 - * characters. - * - * @generated from protobuf field: string error = 3; - */ - error: string; - /** - * - * The upfront shutdown address to use if the initiating peer supports option - * upfront shutdown script (see ListPeers for the features supported). Note - * that the channel open will fail if this value is set for a peer that does - * not support this feature bit. - * - * @generated from protobuf field: string upfront_shutdown = 4; - */ - upfrontShutdown: string; - /** - * - * The csv delay (in blocks) that we require for the remote party. - * - * @generated from protobuf field: uint32 csv_delay = 5; - */ - csvDelay: number; - /** - * - * The reserve amount in satoshis that we require the remote peer to adhere to. - * We require that the remote peer always have some reserve amount allocated to - * them so that there is always a disincentive to broadcast old state (if they - * hold 0 sats on their side of the channel, there is nothing to lose). - * - * @generated from protobuf field: uint64 reserve_sat = 6; - */ - reserveSat: number; - /** - * - * The maximum amount of funds in millisatoshis that we allow the remote peer - * to have in outstanding htlcs. - * - * @generated from protobuf field: uint64 in_flight_max_msat = 7; - */ - inFlightMaxMsat: number; - /** - * - * The maximum number of htlcs that the remote peer can offer us. - * - * @generated from protobuf field: uint32 max_htlc_count = 8; - */ - maxHtlcCount: number; - /** - * - * The minimum value in millisatoshis for incoming htlcs on the channel. - * - * @generated from protobuf field: uint64 min_htlc_in = 9; - */ - minHtlcIn: number; - /** - * - * The number of confirmations we require before we consider the channel open. - * - * @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 - */ -export interface ChannelPoint { - /** - * @generated from protobuf oneof: funding_txid - */ - fundingTxid: { - oneofKind: "fundingTxidBytes"; - /** - * - * Txid of the funding transaction. When using REST, this field must be - * encoded as base64. - * - * @generated from protobuf field: bytes funding_txid_bytes = 1; - */ - fundingTxidBytes: Uint8Array; - } | { - oneofKind: "fundingTxidStr"; - /** - * - * Hex-encoded string representing the byte-reversed hash of the funding - * transaction. - * - * @generated from protobuf field: string funding_txid_str = 2; - */ - fundingTxidStr: string; - } | { - oneofKind: undefined; - }; - /** - * The index of the output of the funding transaction - * - * @generated from protobuf field: uint32 output_index = 3; - */ - outputIndex: number; -} -/** - * @generated from protobuf message lnrpc.OutPoint - */ -export interface OutPoint { - /** - * Raw bytes representing the transaction id. - * - * @generated from protobuf field: bytes txid_bytes = 1; - */ - txidBytes: Uint8Array; - /** - * Reversed, hex-encoded string representing the transaction id. - * - * @generated from protobuf field: string txid_str = 2; - */ - txidStr: string; - /** - * The index of the output on the transaction. - * - * @generated from protobuf field: uint32 output_index = 3; - */ - 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. - * - * @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`. - * - * @generated from protobuf field: string host = 2; - */ - host: string; -} -/** - * @generated from protobuf message lnrpc.EstimateFeeRequest - */ -export interface EstimateFeeRequest { - /** - * The map from addresses to amounts for the transaction. - * - * @generated from protobuf field: map AddrToAmount = 1 [json_name = "AddrToAmount"]; - */ - addrToAmount: { - [key: string]: number; - }; - /** - * The target number of blocks that this transaction should be confirmed - * by. - * - * @generated from protobuf field: int32 target_conf = 2; - */ - targetConf: number; - /** - * The minimum number of confirmations each one of your outputs used for - * the transaction must satisfy. - * - * @generated from protobuf field: int32 min_confs = 3; - */ - minConfs: number; - /** - * Whether unconfirmed outputs should be used as inputs for the transaction. - * - * @generated from protobuf field: bool spend_unconfirmed = 4; - */ - spendUnconfirmed: boolean; -} -/** - * @generated from protobuf message lnrpc.EstimateFeeResponse - */ -export interface EstimateFeeResponse { - /** - * The total fee in satoshis. - * - * @generated from protobuf field: int64 fee_sat = 1; - */ - feeSat: number; - /** - * Deprecated, use sat_per_vbyte. - * The fee rate in satoshi/vbyte. - * - * @deprecated - * @generated from protobuf field: int64 feerate_sat_per_byte = 2 [deprecated = true]; - */ - feerateSatPerByte: number; - /** - * The fee rate in satoshi/vbyte. - * - * @generated from protobuf field: uint64 sat_per_vbyte = 3; - */ - satPerVbyte: number; -} -/** - * @generated from protobuf message lnrpc.SendManyRequest - */ -export interface SendManyRequest { - /** - * The map from addresses to amounts - * - * @generated from protobuf field: map AddrToAmount = 1 [json_name = "AddrToAmount"]; - */ - addrToAmount: { - [key: string]: number; - }; - /** - * The target number of blocks that this transaction should be confirmed - * by. - * - * @generated from protobuf field: int32 target_conf = 3; - */ - targetConf: number; - /** - * A manual fee rate set in sat/vbyte that should be used when crafting the - * transaction. - * - * @generated from protobuf field: uint64 sat_per_vbyte = 4; - */ - satPerVbyte: number; - /** - * Deprecated, use sat_per_vbyte. - * A manual fee rate set in sat/vbyte that should be used when crafting the - * transaction. - * - * @deprecated - * @generated from protobuf field: int64 sat_per_byte = 5 [deprecated = true]; - */ - satPerByte: number; - /** - * An optional label for the transaction, limited to 500 characters. - * - * @generated from protobuf field: string label = 6; - */ - label: string; - /** - * The minimum number of confirmations each one of your outputs used for - * the transaction must satisfy. - * - * @generated from protobuf field: int32 min_confs = 7; - */ - minConfs: number; - /** - * Whether unconfirmed outputs should be used as inputs for the transaction. - * - * @generated from protobuf field: bool spend_unconfirmed = 8; - */ - spendUnconfirmed: boolean; -} -/** - * @generated from protobuf message lnrpc.SendManyResponse - */ -export interface SendManyResponse { - /** - * The id of the transaction - * - * @generated from protobuf field: string txid = 1; - */ - txid: string; -} -/** - * @generated from protobuf message lnrpc.SendCoinsRequest - */ -export interface SendCoinsRequest { - /** - * The address to send coins to - * - * @generated from protobuf field: string addr = 1; - */ - addr: string; - /** - * The amount in satoshis to send - * - * @generated from protobuf field: int64 amount = 2; - */ - amount: number; - /** - * The target number of blocks that this transaction should be confirmed - * by. - * - * @generated from protobuf field: int32 target_conf = 3; - */ - targetConf: number; - /** - * A manual fee rate set in sat/vbyte that should be used when crafting the - * transaction. - * - * @generated from protobuf field: uint64 sat_per_vbyte = 4; - */ - satPerVbyte: number; - /** - * Deprecated, use sat_per_vbyte. - * A manual fee rate set in sat/vbyte that should be used when crafting the - * transaction. - * - * @deprecated - * @generated from protobuf field: int64 sat_per_byte = 5 [deprecated = true]; - */ - satPerByte: number; - /** - * - * If set, then the amount field will be ignored, and lnd will attempt to - * send all the coins under control of the internal wallet to the specified - * address. - * - * @generated from protobuf field: bool send_all = 6; - */ - sendAll: boolean; - /** - * An optional label for the transaction, limited to 500 characters. - * - * @generated from protobuf field: string label = 7; - */ - label: string; - /** - * The minimum number of confirmations each one of your outputs used for - * the transaction must satisfy. - * - * @generated from protobuf field: int32 min_confs = 8; - */ - minConfs: number; - /** - * Whether unconfirmed outputs should be used as inputs for the transaction. - * - * @generated from protobuf field: bool spend_unconfirmed = 9; - */ - spendUnconfirmed: boolean; -} -/** - * @generated from protobuf message lnrpc.SendCoinsResponse - */ -export interface SendCoinsResponse { - /** - * The transaction ID of the transaction - * - * @generated from protobuf field: string txid = 1; - */ - txid: string; -} -/** - * @generated from protobuf message lnrpc.ListUnspentRequest - */ -export interface ListUnspentRequest { - /** - * The minimum number of confirmations to be included. - * - * @generated from protobuf field: int32 min_confs = 1; - */ - minConfs: number; - /** - * The maximum number of confirmations to be included. - * - * @generated from protobuf field: int32 max_confs = 2; - */ - maxConfs: number; - /** - * An optional filter to only include outputs belonging to an account. - * - * @generated from protobuf field: string account = 3; - */ - account: string; -} -/** - * @generated from protobuf message lnrpc.ListUnspentResponse - */ -export interface ListUnspentResponse { - /** - * A list of utxos - * - * @generated from protobuf field: repeated lnrpc.Utxo utxos = 1; - */ - utxos: Utxo[]; -} -/** - * @generated from protobuf message lnrpc.NewAddressRequest - */ -export interface NewAddressRequest { - /** - * The type of address to generate. - * - * @generated from protobuf field: lnrpc.AddressType type = 1; - */ - type: AddressType; - /** - * - * The name of the account to generate a new address for. If empty, the - * default wallet account is used. - * - * @generated from protobuf field: string account = 2; - */ - account: string; -} -/** - * @generated from protobuf message lnrpc.NewAddressResponse - */ -export interface NewAddressResponse { - /** - * The newly generated wallet address - * - * @generated from protobuf field: string address = 1; - */ - address: string; -} -/** - * @generated from protobuf message lnrpc.SignMessageRequest - */ -export interface SignMessageRequest { - /** - * - * The message to be signed. When using REST, this field must be encoded as - * base64. - * - * @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 - */ -export interface SignMessageResponse { - /** - * The signature for the given message - * - * @generated from protobuf field: string signature = 1; - */ - signature: string; -} -/** - * @generated from protobuf message lnrpc.VerifyMessageRequest - */ -export interface VerifyMessageRequest { - /** - * - * The message over which the signature is to be verified. When using REST, - * this field must be encoded as base64. - * - * @generated from protobuf field: bytes msg = 1; - */ - msg: Uint8Array; - /** - * The signature to be verified over the given message - * - * @generated from protobuf field: string signature = 2; - */ - signature: string; -} -/** - * @generated from protobuf message lnrpc.VerifyMessageResponse - */ -export interface VerifyMessageResponse { - /** - * Whether the signature was valid over the given message - * - * @generated from protobuf field: bool valid = 1; - */ - valid: boolean; - /** - * The pubkey recovered from the signature - * - * @generated from protobuf field: string pubkey = 2; - */ - pubkey: string; -} -/** - * @generated from protobuf message lnrpc.ConnectPeerRequest - */ -export interface ConnectPeerRequest { - /** - * - * 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. - * - * @generated from protobuf field: bool perm = 2; - */ - perm: boolean; - /** - * - * The connection timeout value (in seconds) for this request. It won't affect - * other requests. - * - * @generated from protobuf field: uint64 timeout = 3; - */ - timeout: number; -} -/** - * @generated from protobuf message lnrpc.ConnectPeerResponse - */ -export interface ConnectPeerResponse { -} -/** - * @generated from protobuf message lnrpc.DisconnectPeerRequest - */ -export interface DisconnectPeerRequest { - /** - * The pubkey of the node to disconnect from - * - * @generated from protobuf field: string pub_key = 1; - */ - pubKey: string; -} -/** - * @generated from protobuf message lnrpc.DisconnectPeerResponse - */ -export interface DisconnectPeerResponse { -} -/** - * @generated from protobuf message lnrpc.HTLC - */ -export interface HTLC { - /** - * @generated from protobuf field: bool incoming = 1; - */ - incoming: boolean; - /** - * @generated from protobuf field: int64 amount = 2; - */ - amount: number; - /** - * @generated from protobuf field: bytes hash_lock = 3; - */ - hashLock: Uint8Array; - /** - * @generated from protobuf field: uint32 expiration_height = 4; - */ - expirationHeight: number; - /** - * Index identifying the htlc on the channel. - * - * @generated from protobuf field: uint64 htlc_index = 5; - */ - htlcIndex: number; - /** - * If this HTLC is involved in a forwarding operation, this field indicates - * the forwarding channel. For an outgoing htlc, it is the incoming channel. - * For an incoming htlc, it is the outgoing channel. When the htlc - * originates from this node or this node is the final destination, - * forwarding_channel will be zero. The forwarding channel will also be zero - * for htlcs that need to be forwarded but don't have a forwarding decision - * persisted yet. - * - * @generated from protobuf field: uint64 forwarding_channel = 6; - */ - forwardingChannel: number; - /** - * Index identifying the htlc on the forwarding channel. - * - * @generated from protobuf field: uint64 forwarding_htlc_index = 7; - */ - forwardingHtlcIndex: number; -} -/** - * @generated from protobuf message lnrpc.ChannelConstraints - */ -export interface ChannelConstraints { - /** - * - * The CSV delay expressed in relative blocks. If the channel is force closed, - * we will need to wait for this many blocks before we can regain our funds. - * - * @generated from protobuf field: uint32 csv_delay = 1; - */ - csvDelay: number; - /** - * The minimum satoshis this node is required to reserve in its balance. - * - * @generated from protobuf field: uint64 chan_reserve_sat = 2; - */ - chanReserveSat: number; - /** - * The dust limit (in satoshis) of the initiator's commitment tx. - * - * @generated from protobuf field: uint64 dust_limit_sat = 3; - */ - dustLimitSat: number; - /** - * 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: number; - /** - * The smallest HTLC in millisatoshis that the initiator will accept. - * - * @generated from protobuf field: uint64 min_htlc_msat = 5; - */ - minHtlcMsat: number; - /** - * The total number of incoming HTLC's that the initiator will accept. - * - * @generated from protobuf field: uint32 max_accepted_htlcs = 6; - */ - maxAcceptedHtlcs: number; -} -/** - * @generated from protobuf message lnrpc.Channel - */ -export interface Channel { - /** - * Whether this channel is active or not - * - * @generated from protobuf field: bool active = 1; - */ - active: boolean; - /** - * The identity pubkey of the remote node - * - * @generated from protobuf field: string remote_pubkey = 2; - */ - remotePubkey: string; - /** - * - * The outpoint (txid:index) of the funding transaction. With this value, Bob - * will be able to generate a signature for Alice's version of the commitment - * transaction. - * - * @generated from protobuf field: string channel_point = 3; - */ - channelPoint: string; - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 chan_id = 4 [jstype = JS_STRING]; - */ - chanId: string; - /** - * The total amount of funds held in this channel - * - * @generated from protobuf field: int64 capacity = 5; - */ - capacity: number; - /** - * This node's current balance in this channel - * - * @generated from protobuf field: int64 local_balance = 6; - */ - localBalance: number; - /** - * The counterparty's current balance in this channel - * - * @generated from protobuf field: int64 remote_balance = 7; - */ - remoteBalance: number; - /** - * - * The amount calculated to be paid in fees for the current set of commitment - * transactions. The fee amount is persisted with the channel in order to - * allow the fee amount to be removed and recalculated with each channel state - * update, including updates that happen after a system restart. - * - * @generated from protobuf field: int64 commit_fee = 8; - */ - commitFee: number; - /** - * The weight of the commitment transaction - * - * @generated from protobuf field: int64 commit_weight = 9; - */ - commitWeight: number; - /** - * - * The required number of satoshis per kilo-weight that the requester will pay - * at all times, for both the funding transaction and commitment transaction. - * This value can later be updated once the channel is open. - * - * @generated from protobuf field: int64 fee_per_kw = 10; - */ - feePerKw: number; - /** - * The unsettled balance in this channel - * - * @generated from protobuf field: int64 unsettled_balance = 11; - */ - unsettledBalance: number; - /** - * - * The total number of satoshis we've sent within this channel. - * - * @generated from protobuf field: int64 total_satoshis_sent = 12; - */ - totalSatoshisSent: number; - /** - * - * The total number of satoshis we've received within this channel. - * - * @generated from protobuf field: int64 total_satoshis_received = 13; - */ - totalSatoshisReceived: number; - /** - * - * The total number of updates conducted within this channel. - * - * @generated from protobuf field: uint64 num_updates = 14; - */ - numUpdates: number; - /** - * - * The list of active, uncleared HTLCs currently pending within the channel. - * - * @generated from protobuf field: repeated lnrpc.HTLC pending_htlcs = 15; - */ - pendingHtlcs: HTLC[]; - /** - * - * Deprecated. The CSV delay expressed in relative blocks. If the channel is - * force closed, we will need to wait for this many blocks before we can regain - * our funds. - * - * @deprecated - * @generated from protobuf field: uint32 csv_delay = 16 [deprecated = true]; - */ - csvDelay: number; - /** - * Whether this channel is advertised to the network or not. - * - * @generated from protobuf field: bool private = 17; - */ - private: boolean; - /** - * True if we were the ones that created the channel. - * - * @generated from protobuf field: bool initiator = 18; - */ - initiator: boolean; - /** - * A set of flags showing the current state of the channel. - * - * @generated from protobuf field: string chan_status_flags = 19; - */ - chanStatusFlags: string; - /** - * Deprecated. The minimum satoshis this node is required to reserve in its - * balance. - * - * @deprecated - * @generated from protobuf field: int64 local_chan_reserve_sat = 20 [deprecated = true]; - */ - localChanReserveSat: number; - /** - * - * Deprecated. The minimum satoshis the other node is required to reserve in - * its balance. - * - * @deprecated - * @generated from protobuf field: int64 remote_chan_reserve_sat = 21 [deprecated = true]; - */ - remoteChanReserveSat: number; - /** - * Deprecated. Use commitment_type. - * - * @deprecated - * @generated from protobuf field: bool static_remote_key = 22 [deprecated = true]; - */ - staticRemoteKey: boolean; - /** - * The commitment type used by this channel. - * - * @generated from protobuf field: lnrpc.CommitmentType commitment_type = 26; - */ - commitmentType: CommitmentType; - /** - * - * The number of seconds that the channel has been monitored by the channel - * scoring system. Scores are currently not persisted, so this value may be - * less than the lifetime of the channel [EXPERIMENTAL]. - * - * @generated from protobuf field: int64 lifetime = 23; - */ - lifetime: number; - /** - * - * The number of seconds that the remote peer has been observed as being online - * by the channel scoring system over the lifetime of the channel - * [EXPERIMENTAL]. - * - * @generated from protobuf field: int64 uptime = 24; - */ - uptime: number; - /** - * - * Close address is the address that we will enforce payout to on cooperative - * close if the channel was opened utilizing option upfront shutdown. This - * value can be set on channel open by setting close_address in an open channel - * request. If this value is not set, you can still choose a payout address by - * cooperatively closing with the delivery_address field set. - * - * @generated from protobuf field: string close_address = 25; - */ - closeAddress: string; - /** - * - * The amount that the initiator of the channel optionally pushed to the remote - * party on channel open. This amount will be zero if the channel initiator did - * not push any funds to the remote peer. If the initiator field is true, we - * pushed this amount to our peer, if it is false, the remote peer pushed this - * amount to us. - * - * @generated from protobuf field: uint64 push_amount_sat = 27; - */ - pushAmountSat: number; - /** - * - * This uint32 indicates if this channel is to be considered 'frozen'. A - * frozen channel doest not allow a cooperative channel close by the - * initiator. The thaw_height is the height that this restriction stops - * applying to the channel. This field is optional, not setting it or using a - * value of zero will mean the channel has no additional restrictions. The - * height can be interpreted in two ways: as a relative height if the value is - * less than 500,000, or as an absolute height otherwise. - * - * @generated from protobuf field: uint32 thaw_height = 28; - */ - thawHeight: number; - /** - * List constraints for the local node. - * - * @generated from protobuf field: lnrpc.ChannelConstraints local_constraints = 29; - */ - localConstraints?: ChannelConstraints; - /** - * List constraints for the remote node. - * - * @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: number[]; - /** - * 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: number; -} -/** - * @generated from protobuf message lnrpc.ListChannelsRequest - */ -export interface ListChannelsRequest { - /** - * @generated from protobuf field: bool active_only = 1; - */ - activeOnly: boolean; - /** - * @generated from protobuf field: bool inactive_only = 2; - */ - inactiveOnly: boolean; - /** - * @generated from protobuf field: bool public_only = 3; - */ - publicOnly: boolean; - /** - * @generated from protobuf field: bool private_only = 4; - */ - privateOnly: boolean; - /** - * - * Filters the response for channels with a target peer's pubkey. If peer is - * empty, all channels will be returned. - * - * @generated from protobuf field: bytes peer = 5; - */ - peer: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.ListChannelsResponse - */ -export interface ListChannelsResponse { - /** - * The list of active channels - * - * @generated from protobuf field: repeated lnrpc.Channel channels = 11; - */ - 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: number; - /** - * The set of all aliases stored for the base SCID. - * - * @generated from protobuf field: repeated uint64 aliases = 2; - */ - aliases: number[]; -} -/** - * @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 - */ -export interface ChannelCloseSummary { - /** - * The outpoint (txid:index) of the funding transaction. - * - * @generated from protobuf field: string channel_point = 1; - */ - channelPoint: string; - /** - * The unique channel ID for the channel. - * - * @generated from protobuf field: uint64 chan_id = 2 [jstype = JS_STRING]; - */ - chanId: string; - /** - * The hash of the genesis block that this channel resides within. - * - * @generated from protobuf field: string chain_hash = 3; - */ - chainHash: string; - /** - * The txid of the transaction which ultimately closed this channel. - * - * @generated from protobuf field: string closing_tx_hash = 4; - */ - closingTxHash: string; - /** - * Public key of the remote peer that we formerly had a channel with. - * - * @generated from protobuf field: string remote_pubkey = 5; - */ - remotePubkey: string; - /** - * Total capacity of the channel. - * - * @generated from protobuf field: int64 capacity = 6; - */ - capacity: number; - /** - * Height at which the funding transaction was spent. - * - * @generated from protobuf field: uint32 close_height = 7; - */ - closeHeight: number; - /** - * Settled balance at the time of channel closure - * - * @generated from protobuf field: int64 settled_balance = 8; - */ - settledBalance: number; - /** - * The sum of all the time-locked outputs at the time of channel closure - * - * @generated from protobuf field: int64 time_locked_balance = 9; - */ - timeLockedBalance: number; - /** - * Details on how the channel was closed. - * - * @generated from protobuf field: lnrpc.ChannelCloseSummary.ClosureType close_type = 10; - */ - closeType: ChannelCloseSummary_ClosureType; - /** - * - * Open initiator is the party that initiated opening the channel. Note that - * this value may be unknown if the channel was closed before we migrated to - * store open channel information after close. - * - * @generated from protobuf field: lnrpc.Initiator open_initiator = 11; - */ - openInitiator: Initiator; - /** - * - * Close initiator indicates which party initiated the close. This value will - * be unknown for channels that were cooperatively closed before we started - * tracking cooperative close initiators. Note that this indicates which party - * initiated a close, and it is possible for both to initiate cooperative or - * force closes, although only one party's close will be confirmed on chain. - * - * @generated from protobuf field: lnrpc.Initiator close_initiator = 12; - */ - closeInitiator: Initiator; - /** - * @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: number[]; - /** - * 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 - */ -export declare enum ChannelCloseSummary_ClosureType { - /** - * @generated from protobuf enum value: COOPERATIVE_CLOSE = 0; - */ - COOPERATIVE_CLOSE = 0, - /** - * @generated from protobuf enum value: LOCAL_FORCE_CLOSE = 1; - */ - LOCAL_FORCE_CLOSE = 1, - /** - * @generated from protobuf enum value: REMOTE_FORCE_CLOSE = 2; - */ - REMOTE_FORCE_CLOSE = 2, - /** - * @generated from protobuf enum value: BREACH_CLOSE = 3; - */ - BREACH_CLOSE = 3, - /** - * @generated from protobuf enum value: FUNDING_CANCELED = 4; - */ - FUNDING_CANCELED = 4, - /** - * @generated from protobuf enum value: ABANDONED = 5; - */ - ABANDONED = 5 -} -/** - * @generated from protobuf message lnrpc.Resolution - */ -export interface Resolution { - /** - * The type of output we are resolving. - * - * @generated from protobuf field: lnrpc.ResolutionType resolution_type = 1; - */ - resolutionType: ResolutionType; - /** - * The outcome of our on chain action that resolved the outpoint. - * - * @generated from protobuf field: lnrpc.ResolutionOutcome outcome = 2; - */ - outcome: ResolutionOutcome; - /** - * The outpoint that was spent by the resolution. - * - * @generated from protobuf field: lnrpc.OutPoint outpoint = 3; - */ - outpoint?: OutPoint; - /** - * The amount that was claimed by the resolution. - * - * @generated from protobuf field: uint64 amount_sat = 4; - */ - amountSat: number; - /** - * The hex-encoded transaction ID of the sweep transaction that spent the - * output. - * - * @generated from protobuf field: string sweep_txid = 5; - */ - sweepTxid: string; -} -/** - * @generated from protobuf message lnrpc.ClosedChannelsRequest - */ -export interface ClosedChannelsRequest { - /** - * @generated from protobuf field: bool cooperative = 1; - */ - cooperative: boolean; - /** - * @generated from protobuf field: bool local_force = 2; - */ - localForce: boolean; - /** - * @generated from protobuf field: bool remote_force = 3; - */ - remoteForce: boolean; - /** - * @generated from protobuf field: bool breach = 4; - */ - breach: boolean; - /** - * @generated from protobuf field: bool funding_canceled = 5; - */ - fundingCanceled: boolean; - /** - * @generated from protobuf field: bool abandoned = 6; - */ - abandoned: boolean; -} -/** - * @generated from protobuf message lnrpc.ClosedChannelsResponse - */ -export interface ClosedChannelsResponse { - /** - * @generated from protobuf field: repeated lnrpc.ChannelCloseSummary channels = 1; - */ - channels: ChannelCloseSummary[]; -} -/** - * @generated from protobuf message lnrpc.Peer - */ -export interface Peer { - /** - * The identity pubkey of the peer - * - * @generated from protobuf field: string pub_key = 1; - */ - pubKey: string; - /** - * Network address of the peer; eg `127.0.0.1:10011` - * - * @generated from protobuf field: string address = 3; - */ - address: string; - /** - * Bytes of data transmitted to this peer - * - * @generated from protobuf field: uint64 bytes_sent = 4; - */ - bytesSent: number; - /** - * Bytes of data transmitted from this peer - * - * @generated from protobuf field: uint64 bytes_recv = 5; - */ - bytesRecv: number; - /** - * Satoshis sent to this peer - * - * @generated from protobuf field: int64 sat_sent = 6; - */ - satSent: number; - /** - * Satoshis received from this peer - * - * @generated from protobuf field: int64 sat_recv = 7; - */ - satRecv: number; - /** - * A channel is inbound if the counterparty initiated the channel - * - * @generated from protobuf field: bool inbound = 8; - */ - inbound: boolean; - /** - * Ping time to this peer - * - * @generated from protobuf field: int64 ping_time = 9; - */ - pingTime: number; - /** - * The type of sync we are currently performing with this peer. - * - * @generated from protobuf field: lnrpc.Peer.SyncType sync_type = 10; - */ - syncType: Peer_SyncType; - /** - * Features advertised by the remote peer in their init message. - * - * @generated from protobuf field: map features = 11; - */ - features: { - [key: number]: Feature; - }; - /** - * - * The latest errors received from our peer with timestamps, limited to the 10 - * most recent errors. These errors are tracked across peer connections, but - * are not persisted across lnd restarts. Note that these errors are only - * stored for peers that we have channels open with, to prevent peers from - * spamming us with errors at no cost. - * - * @generated from protobuf field: repeated lnrpc.TimestampedError errors = 12; - */ - errors: TimestampedError[]; - /** - * - * The number of times we have recorded this peer going offline or coming - * online, recorded across restarts. Note that this value is decreased over - * time if the peer has not recently flapped, so that we can forgive peers - * with historically high flap counts. - * - * @generated from protobuf field: int32 flap_count = 13; - */ - flapCount: number; - /** - * - * The timestamp of the last flap we observed for this peer. If this value is - * zero, we have not observed any flaps for this peer. - * - * @generated from protobuf field: int64 last_flap_ns = 14; - */ - lastFlapNs: number; - /** - * - * 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 - */ -export declare enum Peer_SyncType { - /** - * - * Denotes that we cannot determine the peer's current sync type. - * - * @generated from protobuf enum value: UNKNOWN_SYNC = 0; - */ - UNKNOWN_SYNC = 0, - /** - * - * Denotes that we are actively receiving new graph updates from the peer. - * - * @generated from protobuf enum value: ACTIVE_SYNC = 1; - */ - ACTIVE_SYNC = 1, - /** - * - * Denotes that we are not receiving new graph updates from the peer. - * - * @generated from protobuf enum value: PASSIVE_SYNC = 2; - */ - PASSIVE_SYNC = 2, - /** - * - * Denotes that this peer is pinned into an active sync. - * - * @generated from protobuf enum value: PINNED_SYNC = 3; - */ - PINNED_SYNC = 3 -} -/** - * @generated from protobuf message lnrpc.TimestampedError - */ -export interface TimestampedError { - /** - * The unix timestamp in seconds when the error occurred. - * - * @generated from protobuf field: uint64 timestamp = 1; - */ - timestamp: number; - /** - * The string representation of the error sent by our peer. - * - * @generated from protobuf field: string error = 2; - */ - error: string; -} -/** - * @generated from protobuf message lnrpc.ListPeersRequest - */ -export interface ListPeersRequest { - /** - * - * If true, only the last error that our peer sent us will be returned with - * the peer's information, rather than the full set of historic errors we have - * stored. - * - * @generated from protobuf field: bool latest_error = 1; - */ - latestError: boolean; -} -/** - * @generated from protobuf message lnrpc.ListPeersResponse - */ -export interface ListPeersResponse { - /** - * The list of currently connected peers - * - * @generated from protobuf field: repeated lnrpc.Peer peers = 1; - */ - peers: Peer[]; -} -/** - * @generated from protobuf message lnrpc.PeerEventSubscription - */ -export interface PeerEventSubscription { -} -/** - * @generated from protobuf message lnrpc.PeerEvent - */ -export interface PeerEvent { - /** - * The identity pubkey of the peer. - * - * @generated from protobuf field: string pub_key = 1; - */ - pubKey: string; - /** - * @generated from protobuf field: lnrpc.PeerEvent.EventType type = 2; - */ - type: PeerEvent_EventType; -} -/** - * @generated from protobuf enum lnrpc.PeerEvent.EventType - */ -export declare enum PeerEvent_EventType { - /** - * @generated from protobuf enum value: PEER_ONLINE = 0; - */ - PEER_ONLINE = 0, - /** - * @generated from protobuf enum value: PEER_OFFLINE = 1; - */ - PEER_OFFLINE = 1 -} -/** - * @generated from protobuf message lnrpc.GetInfoRequest - */ -export interface GetInfoRequest { -} -/** - * @generated from protobuf message lnrpc.GetInfoResponse - */ -export interface GetInfoResponse { - /** - * The version of the LND software that the node is running. - * - * @generated from protobuf field: string version = 14; - */ - version: string; - /** - * The SHA1 commit hash that the daemon is compiled with. - * - * @generated from protobuf field: string commit_hash = 20; - */ - commitHash: string; - /** - * The identity pubkey of the current node. - * - * @generated from protobuf field: string identity_pubkey = 1; - */ - identityPubkey: string; - /** - * If applicable, the alias of the current node, e.g. "bob" - * - * @generated from protobuf field: string alias = 2; - */ - alias: string; - /** - * The color of the current node in hex code format - * - * @generated from protobuf field: string color = 17; - */ - color: string; - /** - * Number of pending channels - * - * @generated from protobuf field: uint32 num_pending_channels = 3; - */ - numPendingChannels: number; - /** - * Number of active channels - * - * @generated from protobuf field: uint32 num_active_channels = 4; - */ - numActiveChannels: number; - /** - * Number of inactive channels - * - * @generated from protobuf field: uint32 num_inactive_channels = 15; - */ - numInactiveChannels: number; - /** - * Number of peers - * - * @generated from protobuf field: uint32 num_peers = 5; - */ - numPeers: number; - /** - * The node's current view of the height of the best block - * - * @generated from protobuf field: uint32 block_height = 6; - */ - blockHeight: number; - /** - * The node's current view of the hash of the best block - * - * @generated from protobuf field: string block_hash = 8; - */ - blockHash: string; - /** - * Timestamp of the block best known to the wallet - * - * @generated from protobuf field: int64 best_header_timestamp = 13; - */ - bestHeaderTimestamp: number; - /** - * Whether the wallet's view is synced to the main chain - * - * @generated from protobuf field: bool synced_to_chain = 9; - */ - syncedToChain: boolean; - /** - * Whether we consider ourselves synced with the public channel graph. - * - * @generated from protobuf field: bool synced_to_graph = 18; - */ - syncedToGraph: boolean; - /** - * - * Whether the current node is connected to testnet. This field is - * deprecated and the network field should be used instead - * - * @deprecated - * @generated from protobuf field: bool testnet = 10 [deprecated = true]; - */ - testnet: boolean; - /** - * A list of active chains the node is connected to - * - * @generated from protobuf field: repeated lnrpc.Chain chains = 16; - */ - chains: Chain[]; - /** - * The URIs of the current node. - * - * @generated from protobuf field: repeated string uris = 12; - */ - uris: string[]; - /** - * - * Features that our node has advertised in our init message, node - * announcements and invoices. - * - * @generated from protobuf field: map features = 19; - */ - 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 - */ -export interface GetRecoveryInfoRequest { -} -/** - * @generated from protobuf message lnrpc.GetRecoveryInfoResponse - */ -export interface GetRecoveryInfoResponse { - /** - * Whether the wallet is in recovery mode - * - * @generated from protobuf field: bool recovery_mode = 1; - */ - recoveryMode: boolean; - /** - * Whether the wallet recovery progress is finished - * - * @generated from protobuf field: bool recovery_finished = 2; - */ - recoveryFinished: boolean; - /** - * The recovery progress, ranging from 0 to 1. - * - * @generated from protobuf field: double progress = 3; - */ - progress: number; -} -/** - * @generated from protobuf message lnrpc.Chain - */ -export interface Chain { - /** - * The blockchain the node is on (eg bitcoin, litecoin) - * - * @generated from protobuf field: string chain = 1; - */ - chain: string; - /** - * The network the node is on (eg regtest, testnet, mainnet) - * - * @generated from protobuf field: string network = 2; - */ - network: string; -} -/** - * @generated from protobuf message lnrpc.ConfirmationUpdate - */ -export interface ConfirmationUpdate { - /** - * @generated from protobuf field: bytes block_sha = 1; - */ - blockSha: Uint8Array; - /** - * @generated from protobuf field: int32 block_height = 2; - */ - blockHeight: number; - /** - * @generated from protobuf field: uint32 num_confs_left = 3; - */ - numConfsLeft: number; -} -/** - * @generated from protobuf message lnrpc.ChannelOpenUpdate - */ -export interface ChannelOpenUpdate { - /** - * @generated from protobuf field: lnrpc.ChannelPoint channel_point = 1; - */ - channelPoint?: ChannelPoint; -} -/** - * @generated from protobuf message lnrpc.ChannelCloseUpdate - */ -export interface ChannelCloseUpdate { - /** - * @generated from protobuf field: bytes closing_txid = 1; - */ - closingTxid: Uint8Array; - /** - * @generated from protobuf field: bool success = 2; - */ - success: boolean; -} -/** - * @generated from protobuf message lnrpc.CloseChannelRequest - */ -export interface CloseChannelRequest { - /** - * - * The outpoint (txid:index) of the funding transaction. With this value, Bob - * will be able to generate a signature for Alice's version of the commitment - * transaction. - * - * @generated from protobuf field: lnrpc.ChannelPoint channel_point = 1; - */ - channelPoint?: ChannelPoint; - /** - * If true, then the channel will be closed forcibly. This means the - * current commitment transaction will be signed and broadcast. - * - * @generated from protobuf field: bool force = 2; - */ - force: boolean; - /** - * The target number of blocks that the closure transaction should be - * confirmed by. - * - * @generated from protobuf field: int32 target_conf = 3; - */ - targetConf: number; - /** - * Deprecated, use sat_per_vbyte. - * A manual fee rate set in sat/vbyte that should be used when crafting the - * closure transaction. - * - * @deprecated - * @generated from protobuf field: int64 sat_per_byte = 4 [deprecated = true]; - */ - satPerByte: number; - /** - * - * An optional address to send funds to in the case of a cooperative close. - * If the channel was opened with an upfront shutdown script and this field - * is set, the request to close will fail because the channel must pay out - * to the upfront shutdown addresss. - * - * @generated from protobuf field: string delivery_address = 5; - */ - deliveryAddress: string; - /** - * A manual fee rate set in sat/vbyte that should be used when crafting the - * closure transaction. - * - * @generated from protobuf field: uint64 sat_per_vbyte = 6; - */ - satPerVbyte: number; - /** - * 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: number; -} -/** - * @generated from protobuf message lnrpc.CloseStatusUpdate - */ -export interface CloseStatusUpdate { - /** - * @generated from protobuf oneof: update - */ - update: { - oneofKind: "closePending"; - /** - * @generated from protobuf field: lnrpc.PendingUpdate close_pending = 1; - */ - closePending: PendingUpdate; - } | { - oneofKind: "chanClose"; - /** - * @generated from protobuf field: lnrpc.ChannelCloseUpdate chan_close = 3; - */ - chanClose: ChannelCloseUpdate; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message lnrpc.PendingUpdate - */ -export interface PendingUpdate { - /** - * @generated from protobuf field: bytes txid = 1; - */ - txid: Uint8Array; - /** - * @generated from protobuf field: uint32 output_index = 2; - */ - outputIndex: number; -} -/** - * @generated from protobuf message lnrpc.ReadyForPsbtFunding - */ -export interface ReadyForPsbtFunding { - /** - * - * The P2WSH address of the channel funding multisig address that the below - * specified amount in satoshis needs to be sent to. - * - * @generated from protobuf field: string funding_address = 1; - */ - fundingAddress: string; - /** - * - * The exact amount in satoshis that needs to be sent to the above address to - * fund the pending channel. - * - * @generated from protobuf field: int64 funding_amount = 2; - */ - fundingAmount: number; - /** - * - * A raw PSBT that contains the pending channel output. If a base PSBT was - * provided in the PsbtShim, this is the base PSBT with one additional output. - * If no base PSBT was specified, this is an otherwise empty PSBT with exactly - * one output. - * - * @generated from protobuf field: bytes psbt = 3; - */ - 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: number; - /** - * 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: number; - /** - * 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: number; - /** - * 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: number; - /** - * 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 - */ -export interface OpenChannelRequest { - /** - * A manual fee rate set in sat/vbyte that should be used when crafting the - * funding transaction. - * - * @generated from protobuf field: uint64 sat_per_vbyte = 1; - */ - satPerVbyte: number; - /** - * - * 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 = 2; - */ - nodePubkey: Uint8Array; - /** - * - * The hex encoded pubkey of the node to open a channel with. Deprecated now - * that the REST gateway supports base64 encoding of bytes fields. - * - * @deprecated - * @generated from protobuf field: string node_pubkey_string = 3 [deprecated = true]; - */ - nodePubkeyString: string; - /** - * The number of satoshis the wallet should commit to the channel - * - * @generated from protobuf field: int64 local_funding_amount = 4; - */ - localFundingAmount: number; - /** - * 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: number; - /** - * The target number of blocks that the funding transaction should be - * confirmed by. - * - * @generated from protobuf field: int32 target_conf = 6; - */ - targetConf: number; - /** - * Deprecated, use sat_per_vbyte. - * A manual fee rate set in sat/vbyte that should be used when crafting the - * funding transaction. - * - * @deprecated - * @generated from protobuf field: int64 sat_per_byte = 7 [deprecated = true]; - */ - satPerByte: number; - /** - * Whether this channel should be private, not announced to the greater - * network. - * - * @generated from protobuf field: bool private = 8; - */ - private: boolean; - /** - * The minimum value in millisatoshi we will require for incoming HTLCs on - * the channel. - * - * @generated from protobuf field: int64 min_htlc_msat = 9; - */ - minHtlcMsat: number; - /** - * 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 = 10; - */ - remoteCsvDelay: number; - /** - * The minimum number of confirmations each one of your outputs used for - * the funding transaction must satisfy. - * - * @generated from protobuf field: int32 min_confs = 11; - */ - minConfs: number; - /** - * Whether unconfirmed outputs should be used as inputs for the funding - * transaction. - * - * @generated from protobuf field: bool spend_unconfirmed = 12; - */ - spendUnconfirmed: boolean; - /** - * - * 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 = 13; - */ - closeAddress: string; - /** - * - * Funding shims are an optional argument that allow the caller to intercept - * certain funding functionality. For example, a shim can be provided to use a - * particular key for the commitment key (ideally cold) rather than use one - * that is generated by the wallet as normal, or signal that signing will be - * carried out in an interactive manner (PSBT based). - * - * @generated from protobuf field: lnrpc.FundingShim funding_shim = 14; - */ - fundingShim?: FundingShim; - /** - * - * The maximum amount of coins in millisatoshi that can be pending within - * the channel. It only applies to the remote party. - * - * @generated from protobuf field: uint64 remote_max_value_in_flight_msat = 15; - */ - remoteMaxValueInFlightMsat: number; - /** - * - * The maximum number of concurrent HTLCs we will allow the remote party to add - * to the commitment transaction. - * - * @generated from protobuf field: uint32 remote_max_htlcs = 16; - */ - remoteMaxHtlcs: number; - /** - * - * Max local csv is the maximum csv delay we will allow for our own commitment - * transaction. - * - * @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: number; - /** - * - * 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: number; - /** - * - * 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: number; -} -/** - * @generated from protobuf message lnrpc.OpenStatusUpdate - */ -export interface OpenStatusUpdate { - /** - * @generated from protobuf oneof: update - */ - update: { - oneofKind: "chanPending"; - /** - * - * Signals that the channel is now fully negotiated and the funding - * transaction published. - * - * @generated from protobuf field: lnrpc.PendingUpdate chan_pending = 1; - */ - chanPending: PendingUpdate; - } | { - oneofKind: "chanOpen"; - /** - * - * Signals that the channel's funding transaction has now reached the - * required number of confirmations on chain and can be used. - * - * @generated from protobuf field: lnrpc.ChannelOpenUpdate chan_open = 3; - */ - chanOpen: ChannelOpenUpdate; - } | { - oneofKind: "psbtFund"; - /** - * - * Signals that the funding process has been suspended and the construction - * of a PSBT that funds the channel PK script is now required. - * - * @generated from protobuf field: lnrpc.ReadyForPsbtFunding psbt_fund = 5; - */ - psbtFund: ReadyForPsbtFunding; - } | { - oneofKind: undefined; - }; - /** - * - * The pending channel ID of the created channel. This value may be used to - * further the funding flow manually via the FundingStateStep method. - * - * @generated from protobuf field: bytes pending_chan_id = 4; - */ - pendingChanId: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.KeyLocator - */ -export interface KeyLocator { - /** - * The family of key being identified. - * - * @generated from protobuf field: int32 key_family = 1; - */ - keyFamily: number; - /** - * The precise index of the key being identified. - * - * @generated from protobuf field: int32 key_index = 2; - */ - keyIndex: number; -} -/** - * @generated from protobuf message lnrpc.KeyDescriptor - */ -export interface KeyDescriptor { - /** - * - * The raw bytes of the key being identified. - * - * @generated from protobuf field: bytes raw_key_bytes = 1; - */ - rawKeyBytes: Uint8Array; - /** - * - * The key locator that identifies which key to use for signing. - * - * @generated from protobuf field: lnrpc.KeyLocator key_loc = 2; - */ - keyLoc?: KeyLocator; -} -/** - * @generated from protobuf message lnrpc.ChanPointShim - */ -export interface ChanPointShim { - /** - * - * The size of the pre-crafted output to be used as the channel point for this - * channel funding. - * - * @generated from protobuf field: int64 amt = 1; - */ - amt: number; - /** - * The target channel point to refrence in created commitment transactions. - * - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 2; - */ - chanPoint?: ChannelPoint; - /** - * Our local key to use when creating the multi-sig output. - * - * @generated from protobuf field: lnrpc.KeyDescriptor local_key = 3; - */ - localKey?: KeyDescriptor; - /** - * The key of the remote party to use when creating the multi-sig output. - * - * @generated from protobuf field: bytes remote_key = 4; - */ - remoteKey: Uint8Array; - /** - * - * If non-zero, then this will be used as the pending channel ID on the wire - * protocol to initate the funding request. This is an optional field, and - * should only be set if the responder is already expecting a specific pending - * channel ID. - * - * @generated from protobuf field: bytes pending_chan_id = 5; - */ - pendingChanId: Uint8Array; - /** - * - * This uint32 indicates if this channel is to be considered 'frozen'. A frozen - * channel does not allow a cooperative channel close by the initiator. The - * thaw_height is the height that this restriction stops applying to the - * channel. The height can be interpreted in two ways: as a relative height if - * the value is less than 500,000, or as an absolute height otherwise. - * - * @generated from protobuf field: uint32 thaw_height = 6; - */ - thawHeight: number; -} -/** - * @generated from protobuf message lnrpc.PsbtShim - */ -export interface PsbtShim { - /** - * - * A unique identifier of 32 random bytes that will be used as the pending - * channel ID to identify the PSBT state machine when interacting with it and - * on the wire protocol to initiate the funding request. - * - * @generated from protobuf field: bytes pending_chan_id = 1; - */ - pendingChanId: Uint8Array; - /** - * - * An optional base PSBT the new channel output will be added to. If this is - * non-empty, it must be a binary serialized PSBT. - * - * @generated from protobuf field: bytes base_psbt = 2; - */ - basePsbt: Uint8Array; - /** - * - * If a channel should be part of a batch (multiple channel openings in one - * transaction), it can be dangerous if the whole batch transaction is - * published too early before all channel opening negotiations are completed. - * This flag prevents this particular channel from broadcasting the transaction - * after the negotiation with the remote peer. In a batch of channel openings - * this flag should be set to true for every channel but the very last. - * - * @generated from protobuf field: bool no_publish = 3; - */ - noPublish: boolean; -} -/** - * @generated from protobuf message lnrpc.FundingShim - */ -export interface FundingShim { - /** - * @generated from protobuf oneof: shim - */ - shim: { - oneofKind: "chanPointShim"; - /** - * - * A channel shim where the channel point was fully constructed outside - * of lnd's wallet and the transaction might already be published. - * - * @generated from protobuf field: lnrpc.ChanPointShim chan_point_shim = 1; - */ - chanPointShim: ChanPointShim; - } | { - oneofKind: "psbtShim"; - /** - * - * A channel shim that uses a PSBT to fund and sign the channel funding - * transaction. - * - * @generated from protobuf field: lnrpc.PsbtShim psbt_shim = 2; - */ - psbtShim: PsbtShim; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message lnrpc.FundingShimCancel - */ -export interface FundingShimCancel { - /** - * The pending channel ID of the channel to cancel the funding shim for. - * - * @generated from protobuf field: bytes pending_chan_id = 1; - */ - pendingChanId: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.FundingPsbtVerify - */ -export interface FundingPsbtVerify { - /** - * - * The funded but not yet signed PSBT that sends the exact channel capacity - * amount to the PK script returned in the open channel message in a previous - * step. - * - * @generated from protobuf field: bytes funded_psbt = 1; - */ - fundedPsbt: Uint8Array; - /** - * The pending channel ID of the channel to get the PSBT for. - * - * @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 - */ -export interface FundingPsbtFinalize { - /** - * - * The funded PSBT that contains all witness data to send the exact channel - * capacity amount to the PK script returned in the open channel message in a - * previous step. Cannot be set at the same time as final_raw_tx. - * - * @generated from protobuf field: bytes signed_psbt = 1; - */ - signedPsbt: Uint8Array; - /** - * The pending channel ID of the channel to get the PSBT for. - * - * @generated from protobuf field: bytes pending_chan_id = 2; - */ - pendingChanId: Uint8Array; - /** - * - * As an alternative to the signed PSBT with all witness data, the final raw - * wire format transaction can also be specified directly. Cannot be set at the - * same time as signed_psbt. - * - * @generated from protobuf field: bytes final_raw_tx = 3; - */ - finalRawTx: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.FundingTransitionMsg - */ -export interface FundingTransitionMsg { - /** - * @generated from protobuf oneof: trigger - */ - trigger: { - oneofKind: "shimRegister"; - /** - * - * The funding shim to register. This should be used before any - * channel funding has began by the remote party, as it is intended as a - * preparatory step for the full channel funding. - * - * @generated from protobuf field: lnrpc.FundingShim shim_register = 1; - */ - shimRegister: FundingShim; - } | { - oneofKind: "shimCancel"; - /** - * Used to cancel an existing registered funding shim. - * - * @generated from protobuf field: lnrpc.FundingShimCancel shim_cancel = 2; - */ - shimCancel: FundingShimCancel; - } | { - oneofKind: "psbtVerify"; - /** - * - * Used to continue a funding flow that was initiated to be executed - * through a PSBT. This step verifies that the PSBT contains the correct - * outputs to fund the channel. - * - * @generated from protobuf field: lnrpc.FundingPsbtVerify psbt_verify = 3; - */ - psbtVerify: FundingPsbtVerify; - } | { - oneofKind: "psbtFinalize"; - /** - * - * Used to continue a funding flow that was initiated to be executed - * through a PSBT. This step finalizes the funded and signed PSBT, finishes - * negotiation with the peer and finally publishes the resulting funding - * transaction. - * - * @generated from protobuf field: lnrpc.FundingPsbtFinalize psbt_finalize = 4; - */ - psbtFinalize: FundingPsbtFinalize; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message lnrpc.FundingStateStepResp - */ -export interface FundingStateStepResp { -} -/** - * @generated from protobuf message lnrpc.PendingHTLC - */ -export interface PendingHTLC { - /** - * The direction within the channel that the htlc was sent - * - * @generated from protobuf field: bool incoming = 1; - */ - incoming: boolean; - /** - * The total value of the htlc - * - * @generated from protobuf field: int64 amount = 2; - */ - amount: number; - /** - * The final output to be swept back to the user's wallet - * - * @generated from protobuf field: string outpoint = 3; - */ - outpoint: string; - /** - * The next block height at which we can spend the current stage - * - * @generated from protobuf field: uint32 maturity_height = 4; - */ - maturityHeight: number; - /** - * - * The number of blocks remaining until the current stage can be swept. - * Negative values indicate how many blocks have passed since becoming - * mature. - * - * @generated from protobuf field: int32 blocks_til_maturity = 5; - */ - blocksTilMaturity: number; - /** - * Indicates whether the htlc is in its first or second stage of recovery - * - * @generated from protobuf field: uint32 stage = 6; - */ - stage: number; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsRequest - */ -export interface PendingChannelsRequest { -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse - */ -export interface PendingChannelsResponse { - /** - * The balance in satoshis encumbered in pending channels - * - * @generated from protobuf field: int64 total_limbo_balance = 1; - */ - totalLimboBalance: number; - /** - * Channels pending opening - * - * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.PendingOpenChannel pending_open_channels = 2; - */ - pendingOpenChannels: PendingChannelsResponse_PendingOpenChannel[]; - /** - * - * Deprecated: Channels pending closing previously contained cooperatively - * closed channels with a single confirmation. These channels are now - * considered closed from the time we see them on chain. - * - * @deprecated - * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.ClosedChannel pending_closing_channels = 3 [deprecated = true]; - */ - pendingClosingChannels: PendingChannelsResponse_ClosedChannel[]; - /** - * Channels pending force closing - * - * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.ForceClosedChannel pending_force_closing_channels = 4; - */ - pendingForceClosingChannels: PendingChannelsResponse_ForceClosedChannel[]; - /** - * Channels waiting for closing tx to confirm - * - * @generated from protobuf field: repeated lnrpc.PendingChannelsResponse.WaitingCloseChannel waiting_close_channels = 5; - */ - waitingCloseChannels: PendingChannelsResponse_WaitingCloseChannel[]; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse.PendingChannel - */ -export interface PendingChannelsResponse_PendingChannel { - /** - * @generated from protobuf field: string remote_node_pub = 1; - */ - remoteNodePub: string; - /** - * @generated from protobuf field: string channel_point = 2; - */ - channelPoint: string; - /** - * @generated from protobuf field: int64 capacity = 3; - */ - capacity: number; - /** - * @generated from protobuf field: int64 local_balance = 4; - */ - localBalance: number; - /** - * @generated from protobuf field: int64 remote_balance = 5; - */ - remoteBalance: number; - /** - * The minimum satoshis this node is required to reserve in its - * balance. - * - * @generated from protobuf field: int64 local_chan_reserve_sat = 6; - */ - localChanReserveSat: number; - /** - * - * The minimum satoshis the other node is required to reserve in its - * balance. - * - * @generated from protobuf field: int64 remote_chan_reserve_sat = 7; - */ - remoteChanReserveSat: number; - /** - * The party that initiated opening the channel. - * - * @generated from protobuf field: lnrpc.Initiator initiator = 8; - */ - initiator: Initiator; - /** - * The commitment type used by this channel. - * - * @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: number; - /** - * 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 - */ -export interface PendingChannelsResponse_PendingOpenChannel { - /** - * The pending channel - * - * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; - */ - channel?: PendingChannelsResponse_PendingChannel; - /** - * - * The amount calculated to be paid in fees for the current set of - * commitment transactions. The fee amount is persisted with the channel - * in order to allow the fee amount to be removed and recalculated with - * each channel state update, including updates that happen after a system - * restart. - * - * @generated from protobuf field: int64 commit_fee = 4; - */ - commitFee: number; - /** - * The weight of the commitment transaction - * - * @generated from protobuf field: int64 commit_weight = 5; - */ - commitWeight: number; - /** - * - * The required number of satoshis per kilo-weight that the requester will - * pay at all times, for both the funding transaction and commitment - * transaction. This value can later be updated once the channel is open. - * - * @generated from protobuf field: int64 fee_per_kw = 6; - */ - feePerKw: number; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse.WaitingCloseChannel - */ -export interface PendingChannelsResponse_WaitingCloseChannel { - /** - * The pending channel waiting for closing tx to confirm - * - * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; - */ - channel?: PendingChannelsResponse_PendingChannel; - /** - * The balance in satoshis encumbered in this channel - * - * @generated from protobuf field: int64 limbo_balance = 2; - */ - limboBalance: number; - /** - * - * A list of valid commitment transactions. Any of these can confirm at - * this point. - * - * @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 - */ -export interface PendingChannelsResponse_Commitments { - /** - * Hash of the local version of the commitment tx. - * - * @generated from protobuf field: string local_txid = 1; - */ - localTxid: string; - /** - * Hash of the remote version of the commitment tx. - * - * @generated from protobuf field: string remote_txid = 2; - */ - remoteTxid: string; - /** - * Hash of the remote pending version of the commitment tx. - * - * @generated from protobuf field: string remote_pending_txid = 3; - */ - remotePendingTxid: string; - /** - * - * The amount in satoshis calculated to be paid in fees for the local - * commitment. - * - * @generated from protobuf field: uint64 local_commit_fee_sat = 4; - */ - localCommitFeeSat: number; - /** - * - * The amount in satoshis calculated to be paid in fees for the remote - * commitment. - * - * @generated from protobuf field: uint64 remote_commit_fee_sat = 5; - */ - remoteCommitFeeSat: number; - /** - * - * The amount in satoshis calculated to be paid in fees for the remote - * pending commitment. - * - * @generated from protobuf field: uint64 remote_pending_commit_fee_sat = 6; - */ - remotePendingCommitFeeSat: number; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse.ClosedChannel - */ -export interface PendingChannelsResponse_ClosedChannel { - /** - * The pending channel to be closed - * - * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; - */ - channel?: PendingChannelsResponse_PendingChannel; - /** - * The transaction id of the closing transaction - * - * @generated from protobuf field: string closing_txid = 2; - */ - closingTxid: string; -} -/** - * @generated from protobuf message lnrpc.PendingChannelsResponse.ForceClosedChannel - */ -export interface PendingChannelsResponse_ForceClosedChannel { - /** - * The pending channel to be force closed - * - * @generated from protobuf field: lnrpc.PendingChannelsResponse.PendingChannel channel = 1; - */ - channel?: PendingChannelsResponse_PendingChannel; - /** - * The transaction id of the closing transaction - * - * @generated from protobuf field: string closing_txid = 2; - */ - closingTxid: string; - /** - * The balance in satoshis encumbered in this pending channel - * - * @generated from protobuf field: int64 limbo_balance = 3; - */ - limboBalance: number; - /** - * The height at which funds can be swept into the wallet - * - * @generated from protobuf field: uint32 maturity_height = 4; - */ - maturityHeight: number; - /** - * - * Remaining # of blocks until the commitment output can be swept. - * Negative values indicate how many blocks have passed since becoming - * mature. - * - * @generated from protobuf field: int32 blocks_til_maturity = 5; - */ - blocksTilMaturity: number; - /** - * The total value of funds successfully recovered from this channel - * - * @generated from protobuf field: int64 recovered_balance = 6; - */ - recoveredBalance: number; - /** - * @generated from protobuf field: repeated lnrpc.PendingHTLC pending_htlcs = 8; - */ - pendingHtlcs: PendingHTLC[]; - /** - * @generated from protobuf field: lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState anchor = 9; - */ - 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 declare 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 -} -/** - * @generated from protobuf message lnrpc.ChannelEventSubscription - */ -export interface ChannelEventSubscription { -} -/** - * @generated from protobuf message lnrpc.ChannelEventUpdate - */ -export interface ChannelEventUpdate { - /** - * @generated from protobuf oneof: channel - */ - channel: { - oneofKind: "openChannel"; - /** - * @generated from protobuf field: lnrpc.Channel open_channel = 1; - */ - openChannel: Channel; - } | { - oneofKind: "closedChannel"; - /** - * @generated from protobuf field: lnrpc.ChannelCloseSummary closed_channel = 2; - */ - closedChannel: ChannelCloseSummary; - } | { - oneofKind: "activeChannel"; - /** - * @generated from protobuf field: lnrpc.ChannelPoint active_channel = 3; - */ - activeChannel: ChannelPoint; - } | { - oneofKind: "inactiveChannel"; - /** - * @generated from protobuf field: lnrpc.ChannelPoint inactive_channel = 4; - */ - inactiveChannel: ChannelPoint; - } | { - oneofKind: "pendingOpenChannel"; - /** - * @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; - }; - /** - * @generated from protobuf field: lnrpc.ChannelEventUpdate.UpdateType type = 5; - */ - type: ChannelEventUpdate_UpdateType; -} -/** - * @generated from protobuf enum lnrpc.ChannelEventUpdate.UpdateType - */ -export declare enum ChannelEventUpdate_UpdateType { - /** - * @generated from protobuf enum value: OPEN_CHANNEL = 0; - */ - OPEN_CHANNEL = 0, - /** - * @generated from protobuf enum value: CLOSED_CHANNEL = 1; - */ - CLOSED_CHANNEL = 1, - /** - * @generated from protobuf enum value: ACTIVE_CHANNEL = 2; - */ - ACTIVE_CHANNEL = 2, - /** - * @generated from protobuf enum value: INACTIVE_CHANNEL = 3; - */ - INACTIVE_CHANNEL = 3, - /** - * @generated from protobuf enum value: 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 - */ -export interface WalletAccountBalance { - /** - * The confirmed balance of the account (with >= 1 confirmations). - * - * @generated from protobuf field: int64 confirmed_balance = 1; - */ - confirmedBalance: number; - /** - * The unconfirmed balance of the account (with 0 confirmations). - * - * @generated from protobuf field: int64 unconfirmed_balance = 2; - */ - unconfirmedBalance: number; -} -/** - * @generated from protobuf message lnrpc.WalletBalanceRequest - */ -export interface WalletBalanceRequest { -} -/** - * @generated from protobuf message lnrpc.WalletBalanceResponse - */ -export interface WalletBalanceResponse { - /** - * The balance of the wallet - * - * @generated from protobuf field: int64 total_balance = 1; - */ - totalBalance: number; - /** - * The confirmed balance of a wallet(with >= 1 confirmations) - * - * @generated from protobuf field: int64 confirmed_balance = 2; - */ - confirmedBalance: number; - /** - * The unconfirmed balance of a wallet(with 0 confirmations) - * - * @generated from protobuf field: int64 unconfirmed_balance = 3; - */ - unconfirmedBalance: number; - /** - * The total amount of wallet UTXOs held in outputs that are locked for - * other usage. - * - * @generated from protobuf field: int64 locked_balance = 5; - */ - lockedBalance: number; - /** - * The amount of reserve required. - * - * @generated from protobuf field: int64 reserved_balance_anchor_chan = 6; - */ - reservedBalanceAnchorChan: number; - /** - * A mapping of each wallet account's name to its balance. - * - * @generated from protobuf field: map account_balance = 4; - */ - accountBalance: { - [key: string]: WalletAccountBalance; - }; -} -/** - * @generated from protobuf message lnrpc.Amount - */ -export interface Amount { - /** - * Value denominated in satoshis. - * - * @generated from protobuf field: uint64 sat = 1; - */ - sat: number; - /** - * Value denominated in milli-satoshis. - * - * @generated from protobuf field: uint64 msat = 2; - */ - msat: number; -} -/** - * @generated from protobuf message lnrpc.ChannelBalanceRequest - */ -export interface ChannelBalanceRequest { -} -/** - * @generated from protobuf message lnrpc.ChannelBalanceResponse - */ -export interface ChannelBalanceResponse { - /** - * Deprecated. Sum of channels balances denominated in satoshis - * - * @deprecated - * @generated from protobuf field: int64 balance = 1 [deprecated = true]; - */ - balance: number; - /** - * Deprecated. Sum of channels pending balances denominated in satoshis - * - * @deprecated - * @generated from protobuf field: int64 pending_open_balance = 2 [deprecated = true]; - */ - pendingOpenBalance: number; - /** - * Sum of channels local balances. - * - * @generated from protobuf field: lnrpc.Amount local_balance = 3; - */ - localBalance?: Amount; - /** - * Sum of channels remote balances. - * - * @generated from protobuf field: lnrpc.Amount remote_balance = 4; - */ - remoteBalance?: Amount; - /** - * Sum of channels local unsettled balances. - * - * @generated from protobuf field: lnrpc.Amount unsettled_local_balance = 5; - */ - unsettledLocalBalance?: Amount; - /** - * Sum of channels remote unsettled balances. - * - * @generated from protobuf field: lnrpc.Amount unsettled_remote_balance = 6; - */ - unsettledRemoteBalance?: Amount; - /** - * Sum of channels pending local balances. - * - * @generated from protobuf field: lnrpc.Amount pending_open_local_balance = 7; - */ - pendingOpenLocalBalance?: Amount; - /** - * Sum of channels pending remote balances. - * - * @generated from protobuf field: lnrpc.Amount pending_open_remote_balance = 8; - */ - pendingOpenRemoteBalance?: Amount; -} -/** - * @generated from protobuf message lnrpc.QueryRoutesRequest - */ -export interface QueryRoutesRequest { - /** - * The 33-byte hex-encoded public key for the payment destination - * - * @generated from protobuf field: string pub_key = 1; - */ - pubKey: string; - /** - * - * The amount to send expressed in satoshis. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt = 2; - */ - amt: number; - /** - * - * The amount to send expressed in millisatoshis. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt_msat = 12; - */ - amtMsat: number; - /** - * - * An optional CLTV delta from the current height that should be used for the - * timelock of the final hop. Note that unlike SendPayment, QueryRoutes does - * not add any additional block padding on top of final_ctlv_delta. This - * padding of a few blocks needs to be added manually or otherwise failures may - * happen when a block comes in while the payment is in flight. - * - * @generated from protobuf field: int32 final_cltv_delta = 4; - */ - finalCltvDelta: number; - /** - * - * 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. 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; - */ - feeLimit?: FeeLimit; - /** - * - * A list of nodes to ignore during path finding. When using REST, these fields - * must be encoded as base64. - * - * @generated from protobuf field: repeated bytes ignored_nodes = 6; - */ - ignoredNodes: Uint8Array[]; - /** - * - * Deprecated. A list of edges to ignore during path finding. - * - * @deprecated - * @generated from protobuf field: repeated lnrpc.EdgeLocator ignored_edges = 7 [deprecated = true]; - */ - ignoredEdges: EdgeLocator[]; - /** - * - * The source node where the request route should originated from. If empty, - * self is assumed. - * - * @generated from protobuf field: string source_pub_key = 8; - */ - sourcePubKey: string; - /** - * - * If set to true, edge probabilities from mission control will be used to get - * the optimal route. - * - * @generated from protobuf field: bool use_mission_control = 9; - */ - useMissionControl: boolean; - /** - * - * A list of directed node pairs that will be ignored during path finding. - * - * @generated from protobuf field: repeated lnrpc.NodePair ignored_pairs = 10; - */ - ignoredPairs: NodePair[]; - /** - * - * An optional maximum total time lock for the route. If the source is empty or - * ourselves, this should not exceed lnd's `--max-cltv-expiry` setting. If - * zero, then the value of `--max-cltv-expiry` is used as the limit. - * - * @generated from protobuf field: uint32 cltv_limit = 11; - */ - cltvLimit: number; - /** - * - * 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 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. - * - * @generated from protobuf field: map dest_custom_records = 13; - */ - destCustomRecords: { - [key: string]: Uint8Array; - }; - /** - * - * The channel id of the channel that must be taken to the first hop. If zero, - * any channel may be used. - * - * @generated from protobuf field: uint64 outgoing_chan_id = 14 [jstype = JS_STRING]; - */ - outgoingChanId: string; - /** - * - * The pubkey of the last hop of the route. If empty, any hop may be used. - * - * @generated from protobuf field: bytes last_hop_pubkey = 15; - */ - lastHopPubkey: Uint8Array; - /** - * - * Optional route hints to reach the destination through private channels. - * - * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 16; - */ - routeHints: RouteHint[]; - /** - * - * Features assumed to be supported by the final node. All transitive feature - * dependencies must also be set properly. For a given feature bit pair, either - * optional or remote may be set, but not both. If this field is nil or empty, - * the router will try to load destination features from the graph as a - * fallback. - * - * @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 - */ -export interface NodePair { - /** - * - * The sending node of the pair. When using REST, this field must be encoded as - * base64. - * - * @generated from protobuf field: bytes from = 1; - */ - from: Uint8Array; - /** - * - * The receiving node of the pair. When using REST, this field must be encoded - * as base64. - * - * @generated from protobuf field: bytes to = 2; - */ - to: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.EdgeLocator - */ -export interface EdgeLocator { - /** - * The short channel id of this edge. - * - * @generated from protobuf field: uint64 channel_id = 1 [jstype = JS_STRING]; - */ - channelId: string; - /** - * - * The direction of this edge. If direction_reverse is false, the direction - * of this edge is from the channel endpoint with the lexicographically smaller - * pub key to the endpoint with the larger pub key. If direction_reverse is - * is true, the edge goes the other way. - * - * @generated from protobuf field: bool direction_reverse = 2; - */ - directionReverse: boolean; -} -/** - * @generated from protobuf message lnrpc.QueryRoutesResponse - */ -export interface QueryRoutesResponse { - /** - * - * The route that results from the path finding operation. This is still a - * repeated field to retain backwards compatibility. - * - * @generated from protobuf field: repeated lnrpc.Route routes = 1; - */ - routes: Route[]; - /** - * - * The success probability of the returned route based on the current mission - * control state. [EXPERIMENTAL] - * - * @generated from protobuf field: double success_prob = 2; - */ - successProb: number; -} -/** - * @generated from protobuf message lnrpc.Hop - */ -export interface Hop { - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; - */ - chanId: string; - /** - * @deprecated - * @generated from protobuf field: int64 chan_capacity = 2 [deprecated = true]; - */ - chanCapacity: number; - /** - * @deprecated - * @generated from protobuf field: int64 amt_to_forward = 3 [deprecated = true]; - */ - amtToForward: number; - /** - * @deprecated - * @generated from protobuf field: int64 fee = 4 [deprecated = true]; - */ - fee: number; - /** - * @generated from protobuf field: uint32 expiry = 5; - */ - expiry: number; - /** - * @generated from protobuf field: int64 amt_to_forward_msat = 6; - */ - amtToForwardMsat: number; - /** - * @generated from protobuf field: int64 fee_msat = 7; - */ - feeMsat: number; - /** - * - * An optional public key of the hop. If the public key is given, the payment - * can be executed without relying on a copy of the channel graph. - * - * @generated from protobuf field: string pub_key = 8; - */ - pubKey: string; - /** - * - * If set to true, then this hop will be encoded using the new variable length - * 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. - * - * @deprecated - * @generated from protobuf field: bool tlv_payload = 9 [deprecated = true]; - */ - tlvPayload: boolean; - /** - * - * An optional TLV record that signals the use of an MPP payment. If present, - * the receiver will enforce that the same mpp_record is included in the final - * hop payload of all non-zero payments in the HTLC set. If empty, a regular - * single-shot payment is or was attempted. - * - * @generated from protobuf field: lnrpc.MPPRecord mpp_record = 10; - */ - mppRecord?: MPPRecord; - /** - * - * An optional TLV record that signals the use of an AMP payment. If present, - * the receiver will treat all received payments including the same - * (payment_addr, set_id) pair as being part of one logical payment. The - * payment will be settled by XORing the root_share's together and deriving the - * child hashes and preimages according to BOLT XX. Must be used in conjunction - * with mpp_record. - * - * @generated from protobuf field: lnrpc.AMPRecord amp_record = 12; - */ - ampRecord?: AMPRecord; - /** - * - * An optional set of key-value TLV records. This is useful within the context - * of the SendToRoute call as it allows callers to specify arbitrary K-V pairs - * to drop off at each hop within the onion. - * - * @generated from protobuf field: map custom_records = 11; - */ - 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 - */ -export interface MPPRecord { - /** - * - * A unique, random identifier used to authenticate the sender as the intended - * payer of a multi-path payment. The payment_addr must be the same for all - * subpayments, and match the payment_addr provided in the receiver's invoice. - * The same payment_addr must be used on all subpayments. - * - * @generated from protobuf field: bytes payment_addr = 11; - */ - paymentAddr: Uint8Array; - /** - * - * The total amount in milli-satoshis being sent as part of a larger multi-path - * payment. The caller is responsible for ensuring subpayments to the same node - * and payment_hash sum exactly to total_amt_msat. The same - * total_amt_msat must be used on all subpayments. - * - * @generated from protobuf field: int64 total_amt_msat = 10; - */ - totalAmtMsat: number; -} -/** - * @generated from protobuf message lnrpc.AMPRecord - */ -export interface AMPRecord { - /** - * @generated from protobuf field: bytes root_share = 1; - */ - rootShare: Uint8Array; - /** - * @generated from protobuf field: bytes set_id = 2; - */ - setId: Uint8Array; - /** - * @generated from protobuf field: uint32 child_index = 3; - */ - childIndex: number; -} -/** - * - * A path through the channel graph which runs over one or more channels in - * succession. This struct carries all the information required to craft the - * Sphinx onion packet, and send the payment along the first hop in the path. A - * route is only selected as valid if all the channels have sufficient capacity to - * carry the initial payment amount after fees are accounted for. - * - * @generated from protobuf message lnrpc.Route - */ -export interface Route { - /** - * - * The cumulative (final) time lock across the entire route. This is the CLTV - * value that should be extended to the first hop in the route. All other hops - * will decrement the time-lock as advertised, leaving enough time for all - * hops to wait for or present the payment preimage to complete the payment. - * - * @generated from protobuf field: uint32 total_time_lock = 1; - */ - totalTimeLock: number; - /** - * - * The sum of the fees paid at each hop within the final route. In the case - * of a one-hop payment, this value will be zero as we don't need to pay a fee - * to ourselves. - * - * @deprecated - * @generated from protobuf field: int64 total_fees = 2 [deprecated = true]; - */ - totalFees: number; - /** - * - * The total amount of funds required to complete a payment over this route. - * This value includes the cumulative fees at each hop. As a result, the HTLC - * extended to the first-hop in the route will need to have at least this many - * satoshis, otherwise the route will fail at an intermediate node due to an - * insufficient amount of fees. - * - * @deprecated - * @generated from protobuf field: int64 total_amt = 3 [deprecated = true]; - */ - totalAmt: number; - /** - * - * Contains details concerning the specific forwarding details at each hop. - * - * @generated from protobuf field: repeated lnrpc.Hop hops = 4; - */ - hops: Hop[]; - /** - * - * The total fees in millisatoshis. - * - * @generated from protobuf field: int64 total_fees_msat = 5; - */ - totalFeesMsat: number; - /** - * - * The total amount in millisatoshis. - * - * @generated from protobuf field: int64 total_amt_msat = 6; - */ - totalAmtMsat: number; -} -/** - * @generated from protobuf message lnrpc.NodeInfoRequest - */ -export interface NodeInfoRequest { - /** - * The 33-byte hex-encoded compressed public of the target node - * - * @generated from protobuf field: string pub_key = 1; - */ - pubKey: string; - /** - * If true, will include all known channels associated with the node. - * - * @generated from protobuf field: bool include_channels = 2; - */ - includeChannels: boolean; -} -/** - * @generated from protobuf message lnrpc.NodeInfo - */ -export interface NodeInfo { - /** - * - * An individual vertex/node within the channel graph. A node is - * connected to other nodes by one or more channel edges emanating from it. As - * the graph is directed, a node will also have an incoming edge attached to - * it for each outgoing edge. - * - * @generated from protobuf field: lnrpc.LightningNode node = 1; - */ - node?: LightningNode; - /** - * The total number of channels for the node. - * - * @generated from protobuf field: uint32 num_channels = 2; - */ - numChannels: number; - /** - * The sum of all channels capacity for the node, denominated in satoshis. - * - * @generated from protobuf field: int64 total_capacity = 3; - */ - totalCapacity: number; - /** - * A list of all public channels for the node. - * - * @generated from protobuf field: repeated lnrpc.ChannelEdge channels = 4; - */ - channels: ChannelEdge[]; -} -/** - * - * An individual vertex/node within the channel graph. A node is - * connected to other nodes by one or more channel edges emanating from it. As the - * graph is directed, a node will also have an incoming edge attached to it for - * each outgoing edge. - * - * @generated from protobuf message lnrpc.LightningNode - */ -export interface LightningNode { - /** - * @generated from protobuf field: uint32 last_update = 1; - */ - lastUpdate: number; - /** - * @generated from protobuf field: string pub_key = 2; - */ - pubKey: string; - /** - * @generated from protobuf field: string alias = 3; - */ - alias: string; - /** - * @generated from protobuf field: repeated lnrpc.NodeAddress addresses = 4; - */ - addresses: NodeAddress[]; - /** - * @generated from protobuf field: string color = 5; - */ - color: string; - /** - * @generated from protobuf field: map features = 6; - */ - 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 - */ -export interface NodeAddress { - /** - * @generated from protobuf field: string network = 1; - */ - network: string; - /** - * @generated from protobuf field: string addr = 2; - */ - addr: string; -} -/** - * @generated from protobuf message lnrpc.RoutingPolicy - */ -export interface RoutingPolicy { - /** - * @generated from protobuf field: uint32 time_lock_delta = 1; - */ - timeLockDelta: number; - /** - * @generated from protobuf field: int64 min_htlc = 2; - */ - minHtlc: number; - /** - * @generated from protobuf field: int64 fee_base_msat = 3; - */ - feeBaseMsat: number; - /** - * @generated from protobuf field: int64 fee_rate_milli_msat = 4; - */ - feeRateMilliMsat: number; - /** - * @generated from protobuf field: bool disabled = 5; - */ - disabled: boolean; - /** - * @generated from protobuf field: uint64 max_htlc_msat = 6; - */ - maxHtlcMsat: number; - /** - * @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; - }; -} -/** - * - * A fully authenticated channel along with all its unique attributes. - * Once an authenticated channel announcement has been processed on the network, - * then an instance of ChannelEdgeInfo encapsulating the channels attributes is - * stored. The other portions relevant to routing policy of a channel are stored - * within a ChannelEdgePolicy for each direction of the channel. - * - * @generated from protobuf message lnrpc.ChannelEdge - */ -export interface ChannelEdge { - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 channel_id = 1 [jstype = JS_STRING]; - */ - channelId: string; - /** - * @generated from protobuf field: string chan_point = 2; - */ - chanPoint: string; - /** - * @deprecated - * @generated from protobuf field: uint32 last_update = 3 [deprecated = true]; - */ - lastUpdate: number; - /** - * @generated from protobuf field: string node1_pub = 4; - */ - node1Pub: string; - /** - * @generated from protobuf field: string node2_pub = 5; - */ - node2Pub: string; - /** - * @generated from protobuf field: int64 capacity = 6; - */ - capacity: number; - /** - * @generated from protobuf field: lnrpc.RoutingPolicy node1_policy = 7; - */ - node1Policy?: RoutingPolicy; - /** - * @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 - */ -export interface ChannelGraphRequest { - /** - * - * Whether unannounced channels are included in the response or not. If set, - * unannounced channels are included. Unannounced channels are both private - * channels, and public channels that are not yet announced to the network. - * - * @generated from protobuf field: bool include_unannounced = 1; - */ - includeUnannounced: boolean; -} -/** - * Returns a new instance of the directed channel graph. - * - * @generated from protobuf message lnrpc.ChannelGraph - */ -export interface ChannelGraph { - /** - * The list of `LightningNode`s in this channel graph - * - * @generated from protobuf field: repeated lnrpc.LightningNode nodes = 1; - */ - nodes: LightningNode[]; - /** - * The list of `ChannelEdge`s in this channel graph - * - * @generated from protobuf field: repeated lnrpc.ChannelEdge edges = 2; - */ - edges: ChannelEdge[]; -} -/** - * @generated from protobuf message lnrpc.NodeMetricsRequest - */ -export interface NodeMetricsRequest { - /** - * The requested node metrics. - * - * @generated from protobuf field: repeated lnrpc.NodeMetricType types = 1; - */ - types: NodeMetricType[]; -} -/** - * @generated from protobuf message lnrpc.NodeMetricsResponse - */ -export interface NodeMetricsResponse { - /** - * - * Betweenness centrality is the sum of the ratio of shortest paths that pass - * through the node for each pair of nodes in the graph (not counting paths - * starting or ending at this node). - * Map of node pubkey to betweenness centrality of the node. Normalized - * values are in the [0,1] closed interval. - * - * @generated from protobuf field: map betweenness_centrality = 1; - */ - betweennessCentrality: { - [key: string]: FloatMetric; - }; -} -/** - * @generated from protobuf message lnrpc.FloatMetric - */ -export interface FloatMetric { - /** - * Arbitrary float value. - * - * @generated from protobuf field: double value = 1; - */ - value: number; - /** - * The value normalized to [0,1] or [-1,1]. - * - * @generated from protobuf field: double normalized_value = 2; - */ - normalizedValue: number; -} -/** - * @generated from protobuf message lnrpc.ChanInfoRequest - */ -export interface ChanInfoRequest { - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; - */ - chanId: string; -} -/** - * @generated from protobuf message lnrpc.NetworkInfoRequest - */ -export interface NetworkInfoRequest { -} -/** - * @generated from protobuf message lnrpc.NetworkInfo - */ -export interface NetworkInfo { - /** - * @generated from protobuf field: uint32 graph_diameter = 1; - */ - graphDiameter: number; - /** - * @generated from protobuf field: double avg_out_degree = 2; - */ - avgOutDegree: number; - /** - * @generated from protobuf field: uint32 max_out_degree = 3; - */ - maxOutDegree: number; - /** - * @generated from protobuf field: uint32 num_nodes = 4; - */ - numNodes: number; - /** - * @generated from protobuf field: uint32 num_channels = 5; - */ - numChannels: number; - /** - * @generated from protobuf field: int64 total_network_capacity = 6; - */ - totalNetworkCapacity: number; - /** - * @generated from protobuf field: double avg_channel_size = 7; - */ - avgChannelSize: number; - /** - * @generated from protobuf field: int64 min_channel_size = 8; - */ - minChannelSize: number; - /** - * @generated from protobuf field: int64 max_channel_size = 9; - */ - maxChannelSize: number; - /** - * @generated from protobuf field: int64 median_channel_size_sat = 10; - */ - medianChannelSizeSat: number; - /** - * The number of edges marked as zombies. - * - * @generated from protobuf field: uint64 num_zombie_chans = 11; - */ - numZombieChans: number; -} -/** - * @generated from protobuf message lnrpc.StopRequest - */ -export interface StopRequest { -} -/** - * @generated from protobuf message lnrpc.StopResponse - */ -export interface StopResponse { -} -/** - * @generated from protobuf message lnrpc.GraphTopologySubscription - */ -export interface GraphTopologySubscription { -} -/** - * @generated from protobuf message lnrpc.GraphTopologyUpdate - */ -export interface GraphTopologyUpdate { - /** - * @generated from protobuf field: repeated lnrpc.NodeUpdate node_updates = 1; - */ - nodeUpdates: NodeUpdate[]; - /** - * @generated from protobuf field: repeated lnrpc.ChannelEdgeUpdate channel_updates = 2; - */ - channelUpdates: ChannelEdgeUpdate[]; - /** - * @generated from protobuf field: repeated lnrpc.ClosedChannelUpdate closed_chans = 3; - */ - closedChans: ClosedChannelUpdate[]; -} -/** - * @generated from protobuf message lnrpc.NodeUpdate - */ -export interface NodeUpdate { - /** - * - * Deprecated, use node_addresses. - * - * @deprecated - * @generated from protobuf field: repeated string addresses = 1 [deprecated = true]; - */ - addresses: string[]; - /** - * @generated from protobuf field: string identity_key = 2; - */ - identityKey: string; - /** - * - * Deprecated, use features. - * - * @deprecated - * @generated from protobuf field: bytes global_features = 3 [deprecated = true]; - */ - globalFeatures: Uint8Array; - /** - * @generated from protobuf field: string alias = 4; - */ - alias: string; - /** - * @generated from protobuf field: string color = 5; - */ - color: string; - /** - * @generated from protobuf field: repeated lnrpc.NodeAddress node_addresses = 7; - */ - nodeAddresses: NodeAddress[]; - /** - * - * Features that the node has advertised in the init message, node - * announcements and invoices. - * - * @generated from protobuf field: map features = 6; - */ - features: { - [key: number]: Feature; - }; -} -/** - * @generated from protobuf message lnrpc.ChannelEdgeUpdate - */ -export interface ChannelEdgeUpdate { - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; - */ - chanId: string; - /** - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 2; - */ - chanPoint?: ChannelPoint; - /** - * @generated from protobuf field: int64 capacity = 3; - */ - capacity: number; - /** - * @generated from protobuf field: lnrpc.RoutingPolicy routing_policy = 4; - */ - routingPolicy?: RoutingPolicy; - /** - * @generated from protobuf field: string advertising_node = 5; - */ - advertisingNode: string; - /** - * @generated from protobuf field: string connecting_node = 6; - */ - connectingNode: string; -} -/** - * @generated from protobuf message lnrpc.ClosedChannelUpdate - */ -export interface ClosedChannelUpdate { - /** - * - * The unique channel ID for the channel. The first 3 bytes are the block - * height, the next 3 the index within the block, and the last 2 bytes are the - * output index for the channel. - * - * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; - */ - chanId: string; - /** - * @generated from protobuf field: int64 capacity = 2; - */ - capacity: number; - /** - * @generated from protobuf field: uint32 closed_height = 3; - */ - closedHeight: number; - /** - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 4; - */ - chanPoint?: ChannelPoint; -} -/** - * @generated from protobuf message lnrpc.HopHint - */ -export interface HopHint { - /** - * The public key of the node at the start of the channel. - * - * @generated from protobuf field: string node_id = 1; - */ - nodeId: string; - /** - * The unique identifier of the channel. - * - * @generated from protobuf field: uint64 chan_id = 2 [jstype = JS_STRING]; - */ - chanId: string; - /** - * The base fee of the channel denominated in millisatoshis. - * - * @generated from protobuf field: uint32 fee_base_msat = 3; - */ - feeBaseMsat: number; - /** - * - * The fee rate of the channel for sending one satoshi across it denominated in - * millionths of a satoshi. - * - * @generated from protobuf field: uint32 fee_proportional_millionths = 4; - */ - feeProportionalMillionths: number; - /** - * The time-lock delta of the channel. - * - * @generated from protobuf field: uint32 cltv_expiry_delta = 5; - */ - 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 - */ -export interface RouteHint { - /** - * - * A list of hop hints that when chained together can assist in reaching a - * specific destination. - * - * @generated from protobuf field: repeated lnrpc.HopHint hop_hints = 1; - */ - 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: number; - /** - * The time this HTLC set was settled expressed in unix epoch. - * - * @generated from protobuf field: int64 settle_time = 3; - */ - settleTime: number; - /** - * The total amount paid for the sub-invoice expressed in milli satoshis. - * - * @generated from protobuf field: int64 amt_paid_msat = 5; - */ - amtPaidMsat: number; -} -/** - * @generated from protobuf message lnrpc.Invoice - */ -export interface Invoice { - /** - * - * An optional memo to attach along with the invoice. Used for record keeping - * purposes for the invoice's creator, and will also be set in the description - * field of the encoded payment request if the description_hash field is not - * being used. - * - * @generated from protobuf field: string memo = 1; - */ - memo: string; - /** - * - * The hex-encoded preimage (32 byte) which will allow settling an incoming - * HTLC payable to this preimage. When using REST, this field must be encoded - * as base64. - * - * @generated from protobuf field: bytes r_preimage = 3; - */ - rPreimage: Uint8Array; - /** - * - * 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; - */ - rHash: Uint8Array; - /** - * - * The value of this invoice in satoshis - * - * The fields value and value_msat are mutually exclusive. - * - * @generated from protobuf field: int64 value = 5; - */ - value: number; - /** - * - * The value of this invoice in millisatoshis - * - * The fields value and value_msat are mutually exclusive. - * - * @generated from protobuf field: int64 value_msat = 23; - */ - valueMsat: number; - /** - * - * 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. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: int64 creation_date = 7; - */ - creationDate: number; - /** - * - * When this invoice was settled. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: int64 settle_date = 8; - */ - settleDate: number; - /** - * - * 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; - */ - paymentRequest: string; - /** - * - * Hash (SHA-256) of a description of the payment. Used if the description of - * payment (memo) is too long to naturally fit within the description field - * of an encoded payment request. When using REST, this field must be encoded - * as base64. - * - * @generated from protobuf field: bytes description_hash = 10; - */ - descriptionHash: Uint8Array; - /** - * Payment request expiry time in seconds. Default is 3600 (1 hour). - * - * @generated from protobuf field: int64 expiry = 11; - */ - expiry: number; - /** - * Fallback on-chain address. - * - * @generated from protobuf field: string fallback_addr = 12; - */ - fallbackAddr: string; - /** - * Delta to use for the time-lock of the CLTV extended to the final hop. - * - * @generated from protobuf field: uint64 cltv_expiry = 13; - */ - cltvExpiry: number; - /** - * - * Route hints that can each be individually used to assist in reaching the - * invoice's destination. - * - * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 14; - */ - routeHints: RouteHint[]; - /** - * Whether this invoice should include routing hints for private channels. - * - * @generated from protobuf field: bool private = 15; - */ - private: boolean; - /** - * - * 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. - * Note: Output only, don't specify for creating an invoice. - * - * @generated from protobuf field: uint64 add_index = 16; - */ - addIndex: number; - /** - * - * 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: number; - /** - * Deprecated, use amt_paid_sat or amt_paid_msat. - * - * @deprecated - * @generated from protobuf field: int64 amt_paid = 18 [deprecated = true]; - */ - amtPaid: number; - /** - * - * The amount that was accepted for this invoice, in satoshis. This will ONLY - * be set if this invoice has been settled. We provide this field as if the - * invoice was created with a zero value, then we need to record what 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_sat = 19; - */ - amtPaidSat: number; - /** - * - * The amount that was accepted for this invoice, in millisatoshis. This will - * ONLY be set if this invoice has been settled. We provide this field as if - * the invoice was created with a zero value, then we need to record what - * 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: number; - /** - * - * 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; - */ - features: { - [key: number]: Feature; - }; - /** - * - * 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; - */ - isKeysend: boolean; - /** - * - * The payment address of this invoice. This value will be used in MPP - * 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; - */ - paymentAddr: Uint8Array; - /** - * - * Signals whether or not this is an AMP 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 - */ -export declare enum Invoice_InvoiceState { - /** - * @generated from protobuf enum value: OPEN = 0; - */ - OPEN = 0, - /** - * @generated from protobuf enum value: SETTLED = 1; - */ - SETTLED = 1, - /** - * @generated from protobuf enum value: CANCELED = 2; - */ - CANCELED = 2, - /** - * @generated from protobuf enum value: ACCEPTED = 3; - */ - ACCEPTED = 3 -} -/** - * Details of an HTLC that paid to an invoice - * - * @generated from protobuf message lnrpc.InvoiceHTLC - */ -export interface InvoiceHTLC { - /** - * Short channel id over which the htlc was received. - * - * @generated from protobuf field: uint64 chan_id = 1 [jstype = JS_STRING]; - */ - chanId: string; - /** - * Index identifying the htlc on the channel. - * - * @generated from protobuf field: uint64 htlc_index = 2; - */ - htlcIndex: number; - /** - * The amount of the htlc in msat. - * - * @generated from protobuf field: uint64 amt_msat = 3; - */ - amtMsat: number; - /** - * Block height at which this htlc was accepted. - * - * @generated from protobuf field: int32 accept_height = 4; - */ - acceptHeight: number; - /** - * Time at which this htlc was accepted. - * - * @generated from protobuf field: int64 accept_time = 5; - */ - acceptTime: number; - /** - * Time at which this htlc was settled or canceled. - * - * @generated from protobuf field: int64 resolve_time = 6; - */ - resolveTime: number; - /** - * Block height at which this htlc expires. - * - * @generated from protobuf field: int32 expiry_height = 7; - */ - expiryHeight: number; - /** - * Current state the htlc is in. - * - * @generated from protobuf field: lnrpc.InvoiceHTLCState state = 8; - */ - state: InvoiceHTLCState; - /** - * Custom tlv records. - * - * @generated from protobuf field: map custom_records = 9; - */ - customRecords: { - [key: string]: Uint8Array; - }; - /** - * The total amount of the mpp payment in msat. - * - * @generated from protobuf field: uint64 mpp_total_amt_msat = 10; - */ - mppTotalAmtMsat: number; - /** - * Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. - * - * @generated from protobuf field: lnrpc.AMP amp = 11; - */ - amp?: AMP; -} -/** - * Details specific to AMP HTLCs. - * - * @generated from protobuf message lnrpc.AMP - */ -export interface AMP { - /** - * An n-of-n secret share of the root seed from which child payment hashes - * and preimages are derived. - * - * @generated from protobuf field: bytes root_share = 1; - */ - rootShare: Uint8Array; - /** - * An identifier for the HTLC set that this HTLC belongs to. - * - * @generated from protobuf field: bytes set_id = 2; - */ - setId: Uint8Array; - /** - * A nonce used to randomize the child preimage and child hash from a given - * root_share. - * - * @generated from protobuf field: uint32 child_index = 3; - */ - childIndex: number; - /** - * The payment hash of the AMP HTLC. - * - * @generated from protobuf field: bytes hash = 4; - */ - hash: Uint8Array; - /** - * The preimage used to settle this AMP htlc. This field will only be - * populated if the invoice is in InvoiceState_ACCEPTED or - * InvoiceState_SETTLED. - * - * @generated from protobuf field: bytes preimage = 5; - */ - preimage: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.AddInvoiceResponse - */ -export interface AddInvoiceResponse { - /** - * @generated from protobuf field: bytes r_hash = 1; - */ - rHash: Uint8Array; - /** - * - * 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 = 2; - */ - 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 = 16; - */ - addIndex: number; - /** - * - * 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 = 17; - */ - paymentAddr: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.PaymentHash - */ -export interface PaymentHash { - /** - * - * The hex-encoded payment hash of the invoice to be looked up. The passed - * payment hash must be exactly 32 bytes, otherwise an error is returned. - * Deprecated now that the REST gateway supports base64 encoding of bytes - * fields. - * - * @deprecated - * @generated from protobuf field: string r_hash_str = 1 [deprecated = true]; - */ - rHashStr: string; - /** - * - * The payment hash of the invoice to be looked up. When using REST, this field - * must be encoded as base64. - * - * @generated from protobuf field: bytes r_hash = 2; - */ - rHash: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.ListInvoiceRequest - */ -export interface ListInvoiceRequest { - /** - * - * If set, only invoices that are not settled and not canceled will be returned - * in the response. - * - * @generated from protobuf field: bool pending_only = 1; - */ - pendingOnly: boolean; - /** - * - * The index of an invoice that will be used as either the start or end of a - * query to determine which invoices should be returned in the response. - * - * @generated from protobuf field: uint64 index_offset = 4; - */ - indexOffset: number; - /** - * The max number of invoices to return in the response to this query. - * - * @generated from protobuf field: uint64 num_max_invoices = 5; - */ - numMaxInvoices: number; - /** - * - * If set, the invoices returned will result from seeking backwards from the - * specified index offset. This can be used to paginate backwards. - * - * @generated from protobuf field: bool reversed = 6; - */ - reversed: boolean; -} -/** - * @generated from protobuf message lnrpc.ListInvoiceResponse - */ -export interface ListInvoiceResponse { - /** - * - * A list of invoices from the time slice of the time series specified in the - * request. - * - * @generated from protobuf field: repeated lnrpc.Invoice invoices = 1; - */ - invoices: Invoice[]; - /** - * - * The index of the last item in the set of returned invoices. This can be used - * to seek further, pagination style. - * - * @generated from protobuf field: uint64 last_index_offset = 2; - */ - lastIndexOffset: number; - /** - * - * The index of the last item in the set of returned invoices. This can be used - * to seek backwards, pagination style. - * - * @generated from protobuf field: uint64 first_index_offset = 3; - */ - firstIndexOffset: number; -} -/** - * @generated from protobuf message lnrpc.InvoiceSubscription - */ -export interface InvoiceSubscription { - /** - * - * If specified (non-zero), then we'll first start by sending out - * notifications for all added indexes with an add_index greater than this - * value. This allows callers to catch up on any events they missed while they - * weren't connected to the streaming RPC. - * - * @generated from protobuf field: uint64 add_index = 1; - */ - addIndex: number; - /** - * - * If specified (non-zero), then we'll first start by sending out - * notifications for all settled indexes with an settle_index greater than - * this value. This allows callers to catch up on any events they missed while - * they weren't connected to the streaming RPC. - * - * @generated from protobuf field: uint64 settle_index = 2; - */ - settleIndex: number; -} -/** - * @generated from protobuf message lnrpc.Payment - */ -export interface Payment { - /** - * The payment hash - * - * @generated from protobuf field: string payment_hash = 1; - */ - paymentHash: string; - /** - * Deprecated, use value_sat or value_msat. - * - * @deprecated - * @generated from protobuf field: int64 value = 2 [deprecated = true]; - */ - value: number; - /** - * Deprecated, use creation_time_ns - * - * @deprecated - * @generated from protobuf field: int64 creation_date = 3 [deprecated = true]; - */ - creationDate: number; - /** - * Deprecated, use fee_sat or fee_msat. - * - * @deprecated - * @generated from protobuf field: int64 fee = 5 [deprecated = true]; - */ - fee: number; - /** - * The payment preimage - * - * @generated from protobuf field: string payment_preimage = 6; - */ - paymentPreimage: string; - /** - * The value of the payment in satoshis - * - * @generated from protobuf field: int64 value_sat = 7; - */ - valueSat: number; - /** - * The value of the payment in milli-satoshis - * - * @generated from protobuf field: int64 value_msat = 8; - */ - valueMsat: number; - /** - * The optional payment request being fulfilled. - * - * @generated from protobuf field: string payment_request = 9; - */ - paymentRequest: string; - /** - * The status of the payment. - * - * @generated from protobuf field: lnrpc.Payment.PaymentStatus status = 10; - */ - status: Payment_PaymentStatus; - /** - * The fee paid for this payment in satoshis - * - * @generated from protobuf field: int64 fee_sat = 11; - */ - feeSat: number; - /** - * The fee paid for this payment in milli-satoshis - * - * @generated from protobuf field: int64 fee_msat = 12; - */ - feeMsat: number; - /** - * The time in UNIX nanoseconds at which the payment was created. - * - * @generated from protobuf field: int64 creation_time_ns = 13; - */ - creationTimeNs: number; - /** - * The HTLCs made in attempt to settle the payment. - * - * @generated from protobuf field: repeated lnrpc.HTLCAttempt htlcs = 14; - */ - htlcs: HTLCAttempt[]; - /** - * - * The creation index of this payment. Each payment can be uniquely identified - * by this index, which may not strictly increment by 1 for payments made in - * older versions of lnd. - * - * @generated from protobuf field: uint64 payment_index = 15; - */ - paymentIndex: number; - /** - * @generated from protobuf field: lnrpc.PaymentFailureReason failure_reason = 16; - */ - failureReason: PaymentFailureReason; -} -/** - * @generated from protobuf enum lnrpc.Payment.PaymentStatus - */ -export declare enum Payment_PaymentStatus { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: IN_FLIGHT = 1; - */ - IN_FLIGHT = 1, - /** - * @generated from protobuf enum value: SUCCEEDED = 2; - */ - SUCCEEDED = 2, - /** - * @generated from protobuf enum value: FAILED = 3; - */ - FAILED = 3 -} -/** - * @generated from protobuf message lnrpc.HTLCAttempt - */ -export interface HTLCAttempt { - /** - * The unique ID that is used for this attempt. - * - * @generated from protobuf field: uint64 attempt_id = 7; - */ - attemptId: number; - /** - * The status of the HTLC. - * - * @generated from protobuf field: lnrpc.HTLCAttempt.HTLCStatus status = 1; - */ - status: HTLCAttempt_HTLCStatus; - /** - * The route taken by this HTLC. - * - * @generated from protobuf field: lnrpc.Route route = 2; - */ - route?: Route; - /** - * The time in UNIX nanoseconds at which this HTLC was sent. - * - * @generated from protobuf field: int64 attempt_time_ns = 3; - */ - attemptTimeNs: number; - /** - * - * The time in UNIX nanoseconds at which this HTLC was settled or failed. - * This value will not be set if the HTLC is still IN_FLIGHT. - * - * @generated from protobuf field: int64 resolve_time_ns = 4; - */ - resolveTimeNs: number; - /** - * Detailed htlc failure info. - * - * @generated from protobuf field: lnrpc.Failure failure = 5; - */ - failure?: Failure; - /** - * The preimage that was used to settle the HTLC. - * - * @generated from protobuf field: bytes preimage = 6; - */ - preimage: Uint8Array; -} -/** - * @generated from protobuf enum lnrpc.HTLCAttempt.HTLCStatus - */ -export declare enum HTLCAttempt_HTLCStatus { - /** - * @generated from protobuf enum value: IN_FLIGHT = 0; - */ - IN_FLIGHT = 0, - /** - * @generated from protobuf enum value: SUCCEEDED = 1; - */ - SUCCEEDED = 1, - /** - * @generated from protobuf enum value: FAILED = 2; - */ - FAILED = 2 -} -/** - * @generated from protobuf message lnrpc.ListPaymentsRequest - */ -export interface ListPaymentsRequest { - /** - * - * If true, then return payments that have not yet fully completed. This means - * that pending payments, as well as failed payments will show up if this - * field is set to true. This flag doesn't change the meaning of the indices, - * which are tied to individual payments. - * - * @generated from protobuf field: bool include_incomplete = 1; - */ - includeIncomplete: boolean; - /** - * - * The index of a payment that will be used as either the start or end of a - * query to determine which payments should be returned in the response. The - * index_offset is exclusive. In the case of a zero index_offset, the query - * will start with the oldest payment when paginating forwards, or will end - * with the most recent payment when paginating backwards. - * - * @generated from protobuf field: uint64 index_offset = 2; - */ - indexOffset: number; - /** - * The maximal number of payments returned in the response to this query. - * - * @generated from protobuf field: uint64 max_payments = 3; - */ - maxPayments: number; - /** - * - * If set, the payments returned will result from seeking backwards from the - * specified index offset. This can be used to paginate backwards. The order - * of the returned payments is always oldest first (ascending index order). - * - * @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 - */ -export interface ListPaymentsResponse { - /** - * The list of payments - * - * @generated from protobuf field: repeated lnrpc.Payment payments = 1; - */ - payments: Payment[]; - /** - * - * The index of the first item in the set of returned payments. This can be - * used as the index_offset to continue seeking backwards in the next request. - * - * @generated from protobuf field: uint64 first_index_offset = 2; - */ - firstIndexOffset: number; - /** - * - * The index of the last item in the set of returned payments. This can be used - * as the index_offset to continue seeking forwards in the next request. - * - * @generated from protobuf field: uint64 last_index_offset = 3; - */ - lastIndexOffset: number; - /** - * - * 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: number; -} -/** - * @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 - */ -export interface DeleteAllPaymentsRequest { - /** - * Only delete failed payments. - * - * @generated from protobuf field: bool failed_payments_only = 1; - */ - failedPaymentsOnly: boolean; - /** - * - * Only delete failed HTLCs from payments, not the payment itself. - * - * @generated from protobuf field: bool failed_htlcs_only = 2; - */ - failedHtlcsOnly: boolean; -} -/** - * @generated from protobuf message lnrpc.DeletePaymentResponse - */ -export interface DeletePaymentResponse { -} -/** - * @generated from protobuf message lnrpc.DeleteAllPaymentsResponse - */ -export interface DeleteAllPaymentsResponse { -} -/** - * @generated from protobuf message lnrpc.AbandonChannelRequest - */ -export interface AbandonChannelRequest { - /** - * @generated from protobuf field: lnrpc.ChannelPoint channel_point = 1; - */ - channelPoint?: ChannelPoint; - /** - * @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 - */ -export interface AbandonChannelResponse { -} -/** - * @generated from protobuf message lnrpc.DebugLevelRequest - */ -export interface DebugLevelRequest { - /** - * @generated from protobuf field: bool show = 1; - */ - show: boolean; - /** - * @generated from protobuf field: string level_spec = 2; - */ - levelSpec: string; -} -/** - * @generated from protobuf message lnrpc.DebugLevelResponse - */ -export interface DebugLevelResponse { - /** - * @generated from protobuf field: string sub_systems = 1; - */ - subSystems: string; -} -/** - * @generated from protobuf message lnrpc.PayReqString - */ -export interface PayReqString { - /** - * The payment request string to be decoded - * - * @generated from protobuf field: string pay_req = 1; - */ - payReq: string; -} -/** - * @generated from protobuf message lnrpc.PayReq - */ -export interface PayReq { - /** - * @generated from protobuf field: string destination = 1; - */ - destination: string; - /** - * @generated from protobuf field: string payment_hash = 2; - */ - paymentHash: string; - /** - * @generated from protobuf field: int64 num_satoshis = 3; - */ - numSatoshis: number; - /** - * @generated from protobuf field: int64 timestamp = 4; - */ - timestamp: number; - /** - * @generated from protobuf field: int64 expiry = 5; - */ - expiry: number; - /** - * @generated from protobuf field: string description = 6; - */ - description: string; - /** - * @generated from protobuf field: string description_hash = 7; - */ - descriptionHash: string; - /** - * @generated from protobuf field: string fallback_addr = 8; - */ - fallbackAddr: string; - /** - * @generated from protobuf field: int64 cltv_expiry = 9; - */ - cltvExpiry: number; - /** - * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 10; - */ - routeHints: RouteHint[]; - /** - * @generated from protobuf field: bytes payment_addr = 11; - */ - paymentAddr: Uint8Array; - /** - * @generated from protobuf field: int64 num_msat = 12; - */ - numMsat: number; - /** - * @generated from protobuf field: map features = 13; - */ - features: { - [key: number]: Feature; - }; -} -/** - * @generated from protobuf message lnrpc.Feature - */ -export interface Feature { - /** - * @generated from protobuf field: string name = 2; - */ - name: string; - /** - * @generated from protobuf field: bool is_required = 3; - */ - isRequired: boolean; - /** - * @generated from protobuf field: bool is_known = 4; - */ - isKnown: boolean; -} -/** - * @generated from protobuf message lnrpc.FeeReportRequest - */ -export interface FeeReportRequest { -} -/** - * @generated from protobuf message lnrpc.ChannelFeeReport - */ -export interface ChannelFeeReport { - /** - * The short channel id that this fee report belongs to. - * - * @generated from protobuf field: uint64 chan_id = 5 [jstype = JS_STRING]; - */ - chanId: string; - /** - * The channel that this fee report belongs to. - * - * @generated from protobuf field: string channel_point = 1; - */ - channelPoint: string; - /** - * The base fee charged regardless of the number of milli-satoshis sent. - * - * @generated from protobuf field: int64 base_fee_msat = 2; - */ - baseFeeMsat: number; - /** - * The amount charged per milli-satoshis transferred expressed in - * millionths of a satoshi. - * - * @generated from protobuf field: int64 fee_per_mil = 3; - */ - feePerMil: number; - /** - * The effective fee rate in milli-satoshis. Computed by dividing the - * fee_per_mil value by 1 million. - * - * @generated from protobuf field: double fee_rate = 4; - */ - feeRate: number; -} -/** - * @generated from protobuf message lnrpc.FeeReportResponse - */ -export interface FeeReportResponse { - /** - * An array of channel fee reports which describes the current fee schedule - * for each channel. - * - * @generated from protobuf field: repeated lnrpc.ChannelFeeReport channel_fees = 1; - */ - channelFees: ChannelFeeReport[]; - /** - * The total amount of fee revenue (in satoshis) the switch has collected - * over the past 24 hrs. - * - * @generated from protobuf field: uint64 day_fee_sum = 2; - */ - dayFeeSum: number; - /** - * 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: number; - /** - * 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: number; -} -/** - * @generated from protobuf message lnrpc.PolicyUpdateRequest - */ -export interface PolicyUpdateRequest { - /** - * @generated from protobuf oneof: scope - */ - scope: { - oneofKind: "global"; - /** - * If set, then this update applies to all currently active channels. - * - * @generated from protobuf field: bool global = 1; - */ - global: boolean; - } | { - oneofKind: "chanPoint"; - /** - * If set, this update will target a specific channel. - * - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 2; - */ - chanPoint: ChannelPoint; - } | { - oneofKind: undefined; - }; - /** - * The base fee charged regardless of the number of milli-satoshis sent. - * - * @generated from protobuf field: int64 base_fee_msat = 3; - */ - baseFeeMsat: number; - /** - * The effective fee rate in milli-satoshis. The precision of this value - * goes up to 6 decimal places, so 1e-6. - * - * @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. - * - * @generated from protobuf field: uint32 time_lock_delta = 5; - */ - timeLockDelta: number; - /** - * If set, the maximum HTLC size in milli-satoshis. If unset, the maximum - * HTLC will be unchanged. - * - * @generated from protobuf field: uint64 max_htlc_msat = 6; - */ - maxHtlcMsat: number; - /** - * 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: number; - /** - * If true, min_htlc_msat is applied. - * - * @generated from protobuf field: bool min_htlc_msat_specified = 8; - */ - 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 - */ -export interface ForwardingHistoryRequest { - /** - * Start time is the starting point of the forwarding history request. All - * records beyond this point will be included, respecting the end time, and - * the index offset. - * - * @generated from protobuf field: uint64 start_time = 1; - */ - startTime: number; - /** - * 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 - * end time. The index offset can be used to implement pagination. - * - * @generated from protobuf field: uint64 end_time = 2; - */ - endTime: number; - /** - * 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 - * around within a packed time series. - * - * @generated from protobuf field: uint32 index_offset = 3; - */ - indexOffset: number; - /** - * The max number of events to return in the response to this query. - * - * @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 - */ -export interface ForwardingEvent { - /** - * Timestamp is the time (unix epoch offset) that this circuit was - * completed. Deprecated by timestamp_ns. - * - * @deprecated - * @generated from protobuf field: uint64 timestamp = 1 [deprecated = true]; - */ - timestamp: number; - /** - * The incoming channel ID that carried the HTLC that created the circuit. - * - * @generated from protobuf field: uint64 chan_id_in = 2 [jstype = JS_STRING]; - */ - chanIdIn: string; - /** - * The outgoing channel ID that carried the preimage that completed the - * circuit. - * - * @generated from protobuf field: uint64 chan_id_out = 4 [jstype = JS_STRING]; - */ - chanIdOut: string; - /** - * The total amount (in satoshis) of the incoming HTLC that created half - * the circuit. - * - * @generated from protobuf field: uint64 amt_in = 5; - */ - amtIn: number; - /** - * 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: number; - /** - * The total fee (in satoshis) that this payment circuit carried. - * - * @generated from protobuf field: uint64 fee = 7; - */ - fee: number; - /** - * The total fee (in milli-satoshis) that this payment circuit carried. - * - * @generated from protobuf field: uint64 fee_msat = 8; - */ - feeMsat: number; - /** - * 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: number; - /** - * 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: number; - /** - * The number of nanoseconds elapsed since January 1, 1970 UTC when this - * circuit was completed. - * - * @generated from protobuf field: uint64 timestamp_ns = 11; - */ - timestampNs: number; - /** - * 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 - */ -export interface ForwardingHistoryResponse { - /** - * A list of forwarding events from the time slice of the time series - * specified in the request. - * - * @generated from protobuf field: repeated lnrpc.ForwardingEvent forwarding_events = 1; - */ - forwardingEvents: ForwardingEvent[]; - /** - * The index of the last time in the set of returned forwarding events. Can - * be used to seek further, pagination style. - * - * @generated from protobuf field: uint32 last_offset_index = 2; - */ - lastOffsetIndex: number; -} -/** - * @generated from protobuf message lnrpc.ExportChannelBackupRequest - */ -export interface ExportChannelBackupRequest { - /** - * The target channel point to obtain a back up for. - * - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 1; - */ - chanPoint?: ChannelPoint; -} -/** - * @generated from protobuf message lnrpc.ChannelBackup - */ -export interface ChannelBackup { - /** - * - * Identifies the channel that this backup belongs to. - * - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 1; - */ - chanPoint?: ChannelPoint; - /** - * - * Is an encrypted single-chan backup. this can be passed to - * RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in - * order to trigger the recovery protocol. When using REST, this field must be - * encoded as base64. - * - * @generated from protobuf field: bytes chan_backup = 2; - */ - chanBackup: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.MultiChanBackup - */ -export interface MultiChanBackup { - /** - * - * Is the set of all channels that are included in this multi-channel backup. - * - * @generated from protobuf field: repeated lnrpc.ChannelPoint chan_points = 1; - */ - chanPoints: ChannelPoint[]; - /** - * - * A single encrypted blob containing all the static channel backups of the - * channel listed above. This can be stored as a single file or blob, and - * safely be replaced with any prior/future versions. When using REST, this - * field must be encoded as base64. - * - * @generated from protobuf field: bytes multi_chan_backup = 2; - */ - multiChanBackup: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.ChanBackupExportRequest - */ -export interface ChanBackupExportRequest { -} -/** - * @generated from protobuf message lnrpc.ChanBackupSnapshot - */ -export interface ChanBackupSnapshot { - /** - * - * The set of new channels that have been added since the last channel backup - * snapshot was requested. - * - * @generated from protobuf field: lnrpc.ChannelBackups single_chan_backups = 1; - */ - singleChanBackups?: ChannelBackups; - /** - * - * A multi-channel backup that covers all open channels currently known to - * lnd. - * - * @generated from protobuf field: lnrpc.MultiChanBackup multi_chan_backup = 2; - */ - multiChanBackup?: MultiChanBackup; -} -/** - * @generated from protobuf message lnrpc.ChannelBackups - */ -export interface ChannelBackups { - /** - * - * A set of single-chan static channel backups. - * - * @generated from protobuf field: repeated lnrpc.ChannelBackup chan_backups = 1; - */ - chanBackups: ChannelBackup[]; -} -/** - * @generated from protobuf message lnrpc.RestoreChanBackupRequest - */ -export interface RestoreChanBackupRequest { - /** - * @generated from protobuf oneof: backup - */ - backup: { - oneofKind: "chanBackups"; - /** - * - * The channels to restore as a list of channel/backup pairs. - * - * @generated from protobuf field: lnrpc.ChannelBackups chan_backups = 1; - */ - chanBackups: ChannelBackups; - } | { - oneofKind: "multiChanBackup"; - /** - * - * The channels to restore in the packed multi backup format. When using - * REST, this field must be encoded as base64. - * - * @generated from protobuf field: bytes multi_chan_backup = 2; - */ - multiChanBackup: Uint8Array; - } | { - oneofKind: undefined; - }; -} -/** - * @generated from protobuf message lnrpc.RestoreBackupResponse - */ -export interface RestoreBackupResponse { -} -/** - * @generated from protobuf message lnrpc.ChannelBackupSubscription - */ -export interface ChannelBackupSubscription { -} -/** - * @generated from protobuf message lnrpc.VerifyChanBackupResponse - */ -export interface VerifyChanBackupResponse { -} -/** - * @generated from protobuf message lnrpc.MacaroonPermission - */ -export interface MacaroonPermission { - /** - * The entity a permission grants access to. - * - * @generated from protobuf field: string entity = 1; - */ - entity: string; - /** - * The action that is granted. - * - * @generated from protobuf field: string action = 2; - */ - action: string; -} -/** - * @generated from protobuf message lnrpc.BakeMacaroonRequest - */ -export interface BakeMacaroonRequest { - /** - * The list of permissions the new macaroon should grant. - * - * @generated from protobuf field: repeated lnrpc.MacaroonPermission permissions = 1; - */ - permissions: MacaroonPermission[]; - /** - * The root key ID used to create the macaroon, must be a positive integer. - * - * @generated from protobuf field: uint64 root_key_id = 2; - */ - rootKeyId: number; - /** - * - * 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 - */ -export interface BakeMacaroonResponse { - /** - * The hex encoded macaroon, serialized in binary format. - * - * @generated from protobuf field: string macaroon = 1; - */ - macaroon: string; -} -/** - * @generated from protobuf message lnrpc.ListMacaroonIDsRequest - */ -export interface ListMacaroonIDsRequest { -} -/** - * @generated from protobuf message lnrpc.ListMacaroonIDsResponse - */ -export interface ListMacaroonIDsResponse { - /** - * The list of root key IDs that are in use. - * - * @generated from protobuf field: repeated uint64 root_key_ids = 1; - */ - rootKeyIds: number[]; -} -/** - * @generated from protobuf message lnrpc.DeleteMacaroonIDRequest - */ -export interface DeleteMacaroonIDRequest { - /** - * The root key ID to be removed. - * - * @generated from protobuf field: uint64 root_key_id = 1; - */ - rootKeyId: number; -} -/** - * @generated from protobuf message lnrpc.DeleteMacaroonIDResponse - */ -export interface DeleteMacaroonIDResponse { - /** - * A boolean indicates that the deletion is successful. - * - * @generated from protobuf field: bool deleted = 1; - */ - deleted: boolean; -} -/** - * @generated from protobuf message lnrpc.MacaroonPermissionList - */ -export interface MacaroonPermissionList { - /** - * A list of macaroon permissions. - * - * @generated from protobuf field: repeated lnrpc.MacaroonPermission permissions = 1; - */ - permissions: MacaroonPermission[]; -} -/** - * @generated from protobuf message lnrpc.ListPermissionsRequest - */ -export interface ListPermissionsRequest { -} -/** - * @generated from protobuf message lnrpc.ListPermissionsResponse - */ -export interface ListPermissionsResponse { - /** - * - * A map between all RPC method URIs and their required macaroon permissions to - * access them. - * - * @generated from protobuf field: map method_permissions = 1; - */ - methodPermissions: { - [key: string]: MacaroonPermissionList; - }; -} -/** - * @generated from protobuf message lnrpc.Failure - */ -export interface Failure { - /** - * Failure code as defined in the Lightning spec - * - * @generated from protobuf field: lnrpc.Failure.FailureCode code = 1; - */ - code: Failure_FailureCode; - /** - * An optional channel update message. - * - * @generated from protobuf field: lnrpc.ChannelUpdate channel_update = 3; - */ - channelUpdate?: ChannelUpdate; - /** - * A failure type-dependent htlc value. - * - * @generated from protobuf field: uint64 htlc_msat = 4; - */ - htlcMsat: number; - /** - * The sha256 sum of the onion payload. - * - * @generated from protobuf field: bytes onion_sha_256 = 5; - */ - onionSha256: Uint8Array; - /** - * A failure type-dependent cltv expiry value. - * - * @generated from protobuf field: uint32 cltv_expiry = 6; - */ - cltvExpiry: number; - /** - * A failure type-dependent flags value. - * - * @generated from protobuf field: uint32 flags = 7; - */ - flags: number; - /** - * - * The position in the path of the intermediate or final node that generated - * the failure message. Position zero is the sender node. - * - * @generated from protobuf field: uint32 failure_source_index = 8; - */ - failureSourceIndex: number; - /** - * A failure type-dependent block height. - * - * @generated from protobuf field: uint32 height = 9; - */ - height: number; -} -/** - * @generated from protobuf enum lnrpc.Failure.FailureCode - */ -export declare enum Failure_FailureCode { - /** - * - * The numbers assigned in this enumeration match the failure codes as - * defined in BOLT #4. Because protobuf 3 requires enums to start with 0, - * a RESERVED value is added. - * - * @generated from protobuf enum value: RESERVED = 0; - */ - RESERVED = 0, - /** - * @generated from protobuf enum value: INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1; - */ - INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1, - /** - * @generated from protobuf enum value: INCORRECT_PAYMENT_AMOUNT = 2; - */ - INCORRECT_PAYMENT_AMOUNT = 2, - /** - * @generated from protobuf enum value: FINAL_INCORRECT_CLTV_EXPIRY = 3; - */ - FINAL_INCORRECT_CLTV_EXPIRY = 3, - /** - * @generated from protobuf enum value: FINAL_INCORRECT_HTLC_AMOUNT = 4; - */ - FINAL_INCORRECT_HTLC_AMOUNT = 4, - /** - * @generated from protobuf enum value: FINAL_EXPIRY_TOO_SOON = 5; - */ - FINAL_EXPIRY_TOO_SOON = 5, - /** - * @generated from protobuf enum value: INVALID_REALM = 6; - */ - INVALID_REALM = 6, - /** - * @generated from protobuf enum value: EXPIRY_TOO_SOON = 7; - */ - EXPIRY_TOO_SOON = 7, - /** - * @generated from protobuf enum value: INVALID_ONION_VERSION = 8; - */ - INVALID_ONION_VERSION = 8, - /** - * @generated from protobuf enum value: INVALID_ONION_HMAC = 9; - */ - INVALID_ONION_HMAC = 9, - /** - * @generated from protobuf enum value: INVALID_ONION_KEY = 10; - */ - INVALID_ONION_KEY = 10, - /** - * @generated from protobuf enum value: AMOUNT_BELOW_MINIMUM = 11; - */ - AMOUNT_BELOW_MINIMUM = 11, - /** - * @generated from protobuf enum value: FEE_INSUFFICIENT = 12; - */ - FEE_INSUFFICIENT = 12, - /** - * @generated from protobuf enum value: INCORRECT_CLTV_EXPIRY = 13; - */ - INCORRECT_CLTV_EXPIRY = 13, - /** - * @generated from protobuf enum value: CHANNEL_DISABLED = 14; - */ - CHANNEL_DISABLED = 14, - /** - * @generated from protobuf enum value: TEMPORARY_CHANNEL_FAILURE = 15; - */ - TEMPORARY_CHANNEL_FAILURE = 15, - /** - * @generated from protobuf enum value: REQUIRED_NODE_FEATURE_MISSING = 16; - */ - REQUIRED_NODE_FEATURE_MISSING = 16, - /** - * @generated from protobuf enum value: REQUIRED_CHANNEL_FEATURE_MISSING = 17; - */ - REQUIRED_CHANNEL_FEATURE_MISSING = 17, - /** - * @generated from protobuf enum value: UNKNOWN_NEXT_PEER = 18; - */ - UNKNOWN_NEXT_PEER = 18, - /** - * @generated from protobuf enum value: TEMPORARY_NODE_FAILURE = 19; - */ - TEMPORARY_NODE_FAILURE = 19, - /** - * @generated from protobuf enum value: PERMANENT_NODE_FAILURE = 20; - */ - PERMANENT_NODE_FAILURE = 20, - /** - * @generated from protobuf enum value: PERMANENT_CHANNEL_FAILURE = 21; - */ - PERMANENT_CHANNEL_FAILURE = 21, - /** - * @generated from protobuf enum value: EXPIRY_TOO_FAR = 22; - */ - EXPIRY_TOO_FAR = 22, - /** - * @generated from protobuf enum value: MPP_TIMEOUT = 23; - */ - MPP_TIMEOUT = 23, - /** - * @generated from protobuf enum value: INVALID_ONION_PAYLOAD = 24; - */ - INVALID_ONION_PAYLOAD = 24, - /** - * - * An internal error occurred. - * - * @generated from protobuf enum value: INTERNAL_FAILURE = 997; - */ - INTERNAL_FAILURE = 997, - /** - * - * The error source is known, but the failure itself couldn't be decoded. - * - * @generated from protobuf enum value: UNKNOWN_FAILURE = 998; - */ - UNKNOWN_FAILURE = 998, - /** - * - * An unreadable failure result is returned if the received failure message - * cannot be decrypted. In that case the error source is unknown. - * - * @generated from protobuf enum value: UNREADABLE_FAILURE = 999; - */ - UNREADABLE_FAILURE = 999 -} -/** - * @generated from protobuf message lnrpc.ChannelUpdate - */ -export interface ChannelUpdate { - /** - * - * The signature that validates the announced data and proves the ownership - * of node id. - * - * @generated from protobuf field: bytes signature = 1; - */ - signature: Uint8Array; - /** - * - * The target chain that this channel was opened within. This value - * should be the genesis hash of the target chain. Along with the short - * channel ID, this uniquely identifies the channel globally in a - * blockchain. - * - * @generated from protobuf field: bytes chain_hash = 2; - */ - chainHash: Uint8Array; - /** - * - * The unique description of the funding transaction. - * - * @generated from protobuf field: uint64 chan_id = 3 [jstype = JS_STRING]; - */ - chanId: string; - /** - * - * A timestamp that allows ordering in the case of multiple announcements. - * We should ignore the message if timestamp is not greater than the - * last-received. - * - * @generated from protobuf field: uint32 timestamp = 4; - */ - timestamp: number; - /** - * - * The bitfield that describes whether optional fields are present in this - * update. Currently, the least-significant bit must be set to 1 if the - * optional field MaxHtlc is present. - * - * @generated from protobuf field: uint32 message_flags = 10; - */ - messageFlags: number; - /** - * - * The bitfield that describes additional meta-data concerning how the - * update is to be interpreted. Currently, the least-significant bit must be - * set to 0 if the creating node corresponds to the first node in the - * previously sent channel announcement and 1 otherwise. If the second bit - * is set, then the channel is set to be disabled. - * - * @generated from protobuf field: uint32 channel_flags = 5; - */ - channelFlags: number; - /** - * - * The minimum number of blocks this node requires to be added to the expiry - * of HTLCs. This is a security parameter determined by the node operator. - * This value represents the required gap between the time locks of the - * incoming and outgoing HTLC's set to this node. - * - * @generated from protobuf field: uint32 time_lock_delta = 6; - */ - timeLockDelta: number; - /** - * - * The minimum HTLC value which will be accepted. - * - * @generated from protobuf field: uint64 htlc_minimum_msat = 7; - */ - htlcMinimumMsat: number; - /** - * - * The base fee that must be used for incoming HTLC's to this particular - * channel. This value will be tacked onto the required for a payment - * independent of the size of the payment. - * - * @generated from protobuf field: uint32 base_fee = 8; - */ - baseFee: number; - /** - * - * The fee rate that will be charged per millionth of a satoshi. - * - * @generated from protobuf field: uint32 fee_rate = 9; - */ - feeRate: number; - /** - * - * The maximum HTLC value which will be accepted. - * - * @generated from protobuf field: uint64 htlc_maximum_msat = 11; - */ - htlcMaximumMsat: number; - /** - * - * The set of data that was appended to this message, some of which we may - * not actually know how to iterate or parse. By holding onto this data, we - * ensure that we're able to properly validate the set of signatures that - * cover these new fields, and ensure we're able to make upgrades to the - * network in a forwards compatible manner. - * - * @generated from protobuf field: bytes extra_opaque_data = 12; - */ - extraOpaqueData: Uint8Array; -} -/** - * @generated from protobuf message lnrpc.MacaroonId - */ -export interface MacaroonId { - /** - * @generated from protobuf field: bytes nonce = 1; - */ - nonce: Uint8Array; - /** - * @generated from protobuf field: bytes storageId = 2; - */ - storageId: Uint8Array; - /** - * @generated from protobuf field: repeated lnrpc.Op ops = 3; - */ - ops: Op[]; -} -/** - * @generated from protobuf message lnrpc.Op - */ -export interface Op { - /** - * @generated from protobuf field: string entity = 1; - */ - entity: string; - /** - * @generated from protobuf field: repeated string actions = 2; - */ - 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: number; - /** - * - * 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: number; -} -/** - * @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: number; - /** - * @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 declare 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 - */ -export declare enum AddressType { - /** - * @generated from protobuf enum value: WITNESS_PUBKEY_HASH = 0; - */ - WITNESS_PUBKEY_HASH = 0, - /** - * @generated from protobuf enum value: NESTED_PUBKEY_HASH = 1; - */ - NESTED_PUBKEY_HASH = 1, - /** - * @generated from protobuf enum value: UNUSED_WITNESS_PUBKEY_HASH = 2; - */ - UNUSED_WITNESS_PUBKEY_HASH = 2, - /** - * @generated from protobuf enum value: 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 declare 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 = 1; - */ - LEGACY = 1, - /** - * - * A channel that uses the modern commitment format where the key in the - * output of the remote party does not change each state. This makes back - * 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 = 2; - */ - 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 = 3; - */ - ANCHORS = 3, - /** - * - * 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: SCRIPT_ENFORCED_LEASE = 4; - */ - SCRIPT_ENFORCED_LEASE = 4 -} -/** - * @generated from protobuf enum lnrpc.Initiator - */ -export declare enum Initiator { - /** - * @generated from protobuf enum value: INITIATOR_UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: INITIATOR_LOCAL = 1; - */ - LOCAL = 1, - /** - * @generated from protobuf enum value: INITIATOR_REMOTE = 2; - */ - REMOTE = 2, - /** - * @generated from protobuf enum value: INITIATOR_BOTH = 3; - */ - BOTH = 3 -} -/** - * @generated from protobuf enum lnrpc.ResolutionType - */ -export declare enum ResolutionType { - /** - * @generated from protobuf enum value: TYPE_UNKNOWN = 0; - */ - TYPE_UNKNOWN = 0, - /** - * We resolved an anchor output. - * - * @generated from protobuf enum value: ANCHOR = 1; - */ - ANCHOR = 1, - /** - * - * We are resolving an incoming htlc on chain. This if this htlc is - * claimed, we swept the incoming htlc with the preimage. If it is timed - * out, our peer swept the timeout path. - * - * @generated from protobuf enum value: INCOMING_HTLC = 2; - */ - INCOMING_HTLC = 2, - /** - * - * We are resolving an outgoing htlc on chain. If this htlc is claimed, - * the remote party swept the htlc with the preimage. If it is timed out, - * we swept it with the timeout path. - * - * @generated from protobuf enum value: OUTGOING_HTLC = 3; - */ - OUTGOING_HTLC = 3, - /** - * We force closed and need to sweep our time locked commitment output. - * - * @generated from protobuf enum value: COMMIT = 4; - */ - COMMIT = 4 -} -/** - * @generated from protobuf enum lnrpc.ResolutionOutcome - */ -export declare enum ResolutionOutcome { - /** - * Outcome unknown. - * - * @generated from protobuf enum value: OUTCOME_UNKNOWN = 0; - */ - OUTCOME_UNKNOWN = 0, - /** - * An output was claimed on chain. - * - * @generated from protobuf enum value: CLAIMED = 1; - */ - CLAIMED = 1, - /** - * An output was left unclaimed on chain. - * - * @generated from protobuf enum value: UNCLAIMED = 2; - */ - UNCLAIMED = 2, - /** - * - * ResolverOutcomeAbandoned indicates that an output that we did not - * claim on chain, for example an anchor that we did not sweep and a - * third party claimed on chain, or a htlc that we could not decode - * so left unclaimed. - * - * @generated from protobuf enum value: ABANDONED = 3; - */ - ABANDONED = 3, - /** - * - * If we force closed our channel, our htlcs need to be claimed in two - * stages. This outcome represents the broadcast of a timeout or success - * transaction for this two stage htlc claim. - * - * @generated from protobuf enum value: FIRST_STAGE = 4; - */ - FIRST_STAGE = 4, - /** - * A htlc was timed out on chain. - * - * @generated from protobuf enum value: TIMEOUT = 5; - */ - TIMEOUT = 5 -} -/** - * @generated from protobuf enum lnrpc.NodeMetricType - */ -export declare enum NodeMetricType { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: BETWEENNESS_CENTRALITY = 1; - */ - BETWEENNESS_CENTRALITY = 1 -} -/** - * @generated from protobuf enum lnrpc.InvoiceHTLCState - */ -export declare enum InvoiceHTLCState { - /** - * @generated from protobuf enum value: ACCEPTED = 0; - */ - ACCEPTED = 0, - /** - * @generated from protobuf enum value: SETTLED = 1; - */ - SETTLED = 1, - /** - * @generated from protobuf enum value: CANCELED = 2; - */ - CANCELED = 2 -} -/** - * @generated from protobuf enum lnrpc.PaymentFailureReason - */ -export declare enum PaymentFailureReason { - /** - * - * Payment isn't failed (yet). - * - * @generated from protobuf enum value: FAILURE_REASON_NONE = 0; - */ - FAILURE_REASON_NONE = 0, - /** - * - * There are more routes to try, but the payment timeout was exceeded. - * - * @generated from protobuf enum value: FAILURE_REASON_TIMEOUT = 1; - */ - FAILURE_REASON_TIMEOUT = 1, - /** - * - * All possible routes were tried and failed permanently. Or were no - * routes to the destination at all. - * - * @generated from protobuf enum value: FAILURE_REASON_NO_ROUTE = 2; - */ - FAILURE_REASON_NO_ROUTE = 2, - /** - * - * A non-recoverable error has occured. - * - * @generated from protobuf enum value: FAILURE_REASON_ERROR = 3; - */ - FAILURE_REASON_ERROR = 3, - /** - * - * Payment details incorrect (unknown hash, invalid amt or - * invalid final cltv delta) - * - * @generated from protobuf enum value: FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4; - */ - FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4, - /** - * - * Insufficient local balance. - * - * @generated from protobuf enum value: FAILURE_REASON_INSUFFICIENT_BALANCE = 5; - */ - FAILURE_REASON_INSUFFICIENT_BALANCE = 5 -} -/** - * @generated from protobuf enum lnrpc.FeatureBit - */ -export declare enum FeatureBit { - /** - * @generated from protobuf enum value: DATALOSS_PROTECT_REQ = 0; - */ - DATALOSS_PROTECT_REQ = 0, - /** - * @generated from protobuf enum value: DATALOSS_PROTECT_OPT = 1; - */ - DATALOSS_PROTECT_OPT = 1, - /** - * @generated from protobuf enum value: INITIAL_ROUING_SYNC = 3; - */ - INITIAL_ROUING_SYNC = 3, - /** - * @generated from protobuf enum value: UPFRONT_SHUTDOWN_SCRIPT_REQ = 4; - */ - UPFRONT_SHUTDOWN_SCRIPT_REQ = 4, - /** - * @generated from protobuf enum value: UPFRONT_SHUTDOWN_SCRIPT_OPT = 5; - */ - UPFRONT_SHUTDOWN_SCRIPT_OPT = 5, - /** - * @generated from protobuf enum value: GOSSIP_QUERIES_REQ = 6; - */ - GOSSIP_QUERIES_REQ = 6, - /** - * @generated from protobuf enum value: GOSSIP_QUERIES_OPT = 7; - */ - GOSSIP_QUERIES_OPT = 7, - /** - * @generated from protobuf enum value: TLV_ONION_REQ = 8; - */ - TLV_ONION_REQ = 8, - /** - * @generated from protobuf enum value: TLV_ONION_OPT = 9; - */ - TLV_ONION_OPT = 9, - /** - * @generated from protobuf enum value: EXT_GOSSIP_QUERIES_REQ = 10; - */ - EXT_GOSSIP_QUERIES_REQ = 10, - /** - * @generated from protobuf enum value: EXT_GOSSIP_QUERIES_OPT = 11; - */ - EXT_GOSSIP_QUERIES_OPT = 11, - /** - * @generated from protobuf enum value: STATIC_REMOTE_KEY_REQ = 12; - */ - STATIC_REMOTE_KEY_REQ = 12, - /** - * @generated from protobuf enum value: STATIC_REMOTE_KEY_OPT = 13; - */ - STATIC_REMOTE_KEY_OPT = 13, - /** - * @generated from protobuf enum value: PAYMENT_ADDR_REQ = 14; - */ - PAYMENT_ADDR_REQ = 14, - /** - * @generated from protobuf enum value: PAYMENT_ADDR_OPT = 15; - */ - PAYMENT_ADDR_OPT = 15, - /** - * @generated from protobuf enum value: MPP_REQ = 16; - */ - MPP_REQ = 16, - /** - * @generated from protobuf enum value: MPP_OPT = 17; - */ - MPP_OPT = 17, - /** - * @generated from protobuf enum value: WUMBO_CHANNELS_REQ = 18; - */ - WUMBO_CHANNELS_REQ = 18, - /** - * @generated from protobuf enum value: WUMBO_CHANNELS_OPT = 19; - */ - WUMBO_CHANNELS_OPT = 19, - /** - * @generated from protobuf enum value: ANCHORS_REQ = 20; - */ - ANCHORS_REQ = 20, - /** - * @generated from protobuf enum value: ANCHORS_OPT = 21; - */ - ANCHORS_OPT = 21, - /** - * @generated from protobuf enum value: ANCHORS_ZERO_FEE_HTLC_REQ = 22; - */ - ANCHORS_ZERO_FEE_HTLC_REQ = 22, - /** - * @generated from protobuf enum value: ANCHORS_ZERO_FEE_HTLC_OPT = 23; - */ - ANCHORS_ZERO_FEE_HTLC_OPT = 23, - /** - * @generated from protobuf enum value: AMP_REQ = 30; - */ - AMP_REQ = 30, - /** - * @generated from protobuf enum value: AMP_OPT = 31; - */ - AMP_OPT = 31 -} -/** - * @generated from protobuf enum lnrpc.UpdateFailure - */ -export declare 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 -} -declare class LookupHtlcRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): LookupHtlcRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupHtlcRequest): LookupHtlcRequest; - internalBinaryWrite(message: LookupHtlcRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.LookupHtlcRequest - */ -export declare const LookupHtlcRequest: LookupHtlcRequest$Type; -declare class LookupHtlcResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): LookupHtlcResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LookupHtlcResponse): LookupHtlcResponse; - internalBinaryWrite(message: LookupHtlcResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.LookupHtlcResponse - */ -export declare const LookupHtlcResponse: LookupHtlcResponse$Type; -declare class SubscribeCustomMessagesRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SubscribeCustomMessagesRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeCustomMessagesRequest): SubscribeCustomMessagesRequest; - internalBinaryWrite(message: SubscribeCustomMessagesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SubscribeCustomMessagesRequest - */ -export declare const SubscribeCustomMessagesRequest: SubscribeCustomMessagesRequest$Type; -declare class CustomMessage$Type extends MessageType { - constructor(); - create(value?: PartialMessage): CustomMessage; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CustomMessage): CustomMessage; - internalBinaryWrite(message: CustomMessage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.CustomMessage - */ -export declare const CustomMessage: CustomMessage$Type; -declare class SendCustomMessageRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendCustomMessageRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCustomMessageRequest): SendCustomMessageRequest; - internalBinaryWrite(message: SendCustomMessageRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SendCustomMessageRequest - */ -export declare const SendCustomMessageRequest: SendCustomMessageRequest$Type; -declare class SendCustomMessageResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendCustomMessageResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCustomMessageResponse): SendCustomMessageResponse; - internalBinaryWrite(message: SendCustomMessageResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SendCustomMessageResponse - */ -export declare const SendCustomMessageResponse: SendCustomMessageResponse$Type; -declare class Utxo$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Utxo; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Utxo): Utxo; - internalBinaryWrite(message: Utxo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Utxo - */ -export declare const Utxo: Utxo$Type; -declare class OutputDetail$Type extends MessageType { - constructor(); - create(value?: PartialMessage): OutputDetail; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OutputDetail): OutputDetail; - internalBinaryWrite(message: OutputDetail, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.OutputDetail - */ -export declare const OutputDetail: OutputDetail$Type; -declare class Transaction$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Transaction; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Transaction): Transaction; - internalBinaryWrite(message: Transaction, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Transaction - */ -export declare const Transaction: Transaction$Type; -declare class GetTransactionsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetTransactionsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetTransactionsRequest): GetTransactionsRequest; - internalBinaryWrite(message: GetTransactionsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.GetTransactionsRequest - */ -export declare const GetTransactionsRequest: GetTransactionsRequest$Type; -declare class TransactionDetails$Type extends MessageType { - constructor(); - create(value?: PartialMessage): TransactionDetails; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TransactionDetails): TransactionDetails; - internalBinaryWrite(message: TransactionDetails, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.TransactionDetails - */ -export declare const TransactionDetails: TransactionDetails$Type; -declare class FeeLimit$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FeeLimit; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeeLimit): FeeLimit; - internalBinaryWrite(message: FeeLimit, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.FeeLimit - */ -export declare const FeeLimit: FeeLimit$Type; -declare class SendRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendRequest): SendRequest; - private binaryReadMap11; - internalBinaryWrite(message: SendRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SendRequest - */ -export declare const SendRequest: SendRequest$Type; -declare class SendResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendResponse): SendResponse; - internalBinaryWrite(message: SendResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SendResponse - */ -export declare const SendResponse: SendResponse$Type; -declare class SendToRouteRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendToRouteRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendToRouteRequest): SendToRouteRequest; - internalBinaryWrite(message: SendToRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SendToRouteRequest - */ -export declare const SendToRouteRequest: SendToRouteRequest$Type; -declare class ChannelAcceptRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelAcceptRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelAcceptRequest): ChannelAcceptRequest; - internalBinaryWrite(message: ChannelAcceptRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelAcceptRequest - */ -export declare const ChannelAcceptRequest: ChannelAcceptRequest$Type; -declare class ChannelAcceptResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelAcceptResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelAcceptResponse): ChannelAcceptResponse; - internalBinaryWrite(message: ChannelAcceptResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelAcceptResponse - */ -export declare const ChannelAcceptResponse: ChannelAcceptResponse$Type; -declare class ChannelPoint$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelPoint; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelPoint): ChannelPoint; - internalBinaryWrite(message: ChannelPoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelPoint - */ -export declare const ChannelPoint: ChannelPoint$Type; -declare class OutPoint$Type extends MessageType { - constructor(); - create(value?: PartialMessage): OutPoint; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OutPoint): OutPoint; - internalBinaryWrite(message: OutPoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.OutPoint - */ -export declare const OutPoint: OutPoint$Type; -declare class PreviousOutPoint$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PreviousOutPoint; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PreviousOutPoint): PreviousOutPoint; - internalBinaryWrite(message: PreviousOutPoint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PreviousOutPoint - */ -export declare const PreviousOutPoint: PreviousOutPoint$Type; -declare class LightningAddress$Type extends MessageType { - constructor(); - create(value?: PartialMessage): LightningAddress; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LightningAddress): LightningAddress; - internalBinaryWrite(message: LightningAddress, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.LightningAddress - */ -export declare const LightningAddress: LightningAddress$Type; -declare class EstimateFeeRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): EstimateFeeRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EstimateFeeRequest): EstimateFeeRequest; - private binaryReadMap1; - internalBinaryWrite(message: EstimateFeeRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.EstimateFeeRequest - */ -export declare const EstimateFeeRequest: EstimateFeeRequest$Type; -declare class EstimateFeeResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): EstimateFeeResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EstimateFeeResponse): EstimateFeeResponse; - internalBinaryWrite(message: EstimateFeeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.EstimateFeeResponse - */ -export declare const EstimateFeeResponse: EstimateFeeResponse$Type; -declare class SendManyRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendManyRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendManyRequest): SendManyRequest; - private binaryReadMap1; - internalBinaryWrite(message: SendManyRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SendManyRequest - */ -export declare const SendManyRequest: SendManyRequest$Type; -declare class SendManyResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendManyResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendManyResponse): SendManyResponse; - internalBinaryWrite(message: SendManyResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SendManyResponse - */ -export declare const SendManyResponse: SendManyResponse$Type; -declare class SendCoinsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendCoinsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCoinsRequest): SendCoinsRequest; - internalBinaryWrite(message: SendCoinsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SendCoinsRequest - */ -export declare const SendCoinsRequest: SendCoinsRequest$Type; -declare class SendCoinsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendCoinsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendCoinsResponse): SendCoinsResponse; - internalBinaryWrite(message: SendCoinsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SendCoinsResponse - */ -export declare const SendCoinsResponse: SendCoinsResponse$Type; -declare class ListUnspentRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListUnspentRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUnspentRequest): ListUnspentRequest; - internalBinaryWrite(message: ListUnspentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListUnspentRequest - */ -export declare const ListUnspentRequest: ListUnspentRequest$Type; -declare class ListUnspentResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListUnspentResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUnspentResponse): ListUnspentResponse; - internalBinaryWrite(message: ListUnspentResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListUnspentResponse - */ -export declare const ListUnspentResponse: ListUnspentResponse$Type; -declare class NewAddressRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): NewAddressRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NewAddressRequest): NewAddressRequest; - internalBinaryWrite(message: NewAddressRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.NewAddressRequest - */ -export declare const NewAddressRequest: NewAddressRequest$Type; -declare class NewAddressResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): NewAddressResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NewAddressResponse): NewAddressResponse; - internalBinaryWrite(message: NewAddressResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.NewAddressResponse - */ -export declare const NewAddressResponse: NewAddressResponse$Type; -declare class SignMessageRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SignMessageRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SignMessageRequest): SignMessageRequest; - internalBinaryWrite(message: SignMessageRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SignMessageRequest - */ -export declare const SignMessageRequest: SignMessageRequest$Type; -declare class SignMessageResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SignMessageResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SignMessageResponse): SignMessageResponse; - internalBinaryWrite(message: SignMessageResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SignMessageResponse - */ -export declare const SignMessageResponse: SignMessageResponse$Type; -declare class VerifyMessageRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): VerifyMessageRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VerifyMessageRequest): VerifyMessageRequest; - internalBinaryWrite(message: VerifyMessageRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.VerifyMessageRequest - */ -export declare const VerifyMessageRequest: VerifyMessageRequest$Type; -declare class VerifyMessageResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): VerifyMessageResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VerifyMessageResponse): VerifyMessageResponse; - internalBinaryWrite(message: VerifyMessageResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.VerifyMessageResponse - */ -export declare const VerifyMessageResponse: VerifyMessageResponse$Type; -declare class ConnectPeerRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ConnectPeerRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConnectPeerRequest): ConnectPeerRequest; - internalBinaryWrite(message: ConnectPeerRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ConnectPeerRequest - */ -export declare const ConnectPeerRequest: ConnectPeerRequest$Type; -declare class ConnectPeerResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ConnectPeerResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConnectPeerResponse): ConnectPeerResponse; - internalBinaryWrite(message: ConnectPeerResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ConnectPeerResponse - */ -export declare const ConnectPeerResponse: ConnectPeerResponse$Type; -declare class DisconnectPeerRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DisconnectPeerRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DisconnectPeerRequest): DisconnectPeerRequest; - internalBinaryWrite(message: DisconnectPeerRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.DisconnectPeerRequest - */ -export declare const DisconnectPeerRequest: DisconnectPeerRequest$Type; -declare class DisconnectPeerResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DisconnectPeerResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DisconnectPeerResponse): DisconnectPeerResponse; - internalBinaryWrite(message: DisconnectPeerResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.DisconnectPeerResponse - */ -export declare const DisconnectPeerResponse: DisconnectPeerResponse$Type; -declare class HTLC$Type extends MessageType { - constructor(); - create(value?: PartialMessage): HTLC; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HTLC): HTLC; - internalBinaryWrite(message: HTLC, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.HTLC - */ -export declare const HTLC: HTLC$Type; -declare class ChannelConstraints$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelConstraints; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelConstraints): ChannelConstraints; - internalBinaryWrite(message: ChannelConstraints, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelConstraints - */ -export declare const ChannelConstraints: ChannelConstraints$Type; -declare class Channel$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Channel; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Channel): Channel; - internalBinaryWrite(message: Channel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Channel - */ -export declare const Channel: Channel$Type; -declare class ListChannelsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListChannelsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListChannelsRequest): ListChannelsRequest; - internalBinaryWrite(message: ListChannelsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListChannelsRequest - */ -export declare const ListChannelsRequest: ListChannelsRequest$Type; -declare class ListChannelsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListChannelsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListChannelsResponse): ListChannelsResponse; - internalBinaryWrite(message: ListChannelsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListChannelsResponse - */ -export declare const ListChannelsResponse: ListChannelsResponse$Type; -declare class AliasMap$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AliasMap; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AliasMap): AliasMap; - internalBinaryWrite(message: AliasMap, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.AliasMap - */ -export declare const AliasMap: AliasMap$Type; -declare class ListAliasesRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListAliasesRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListAliasesRequest): ListAliasesRequest; - internalBinaryWrite(message: ListAliasesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListAliasesRequest - */ -export declare const ListAliasesRequest: ListAliasesRequest$Type; -declare class ListAliasesResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListAliasesResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListAliasesResponse): ListAliasesResponse; - internalBinaryWrite(message: ListAliasesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListAliasesResponse - */ -export declare const ListAliasesResponse: ListAliasesResponse$Type; -declare class ChannelCloseSummary$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelCloseSummary; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelCloseSummary): ChannelCloseSummary; - internalBinaryWrite(message: ChannelCloseSummary, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelCloseSummary - */ -export declare const ChannelCloseSummary: ChannelCloseSummary$Type; -declare class Resolution$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Resolution; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Resolution): Resolution; - internalBinaryWrite(message: Resolution, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Resolution - */ -export declare const Resolution: Resolution$Type; -declare class ClosedChannelsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ClosedChannelsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ClosedChannelsRequest): ClosedChannelsRequest; - internalBinaryWrite(message: ClosedChannelsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ClosedChannelsRequest - */ -export declare const ClosedChannelsRequest: ClosedChannelsRequest$Type; -declare class ClosedChannelsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ClosedChannelsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ClosedChannelsResponse): ClosedChannelsResponse; - internalBinaryWrite(message: ClosedChannelsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ClosedChannelsResponse - */ -export declare const ClosedChannelsResponse: ClosedChannelsResponse$Type; -declare class Peer$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Peer; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Peer): Peer; - private binaryReadMap11; - internalBinaryWrite(message: Peer, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Peer - */ -export declare const Peer: Peer$Type; -declare class TimestampedError$Type extends MessageType { - constructor(); - create(value?: PartialMessage): TimestampedError; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TimestampedError): TimestampedError; - internalBinaryWrite(message: TimestampedError, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.TimestampedError - */ -export declare const TimestampedError: TimestampedError$Type; -declare class ListPeersRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListPeersRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPeersRequest): ListPeersRequest; - internalBinaryWrite(message: ListPeersRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListPeersRequest - */ -export declare const ListPeersRequest: ListPeersRequest$Type; -declare class ListPeersResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListPeersResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPeersResponse): ListPeersResponse; - internalBinaryWrite(message: ListPeersResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListPeersResponse - */ -export declare const ListPeersResponse: ListPeersResponse$Type; -declare class PeerEventSubscription$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PeerEventSubscription; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PeerEventSubscription): PeerEventSubscription; - internalBinaryWrite(message: PeerEventSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PeerEventSubscription - */ -export declare const PeerEventSubscription: PeerEventSubscription$Type; -declare class PeerEvent$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PeerEvent; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PeerEvent): PeerEvent; - internalBinaryWrite(message: PeerEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PeerEvent - */ -export declare const PeerEvent: PeerEvent$Type; -declare class GetInfoRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetInfoRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetInfoRequest): GetInfoRequest; - internalBinaryWrite(message: GetInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.GetInfoRequest - */ -export declare const GetInfoRequest: GetInfoRequest$Type; -declare class GetInfoResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetInfoResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetInfoResponse): GetInfoResponse; - private binaryReadMap19; - internalBinaryWrite(message: GetInfoResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.GetInfoResponse - */ -export declare const GetInfoResponse: GetInfoResponse$Type; -declare class GetRecoveryInfoRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetRecoveryInfoRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRecoveryInfoRequest): GetRecoveryInfoRequest; - internalBinaryWrite(message: GetRecoveryInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.GetRecoveryInfoRequest - */ -export declare const GetRecoveryInfoRequest: GetRecoveryInfoRequest$Type; -declare class GetRecoveryInfoResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetRecoveryInfoResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRecoveryInfoResponse): GetRecoveryInfoResponse; - internalBinaryWrite(message: GetRecoveryInfoResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.GetRecoveryInfoResponse - */ -export declare const GetRecoveryInfoResponse: GetRecoveryInfoResponse$Type; -declare class Chain$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Chain; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Chain): Chain; - internalBinaryWrite(message: Chain, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Chain - */ -export declare const Chain: Chain$Type; -declare class ConfirmationUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ConfirmationUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ConfirmationUpdate): ConfirmationUpdate; - internalBinaryWrite(message: ConfirmationUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ConfirmationUpdate - */ -export declare const ConfirmationUpdate: ConfirmationUpdate$Type; -declare class ChannelOpenUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelOpenUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelOpenUpdate): ChannelOpenUpdate; - internalBinaryWrite(message: ChannelOpenUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelOpenUpdate - */ -export declare const ChannelOpenUpdate: ChannelOpenUpdate$Type; -declare class ChannelCloseUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelCloseUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelCloseUpdate): ChannelCloseUpdate; - internalBinaryWrite(message: ChannelCloseUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelCloseUpdate - */ -export declare const ChannelCloseUpdate: ChannelCloseUpdate$Type; -declare class CloseChannelRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): CloseChannelRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CloseChannelRequest): CloseChannelRequest; - internalBinaryWrite(message: CloseChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.CloseChannelRequest - */ -export declare const CloseChannelRequest: CloseChannelRequest$Type; -declare class CloseStatusUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): CloseStatusUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CloseStatusUpdate): CloseStatusUpdate; - internalBinaryWrite(message: CloseStatusUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.CloseStatusUpdate - */ -export declare const CloseStatusUpdate: CloseStatusUpdate$Type; -declare class PendingUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PendingUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingUpdate): PendingUpdate; - internalBinaryWrite(message: PendingUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PendingUpdate - */ -export declare const PendingUpdate: PendingUpdate$Type; -declare class ReadyForPsbtFunding$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ReadyForPsbtFunding; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ReadyForPsbtFunding): ReadyForPsbtFunding; - internalBinaryWrite(message: ReadyForPsbtFunding, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ReadyForPsbtFunding - */ -export declare const ReadyForPsbtFunding: ReadyForPsbtFunding$Type; -declare class BatchOpenChannelRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): BatchOpenChannelRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannelRequest): BatchOpenChannelRequest; - internalBinaryWrite(message: BatchOpenChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.BatchOpenChannelRequest - */ -export declare const BatchOpenChannelRequest: BatchOpenChannelRequest$Type; -declare class BatchOpenChannel$Type extends MessageType { - constructor(); - create(value?: PartialMessage): BatchOpenChannel; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannel): BatchOpenChannel; - internalBinaryWrite(message: BatchOpenChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.BatchOpenChannel - */ -export declare const BatchOpenChannel: BatchOpenChannel$Type; -declare class BatchOpenChannelResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): BatchOpenChannelResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BatchOpenChannelResponse): BatchOpenChannelResponse; - internalBinaryWrite(message: BatchOpenChannelResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.BatchOpenChannelResponse - */ -export declare const BatchOpenChannelResponse: BatchOpenChannelResponse$Type; -declare class OpenChannelRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): OpenChannelRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpenChannelRequest): OpenChannelRequest; - internalBinaryWrite(message: OpenChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.OpenChannelRequest - */ -export declare const OpenChannelRequest: OpenChannelRequest$Type; -declare class OpenStatusUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): OpenStatusUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OpenStatusUpdate): OpenStatusUpdate; - internalBinaryWrite(message: OpenStatusUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.OpenStatusUpdate - */ -export declare const OpenStatusUpdate: OpenStatusUpdate$Type; -declare class KeyLocator$Type extends MessageType { - constructor(); - create(value?: PartialMessage): KeyLocator; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: KeyLocator): KeyLocator; - internalBinaryWrite(message: KeyLocator, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.KeyLocator - */ -export declare const KeyLocator: KeyLocator$Type; -declare class KeyDescriptor$Type extends MessageType { - constructor(); - create(value?: PartialMessage): KeyDescriptor; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: KeyDescriptor): KeyDescriptor; - internalBinaryWrite(message: KeyDescriptor, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.KeyDescriptor - */ -export declare const KeyDescriptor: KeyDescriptor$Type; -declare class ChanPointShim$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChanPointShim; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanPointShim): ChanPointShim; - internalBinaryWrite(message: ChanPointShim, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChanPointShim - */ -export declare const ChanPointShim: ChanPointShim$Type; -declare class PsbtShim$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PsbtShim; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PsbtShim): PsbtShim; - internalBinaryWrite(message: PsbtShim, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PsbtShim - */ -export declare const PsbtShim: PsbtShim$Type; -declare class FundingShim$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FundingShim; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingShim): FundingShim; - internalBinaryWrite(message: FundingShim, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.FundingShim - */ -export declare const FundingShim: FundingShim$Type; -declare class FundingShimCancel$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FundingShimCancel; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingShimCancel): FundingShimCancel; - internalBinaryWrite(message: FundingShimCancel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.FundingShimCancel - */ -export declare const FundingShimCancel: FundingShimCancel$Type; -declare class FundingPsbtVerify$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FundingPsbtVerify; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingPsbtVerify): FundingPsbtVerify; - internalBinaryWrite(message: FundingPsbtVerify, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.FundingPsbtVerify - */ -export declare const FundingPsbtVerify: FundingPsbtVerify$Type; -declare class FundingPsbtFinalize$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FundingPsbtFinalize; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingPsbtFinalize): FundingPsbtFinalize; - internalBinaryWrite(message: FundingPsbtFinalize, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.FundingPsbtFinalize - */ -export declare const FundingPsbtFinalize: FundingPsbtFinalize$Type; -declare class FundingTransitionMsg$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FundingTransitionMsg; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingTransitionMsg): FundingTransitionMsg; - internalBinaryWrite(message: FundingTransitionMsg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.FundingTransitionMsg - */ -export declare const FundingTransitionMsg: FundingTransitionMsg$Type; -declare class FundingStateStepResp$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FundingStateStepResp; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FundingStateStepResp): FundingStateStepResp; - internalBinaryWrite(message: FundingStateStepResp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.FundingStateStepResp - */ -export declare const FundingStateStepResp: FundingStateStepResp$Type; -declare class PendingHTLC$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PendingHTLC; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingHTLC): PendingHTLC; - internalBinaryWrite(message: PendingHTLC, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PendingHTLC - */ -export declare const PendingHTLC: PendingHTLC$Type; -declare class PendingChannelsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PendingChannelsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsRequest): PendingChannelsRequest; - internalBinaryWrite(message: PendingChannelsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsRequest - */ -export declare const PendingChannelsRequest: PendingChannelsRequest$Type; -declare class PendingChannelsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PendingChannelsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse): PendingChannelsResponse; - internalBinaryWrite(message: PendingChannelsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse - */ -export declare const PendingChannelsResponse: PendingChannelsResponse$Type; -declare class PendingChannelsResponse_PendingChannel$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PendingChannelsResponse_PendingChannel; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_PendingChannel): PendingChannelsResponse_PendingChannel; - internalBinaryWrite(message: PendingChannelsResponse_PendingChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.PendingChannel - */ -export declare const PendingChannelsResponse_PendingChannel: PendingChannelsResponse_PendingChannel$Type; -declare class PendingChannelsResponse_PendingOpenChannel$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PendingChannelsResponse_PendingOpenChannel; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_PendingOpenChannel): PendingChannelsResponse_PendingOpenChannel; - internalBinaryWrite(message: PendingChannelsResponse_PendingOpenChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.PendingOpenChannel - */ -export declare const PendingChannelsResponse_PendingOpenChannel: PendingChannelsResponse_PendingOpenChannel$Type; -declare class PendingChannelsResponse_WaitingCloseChannel$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PendingChannelsResponse_WaitingCloseChannel; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_WaitingCloseChannel): PendingChannelsResponse_WaitingCloseChannel; - internalBinaryWrite(message: PendingChannelsResponse_WaitingCloseChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.WaitingCloseChannel - */ -export declare const PendingChannelsResponse_WaitingCloseChannel: PendingChannelsResponse_WaitingCloseChannel$Type; -declare class PendingChannelsResponse_Commitments$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PendingChannelsResponse_Commitments; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_Commitments): PendingChannelsResponse_Commitments; - internalBinaryWrite(message: PendingChannelsResponse_Commitments, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.Commitments - */ -export declare const PendingChannelsResponse_Commitments: PendingChannelsResponse_Commitments$Type; -declare class PendingChannelsResponse_ClosedChannel$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PendingChannelsResponse_ClosedChannel; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_ClosedChannel): PendingChannelsResponse_ClosedChannel; - internalBinaryWrite(message: PendingChannelsResponse_ClosedChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.ClosedChannel - */ -export declare const PendingChannelsResponse_ClosedChannel: PendingChannelsResponse_ClosedChannel$Type; -declare class PendingChannelsResponse_ForceClosedChannel$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PendingChannelsResponse_ForceClosedChannel; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PendingChannelsResponse_ForceClosedChannel): PendingChannelsResponse_ForceClosedChannel; - internalBinaryWrite(message: PendingChannelsResponse_ForceClosedChannel, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.ForceClosedChannel - */ -export declare const PendingChannelsResponse_ForceClosedChannel: PendingChannelsResponse_ForceClosedChannel$Type; -declare class ChannelEventSubscription$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelEventSubscription; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEventSubscription): ChannelEventSubscription; - internalBinaryWrite(message: ChannelEventSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEventSubscription - */ -export declare const ChannelEventSubscription: ChannelEventSubscription$Type; -declare class ChannelEventUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelEventUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEventUpdate): ChannelEventUpdate; - internalBinaryWrite(message: ChannelEventUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEventUpdate - */ -export declare const ChannelEventUpdate: ChannelEventUpdate$Type; -declare class WalletAccountBalance$Type extends MessageType { - constructor(); - create(value?: PartialMessage): WalletAccountBalance; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WalletAccountBalance): WalletAccountBalance; - internalBinaryWrite(message: WalletAccountBalance, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.WalletAccountBalance - */ -export declare const WalletAccountBalance: WalletAccountBalance$Type; -declare class WalletBalanceRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): WalletBalanceRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WalletBalanceRequest): WalletBalanceRequest; - internalBinaryWrite(message: WalletBalanceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.WalletBalanceRequest - */ -export declare const WalletBalanceRequest: WalletBalanceRequest$Type; -declare class WalletBalanceResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): WalletBalanceResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WalletBalanceResponse): WalletBalanceResponse; - private binaryReadMap4; - internalBinaryWrite(message: WalletBalanceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.WalletBalanceResponse - */ -export declare const WalletBalanceResponse: WalletBalanceResponse$Type; -declare class Amount$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Amount; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Amount): Amount; - internalBinaryWrite(message: Amount, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Amount - */ -export declare const Amount: Amount$Type; -declare class ChannelBalanceRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelBalanceRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBalanceRequest): ChannelBalanceRequest; - internalBinaryWrite(message: ChannelBalanceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBalanceRequest - */ -export declare const ChannelBalanceRequest: ChannelBalanceRequest$Type; -declare class ChannelBalanceResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelBalanceResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBalanceResponse): ChannelBalanceResponse; - internalBinaryWrite(message: ChannelBalanceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBalanceResponse - */ -export declare const ChannelBalanceResponse: ChannelBalanceResponse$Type; -declare class QueryRoutesRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): QueryRoutesRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRoutesRequest): QueryRoutesRequest; - private binaryReadMap13; - internalBinaryWrite(message: QueryRoutesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.QueryRoutesRequest - */ -export declare const QueryRoutesRequest: QueryRoutesRequest$Type; -declare class NodePair$Type extends MessageType { - constructor(); - create(value?: PartialMessage): NodePair; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodePair): NodePair; - internalBinaryWrite(message: NodePair, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.NodePair - */ -export declare const NodePair: NodePair$Type; -declare class EdgeLocator$Type extends MessageType { - constructor(); - create(value?: PartialMessage): EdgeLocator; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EdgeLocator): EdgeLocator; - internalBinaryWrite(message: EdgeLocator, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.EdgeLocator - */ -export declare const EdgeLocator: EdgeLocator$Type; -declare class QueryRoutesResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): QueryRoutesResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryRoutesResponse): QueryRoutesResponse; - internalBinaryWrite(message: QueryRoutesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.QueryRoutesResponse - */ -export declare const QueryRoutesResponse: QueryRoutesResponse$Type; -declare class Hop$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Hop; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Hop): Hop; - private binaryReadMap11; - internalBinaryWrite(message: Hop, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Hop - */ -export declare const Hop: Hop$Type; -declare class MPPRecord$Type extends MessageType { - constructor(); - create(value?: PartialMessage): MPPRecord; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MPPRecord): MPPRecord; - internalBinaryWrite(message: MPPRecord, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.MPPRecord - */ -export declare const MPPRecord: MPPRecord$Type; -declare class AMPRecord$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AMPRecord; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AMPRecord): AMPRecord; - internalBinaryWrite(message: AMPRecord, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.AMPRecord - */ -export declare const AMPRecord: AMPRecord$Type; -declare class Route$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Route; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Route): Route; - internalBinaryWrite(message: Route, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Route - */ -export declare const Route: Route$Type; -declare class NodeInfoRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): NodeInfoRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeInfoRequest): NodeInfoRequest; - internalBinaryWrite(message: NodeInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.NodeInfoRequest - */ -export declare const NodeInfoRequest: NodeInfoRequest$Type; -declare class NodeInfo$Type extends MessageType { - constructor(); - create(value?: PartialMessage): NodeInfo; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeInfo): NodeInfo; - internalBinaryWrite(message: NodeInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.NodeInfo - */ -export declare const NodeInfo: NodeInfo$Type; -declare class LightningNode$Type extends MessageType { - constructor(); - create(value?: PartialMessage): LightningNode; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LightningNode): LightningNode; - private binaryReadMap6; - private binaryReadMap7; - internalBinaryWrite(message: LightningNode, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.LightningNode - */ -export declare const LightningNode: LightningNode$Type; -declare class NodeAddress$Type extends MessageType { - constructor(); - create(value?: PartialMessage): NodeAddress; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeAddress): NodeAddress; - internalBinaryWrite(message: NodeAddress, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.NodeAddress - */ -export declare const NodeAddress: NodeAddress$Type; -declare class RoutingPolicy$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RoutingPolicy; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RoutingPolicy): RoutingPolicy; - private binaryReadMap8; - internalBinaryWrite(message: RoutingPolicy, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.RoutingPolicy - */ -export declare const RoutingPolicy: RoutingPolicy$Type; -declare class ChannelEdge$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelEdge; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEdge): ChannelEdge; - private binaryReadMap9; - internalBinaryWrite(message: ChannelEdge, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEdge - */ -export declare const ChannelEdge: ChannelEdge$Type; -declare class ChannelGraphRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelGraphRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelGraphRequest): ChannelGraphRequest; - internalBinaryWrite(message: ChannelGraphRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelGraphRequest - */ -export declare const ChannelGraphRequest: ChannelGraphRequest$Type; -declare class ChannelGraph$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelGraph; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelGraph): ChannelGraph; - internalBinaryWrite(message: ChannelGraph, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelGraph - */ -export declare const ChannelGraph: ChannelGraph$Type; -declare class NodeMetricsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): NodeMetricsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeMetricsRequest): NodeMetricsRequest; - internalBinaryWrite(message: NodeMetricsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.NodeMetricsRequest - */ -export declare const NodeMetricsRequest: NodeMetricsRequest$Type; -declare class NodeMetricsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): NodeMetricsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeMetricsResponse): NodeMetricsResponse; - private binaryReadMap1; - internalBinaryWrite(message: NodeMetricsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.NodeMetricsResponse - */ -export declare const NodeMetricsResponse: NodeMetricsResponse$Type; -declare class FloatMetric$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FloatMetric; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FloatMetric): FloatMetric; - internalBinaryWrite(message: FloatMetric, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.FloatMetric - */ -export declare const FloatMetric: FloatMetric$Type; -declare class ChanInfoRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChanInfoRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanInfoRequest): ChanInfoRequest; - internalBinaryWrite(message: ChanInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChanInfoRequest - */ -export declare const ChanInfoRequest: ChanInfoRequest$Type; -declare class NetworkInfoRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): NetworkInfoRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NetworkInfoRequest): NetworkInfoRequest; - internalBinaryWrite(message: NetworkInfoRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.NetworkInfoRequest - */ -export declare const NetworkInfoRequest: NetworkInfoRequest$Type; -declare class NetworkInfo$Type extends MessageType { - constructor(); - create(value?: PartialMessage): NetworkInfo; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NetworkInfo): NetworkInfo; - internalBinaryWrite(message: NetworkInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.NetworkInfo - */ -export declare const NetworkInfo: NetworkInfo$Type; -declare class StopRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): StopRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StopRequest): StopRequest; - internalBinaryWrite(message: StopRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.StopRequest - */ -export declare const StopRequest: StopRequest$Type; -declare class StopResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): StopResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StopResponse): StopResponse; - internalBinaryWrite(message: StopResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.StopResponse - */ -export declare const StopResponse: StopResponse$Type; -declare class GraphTopologySubscription$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GraphTopologySubscription; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GraphTopologySubscription): GraphTopologySubscription; - internalBinaryWrite(message: GraphTopologySubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.GraphTopologySubscription - */ -export declare const GraphTopologySubscription: GraphTopologySubscription$Type; -declare class GraphTopologyUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GraphTopologyUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GraphTopologyUpdate): GraphTopologyUpdate; - internalBinaryWrite(message: GraphTopologyUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.GraphTopologyUpdate - */ -export declare const GraphTopologyUpdate: GraphTopologyUpdate$Type; -declare class NodeUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): NodeUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NodeUpdate): NodeUpdate; - private binaryReadMap6; - internalBinaryWrite(message: NodeUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.NodeUpdate - */ -export declare const NodeUpdate: NodeUpdate$Type; -declare class ChannelEdgeUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelEdgeUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelEdgeUpdate): ChannelEdgeUpdate; - internalBinaryWrite(message: ChannelEdgeUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEdgeUpdate - */ -export declare const ChannelEdgeUpdate: ChannelEdgeUpdate$Type; -declare class ClosedChannelUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ClosedChannelUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ClosedChannelUpdate): ClosedChannelUpdate; - internalBinaryWrite(message: ClosedChannelUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ClosedChannelUpdate - */ -export declare const ClosedChannelUpdate: ClosedChannelUpdate$Type; -declare class HopHint$Type extends MessageType { - constructor(); - create(value?: PartialMessage): HopHint; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HopHint): HopHint; - internalBinaryWrite(message: HopHint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.HopHint - */ -export declare const HopHint: HopHint$Type; -declare class SetID$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SetID; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetID): SetID; - internalBinaryWrite(message: SetID, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.SetID - */ -export declare const SetID: SetID$Type; -declare class RouteHint$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RouteHint; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RouteHint): RouteHint; - internalBinaryWrite(message: RouteHint, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.RouteHint - */ -export declare const RouteHint: RouteHint$Type; -declare class AMPInvoiceState$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AMPInvoiceState; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AMPInvoiceState): AMPInvoiceState; - internalBinaryWrite(message: AMPInvoiceState, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.AMPInvoiceState - */ -export declare const AMPInvoiceState: AMPInvoiceState$Type; -declare class Invoice$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Invoice; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Invoice): Invoice; - private binaryReadMap24; - private binaryReadMap28; - internalBinaryWrite(message: Invoice, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Invoice - */ -export declare const Invoice: Invoice$Type; -declare class InvoiceHTLC$Type extends MessageType { - constructor(); - create(value?: PartialMessage): InvoiceHTLC; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InvoiceHTLC): InvoiceHTLC; - private binaryReadMap9; - internalBinaryWrite(message: InvoiceHTLC, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.InvoiceHTLC - */ -export declare const InvoiceHTLC: InvoiceHTLC$Type; -declare class AMP$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AMP; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AMP): AMP; - internalBinaryWrite(message: AMP, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.AMP - */ -export declare const AMP: AMP$Type; -declare class AddInvoiceResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AddInvoiceResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AddInvoiceResponse): AddInvoiceResponse; - internalBinaryWrite(message: AddInvoiceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.AddInvoiceResponse - */ -export declare const AddInvoiceResponse: AddInvoiceResponse$Type; -declare class PaymentHash$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PaymentHash; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PaymentHash): PaymentHash; - internalBinaryWrite(message: PaymentHash, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PaymentHash - */ -export declare const PaymentHash: PaymentHash$Type; -declare class ListInvoiceRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListInvoiceRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListInvoiceRequest): ListInvoiceRequest; - internalBinaryWrite(message: ListInvoiceRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListInvoiceRequest - */ -export declare const ListInvoiceRequest: ListInvoiceRequest$Type; -declare class ListInvoiceResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListInvoiceResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListInvoiceResponse): ListInvoiceResponse; - internalBinaryWrite(message: ListInvoiceResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListInvoiceResponse - */ -export declare const ListInvoiceResponse: ListInvoiceResponse$Type; -declare class InvoiceSubscription$Type extends MessageType { - constructor(); - create(value?: PartialMessage): InvoiceSubscription; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InvoiceSubscription): InvoiceSubscription; - internalBinaryWrite(message: InvoiceSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.InvoiceSubscription - */ -export declare const InvoiceSubscription: InvoiceSubscription$Type; -declare class Payment$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Payment; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Payment): Payment; - internalBinaryWrite(message: Payment, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Payment - */ -export declare const Payment: Payment$Type; -declare class HTLCAttempt$Type extends MessageType { - constructor(); - create(value?: PartialMessage): HTLCAttempt; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HTLCAttempt): HTLCAttempt; - internalBinaryWrite(message: HTLCAttempt, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.HTLCAttempt - */ -export declare const HTLCAttempt: HTLCAttempt$Type; -declare class ListPaymentsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListPaymentsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPaymentsRequest): ListPaymentsRequest; - internalBinaryWrite(message: ListPaymentsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListPaymentsRequest - */ -export declare const ListPaymentsRequest: ListPaymentsRequest$Type; -declare class ListPaymentsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListPaymentsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPaymentsResponse): ListPaymentsResponse; - internalBinaryWrite(message: ListPaymentsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListPaymentsResponse - */ -export declare const ListPaymentsResponse: ListPaymentsResponse$Type; -declare class DeletePaymentRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeletePaymentRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePaymentRequest): DeletePaymentRequest; - internalBinaryWrite(message: DeletePaymentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.DeletePaymentRequest - */ -export declare const DeletePaymentRequest: DeletePaymentRequest$Type; -declare class DeleteAllPaymentsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeleteAllPaymentsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteAllPaymentsRequest): DeleteAllPaymentsRequest; - internalBinaryWrite(message: DeleteAllPaymentsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.DeleteAllPaymentsRequest - */ -export declare const DeleteAllPaymentsRequest: DeleteAllPaymentsRequest$Type; -declare class DeletePaymentResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeletePaymentResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePaymentResponse): DeletePaymentResponse; - internalBinaryWrite(message: DeletePaymentResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.DeletePaymentResponse - */ -export declare const DeletePaymentResponse: DeletePaymentResponse$Type; -declare class DeleteAllPaymentsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeleteAllPaymentsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteAllPaymentsResponse): DeleteAllPaymentsResponse; - internalBinaryWrite(message: DeleteAllPaymentsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.DeleteAllPaymentsResponse - */ -export declare const DeleteAllPaymentsResponse: DeleteAllPaymentsResponse$Type; -declare class AbandonChannelRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AbandonChannelRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AbandonChannelRequest): AbandonChannelRequest; - internalBinaryWrite(message: AbandonChannelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.AbandonChannelRequest - */ -export declare const AbandonChannelRequest: AbandonChannelRequest$Type; -declare class AbandonChannelResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AbandonChannelResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AbandonChannelResponse): AbandonChannelResponse; - internalBinaryWrite(message: AbandonChannelResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.AbandonChannelResponse - */ -export declare const AbandonChannelResponse: AbandonChannelResponse$Type; -declare class DebugLevelRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DebugLevelRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DebugLevelRequest): DebugLevelRequest; - internalBinaryWrite(message: DebugLevelRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.DebugLevelRequest - */ -export declare const DebugLevelRequest: DebugLevelRequest$Type; -declare class DebugLevelResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DebugLevelResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DebugLevelResponse): DebugLevelResponse; - internalBinaryWrite(message: DebugLevelResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.DebugLevelResponse - */ -export declare const DebugLevelResponse: DebugLevelResponse$Type; -declare class PayReqString$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PayReqString; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PayReqString): PayReqString; - internalBinaryWrite(message: PayReqString, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PayReqString - */ -export declare const PayReqString: PayReqString$Type; -declare class PayReq$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PayReq; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PayReq): PayReq; - private binaryReadMap13; - internalBinaryWrite(message: PayReq, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PayReq - */ -export declare const PayReq: PayReq$Type; -declare class Feature$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Feature; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Feature): Feature; - internalBinaryWrite(message: Feature, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Feature - */ -export declare const Feature: Feature$Type; -declare class FeeReportRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FeeReportRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeeReportRequest): FeeReportRequest; - internalBinaryWrite(message: FeeReportRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.FeeReportRequest - */ -export declare const FeeReportRequest: FeeReportRequest$Type; -declare class ChannelFeeReport$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelFeeReport; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelFeeReport): ChannelFeeReport; - internalBinaryWrite(message: ChannelFeeReport, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelFeeReport - */ -export declare const ChannelFeeReport: ChannelFeeReport$Type; -declare class FeeReportResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FeeReportResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeeReportResponse): FeeReportResponse; - internalBinaryWrite(message: FeeReportResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.FeeReportResponse - */ -export declare const FeeReportResponse: FeeReportResponse$Type; -declare class PolicyUpdateRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PolicyUpdateRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PolicyUpdateRequest): PolicyUpdateRequest; - internalBinaryWrite(message: PolicyUpdateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PolicyUpdateRequest - */ -export declare const PolicyUpdateRequest: PolicyUpdateRequest$Type; -declare class FailedUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FailedUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FailedUpdate): FailedUpdate; - internalBinaryWrite(message: FailedUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.FailedUpdate - */ -export declare const FailedUpdate: FailedUpdate$Type; -declare class PolicyUpdateResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PolicyUpdateResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PolicyUpdateResponse): PolicyUpdateResponse; - internalBinaryWrite(message: PolicyUpdateResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.PolicyUpdateResponse - */ -export declare const PolicyUpdateResponse: PolicyUpdateResponse$Type; -declare class ForwardingHistoryRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ForwardingHistoryRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardingHistoryRequest): ForwardingHistoryRequest; - internalBinaryWrite(message: ForwardingHistoryRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ForwardingHistoryRequest - */ -export declare const ForwardingHistoryRequest: ForwardingHistoryRequest$Type; -declare class ForwardingEvent$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ForwardingEvent; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardingEvent): ForwardingEvent; - internalBinaryWrite(message: ForwardingEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ForwardingEvent - */ -export declare const ForwardingEvent: ForwardingEvent$Type; -declare class ForwardingHistoryResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ForwardingHistoryResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardingHistoryResponse): ForwardingHistoryResponse; - internalBinaryWrite(message: ForwardingHistoryResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ForwardingHistoryResponse - */ -export declare const ForwardingHistoryResponse: ForwardingHistoryResponse$Type; -declare class ExportChannelBackupRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ExportChannelBackupRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExportChannelBackupRequest): ExportChannelBackupRequest; - internalBinaryWrite(message: ExportChannelBackupRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ExportChannelBackupRequest - */ -export declare const ExportChannelBackupRequest: ExportChannelBackupRequest$Type; -declare class ChannelBackup$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelBackup; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBackup): ChannelBackup; - internalBinaryWrite(message: ChannelBackup, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBackup - */ -export declare const ChannelBackup: ChannelBackup$Type; -declare class MultiChanBackup$Type extends MessageType { - constructor(); - create(value?: PartialMessage): MultiChanBackup; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MultiChanBackup): MultiChanBackup; - internalBinaryWrite(message: MultiChanBackup, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.MultiChanBackup - */ -export declare const MultiChanBackup: MultiChanBackup$Type; -declare class ChanBackupExportRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChanBackupExportRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanBackupExportRequest): ChanBackupExportRequest; - internalBinaryWrite(message: ChanBackupExportRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChanBackupExportRequest - */ -export declare const ChanBackupExportRequest: ChanBackupExportRequest$Type; -declare class ChanBackupSnapshot$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChanBackupSnapshot; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChanBackupSnapshot): ChanBackupSnapshot; - internalBinaryWrite(message: ChanBackupSnapshot, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChanBackupSnapshot - */ -export declare const ChanBackupSnapshot: ChanBackupSnapshot$Type; -declare class ChannelBackups$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelBackups; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBackups): ChannelBackups; - internalBinaryWrite(message: ChannelBackups, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBackups - */ -export declare const ChannelBackups: ChannelBackups$Type; -declare class RestoreChanBackupRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RestoreChanBackupRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RestoreChanBackupRequest): RestoreChanBackupRequest; - internalBinaryWrite(message: RestoreChanBackupRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.RestoreChanBackupRequest - */ -export declare const RestoreChanBackupRequest: RestoreChanBackupRequest$Type; -declare class RestoreBackupResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RestoreBackupResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RestoreBackupResponse): RestoreBackupResponse; - internalBinaryWrite(message: RestoreBackupResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.RestoreBackupResponse - */ -export declare const RestoreBackupResponse: RestoreBackupResponse$Type; -declare class ChannelBackupSubscription$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelBackupSubscription; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelBackupSubscription): ChannelBackupSubscription; - internalBinaryWrite(message: ChannelBackupSubscription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBackupSubscription - */ -export declare const ChannelBackupSubscription: ChannelBackupSubscription$Type; -declare class VerifyChanBackupResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): VerifyChanBackupResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: VerifyChanBackupResponse): VerifyChanBackupResponse; - internalBinaryWrite(message: VerifyChanBackupResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.VerifyChanBackupResponse - */ -export declare const VerifyChanBackupResponse: VerifyChanBackupResponse$Type; -declare class MacaroonPermission$Type extends MessageType { - constructor(); - create(value?: PartialMessage): MacaroonPermission; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MacaroonPermission): MacaroonPermission; - internalBinaryWrite(message: MacaroonPermission, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.MacaroonPermission - */ -export declare const MacaroonPermission: MacaroonPermission$Type; -declare class BakeMacaroonRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): BakeMacaroonRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BakeMacaroonRequest): BakeMacaroonRequest; - internalBinaryWrite(message: BakeMacaroonRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.BakeMacaroonRequest - */ -export declare const BakeMacaroonRequest: BakeMacaroonRequest$Type; -declare class BakeMacaroonResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): BakeMacaroonResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BakeMacaroonResponse): BakeMacaroonResponse; - internalBinaryWrite(message: BakeMacaroonResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.BakeMacaroonResponse - */ -export declare const BakeMacaroonResponse: BakeMacaroonResponse$Type; -declare class ListMacaroonIDsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListMacaroonIDsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListMacaroonIDsRequest): ListMacaroonIDsRequest; - internalBinaryWrite(message: ListMacaroonIDsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListMacaroonIDsRequest - */ -export declare const ListMacaroonIDsRequest: ListMacaroonIDsRequest$Type; -declare class ListMacaroonIDsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListMacaroonIDsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListMacaroonIDsResponse): ListMacaroonIDsResponse; - internalBinaryWrite(message: ListMacaroonIDsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListMacaroonIDsResponse - */ -export declare const ListMacaroonIDsResponse: ListMacaroonIDsResponse$Type; -declare class DeleteMacaroonIDRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeleteMacaroonIDRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteMacaroonIDRequest): DeleteMacaroonIDRequest; - internalBinaryWrite(message: DeleteMacaroonIDRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.DeleteMacaroonIDRequest - */ -export declare const DeleteMacaroonIDRequest: DeleteMacaroonIDRequest$Type; -declare class DeleteMacaroonIDResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeleteMacaroonIDResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteMacaroonIDResponse): DeleteMacaroonIDResponse; - internalBinaryWrite(message: DeleteMacaroonIDResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.DeleteMacaroonIDResponse - */ -export declare const DeleteMacaroonIDResponse: DeleteMacaroonIDResponse$Type; -declare class MacaroonPermissionList$Type extends MessageType { - constructor(); - create(value?: PartialMessage): MacaroonPermissionList; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MacaroonPermissionList): MacaroonPermissionList; - internalBinaryWrite(message: MacaroonPermissionList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.MacaroonPermissionList - */ -export declare const MacaroonPermissionList: MacaroonPermissionList$Type; -declare class ListPermissionsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListPermissionsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPermissionsRequest): ListPermissionsRequest; - internalBinaryWrite(message: ListPermissionsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListPermissionsRequest - */ -export declare const ListPermissionsRequest: ListPermissionsRequest$Type; -declare class ListPermissionsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListPermissionsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPermissionsResponse): ListPermissionsResponse; - private binaryReadMap1; - internalBinaryWrite(message: ListPermissionsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ListPermissionsResponse - */ -export declare const ListPermissionsResponse: ListPermissionsResponse$Type; -declare class Failure$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Failure; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Failure): Failure; - internalBinaryWrite(message: Failure, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Failure - */ -export declare const Failure: Failure$Type; -declare class ChannelUpdate$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ChannelUpdate; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ChannelUpdate): ChannelUpdate; - internalBinaryWrite(message: ChannelUpdate, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelUpdate - */ -export declare const ChannelUpdate: ChannelUpdate$Type; -declare class MacaroonId$Type extends MessageType { - constructor(); - create(value?: PartialMessage): MacaroonId; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MacaroonId): MacaroonId; - internalBinaryWrite(message: MacaroonId, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.MacaroonId - */ -export declare const MacaroonId: MacaroonId$Type; -declare class Op$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Op; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Op): Op; - internalBinaryWrite(message: Op, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.Op - */ -export declare const Op: Op$Type; -declare class CheckMacPermRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): CheckMacPermRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CheckMacPermRequest): CheckMacPermRequest; - internalBinaryWrite(message: CheckMacPermRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.CheckMacPermRequest - */ -export declare const CheckMacPermRequest: CheckMacPermRequest$Type; -declare class CheckMacPermResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): CheckMacPermResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CheckMacPermResponse): CheckMacPermResponse; - internalBinaryWrite(message: CheckMacPermResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.CheckMacPermResponse - */ -export declare const CheckMacPermResponse: CheckMacPermResponse$Type; -declare class RPCMiddlewareRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RPCMiddlewareRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMiddlewareRequest): RPCMiddlewareRequest; - internalBinaryWrite(message: RPCMiddlewareRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.RPCMiddlewareRequest - */ -export declare const RPCMiddlewareRequest: RPCMiddlewareRequest$Type; -declare class StreamAuth$Type extends MessageType { - constructor(); - create(value?: PartialMessage): StreamAuth; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StreamAuth): StreamAuth; - internalBinaryWrite(message: StreamAuth, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.StreamAuth - */ -export declare const StreamAuth: StreamAuth$Type; -declare class RPCMessage$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RPCMessage; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMessage): RPCMessage; - internalBinaryWrite(message: RPCMessage, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.RPCMessage - */ -export declare const RPCMessage: RPCMessage$Type; -declare class RPCMiddlewareResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RPCMiddlewareResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RPCMiddlewareResponse): RPCMiddlewareResponse; - internalBinaryWrite(message: RPCMiddlewareResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.RPCMiddlewareResponse - */ -export declare const RPCMiddlewareResponse: RPCMiddlewareResponse$Type; -declare class MiddlewareRegistration$Type extends MessageType { - constructor(); - create(value?: PartialMessage): MiddlewareRegistration; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MiddlewareRegistration): MiddlewareRegistration; - internalBinaryWrite(message: MiddlewareRegistration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.MiddlewareRegistration - */ -export declare const MiddlewareRegistration: MiddlewareRegistration$Type; -declare class InterceptFeedback$Type extends MessageType { - constructor(); - create(value?: PartialMessage): InterceptFeedback; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: InterceptFeedback): InterceptFeedback; - internalBinaryWrite(message: InterceptFeedback, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message lnrpc.InterceptFeedback - */ -export declare const InterceptFeedback: InterceptFeedback$Type; -/** - * @generated ServiceType for protobuf service lnrpc.Lightning - */ -export declare const Lightning: any; -export {}; diff --git a/proto/lnd/lightning.js b/proto/lnd/lightning.js deleted file mode 100644 index a8a224cb..00000000 --- a/proto/lnd/lightning.js +++ /dev/null @@ -1,14457 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3) -// tslint:disable -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "lightning.proto" (package "lnrpc", syntax proto3) -// tslint:disable -import { ServiceType } from "@protobuf-ts/runtime-rpc"; -import { WireType } from "@protobuf-ts/runtime"; -import { UnknownFieldHandler } 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 enum lnrpc.ChannelCloseSummary.ClosureType - */ -export var ChannelCloseSummary_ClosureType; -(function (ChannelCloseSummary_ClosureType) { - /** - * @generated from protobuf enum value: COOPERATIVE_CLOSE = 0; - */ - ChannelCloseSummary_ClosureType[ChannelCloseSummary_ClosureType["COOPERATIVE_CLOSE"] = 0] = "COOPERATIVE_CLOSE"; - /** - * @generated from protobuf enum value: LOCAL_FORCE_CLOSE = 1; - */ - ChannelCloseSummary_ClosureType[ChannelCloseSummary_ClosureType["LOCAL_FORCE_CLOSE"] = 1] = "LOCAL_FORCE_CLOSE"; - /** - * @generated from protobuf enum value: REMOTE_FORCE_CLOSE = 2; - */ - ChannelCloseSummary_ClosureType[ChannelCloseSummary_ClosureType["REMOTE_FORCE_CLOSE"] = 2] = "REMOTE_FORCE_CLOSE"; - /** - * @generated from protobuf enum value: BREACH_CLOSE = 3; - */ - ChannelCloseSummary_ClosureType[ChannelCloseSummary_ClosureType["BREACH_CLOSE"] = 3] = "BREACH_CLOSE"; - /** - * @generated from protobuf enum value: FUNDING_CANCELED = 4; - */ - ChannelCloseSummary_ClosureType[ChannelCloseSummary_ClosureType["FUNDING_CANCELED"] = 4] = "FUNDING_CANCELED"; - /** - * @generated from protobuf enum value: ABANDONED = 5; - */ - ChannelCloseSummary_ClosureType[ChannelCloseSummary_ClosureType["ABANDONED"] = 5] = "ABANDONED"; -})(ChannelCloseSummary_ClosureType || (ChannelCloseSummary_ClosureType = {})); -/** - * @generated from protobuf enum lnrpc.Peer.SyncType - */ -export var Peer_SyncType; -(function (Peer_SyncType) { - /** - * - * Denotes that we cannot determine the peer's current sync type. - * - * @generated from protobuf enum value: UNKNOWN_SYNC = 0; - */ - Peer_SyncType[Peer_SyncType["UNKNOWN_SYNC"] = 0] = "UNKNOWN_SYNC"; - /** - * - * Denotes that we are actively receiving new graph updates from the peer. - * - * @generated from protobuf enum value: ACTIVE_SYNC = 1; - */ - Peer_SyncType[Peer_SyncType["ACTIVE_SYNC"] = 1] = "ACTIVE_SYNC"; - /** - * - * Denotes that we are not receiving new graph updates from the peer. - * - * @generated from protobuf enum value: PASSIVE_SYNC = 2; - */ - Peer_SyncType[Peer_SyncType["PASSIVE_SYNC"] = 2] = "PASSIVE_SYNC"; - /** - * - * Denotes that this peer is pinned into an active sync. - * - * @generated from protobuf enum value: PINNED_SYNC = 3; - */ - Peer_SyncType[Peer_SyncType["PINNED_SYNC"] = 3] = "PINNED_SYNC"; -})(Peer_SyncType || (Peer_SyncType = {})); -/** - * @generated from protobuf enum lnrpc.PeerEvent.EventType - */ -export var PeerEvent_EventType; -(function (PeerEvent_EventType) { - /** - * @generated from protobuf enum value: PEER_ONLINE = 0; - */ - PeerEvent_EventType[PeerEvent_EventType["PEER_ONLINE"] = 0] = "PEER_ONLINE"; - /** - * @generated from protobuf enum value: PEER_OFFLINE = 1; - */ - PeerEvent_EventType[PeerEvent_EventType["PEER_OFFLINE"] = 1] = "PEER_OFFLINE"; -})(PeerEvent_EventType || (PeerEvent_EventType = {})); -/** - * - * 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 var PendingChannelsResponse_ForceClosedChannel_AnchorState; -(function (PendingChannelsResponse_ForceClosedChannel_AnchorState) { - /** - * The recovered_balance is zero and limbo_balance is non-zero. - * - * @generated from protobuf enum value: LIMBO = 0; - */ - PendingChannelsResponse_ForceClosedChannel_AnchorState[PendingChannelsResponse_ForceClosedChannel_AnchorState["LIMBO"] = 0] = "LIMBO"; - /** - * The recovered_balance is non-zero. - * - * @generated from protobuf enum value: RECOVERED = 1; - */ - PendingChannelsResponse_ForceClosedChannel_AnchorState[PendingChannelsResponse_ForceClosedChannel_AnchorState["RECOVERED"] = 1] = "RECOVERED"; - /** - * A state that is neither LIMBO nor RECOVERED. - * - * @generated from protobuf enum value: LOST = 2; - */ - PendingChannelsResponse_ForceClosedChannel_AnchorState[PendingChannelsResponse_ForceClosedChannel_AnchorState["LOST"] = 2] = "LOST"; -})(PendingChannelsResponse_ForceClosedChannel_AnchorState || (PendingChannelsResponse_ForceClosedChannel_AnchorState = {})); -/** - * @generated from protobuf enum lnrpc.ChannelEventUpdate.UpdateType - */ -export var ChannelEventUpdate_UpdateType; -(function (ChannelEventUpdate_UpdateType) { - /** - * @generated from protobuf enum value: OPEN_CHANNEL = 0; - */ - ChannelEventUpdate_UpdateType[ChannelEventUpdate_UpdateType["OPEN_CHANNEL"] = 0] = "OPEN_CHANNEL"; - /** - * @generated from protobuf enum value: CLOSED_CHANNEL = 1; - */ - ChannelEventUpdate_UpdateType[ChannelEventUpdate_UpdateType["CLOSED_CHANNEL"] = 1] = "CLOSED_CHANNEL"; - /** - * @generated from protobuf enum value: ACTIVE_CHANNEL = 2; - */ - ChannelEventUpdate_UpdateType[ChannelEventUpdate_UpdateType["ACTIVE_CHANNEL"] = 2] = "ACTIVE_CHANNEL"; - /** - * @generated from protobuf enum value: INACTIVE_CHANNEL = 3; - */ - ChannelEventUpdate_UpdateType[ChannelEventUpdate_UpdateType["INACTIVE_CHANNEL"] = 3] = "INACTIVE_CHANNEL"; - /** - * @generated from protobuf enum value: PENDING_OPEN_CHANNEL = 4; - */ - ChannelEventUpdate_UpdateType[ChannelEventUpdate_UpdateType["PENDING_OPEN_CHANNEL"] = 4] = "PENDING_OPEN_CHANNEL"; - /** - * @generated from protobuf enum value: FULLY_RESOLVED_CHANNEL = 5; - */ - ChannelEventUpdate_UpdateType[ChannelEventUpdate_UpdateType["FULLY_RESOLVED_CHANNEL"] = 5] = "FULLY_RESOLVED_CHANNEL"; -})(ChannelEventUpdate_UpdateType || (ChannelEventUpdate_UpdateType = {})); -/** - * @generated from protobuf enum lnrpc.Invoice.InvoiceState - */ -export var Invoice_InvoiceState; -(function (Invoice_InvoiceState) { - /** - * @generated from protobuf enum value: OPEN = 0; - */ - Invoice_InvoiceState[Invoice_InvoiceState["OPEN"] = 0] = "OPEN"; - /** - * @generated from protobuf enum value: SETTLED = 1; - */ - Invoice_InvoiceState[Invoice_InvoiceState["SETTLED"] = 1] = "SETTLED"; - /** - * @generated from protobuf enum value: CANCELED = 2; - */ - Invoice_InvoiceState[Invoice_InvoiceState["CANCELED"] = 2] = "CANCELED"; - /** - * @generated from protobuf enum value: ACCEPTED = 3; - */ - Invoice_InvoiceState[Invoice_InvoiceState["ACCEPTED"] = 3] = "ACCEPTED"; -})(Invoice_InvoiceState || (Invoice_InvoiceState = {})); -/** - * @generated from protobuf enum lnrpc.Payment.PaymentStatus - */ -export var Payment_PaymentStatus; -(function (Payment_PaymentStatus) { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - Payment_PaymentStatus[Payment_PaymentStatus["UNKNOWN"] = 0] = "UNKNOWN"; - /** - * @generated from protobuf enum value: IN_FLIGHT = 1; - */ - Payment_PaymentStatus[Payment_PaymentStatus["IN_FLIGHT"] = 1] = "IN_FLIGHT"; - /** - * @generated from protobuf enum value: SUCCEEDED = 2; - */ - Payment_PaymentStatus[Payment_PaymentStatus["SUCCEEDED"] = 2] = "SUCCEEDED"; - /** - * @generated from protobuf enum value: FAILED = 3; - */ - Payment_PaymentStatus[Payment_PaymentStatus["FAILED"] = 3] = "FAILED"; -})(Payment_PaymentStatus || (Payment_PaymentStatus = {})); -/** - * @generated from protobuf enum lnrpc.HTLCAttempt.HTLCStatus - */ -export var HTLCAttempt_HTLCStatus; -(function (HTLCAttempt_HTLCStatus) { - /** - * @generated from protobuf enum value: IN_FLIGHT = 0; - */ - HTLCAttempt_HTLCStatus[HTLCAttempt_HTLCStatus["IN_FLIGHT"] = 0] = "IN_FLIGHT"; - /** - * @generated from protobuf enum value: SUCCEEDED = 1; - */ - HTLCAttempt_HTLCStatus[HTLCAttempt_HTLCStatus["SUCCEEDED"] = 1] = "SUCCEEDED"; - /** - * @generated from protobuf enum value: FAILED = 2; - */ - HTLCAttempt_HTLCStatus[HTLCAttempt_HTLCStatus["FAILED"] = 2] = "FAILED"; -})(HTLCAttempt_HTLCStatus || (HTLCAttempt_HTLCStatus = {})); -/** - * @generated from protobuf enum lnrpc.Failure.FailureCode - */ -export var Failure_FailureCode; -(function (Failure_FailureCode) { - /** - * - * The numbers assigned in this enumeration match the failure codes as - * defined in BOLT #4. Because protobuf 3 requires enums to start with 0, - * a RESERVED value is added. - * - * @generated from protobuf enum value: RESERVED = 0; - */ - Failure_FailureCode[Failure_FailureCode["RESERVED"] = 0] = "RESERVED"; - /** - * @generated from protobuf enum value: INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1; - */ - Failure_FailureCode[Failure_FailureCode["INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS"] = 1] = "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS"; - /** - * @generated from protobuf enum value: INCORRECT_PAYMENT_AMOUNT = 2; - */ - Failure_FailureCode[Failure_FailureCode["INCORRECT_PAYMENT_AMOUNT"] = 2] = "INCORRECT_PAYMENT_AMOUNT"; - /** - * @generated from protobuf enum value: FINAL_INCORRECT_CLTV_EXPIRY = 3; - */ - Failure_FailureCode[Failure_FailureCode["FINAL_INCORRECT_CLTV_EXPIRY"] = 3] = "FINAL_INCORRECT_CLTV_EXPIRY"; - /** - * @generated from protobuf enum value: FINAL_INCORRECT_HTLC_AMOUNT = 4; - */ - Failure_FailureCode[Failure_FailureCode["FINAL_INCORRECT_HTLC_AMOUNT"] = 4] = "FINAL_INCORRECT_HTLC_AMOUNT"; - /** - * @generated from protobuf enum value: FINAL_EXPIRY_TOO_SOON = 5; - */ - Failure_FailureCode[Failure_FailureCode["FINAL_EXPIRY_TOO_SOON"] = 5] = "FINAL_EXPIRY_TOO_SOON"; - /** - * @generated from protobuf enum value: INVALID_REALM = 6; - */ - Failure_FailureCode[Failure_FailureCode["INVALID_REALM"] = 6] = "INVALID_REALM"; - /** - * @generated from protobuf enum value: EXPIRY_TOO_SOON = 7; - */ - Failure_FailureCode[Failure_FailureCode["EXPIRY_TOO_SOON"] = 7] = "EXPIRY_TOO_SOON"; - /** - * @generated from protobuf enum value: INVALID_ONION_VERSION = 8; - */ - Failure_FailureCode[Failure_FailureCode["INVALID_ONION_VERSION"] = 8] = "INVALID_ONION_VERSION"; - /** - * @generated from protobuf enum value: INVALID_ONION_HMAC = 9; - */ - Failure_FailureCode[Failure_FailureCode["INVALID_ONION_HMAC"] = 9] = "INVALID_ONION_HMAC"; - /** - * @generated from protobuf enum value: INVALID_ONION_KEY = 10; - */ - Failure_FailureCode[Failure_FailureCode["INVALID_ONION_KEY"] = 10] = "INVALID_ONION_KEY"; - /** - * @generated from protobuf enum value: AMOUNT_BELOW_MINIMUM = 11; - */ - Failure_FailureCode[Failure_FailureCode["AMOUNT_BELOW_MINIMUM"] = 11] = "AMOUNT_BELOW_MINIMUM"; - /** - * @generated from protobuf enum value: FEE_INSUFFICIENT = 12; - */ - Failure_FailureCode[Failure_FailureCode["FEE_INSUFFICIENT"] = 12] = "FEE_INSUFFICIENT"; - /** - * @generated from protobuf enum value: INCORRECT_CLTV_EXPIRY = 13; - */ - Failure_FailureCode[Failure_FailureCode["INCORRECT_CLTV_EXPIRY"] = 13] = "INCORRECT_CLTV_EXPIRY"; - /** - * @generated from protobuf enum value: CHANNEL_DISABLED = 14; - */ - Failure_FailureCode[Failure_FailureCode["CHANNEL_DISABLED"] = 14] = "CHANNEL_DISABLED"; - /** - * @generated from protobuf enum value: TEMPORARY_CHANNEL_FAILURE = 15; - */ - Failure_FailureCode[Failure_FailureCode["TEMPORARY_CHANNEL_FAILURE"] = 15] = "TEMPORARY_CHANNEL_FAILURE"; - /** - * @generated from protobuf enum value: REQUIRED_NODE_FEATURE_MISSING = 16; - */ - Failure_FailureCode[Failure_FailureCode["REQUIRED_NODE_FEATURE_MISSING"] = 16] = "REQUIRED_NODE_FEATURE_MISSING"; - /** - * @generated from protobuf enum value: REQUIRED_CHANNEL_FEATURE_MISSING = 17; - */ - Failure_FailureCode[Failure_FailureCode["REQUIRED_CHANNEL_FEATURE_MISSING"] = 17] = "REQUIRED_CHANNEL_FEATURE_MISSING"; - /** - * @generated from protobuf enum value: UNKNOWN_NEXT_PEER = 18; - */ - Failure_FailureCode[Failure_FailureCode["UNKNOWN_NEXT_PEER"] = 18] = "UNKNOWN_NEXT_PEER"; - /** - * @generated from protobuf enum value: TEMPORARY_NODE_FAILURE = 19; - */ - Failure_FailureCode[Failure_FailureCode["TEMPORARY_NODE_FAILURE"] = 19] = "TEMPORARY_NODE_FAILURE"; - /** - * @generated from protobuf enum value: PERMANENT_NODE_FAILURE = 20; - */ - Failure_FailureCode[Failure_FailureCode["PERMANENT_NODE_FAILURE"] = 20] = "PERMANENT_NODE_FAILURE"; - /** - * @generated from protobuf enum value: PERMANENT_CHANNEL_FAILURE = 21; - */ - Failure_FailureCode[Failure_FailureCode["PERMANENT_CHANNEL_FAILURE"] = 21] = "PERMANENT_CHANNEL_FAILURE"; - /** - * @generated from protobuf enum value: EXPIRY_TOO_FAR = 22; - */ - Failure_FailureCode[Failure_FailureCode["EXPIRY_TOO_FAR"] = 22] = "EXPIRY_TOO_FAR"; - /** - * @generated from protobuf enum value: MPP_TIMEOUT = 23; - */ - Failure_FailureCode[Failure_FailureCode["MPP_TIMEOUT"] = 23] = "MPP_TIMEOUT"; - /** - * @generated from protobuf enum value: INVALID_ONION_PAYLOAD = 24; - */ - Failure_FailureCode[Failure_FailureCode["INVALID_ONION_PAYLOAD"] = 24] = "INVALID_ONION_PAYLOAD"; - /** - * - * An internal error occurred. - * - * @generated from protobuf enum value: INTERNAL_FAILURE = 997; - */ - Failure_FailureCode[Failure_FailureCode["INTERNAL_FAILURE"] = 997] = "INTERNAL_FAILURE"; - /** - * - * The error source is known, but the failure itself couldn't be decoded. - * - * @generated from protobuf enum value: UNKNOWN_FAILURE = 998; - */ - Failure_FailureCode[Failure_FailureCode["UNKNOWN_FAILURE"] = 998] = "UNKNOWN_FAILURE"; - /** - * - * An unreadable failure result is returned if the received failure message - * cannot be decrypted. In that case the error source is unknown. - * - * @generated from protobuf enum value: UNREADABLE_FAILURE = 999; - */ - Failure_FailureCode[Failure_FailureCode["UNREADABLE_FAILURE"] = 999] = "UNREADABLE_FAILURE"; -})(Failure_FailureCode || (Failure_FailureCode = {})); -/** - * @generated from protobuf enum lnrpc.OutputScriptType - */ -export var OutputScriptType; -(function (OutputScriptType) { - /** - * @generated from protobuf enum value: SCRIPT_TYPE_PUBKEY_HASH = 0; - */ - OutputScriptType[OutputScriptType["SCRIPT_TYPE_PUBKEY_HASH"] = 0] = "SCRIPT_TYPE_PUBKEY_HASH"; - /** - * @generated from protobuf enum value: SCRIPT_TYPE_SCRIPT_HASH = 1; - */ - OutputScriptType[OutputScriptType["SCRIPT_TYPE_SCRIPT_HASH"] = 1] = "SCRIPT_TYPE_SCRIPT_HASH"; - /** - * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2; - */ - OutputScriptType[OutputScriptType["SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH"] = 2] = "SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH"; - /** - * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3; - */ - OutputScriptType[OutputScriptType["SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH"] = 3] = "SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH"; - /** - * @generated from protobuf enum value: SCRIPT_TYPE_PUBKEY = 4; - */ - OutputScriptType[OutputScriptType["SCRIPT_TYPE_PUBKEY"] = 4] = "SCRIPT_TYPE_PUBKEY"; - /** - * @generated from protobuf enum value: SCRIPT_TYPE_MULTISIG = 5; - */ - OutputScriptType[OutputScriptType["SCRIPT_TYPE_MULTISIG"] = 5] = "SCRIPT_TYPE_MULTISIG"; - /** - * @generated from protobuf enum value: SCRIPT_TYPE_NULLDATA = 6; - */ - OutputScriptType[OutputScriptType["SCRIPT_TYPE_NULLDATA"] = 6] = "SCRIPT_TYPE_NULLDATA"; - /** - * @generated from protobuf enum value: SCRIPT_TYPE_NON_STANDARD = 7; - */ - OutputScriptType[OutputScriptType["SCRIPT_TYPE_NON_STANDARD"] = 7] = "SCRIPT_TYPE_NON_STANDARD"; - /** - * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_UNKNOWN = 8; - */ - OutputScriptType[OutputScriptType["SCRIPT_TYPE_WITNESS_UNKNOWN"] = 8] = "SCRIPT_TYPE_WITNESS_UNKNOWN"; - /** - * @generated from protobuf enum value: SCRIPT_TYPE_WITNESS_V1_TAPROOT = 9; - */ - OutputScriptType[OutputScriptType["SCRIPT_TYPE_WITNESS_V1_TAPROOT"] = 9] = "SCRIPT_TYPE_WITNESS_V1_TAPROOT"; -})(OutputScriptType || (OutputScriptType = {})); -/** - * - * `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 - */ -export var AddressType; -(function (AddressType) { - /** - * @generated from protobuf enum value: WITNESS_PUBKEY_HASH = 0; - */ - AddressType[AddressType["WITNESS_PUBKEY_HASH"] = 0] = "WITNESS_PUBKEY_HASH"; - /** - * @generated from protobuf enum value: NESTED_PUBKEY_HASH = 1; - */ - AddressType[AddressType["NESTED_PUBKEY_HASH"] = 1] = "NESTED_PUBKEY_HASH"; - /** - * @generated from protobuf enum value: UNUSED_WITNESS_PUBKEY_HASH = 2; - */ - AddressType[AddressType["UNUSED_WITNESS_PUBKEY_HASH"] = 2] = "UNUSED_WITNESS_PUBKEY_HASH"; - /** - * @generated from protobuf enum value: UNUSED_NESTED_PUBKEY_HASH = 3; - */ - AddressType[AddressType["UNUSED_NESTED_PUBKEY_HASH"] = 3] = "UNUSED_NESTED_PUBKEY_HASH"; - /** - * @generated from protobuf enum value: TAPROOT_PUBKEY = 4; - */ - AddressType[AddressType["TAPROOT_PUBKEY"] = 4] = "TAPROOT_PUBKEY"; - /** - * @generated from protobuf enum value: UNUSED_TAPROOT_PUBKEY = 5; - */ - AddressType[AddressType["UNUSED_TAPROOT_PUBKEY"] = 5] = "UNUSED_TAPROOT_PUBKEY"; -})(AddressType || (AddressType = {})); -/** - * @generated from protobuf enum lnrpc.CommitmentType - */ -export var CommitmentType; -(function (CommitmentType) { - /** - * - * Returned when the commitment type isn't known or unavailable. - * - * @generated from protobuf enum value: UNKNOWN_COMMITMENT_TYPE = 0; - */ - CommitmentType[CommitmentType["UNKNOWN_COMMITMENT_TYPE"] = 0] = "UNKNOWN_COMMITMENT_TYPE"; - /** - * - * A channel using the legacy commitment format having tweaked to_remote - * keys. - * - * @generated from protobuf enum value: LEGACY = 1; - */ - CommitmentType[CommitmentType["LEGACY"] = 1] = "LEGACY"; - /** - * - * A channel that uses the modern commitment format where the key in the - * output of the remote party does not change each state. This makes back - * 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 = 2; - */ - CommitmentType[CommitmentType["STATIC_REMOTE_KEY"] = 2] = "STATIC_REMOTE_KEY"; - /** - * - * 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 = 3; - */ - CommitmentType[CommitmentType["ANCHORS"] = 3] = "ANCHORS"; - /** - * - * 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: SCRIPT_ENFORCED_LEASE = 4; - */ - CommitmentType[CommitmentType["SCRIPT_ENFORCED_LEASE"] = 4] = "SCRIPT_ENFORCED_LEASE"; -})(CommitmentType || (CommitmentType = {})); -/** - * @generated from protobuf enum lnrpc.Initiator - */ -export var Initiator; -(function (Initiator) { - /** - * @generated from protobuf enum value: INITIATOR_UNKNOWN = 0; - */ - Initiator[Initiator["UNKNOWN"] = 0] = "UNKNOWN"; - /** - * @generated from protobuf enum value: INITIATOR_LOCAL = 1; - */ - Initiator[Initiator["LOCAL"] = 1] = "LOCAL"; - /** - * @generated from protobuf enum value: INITIATOR_REMOTE = 2; - */ - Initiator[Initiator["REMOTE"] = 2] = "REMOTE"; - /** - * @generated from protobuf enum value: INITIATOR_BOTH = 3; - */ - Initiator[Initiator["BOTH"] = 3] = "BOTH"; -})(Initiator || (Initiator = {})); -/** - * @generated from protobuf enum lnrpc.ResolutionType - */ -export var ResolutionType; -(function (ResolutionType) { - /** - * @generated from protobuf enum value: TYPE_UNKNOWN = 0; - */ - ResolutionType[ResolutionType["TYPE_UNKNOWN"] = 0] = "TYPE_UNKNOWN"; - /** - * We resolved an anchor output. - * - * @generated from protobuf enum value: ANCHOR = 1; - */ - ResolutionType[ResolutionType["ANCHOR"] = 1] = "ANCHOR"; - /** - * - * We are resolving an incoming htlc on chain. This if this htlc is - * claimed, we swept the incoming htlc with the preimage. If it is timed - * out, our peer swept the timeout path. - * - * @generated from protobuf enum value: INCOMING_HTLC = 2; - */ - ResolutionType[ResolutionType["INCOMING_HTLC"] = 2] = "INCOMING_HTLC"; - /** - * - * We are resolving an outgoing htlc on chain. If this htlc is claimed, - * the remote party swept the htlc with the preimage. If it is timed out, - * we swept it with the timeout path. - * - * @generated from protobuf enum value: OUTGOING_HTLC = 3; - */ - ResolutionType[ResolutionType["OUTGOING_HTLC"] = 3] = "OUTGOING_HTLC"; - /** - * We force closed and need to sweep our time locked commitment output. - * - * @generated from protobuf enum value: COMMIT = 4; - */ - ResolutionType[ResolutionType["COMMIT"] = 4] = "COMMIT"; -})(ResolutionType || (ResolutionType = {})); -/** - * @generated from protobuf enum lnrpc.ResolutionOutcome - */ -export var ResolutionOutcome; -(function (ResolutionOutcome) { - /** - * Outcome unknown. - * - * @generated from protobuf enum value: OUTCOME_UNKNOWN = 0; - */ - ResolutionOutcome[ResolutionOutcome["OUTCOME_UNKNOWN"] = 0] = "OUTCOME_UNKNOWN"; - /** - * An output was claimed on chain. - * - * @generated from protobuf enum value: CLAIMED = 1; - */ - ResolutionOutcome[ResolutionOutcome["CLAIMED"] = 1] = "CLAIMED"; - /** - * An output was left unclaimed on chain. - * - * @generated from protobuf enum value: UNCLAIMED = 2; - */ - ResolutionOutcome[ResolutionOutcome["UNCLAIMED"] = 2] = "UNCLAIMED"; - /** - * - * ResolverOutcomeAbandoned indicates that an output that we did not - * claim on chain, for example an anchor that we did not sweep and a - * third party claimed on chain, or a htlc that we could not decode - * so left unclaimed. - * - * @generated from protobuf enum value: ABANDONED = 3; - */ - ResolutionOutcome[ResolutionOutcome["ABANDONED"] = 3] = "ABANDONED"; - /** - * - * If we force closed our channel, our htlcs need to be claimed in two - * stages. This outcome represents the broadcast of a timeout or success - * transaction for this two stage htlc claim. - * - * @generated from protobuf enum value: FIRST_STAGE = 4; - */ - ResolutionOutcome[ResolutionOutcome["FIRST_STAGE"] = 4] = "FIRST_STAGE"; - /** - * A htlc was timed out on chain. - * - * @generated from protobuf enum value: TIMEOUT = 5; - */ - ResolutionOutcome[ResolutionOutcome["TIMEOUT"] = 5] = "TIMEOUT"; -})(ResolutionOutcome || (ResolutionOutcome = {})); -/** - * @generated from protobuf enum lnrpc.NodeMetricType - */ -export var NodeMetricType; -(function (NodeMetricType) { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - NodeMetricType[NodeMetricType["UNKNOWN"] = 0] = "UNKNOWN"; - /** - * @generated from protobuf enum value: BETWEENNESS_CENTRALITY = 1; - */ - NodeMetricType[NodeMetricType["BETWEENNESS_CENTRALITY"] = 1] = "BETWEENNESS_CENTRALITY"; -})(NodeMetricType || (NodeMetricType = {})); -/** - * @generated from protobuf enum lnrpc.InvoiceHTLCState - */ -export var InvoiceHTLCState; -(function (InvoiceHTLCState) { - /** - * @generated from protobuf enum value: ACCEPTED = 0; - */ - InvoiceHTLCState[InvoiceHTLCState["ACCEPTED"] = 0] = "ACCEPTED"; - /** - * @generated from protobuf enum value: SETTLED = 1; - */ - InvoiceHTLCState[InvoiceHTLCState["SETTLED"] = 1] = "SETTLED"; - /** - * @generated from protobuf enum value: CANCELED = 2; - */ - InvoiceHTLCState[InvoiceHTLCState["CANCELED"] = 2] = "CANCELED"; -})(InvoiceHTLCState || (InvoiceHTLCState = {})); -/** - * @generated from protobuf enum lnrpc.PaymentFailureReason - */ -export var PaymentFailureReason; -(function (PaymentFailureReason) { - /** - * - * Payment isn't failed (yet). - * - * @generated from protobuf enum value: FAILURE_REASON_NONE = 0; - */ - PaymentFailureReason[PaymentFailureReason["FAILURE_REASON_NONE"] = 0] = "FAILURE_REASON_NONE"; - /** - * - * There are more routes to try, but the payment timeout was exceeded. - * - * @generated from protobuf enum value: FAILURE_REASON_TIMEOUT = 1; - */ - PaymentFailureReason[PaymentFailureReason["FAILURE_REASON_TIMEOUT"] = 1] = "FAILURE_REASON_TIMEOUT"; - /** - * - * All possible routes were tried and failed permanently. Or were no - * routes to the destination at all. - * - * @generated from protobuf enum value: FAILURE_REASON_NO_ROUTE = 2; - */ - PaymentFailureReason[PaymentFailureReason["FAILURE_REASON_NO_ROUTE"] = 2] = "FAILURE_REASON_NO_ROUTE"; - /** - * - * A non-recoverable error has occured. - * - * @generated from protobuf enum value: FAILURE_REASON_ERROR = 3; - */ - PaymentFailureReason[PaymentFailureReason["FAILURE_REASON_ERROR"] = 3] = "FAILURE_REASON_ERROR"; - /** - * - * Payment details incorrect (unknown hash, invalid amt or - * invalid final cltv delta) - * - * @generated from protobuf enum value: FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4; - */ - PaymentFailureReason[PaymentFailureReason["FAILURE_REASON_INCORRECT_PAYMENT_DETAILS"] = 4] = "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS"; - /** - * - * Insufficient local balance. - * - * @generated from protobuf enum value: FAILURE_REASON_INSUFFICIENT_BALANCE = 5; - */ - PaymentFailureReason[PaymentFailureReason["FAILURE_REASON_INSUFFICIENT_BALANCE"] = 5] = "FAILURE_REASON_INSUFFICIENT_BALANCE"; -})(PaymentFailureReason || (PaymentFailureReason = {})); -/** - * @generated from protobuf enum lnrpc.FeatureBit - */ -export var FeatureBit; -(function (FeatureBit) { - /** - * @generated from protobuf enum value: DATALOSS_PROTECT_REQ = 0; - */ - FeatureBit[FeatureBit["DATALOSS_PROTECT_REQ"] = 0] = "DATALOSS_PROTECT_REQ"; - /** - * @generated from protobuf enum value: DATALOSS_PROTECT_OPT = 1; - */ - FeatureBit[FeatureBit["DATALOSS_PROTECT_OPT"] = 1] = "DATALOSS_PROTECT_OPT"; - /** - * @generated from protobuf enum value: INITIAL_ROUING_SYNC = 3; - */ - FeatureBit[FeatureBit["INITIAL_ROUING_SYNC"] = 3] = "INITIAL_ROUING_SYNC"; - /** - * @generated from protobuf enum value: UPFRONT_SHUTDOWN_SCRIPT_REQ = 4; - */ - FeatureBit[FeatureBit["UPFRONT_SHUTDOWN_SCRIPT_REQ"] = 4] = "UPFRONT_SHUTDOWN_SCRIPT_REQ"; - /** - * @generated from protobuf enum value: UPFRONT_SHUTDOWN_SCRIPT_OPT = 5; - */ - FeatureBit[FeatureBit["UPFRONT_SHUTDOWN_SCRIPT_OPT"] = 5] = "UPFRONT_SHUTDOWN_SCRIPT_OPT"; - /** - * @generated from protobuf enum value: GOSSIP_QUERIES_REQ = 6; - */ - FeatureBit[FeatureBit["GOSSIP_QUERIES_REQ"] = 6] = "GOSSIP_QUERIES_REQ"; - /** - * @generated from protobuf enum value: GOSSIP_QUERIES_OPT = 7; - */ - FeatureBit[FeatureBit["GOSSIP_QUERIES_OPT"] = 7] = "GOSSIP_QUERIES_OPT"; - /** - * @generated from protobuf enum value: TLV_ONION_REQ = 8; - */ - FeatureBit[FeatureBit["TLV_ONION_REQ"] = 8] = "TLV_ONION_REQ"; - /** - * @generated from protobuf enum value: TLV_ONION_OPT = 9; - */ - FeatureBit[FeatureBit["TLV_ONION_OPT"] = 9] = "TLV_ONION_OPT"; - /** - * @generated from protobuf enum value: EXT_GOSSIP_QUERIES_REQ = 10; - */ - FeatureBit[FeatureBit["EXT_GOSSIP_QUERIES_REQ"] = 10] = "EXT_GOSSIP_QUERIES_REQ"; - /** - * @generated from protobuf enum value: EXT_GOSSIP_QUERIES_OPT = 11; - */ - FeatureBit[FeatureBit["EXT_GOSSIP_QUERIES_OPT"] = 11] = "EXT_GOSSIP_QUERIES_OPT"; - /** - * @generated from protobuf enum value: STATIC_REMOTE_KEY_REQ = 12; - */ - FeatureBit[FeatureBit["STATIC_REMOTE_KEY_REQ"] = 12] = "STATIC_REMOTE_KEY_REQ"; - /** - * @generated from protobuf enum value: STATIC_REMOTE_KEY_OPT = 13; - */ - FeatureBit[FeatureBit["STATIC_REMOTE_KEY_OPT"] = 13] = "STATIC_REMOTE_KEY_OPT"; - /** - * @generated from protobuf enum value: PAYMENT_ADDR_REQ = 14; - */ - FeatureBit[FeatureBit["PAYMENT_ADDR_REQ"] = 14] = "PAYMENT_ADDR_REQ"; - /** - * @generated from protobuf enum value: PAYMENT_ADDR_OPT = 15; - */ - FeatureBit[FeatureBit["PAYMENT_ADDR_OPT"] = 15] = "PAYMENT_ADDR_OPT"; - /** - * @generated from protobuf enum value: MPP_REQ = 16; - */ - FeatureBit[FeatureBit["MPP_REQ"] = 16] = "MPP_REQ"; - /** - * @generated from protobuf enum value: MPP_OPT = 17; - */ - FeatureBit[FeatureBit["MPP_OPT"] = 17] = "MPP_OPT"; - /** - * @generated from protobuf enum value: WUMBO_CHANNELS_REQ = 18; - */ - FeatureBit[FeatureBit["WUMBO_CHANNELS_REQ"] = 18] = "WUMBO_CHANNELS_REQ"; - /** - * @generated from protobuf enum value: WUMBO_CHANNELS_OPT = 19; - */ - FeatureBit[FeatureBit["WUMBO_CHANNELS_OPT"] = 19] = "WUMBO_CHANNELS_OPT"; - /** - * @generated from protobuf enum value: ANCHORS_REQ = 20; - */ - FeatureBit[FeatureBit["ANCHORS_REQ"] = 20] = "ANCHORS_REQ"; - /** - * @generated from protobuf enum value: ANCHORS_OPT = 21; - */ - FeatureBit[FeatureBit["ANCHORS_OPT"] = 21] = "ANCHORS_OPT"; - /** - * @generated from protobuf enum value: ANCHORS_ZERO_FEE_HTLC_REQ = 22; - */ - FeatureBit[FeatureBit["ANCHORS_ZERO_FEE_HTLC_REQ"] = 22] = "ANCHORS_ZERO_FEE_HTLC_REQ"; - /** - * @generated from protobuf enum value: ANCHORS_ZERO_FEE_HTLC_OPT = 23; - */ - FeatureBit[FeatureBit["ANCHORS_ZERO_FEE_HTLC_OPT"] = 23] = "ANCHORS_ZERO_FEE_HTLC_OPT"; - /** - * @generated from protobuf enum value: AMP_REQ = 30; - */ - FeatureBit[FeatureBit["AMP_REQ"] = 30] = "AMP_REQ"; - /** - * @generated from protobuf enum value: AMP_OPT = 31; - */ - FeatureBit[FeatureBit["AMP_OPT"] = 31] = "AMP_OPT"; -})(FeatureBit || (FeatureBit = {})); -/** - * @generated from protobuf enum lnrpc.UpdateFailure - */ -export var UpdateFailure; -(function (UpdateFailure) { - /** - * @generated from protobuf enum value: UPDATE_FAILURE_UNKNOWN = 0; - */ - UpdateFailure[UpdateFailure["UNKNOWN"] = 0] = "UNKNOWN"; - /** - * @generated from protobuf enum value: UPDATE_FAILURE_PENDING = 1; - */ - UpdateFailure[UpdateFailure["PENDING"] = 1] = "PENDING"; - /** - * @generated from protobuf enum value: UPDATE_FAILURE_NOT_FOUND = 2; - */ - UpdateFailure[UpdateFailure["NOT_FOUND"] = 2] = "NOT_FOUND"; - /** - * @generated from protobuf enum value: UPDATE_FAILURE_INTERNAL_ERR = 3; - */ - UpdateFailure[UpdateFailure["INTERNAL_ERR"] = 3] = "INTERNAL_ERR"; - /** - * @generated from protobuf enum value: UPDATE_FAILURE_INVALID_PARAMETER = 4; - */ - UpdateFailure[UpdateFailure["INVALID_PARAMETER"] = 4] = "INVALID_PARAMETER"; -})(UpdateFailure || (UpdateFailure = {})); -// @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: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { chanId: 0, htlcIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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().toNumber(); - break; - case /* uint64 htlc_index */ 2: - message.htlcIndex = reader.uint64().toNumber(); - 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, writer, options) { - /* uint64 chan_id = 1; */ - if (message.chanId !== 0) - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* uint64 htlc_index = 2; */ - if (message.htlcIndex !== 0) - 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) { - 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, length, options, target) { - 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, writer, options) { - /* 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) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - 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) { - 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, length, options, target) { - 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, writer, options) { - /* 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) { - 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, length, options, target) { - 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, writer, options) { - /* 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) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { addressType: 0, address: "", amountSat: 0, pkScript: "", confirmations: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.AddressType address_type */ 1: - message.addressType = reader.int32(); - break; - case /* string address */ 2: - message.address = reader.string(); - break; - case /* int64 amount_sat */ 3: - message.amountSat = reader.int64().toNumber(); - break; - case /* string pk_script */ 4: - message.pkScript = reader.string(); - break; - case /* lnrpc.OutPoint outpoint */ 5: - message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); - break; - case /* int64 confirmations */ 6: - message.confirmations = reader.int64().toNumber(); - 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, writer, options) { - /* lnrpc.AddressType address_type = 1; */ - if (message.addressType !== 0) - writer.tag(1, WireType.Varint).int32(message.addressType); - /* string address = 2; */ - if (message.address !== "") - writer.tag(2, WireType.LengthDelimited).string(message.address); - /* int64 amount_sat = 3; */ - if (message.amountSat !== 0) - writer.tag(3, WireType.Varint).int64(message.amountSat); - /* string pk_script = 4; */ - if (message.pkScript !== "") - writer.tag(4, WireType.LengthDelimited).string(message.pkScript); - /* lnrpc.OutPoint outpoint = 5; */ - if (message.outpoint) - OutPoint.internalBinaryWrite(message.outpoint, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* int64 confirmations = 6; */ - if (message.confirmations !== 0) - writer.tag(6, WireType.Varint).int64(message.confirmations); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Utxo - */ -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: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "is_our_address", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { outputType: 0, address: "", pkScript: "", outputIndex: 0, amount: 0, isOurAddress: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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().toNumber(); - break; - case /* int64 amount */ 5: - message.amount = reader.int64().toNumber(); - 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, writer, options) { - /* 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 !== 0) - writer.tag(4, WireType.Varint).int64(message.outputIndex); - /* int64 amount = 5; */ - if (message.amount !== 0) - 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "total_fees", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 12, name: "previous_outpoints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PreviousOutPoint } - ]); - } - create(value) { - const message = { txHash: "", amount: 0, numConfirmations: 0, blockHash: "", blockHeight: 0, timeStamp: 0, totalFees: 0, destAddresses: [], outputDetails: [], rawTxHex: "", label: "", previousOutpoints: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string tx_hash */ 1: - message.txHash = reader.string(); - break; - case /* int64 amount */ 2: - message.amount = reader.int64().toNumber(); - break; - case /* int32 num_confirmations */ 3: - message.numConfirmations = reader.int32(); - break; - case /* string block_hash */ 4: - message.blockHash = reader.string(); - break; - case /* int32 block_height */ 5: - message.blockHeight = reader.int32(); - break; - case /* int64 time_stamp */ 6: - message.timeStamp = reader.int64().toNumber(); - break; - case /* int64 total_fees */ 7: - message.totalFees = reader.int64().toNumber(); - break; - 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") - 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, writer, options) { - /* string tx_hash = 1; */ - if (message.txHash !== "") - writer.tag(1, WireType.LengthDelimited).string(message.txHash); - /* int64 amount = 2; */ - if (message.amount !== 0) - writer.tag(2, WireType.Varint).int64(message.amount); - /* int32 num_confirmations = 3; */ - if (message.numConfirmations !== 0) - writer.tag(3, WireType.Varint).int32(message.numConfirmations); - /* string block_hash = 4; */ - if (message.blockHash !== "") - writer.tag(4, WireType.LengthDelimited).string(message.blockHash); - /* int32 block_height = 5; */ - if (message.blockHeight !== 0) - writer.tag(5, WireType.Varint).int32(message.blockHeight); - /* int64 time_stamp = 6; */ - if (message.timeStamp !== 0) - writer.tag(6, WireType.Varint).int64(message.timeStamp); - /* int64 total_fees = 7; */ - if (message.totalFees !== 0) - writer.tag(7, WireType.Varint).int64(message.totalFees); - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Transaction - */ -export const Transaction = new Transaction$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetTransactionsRequest$Type extends MessageType { - constructor() { - super("lnrpc.GetTransactionsRequest", [ - { no: 1, name: "start_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 2, name: "end_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "account", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { startHeight: 0, endHeight: 0, account: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 start_height */ 1: - message.startHeight = reader.int32(); - break; - case /* int32 end_height */ 2: - message.endHeight = reader.int32(); - break; - case /* string account */ 3: - message.account = 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, writer, options) { - /* int32 start_height = 1; */ - if (message.startHeight !== 0) - writer.tag(1, WireType.Varint).int32(message.startHeight); - /* int32 end_height = 2; */ - if (message.endHeight !== 0) - writer.tag(2, WireType.Varint).int32(message.endHeight); - /* string account = 3; */ - if (message.account !== "") - writer.tag(3, WireType.LengthDelimited).string(message.account); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GetTransactionsRequest - */ -export const GetTransactionsRequest = new GetTransactionsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class TransactionDetails$Type extends MessageType { - constructor() { - super("lnrpc.TransactionDetails", [ - { no: 1, name: "transactions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Transaction } - ]); - } - create(value) { - const message = { transactions: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Transaction transactions */ 1: - message.transactions.push(Transaction.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, writer, options) { - /* repeated lnrpc.Transaction transactions = 1; */ - for (let i = 0; i < message.transactions.length; i++) - Transaction.internalBinaryWrite(message.transactions[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.TransactionDetails - */ -export const TransactionDetails = new TransactionDetails$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FeeLimit$Type extends MessageType { - constructor() { - super("lnrpc.FeeLimit", [ - { no: 1, name: "fixed", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "fixed_msat", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "percent", kind: "scalar", oneof: "limit", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { limit: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 fixed */ 1: - message.limit = { - oneofKind: "fixed", - fixed: reader.int64().toNumber() - }; - break; - case /* int64 fixed_msat */ 3: - message.limit = { - oneofKind: "fixedMsat", - fixedMsat: reader.int64().toNumber() - }; - break; - case /* int64 percent */ 2: - message.limit = { - oneofKind: "percent", - percent: reader.int64().toNumber() - }; - 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, writer, options) { - /* int64 fixed = 1; */ - if (message.limit.oneofKind === "fixed") - writer.tag(1, WireType.Varint).int64(message.limit.fixed); - /* int64 fixed_msat = 3; */ - if (message.limit.oneofKind === "fixedMsat") - writer.tag(3, WireType.Varint).int64(message.limit.fixedMsat); - /* int64 percent = 2; */ - if (message.limit.oneofKind === "percent") - writer.tag(2, WireType.Varint).int64(message.limit.percent); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FeeLimit - */ -export const FeeLimit = new FeeLimit$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendRequest$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/ }, - { no: 7, name: "final_cltv_delta", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 8, name: "fee_limit", kind: "message", T: () => FeeLimit }, - { no: 9, name: "outgoing_chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 13, name: "last_hop_pubkey", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 10, name: "cltv_limit", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 11, name: "dest_custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, - { no: 14, name: "allow_self_payment", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 15, name: "dest_features", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.FeatureBit", FeatureBit] }, - { no: 16, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - 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) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes dest */ 1: - message.dest = reader.bytes(); - break; - case /* string dest_string = 2 [deprecated = true];*/ 2: - message.destString = reader.string(); - break; - case /* int64 amt */ 3: - message.amt = reader.int64().toNumber(); - break; - case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toNumber(); - break; - case /* bytes payment_hash */ 4: - message.paymentHash = reader.bytes(); - break; - case /* string payment_hash_string = 5 [deprecated = true];*/ 5: - message.paymentHashString = reader.string(); - break; - case /* string payment_request */ 6: - message.paymentRequest = reader.string(); - break; - case /* int32 final_cltv_delta */ 7: - message.finalCltvDelta = reader.int32(); - break; - case /* lnrpc.FeeLimit fee_limit */ 8: - message.feeLimit = FeeLimit.internalBinaryRead(reader, reader.uint32(), options, message.feeLimit); - break; - case /* uint64 outgoing_chan_id = 9 [jstype = JS_STRING];*/ 9: - message.outgoingChanId = reader.uint64().toString(); - break; - case /* bytes last_hop_pubkey */ 13: - message.lastHopPubkey = reader.bytes(); - break; - case /* uint32 cltv_limit */ 10: - message.cltvLimit = reader.uint32(); - break; - case /* map dest_custom_records */ 11: - this.binaryReadMap11(message.destCustomRecords, reader, options); - break; - case /* bool allow_self_payment */ 14: - message.allowSelfPayment = reader.bool(); - break; - case /* repeated lnrpc.FeatureBit dest_features */ 15: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.destFeatures.push(reader.int32()); - else - message.destFeatures.push(reader.int32()); - break; - case /* bytes payment_addr */ 16: - message.paymentAddr = 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; - } - binaryReadMap11(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - 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.SendRequest.dest_custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message, writer, options) { - /* bytes dest = 1; */ - if (message.dest.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.dest); - /* string dest_string = 2 [deprecated = true]; */ - if (message.destString !== "") - writer.tag(2, WireType.LengthDelimited).string(message.destString); - /* int64 amt = 3; */ - if (message.amt !== 0) - writer.tag(3, WireType.Varint).int64(message.amt); - /* int64 amt_msat = 12; */ - if (message.amtMsat !== 0) - writer.tag(12, WireType.Varint).int64(message.amtMsat); - /* bytes payment_hash = 4; */ - if (message.paymentHash.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.paymentHash); - /* string payment_hash_string = 5 [deprecated = true]; */ - if (message.paymentHashString !== "") - writer.tag(5, WireType.LengthDelimited).string(message.paymentHashString); - /* string payment_request = 6; */ - if (message.paymentRequest !== "") - writer.tag(6, WireType.LengthDelimited).string(message.paymentRequest); - /* int32 final_cltv_delta = 7; */ - if (message.finalCltvDelta !== 0) - writer.tag(7, WireType.Varint).int32(message.finalCltvDelta); - /* lnrpc.FeeLimit fee_limit = 8; */ - if (message.feeLimit) - FeeLimit.internalBinaryWrite(message.feeLimit, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); - /* uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; */ - if (message.outgoingChanId !== "0") - writer.tag(9, WireType.Varint).uint64(message.outgoingChanId); - /* bytes last_hop_pubkey = 13; */ - if (message.lastHopPubkey.length) - writer.tag(13, WireType.LengthDelimited).bytes(message.lastHopPubkey); - /* uint32 cltv_limit = 10; */ - if (message.cltvLimit !== 0) - writer.tag(10, WireType.Varint).uint32(message.cltvLimit); - /* map dest_custom_records = 11; */ - for (let k of Object.keys(message.destCustomRecords)) - writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.destCustomRecords[k]).join(); - /* bool allow_self_payment = 14; */ - if (message.allowSelfPayment !== false) - writer.tag(14, WireType.Varint).bool(message.allowSelfPayment); - /* repeated lnrpc.FeatureBit dest_features = 15; */ - if (message.destFeatures.length) { - writer.tag(15, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.destFeatures.length; i++) - writer.int32(message.destFeatures[i]); - writer.join(); - } - /* bytes payment_addr = 16; */ - if (message.paymentAddr.length) - writer.tag(16, WireType.LengthDelimited).bytes(message.paymentAddr); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendRequest - */ -export const SendRequest = new SendRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendResponse$Type extends MessageType { - constructor() { - super("lnrpc.SendResponse", [ - { no: 1, name: "payment_error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "payment_preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "payment_route", kind: "message", T: () => Route }, - { no: 4, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { paymentError: "", paymentPreimage: new Uint8Array(0), paymentHash: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string payment_error */ 1: - message.paymentError = reader.string(); - break; - case /* bytes payment_preimage */ 2: - message.paymentPreimage = reader.bytes(); - break; - case /* lnrpc.Route payment_route */ 3: - message.paymentRoute = Route.internalBinaryRead(reader, reader.uint32(), options, message.paymentRoute); - break; - case /* bytes payment_hash */ 4: - message.paymentHash = 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, writer, options) { - /* string payment_error = 1; */ - if (message.paymentError !== "") - writer.tag(1, WireType.LengthDelimited).string(message.paymentError); - /* bytes payment_preimage = 2; */ - if (message.paymentPreimage.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.paymentPreimage); - /* lnrpc.Route payment_route = 3; */ - if (message.paymentRoute) - Route.internalBinaryWrite(message.paymentRoute, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* bytes payment_hash = 4; */ - if (message.paymentHash.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.paymentHash); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendResponse - */ -export const SendResponse = new SendResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendToRouteRequest$Type extends MessageType { - constructor() { - super("lnrpc.SendToRouteRequest", [ - { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "payment_hash_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "route", kind: "message", T: () => Route } - ]); - } - create(value) { - const message = { paymentHash: new Uint8Array(0), paymentHashString: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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 /* string payment_hash_string = 2 [deprecated = true];*/ 2: - message.paymentHashString = reader.string(); - break; - case /* lnrpc.Route route */ 4: - message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); - 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, writer, options) { - /* bytes payment_hash = 1; */ - if (message.paymentHash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); - /* string payment_hash_string = 2 [deprecated = true]; */ - if (message.paymentHashString !== "") - writer.tag(2, WireType.LengthDelimited).string(message.paymentHashString); - /* lnrpc.Route route = 4; */ - if (message.route) - Route.internalBinaryWrite(message.route, writer.tag(4, 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.SendToRouteRequest - */ -export const SendToRouteRequest = new SendToRouteRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelAcceptRequest$Type extends MessageType { - constructor() { - super("lnrpc.ChannelAcceptRequest", [ - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "push_amt", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "dust_limit", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "max_value_in_flight", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "channel_reserve", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 9, name: "min_htlc", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 10, name: "fee_per_kw", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 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) { - 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, commitmentType: 0, wantsZeroConf: false, wantsScidAlias: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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 /* bytes chain_hash */ 2: - message.chainHash = reader.bytes(); - break; - case /* bytes pending_chan_id */ 3: - message.pendingChanId = reader.bytes(); - break; - case /* uint64 funding_amt */ 4: - message.fundingAmt = reader.uint64().toNumber(); - break; - case /* uint64 push_amt */ 5: - message.pushAmt = reader.uint64().toNumber(); - break; - case /* uint64 dust_limit */ 6: - message.dustLimit = reader.uint64().toNumber(); - break; - case /* uint64 max_value_in_flight */ 7: - message.maxValueInFlight = reader.uint64().toNumber(); - break; - case /* uint64 channel_reserve */ 8: - message.channelReserve = reader.uint64().toNumber(); - break; - case /* uint64 min_htlc */ 9: - message.minHtlc = reader.uint64().toNumber(); - break; - case /* uint64 fee_per_kw */ 10: - message.feePerKw = reader.uint64().toNumber(); - break; - case /* uint32 csv_delay */ 11: - message.csvDelay = reader.uint32(); - break; - case /* uint32 max_accepted_htlcs */ 12: - message.maxAcceptedHtlcs = reader.uint32(); - break; - 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") - 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, writer, options) { - /* bytes node_pubkey = 1; */ - if (message.nodePubkey.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.nodePubkey); - /* bytes chain_hash = 2; */ - if (message.chainHash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.chainHash); - /* bytes pending_chan_id = 3; */ - if (message.pendingChanId.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.pendingChanId); - /* uint64 funding_amt = 4; */ - if (message.fundingAmt !== 0) - writer.tag(4, WireType.Varint).uint64(message.fundingAmt); - /* uint64 push_amt = 5; */ - if (message.pushAmt !== 0) - writer.tag(5, WireType.Varint).uint64(message.pushAmt); - /* uint64 dust_limit = 6; */ - if (message.dustLimit !== 0) - writer.tag(6, WireType.Varint).uint64(message.dustLimit); - /* uint64 max_value_in_flight = 7; */ - if (message.maxValueInFlight !== 0) - writer.tag(7, WireType.Varint).uint64(message.maxValueInFlight); - /* uint64 channel_reserve = 8; */ - if (message.channelReserve !== 0) - writer.tag(8, WireType.Varint).uint64(message.channelReserve); - /* uint64 min_htlc = 9; */ - if (message.minHtlc !== 0) - writer.tag(9, WireType.Varint).uint64(message.minHtlc); - /* uint64 fee_per_kw = 10; */ - if (message.feePerKw !== 0) - writer.tag(10, WireType.Varint).uint64(message.feePerKw); - /* uint32 csv_delay = 11; */ - if (message.csvDelay !== 0) - writer.tag(11, WireType.Varint).uint32(message.csvDelay); - /* uint32 max_accepted_htlcs = 12; */ - if (message.maxAcceptedHtlcs !== 0) - writer.tag(12, WireType.Varint).uint32(message.maxAcceptedHtlcs); - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelAcceptRequest - */ -export const ChannelAcceptRequest = new ChannelAcceptRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelAcceptResponse$Type extends MessageType { - constructor() { - super("lnrpc.ChannelAcceptResponse", [ - { no: 1, name: "accept", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "in_flight_max_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "max_htlc_count", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 9, name: "min_htlc_in", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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) { - const message = { accept: false, pendingChanId: new Uint8Array(0), error: "", upfrontShutdown: "", csvDelay: 0, reserveSat: 0, inFlightMaxMsat: 0, maxHtlcCount: 0, minHtlcIn: 0, minAcceptDepth: 0, zeroConf: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool accept */ 1: - message.accept = reader.bool(); - break; - case /* bytes pending_chan_id */ 2: - message.pendingChanId = reader.bytes(); - break; - case /* string error */ 3: - message.error = reader.string(); - break; - case /* string upfront_shutdown */ 4: - message.upfrontShutdown = reader.string(); - break; - case /* uint32 csv_delay */ 5: - message.csvDelay = reader.uint32(); - break; - case /* uint64 reserve_sat */ 6: - message.reserveSat = reader.uint64().toNumber(); - break; - case /* uint64 in_flight_max_msat */ 7: - message.inFlightMaxMsat = reader.uint64().toNumber(); - break; - case /* uint32 max_htlc_count */ 8: - message.maxHtlcCount = reader.uint32(); - break; - case /* uint64 min_htlc_in */ 9: - message.minHtlcIn = reader.uint64().toNumber(); - 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") - 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, writer, options) { - /* bool accept = 1; */ - if (message.accept !== false) - writer.tag(1, WireType.Varint).bool(message.accept); - /* bytes pending_chan_id = 2; */ - if (message.pendingChanId.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.pendingChanId); - /* string error = 3; */ - if (message.error !== "") - writer.tag(3, WireType.LengthDelimited).string(message.error); - /* string upfront_shutdown = 4; */ - if (message.upfrontShutdown !== "") - writer.tag(4, WireType.LengthDelimited).string(message.upfrontShutdown); - /* uint32 csv_delay = 5; */ - if (message.csvDelay !== 0) - writer.tag(5, WireType.Varint).uint32(message.csvDelay); - /* uint64 reserve_sat = 6; */ - if (message.reserveSat !== 0) - writer.tag(6, WireType.Varint).uint64(message.reserveSat); - /* uint64 in_flight_max_msat = 7; */ - if (message.inFlightMaxMsat !== 0) - 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) - 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelAcceptResponse - */ -export const ChannelAcceptResponse = new ChannelAcceptResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelPoint$Type extends MessageType { - constructor() { - super("lnrpc.ChannelPoint", [ - { no: 1, name: "funding_txid_bytes", kind: "scalar", oneof: "fundingTxid", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "funding_txid_str", kind: "scalar", oneof: "fundingTxid", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "output_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = { fundingTxid: { oneofKind: undefined }, outputIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes funding_txid_bytes */ 1: - message.fundingTxid = { - oneofKind: "fundingTxidBytes", - fundingTxidBytes: reader.bytes() - }; - break; - case /* string funding_txid_str */ 2: - message.fundingTxid = { - oneofKind: "fundingTxidStr", - fundingTxidStr: reader.string() - }; - break; - case /* uint32 output_index */ 3: - message.outputIndex = reader.uint32(); - 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, writer, options) { - /* bytes funding_txid_bytes = 1; */ - if (message.fundingTxid.oneofKind === "fundingTxidBytes") - writer.tag(1, WireType.LengthDelimited).bytes(message.fundingTxid.fundingTxidBytes); - /* string funding_txid_str = 2; */ - if (message.fundingTxid.oneofKind === "fundingTxidStr") - writer.tag(2, WireType.LengthDelimited).string(message.fundingTxid.fundingTxidStr); - /* uint32 output_index = 3; */ - if (message.outputIndex !== 0) - writer.tag(3, WireType.Varint).uint32(message.outputIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelPoint - */ -export const ChannelPoint = new ChannelPoint$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class OutPoint$Type extends MessageType { - constructor() { - super("lnrpc.OutPoint", [ - { no: 1, name: "txid_bytes", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "txid_str", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "output_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = { txidBytes: new Uint8Array(0), txidStr: "", outputIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes txid_bytes */ 1: - message.txidBytes = reader.bytes(); - break; - case /* string txid_str */ 2: - message.txidStr = reader.string(); - break; - case /* uint32 output_index */ 3: - message.outputIndex = reader.uint32(); - 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, writer, options) { - /* bytes txid_bytes = 1; */ - if (message.txidBytes.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.txidBytes); - /* string txid_str = 2; */ - if (message.txidStr !== "") - writer.tag(2, WireType.LengthDelimited).string(message.txidStr); - /* uint32 output_index = 3; */ - if (message.outputIndex !== 0) - writer.tag(3, WireType.Varint).uint32(message.outputIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.OutPoint - */ -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) { - 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, length, options, target) { - 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, writer, options) { - /* 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", [ - { no: 1, name: "pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "host", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { pubkey: "", host: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pubkey */ 1: - message.pubkey = reader.string(); - break; - case /* string host */ 2: - message.host = 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, writer, options) { - /* string pubkey = 1; */ - if (message.pubkey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubkey); - /* string host = 2; */ - if (message.host !== "") - writer.tag(2, WireType.LengthDelimited).string(message.host); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.LightningAddress - */ -export const LightningAddress = new LightningAddress$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ } }, - { 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*/ } - ]); - } - create(value) { - const message = { addrToAmount: {}, targetConf: 0, minConfs: 0, spendUnconfirmed: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* map AddrToAmount = 1 [json_name = "AddrToAmount"];*/ 1: - this.binaryReadMap1(message.addrToAmount, reader, options); - break; - case /* int32 target_conf */ 2: - message.targetConf = reader.int32(); - break; - case /* int32 min_confs */ 3: - message.minConfs = reader.int32(); - break; - case /* bool spend_unconfirmed */ 4: - message.spendUnconfirmed = 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; - } - binaryReadMap1(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = reader.int64().toNumber(); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.EstimateFeeRequest.AddrToAmount"); - } - } - map[key ?? ""] = val ?? 0; - } - internalBinaryWrite(message, writer, options) { - /* map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ - for (let k of Object.keys(message.addrToAmount)) - writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.Varint).int64(message.addrToAmount[k]).join(); - /* int32 target_conf = 2; */ - if (message.targetConf !== 0) - writer.tag(2, WireType.Varint).int32(message.targetConf); - /* int32 min_confs = 3; */ - if (message.minConfs !== 0) - writer.tag(3, WireType.Varint).int32(message.minConfs); - /* bool spend_unconfirmed = 4; */ - if (message.spendUnconfirmed !== false) - writer.tag(4, WireType.Varint).bool(message.spendUnconfirmed); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.EstimateFeeRequest - */ -export const EstimateFeeRequest = new EstimateFeeRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class EstimateFeeResponse$Type extends MessageType { - constructor() { - super("lnrpc.EstimateFeeResponse", [ - { no: 1, name: "fee_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "feerate_sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { feeSat: 0, feerateSatPerByte: 0, satPerVbyte: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 fee_sat */ 1: - message.feeSat = reader.int64().toNumber(); - break; - case /* int64 feerate_sat_per_byte = 2 [deprecated = true];*/ 2: - message.feerateSatPerByte = reader.int64().toNumber(); - break; - case /* uint64 sat_per_vbyte */ 3: - message.satPerVbyte = reader.uint64().toNumber(); - 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, writer, options) { - /* int64 fee_sat = 1; */ - if (message.feeSat !== 0) - writer.tag(1, WireType.Varint).int64(message.feeSat); - /* int64 feerate_sat_per_byte = 2 [deprecated = true]; */ - if (message.feerateSatPerByte !== 0) - writer.tag(2, WireType.Varint).int64(message.feerateSatPerByte); - /* uint64 sat_per_vbyte = 3; */ - if (message.satPerVbyte !== 0) - writer.tag(3, WireType.Varint).uint64(message.satPerVbyte); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.EstimateFeeResponse - */ -export const EstimateFeeResponse = new EstimateFeeResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ } }, - { no: 3, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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) { - const message = { addrToAmount: {}, targetConf: 0, satPerVbyte: 0, satPerByte: 0, label: "", minConfs: 0, spendUnconfirmed: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* map AddrToAmount = 1 [json_name = "AddrToAmount"];*/ 1: - this.binaryReadMap1(message.addrToAmount, reader, options); - break; - case /* int32 target_conf */ 3: - message.targetConf = reader.int32(); - break; - case /* uint64 sat_per_vbyte */ 4: - message.satPerVbyte = reader.uint64().toNumber(); - break; - case /* int64 sat_per_byte = 5 [deprecated = true];*/ 5: - message.satPerByte = reader.int64().toNumber(); - break; - case /* string label */ 6: - message.label = reader.string(); - break; - case /* int32 min_confs */ 7: - message.minConfs = reader.int32(); - break; - case /* bool spend_unconfirmed */ 8: - message.spendUnconfirmed = 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; - } - binaryReadMap1(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = reader.int64().toNumber(); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.SendManyRequest.AddrToAmount"); - } - } - map[key ?? ""] = val ?? 0; - } - internalBinaryWrite(message, writer, options) { - /* map AddrToAmount = 1 [json_name = "AddrToAmount"]; */ - for (let k of Object.keys(message.addrToAmount)) - writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.Varint).int64(message.addrToAmount[k]).join(); - /* 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) - writer.tag(4, WireType.Varint).uint64(message.satPerVbyte); - /* int64 sat_per_byte = 5 [deprecated = true]; */ - if (message.satPerByte !== 0) - writer.tag(5, WireType.Varint).int64(message.satPerByte); - /* string label = 6; */ - if (message.label !== "") - writer.tag(6, WireType.LengthDelimited).string(message.label); - /* int32 min_confs = 7; */ - if (message.minConfs !== 0) - writer.tag(7, WireType.Varint).int32(message.minConfs); - /* bool spend_unconfirmed = 8; */ - if (message.spendUnconfirmed !== false) - writer.tag(8, WireType.Varint).bool(message.spendUnconfirmed); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendManyRequest - */ -export const SendManyRequest = new SendManyRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendManyResponse$Type extends MessageType { - constructor() { - super("lnrpc.SendManyResponse", [ - { no: 1, name: "txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { txid: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string txid */ 1: - message.txid = 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, writer, options) { - /* string txid = 1; */ - if (message.txid !== "") - writer.tag(1, WireType.LengthDelimited).string(message.txid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendManyResponse - */ -export const SendManyResponse = new SendManyResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/ }, - { no: 9, name: "spend_unconfirmed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { addr: "", amount: 0, targetConf: 0, satPerVbyte: 0, satPerByte: 0, sendAll: false, label: "", minConfs: 0, spendUnconfirmed: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string addr */ 1: - message.addr = reader.string(); - break; - case /* int64 amount */ 2: - message.amount = reader.int64().toNumber(); - break; - case /* int32 target_conf */ 3: - message.targetConf = reader.int32(); - break; - case /* uint64 sat_per_vbyte */ 4: - message.satPerVbyte = reader.uint64().toNumber(); - break; - case /* int64 sat_per_byte = 5 [deprecated = true];*/ 5: - message.satPerByte = reader.int64().toNumber(); - break; - case /* bool send_all */ 6: - message.sendAll = reader.bool(); - break; - case /* string label */ 7: - message.label = reader.string(); - break; - case /* int32 min_confs */ 8: - message.minConfs = reader.int32(); - break; - case /* bool spend_unconfirmed */ 9: - message.spendUnconfirmed = 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, writer, options) { - /* string addr = 1; */ - if (message.addr !== "") - writer.tag(1, WireType.LengthDelimited).string(message.addr); - /* int64 amount = 2; */ - if (message.amount !== 0) - 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) - writer.tag(4, WireType.Varint).uint64(message.satPerVbyte); - /* int64 sat_per_byte = 5 [deprecated = true]; */ - if (message.satPerByte !== 0) - writer.tag(5, WireType.Varint).int64(message.satPerByte); - /* bool send_all = 6; */ - if (message.sendAll !== false) - writer.tag(6, WireType.Varint).bool(message.sendAll); - /* string label = 7; */ - if (message.label !== "") - writer.tag(7, WireType.LengthDelimited).string(message.label); - /* int32 min_confs = 8; */ - if (message.minConfs !== 0) - writer.tag(8, WireType.Varint).int32(message.minConfs); - /* bool spend_unconfirmed = 9; */ - if (message.spendUnconfirmed !== false) - writer.tag(9, WireType.Varint).bool(message.spendUnconfirmed); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendCoinsRequest - */ -export const SendCoinsRequest = new SendCoinsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendCoinsResponse$Type extends MessageType { - constructor() { - super("lnrpc.SendCoinsResponse", [ - { no: 1, name: "txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { txid: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string txid */ 1: - message.txid = 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, writer, options) { - /* string txid = 1; */ - if (message.txid !== "") - writer.tag(1, WireType.LengthDelimited).string(message.txid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SendCoinsResponse - */ -export const SendCoinsResponse = new SendCoinsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListUnspentRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListUnspentRequest", [ - { no: 1, name: "min_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 2, name: "max_confs", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "account", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { minConfs: 0, maxConfs: 0, account: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 min_confs */ 1: - message.minConfs = reader.int32(); - break; - case /* int32 max_confs */ 2: - message.maxConfs = reader.int32(); - break; - case /* string account */ 3: - message.account = 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, writer, options) { - /* int32 min_confs = 1; */ - if (message.minConfs !== 0) - writer.tag(1, WireType.Varint).int32(message.minConfs); - /* int32 max_confs = 2; */ - if (message.maxConfs !== 0) - writer.tag(2, WireType.Varint).int32(message.maxConfs); - /* string account = 3; */ - if (message.account !== "") - writer.tag(3, WireType.LengthDelimited).string(message.account); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListUnspentRequest - */ -export const ListUnspentRequest = new ListUnspentRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListUnspentResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListUnspentResponse", [ - { no: 1, name: "utxos", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Utxo } - ]); - } - create(value) { - const message = { utxos: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Utxo utxos */ 1: - message.utxos.push(Utxo.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, writer, options) { - /* repeated lnrpc.Utxo utxos = 1; */ - for (let i = 0; i < message.utxos.length; i++) - Utxo.internalBinaryWrite(message.utxos[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.ListUnspentResponse - */ -export const ListUnspentResponse = new ListUnspentResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NewAddressRequest$Type extends MessageType { - constructor() { - super("lnrpc.NewAddressRequest", [ - { no: 1, name: "type", kind: "enum", T: () => ["lnrpc.AddressType", AddressType] }, - { no: 2, name: "account", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { type: 0, account: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.AddressType type */ 1: - message.type = reader.int32(); - break; - case /* string account */ 2: - message.account = 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, writer, options) { - /* lnrpc.AddressType type = 1; */ - if (message.type !== 0) - writer.tag(1, WireType.Varint).int32(message.type); - /* string account = 2; */ - if (message.account !== "") - writer.tag(2, WireType.LengthDelimited).string(message.account); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NewAddressRequest - */ -export const NewAddressRequest = new NewAddressRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NewAddressResponse$Type extends MessageType { - constructor() { - super("lnrpc.NewAddressResponse", [ - { no: 1, name: "address", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { address: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string address */ 1: - message.address = 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, writer, options) { - /* string address = 1; */ - if (message.address !== "") - writer.tag(1, WireType.LengthDelimited).string(message.address); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NewAddressResponse - */ -export const NewAddressResponse = new NewAddressResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SignMessageRequest$Type extends MessageType { - constructor() { - super("lnrpc.SignMessageRequest", [ - { no: 1, name: "msg", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "single_hash", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - 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); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - 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") - 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, writer, options) { - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SignMessageRequest - */ -export const SignMessageRequest = new SignMessageRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SignMessageResponse$Type extends MessageType { - constructor() { - super("lnrpc.SignMessageResponse", [ - { no: 1, name: "signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { signature: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string signature */ 1: - message.signature = 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, writer, options) { - /* string signature = 1; */ - if (message.signature !== "") - writer.tag(1, WireType.LengthDelimited).string(message.signature); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.SignMessageResponse - */ -export const SignMessageResponse = new SignMessageResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class VerifyMessageRequest$Type extends MessageType { - constructor() { - super("lnrpc.VerifyMessageRequest", [ - { no: 1, name: "msg", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "signature", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { msg: new Uint8Array(0), signature: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes msg */ 1: - message.msg = reader.bytes(); - break; - case /* string signature */ 2: - message.signature = 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, writer, options) { - /* bytes msg = 1; */ - if (message.msg.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.msg); - /* string signature = 2; */ - if (message.signature !== "") - writer.tag(2, WireType.LengthDelimited).string(message.signature); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.VerifyMessageRequest - */ -export const VerifyMessageRequest = new VerifyMessageRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class VerifyMessageResponse$Type extends MessageType { - constructor() { - super("lnrpc.VerifyMessageResponse", [ - { no: 1, name: "valid", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { valid: false, pubkey: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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; - case /* string pubkey */ 2: - message.pubkey = 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, writer, options) { - /* bool valid = 1; */ - if (message.valid !== false) - writer.tag(1, WireType.Varint).bool(message.valid); - /* string pubkey = 2; */ - if (message.pubkey !== "") - writer.tag(2, WireType.LengthDelimited).string(message.pubkey); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.VerifyMessageResponse - */ -export const VerifyMessageResponse = new VerifyMessageResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ConnectPeerRequest$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { perm: false, timeout: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.LightningAddress addr */ 1: - message.addr = LightningAddress.internalBinaryRead(reader, reader.uint32(), options, message.addr); - break; - case /* bool perm */ 2: - message.perm = reader.bool(); - break; - case /* uint64 timeout */ 3: - message.timeout = reader.uint64().toNumber(); - 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, writer, options) { - /* lnrpc.LightningAddress addr = 1; */ - if (message.addr) - LightningAddress.internalBinaryWrite(message.addr, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bool perm = 2; */ - if (message.perm !== false) - writer.tag(2, WireType.Varint).bool(message.perm); - /* uint64 timeout = 3; */ - if (message.timeout !== 0) - writer.tag(3, WireType.Varint).uint64(message.timeout); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ConnectPeerRequest - */ -export const ConnectPeerRequest = new ConnectPeerRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ConnectPeerResponse$Type extends MessageType { - constructor() { - super("lnrpc.ConnectPeerResponse", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ConnectPeerResponse - */ -export const ConnectPeerResponse = new ConnectPeerResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DisconnectPeerRequest$Type extends MessageType { - constructor() { - super("lnrpc.DisconnectPeerRequest", [ - { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { pubKey: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pub_key */ 1: - message.pubKey = 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, writer, options) { - /* string pub_key = 1; */ - if (message.pubKey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubKey); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DisconnectPeerRequest - */ -export const DisconnectPeerRequest = new DisconnectPeerRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DisconnectPeerResponse$Type extends MessageType { - constructor() { - super("lnrpc.DisconnectPeerResponse", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DisconnectPeerResponse - */ -export const DisconnectPeerResponse = new DisconnectPeerResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "forwarding_channel", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "forwarding_htlc_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { incoming: false, amount: 0, hashLock: new Uint8Array(0), expirationHeight: 0, htlcIndex: 0, forwardingChannel: 0, forwardingHtlcIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool incoming */ 1: - message.incoming = reader.bool(); - break; - case /* int64 amount */ 2: - message.amount = reader.int64().toNumber(); - break; - case /* bytes hash_lock */ 3: - message.hashLock = reader.bytes(); - break; - case /* uint32 expiration_height */ 4: - message.expirationHeight = reader.uint32(); - break; - case /* uint64 htlc_index */ 5: - message.htlcIndex = reader.uint64().toNumber(); - break; - case /* uint64 forwarding_channel */ 6: - message.forwardingChannel = reader.uint64().toNumber(); - break; - case /* uint64 forwarding_htlc_index */ 7: - message.forwardingHtlcIndex = reader.uint64().toNumber(); - 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, writer, options) { - /* bool incoming = 1; */ - if (message.incoming !== false) - writer.tag(1, WireType.Varint).bool(message.incoming); - /* int64 amount = 2; */ - if (message.amount !== 0) - writer.tag(2, WireType.Varint).int64(message.amount); - /* bytes hash_lock = 3; */ - if (message.hashLock.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.hashLock); - /* uint32 expiration_height = 4; */ - if (message.expirationHeight !== 0) - writer.tag(4, WireType.Varint).uint32(message.expirationHeight); - /* uint64 htlc_index = 5; */ - if (message.htlcIndex !== 0) - writer.tag(5, WireType.Varint).uint64(message.htlcIndex); - /* uint64 forwarding_channel = 6; */ - if (message.forwardingChannel !== 0) - writer.tag(6, WireType.Varint).uint64(message.forwardingChannel); - /* uint64 forwarding_htlc_index = 7; */ - if (message.forwardingHtlcIndex !== 0) - writer.tag(7, WireType.Varint).uint64(message.forwardingHtlcIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.HTLC - */ -export const HTLC = new HTLC$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "dust_limit_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "max_pending_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "max_accepted_htlcs", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = { csvDelay: 0, chanReserveSat: 0, dustLimitSat: 0, maxPendingAmtMsat: 0, minHtlcMsat: 0, maxAcceptedHtlcs: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 csv_delay */ 1: - message.csvDelay = reader.uint32(); - break; - case /* uint64 chan_reserve_sat */ 2: - message.chanReserveSat = reader.uint64().toNumber(); - break; - case /* uint64 dust_limit_sat */ 3: - message.dustLimitSat = reader.uint64().toNumber(); - break; - case /* uint64 max_pending_amt_msat */ 4: - message.maxPendingAmtMsat = reader.uint64().toNumber(); - break; - case /* uint64 min_htlc_msat */ 5: - message.minHtlcMsat = reader.uint64().toNumber(); - break; - case /* uint32 max_accepted_htlcs */ 6: - message.maxAcceptedHtlcs = reader.uint32(); - 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, writer, options) { - /* uint32 csv_delay = 1; */ - if (message.csvDelay !== 0) - writer.tag(1, WireType.Varint).uint32(message.csvDelay); - /* uint64 chan_reserve_sat = 2; */ - if (message.chanReserveSat !== 0) - writer.tag(2, WireType.Varint).uint64(message.chanReserveSat); - /* uint64 dust_limit_sat = 3; */ - if (message.dustLimitSat !== 0) - writer.tag(3, WireType.Varint).uint64(message.dustLimitSat); - /* uint64 max_pending_amt_msat = 4; */ - if (message.maxPendingAmtMsat !== 0) - writer.tag(4, WireType.Varint).uint64(message.maxPendingAmtMsat); - /* uint64 min_htlc_msat = 5; */ - if (message.minHtlcMsat !== 0) - writer.tag(5, WireType.Varint).uint64(message.minHtlcMsat); - /* uint32 max_accepted_htlcs = 6; */ - if (message.maxAcceptedHtlcs !== 0) - writer.tag(6, WireType.Varint).uint32(message.maxAcceptedHtlcs); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelConstraints - */ -export const ChannelConstraints = new ChannelConstraints$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Channel$Type extends MessageType { - constructor() { - super("lnrpc.Channel", [ - { no: 1, name: "active", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "local_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "remote_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 9, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 10, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 11, name: "unsettled_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "total_satoshis_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 13, name: "total_satoshis_received", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 14, name: "num_updates", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 21, name: "remote_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 24, name: "uptime", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 25, name: "close_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 27, name: "push_amount_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 31, name: "alias_scids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - 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, aliasScids: [], zeroConf: false, zeroConfConfirmedScid: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool active */ 1: - message.active = reader.bool(); - break; - case /* string remote_pubkey */ 2: - message.remotePubkey = reader.string(); - break; - case /* string channel_point */ 3: - message.channelPoint = reader.string(); - break; - case /* uint64 chan_id = 4 [jstype = JS_STRING];*/ 4: - message.chanId = reader.uint64().toString(); - break; - case /* int64 capacity */ 5: - message.capacity = reader.int64().toNumber(); - break; - case /* int64 local_balance */ 6: - message.localBalance = reader.int64().toNumber(); - break; - case /* int64 remote_balance */ 7: - message.remoteBalance = reader.int64().toNumber(); - break; - case /* int64 commit_fee */ 8: - message.commitFee = reader.int64().toNumber(); - break; - case /* int64 commit_weight */ 9: - message.commitWeight = reader.int64().toNumber(); - break; - case /* int64 fee_per_kw */ 10: - message.feePerKw = reader.int64().toNumber(); - break; - case /* int64 unsettled_balance */ 11: - message.unsettledBalance = reader.int64().toNumber(); - break; - case /* int64 total_satoshis_sent */ 12: - message.totalSatoshisSent = reader.int64().toNumber(); - break; - case /* int64 total_satoshis_received */ 13: - message.totalSatoshisReceived = reader.int64().toNumber(); - break; - case /* uint64 num_updates */ 14: - message.numUpdates = reader.uint64().toNumber(); - break; - case /* repeated lnrpc.HTLC pending_htlcs */ 15: - message.pendingHtlcs.push(HTLC.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint32 csv_delay = 16 [deprecated = true];*/ 16: - message.csvDelay = reader.uint32(); - break; - case /* bool private */ 17: - message.private = reader.bool(); - break; - case /* bool initiator */ 18: - message.initiator = reader.bool(); - break; - case /* string chan_status_flags */ 19: - message.chanStatusFlags = reader.string(); - break; - case /* int64 local_chan_reserve_sat = 20 [deprecated = true];*/ 20: - message.localChanReserveSat = reader.int64().toNumber(); - break; - case /* int64 remote_chan_reserve_sat = 21 [deprecated = true];*/ 21: - message.remoteChanReserveSat = reader.int64().toNumber(); - break; - case /* bool static_remote_key = 22 [deprecated = true];*/ 22: - message.staticRemoteKey = reader.bool(); - break; - case /* lnrpc.CommitmentType commitment_type */ 26: - message.commitmentType = reader.int32(); - break; - case /* int64 lifetime */ 23: - message.lifetime = reader.int64().toNumber(); - break; - case /* int64 uptime */ 24: - message.uptime = reader.int64().toNumber(); - break; - case /* string close_address */ 25: - message.closeAddress = reader.string(); - break; - case /* uint64 push_amount_sat */ 27: - message.pushAmountSat = reader.uint64().toNumber(); - break; - case /* uint32 thaw_height */ 28: - message.thawHeight = reader.uint32(); - break; - case /* lnrpc.ChannelConstraints local_constraints */ 29: - message.localConstraints = ChannelConstraints.internalBinaryRead(reader, reader.uint32(), options, message.localConstraints); - break; - 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().toNumber()); - else - message.aliasScids.push(reader.uint64().toNumber()); - break; - case /* bool zero_conf */ 32: - message.zeroConf = reader.bool(); - break; - case /* uint64 zero_conf_confirmed_scid */ 33: - message.zeroConfConfirmedScid = reader.uint64().toNumber(); - 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, writer, options) { - /* bool active = 1; */ - if (message.active !== false) - writer.tag(1, WireType.Varint).bool(message.active); - /* string remote_pubkey = 2; */ - if (message.remotePubkey !== "") - writer.tag(2, WireType.LengthDelimited).string(message.remotePubkey); - /* string channel_point = 3; */ - if (message.channelPoint !== "") - writer.tag(3, WireType.LengthDelimited).string(message.channelPoint); - /* uint64 chan_id = 4 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(4, WireType.Varint).uint64(message.chanId); - /* int64 capacity = 5; */ - if (message.capacity !== 0) - writer.tag(5, WireType.Varint).int64(message.capacity); - /* int64 local_balance = 6; */ - if (message.localBalance !== 0) - writer.tag(6, WireType.Varint).int64(message.localBalance); - /* int64 remote_balance = 7; */ - if (message.remoteBalance !== 0) - writer.tag(7, WireType.Varint).int64(message.remoteBalance); - /* int64 commit_fee = 8; */ - if (message.commitFee !== 0) - writer.tag(8, WireType.Varint).int64(message.commitFee); - /* int64 commit_weight = 9; */ - if (message.commitWeight !== 0) - writer.tag(9, WireType.Varint).int64(message.commitWeight); - /* int64 fee_per_kw = 10; */ - if (message.feePerKw !== 0) - writer.tag(10, WireType.Varint).int64(message.feePerKw); - /* int64 unsettled_balance = 11; */ - if (message.unsettledBalance !== 0) - writer.tag(11, WireType.Varint).int64(message.unsettledBalance); - /* int64 total_satoshis_sent = 12; */ - if (message.totalSatoshisSent !== 0) - writer.tag(12, WireType.Varint).int64(message.totalSatoshisSent); - /* int64 total_satoshis_received = 13; */ - if (message.totalSatoshisReceived !== 0) - writer.tag(13, WireType.Varint).int64(message.totalSatoshisReceived); - /* uint64 num_updates = 14; */ - if (message.numUpdates !== 0) - writer.tag(14, WireType.Varint).uint64(message.numUpdates); - /* repeated lnrpc.HTLC pending_htlcs = 15; */ - for (let i = 0; i < message.pendingHtlcs.length; i++) - HTLC.internalBinaryWrite(message.pendingHtlcs[i], writer.tag(15, WireType.LengthDelimited).fork(), options).join(); - /* uint32 csv_delay = 16 [deprecated = true]; */ - if (message.csvDelay !== 0) - writer.tag(16, WireType.Varint).uint32(message.csvDelay); - /* bool private = 17; */ - if (message.private !== false) - writer.tag(17, WireType.Varint).bool(message.private); - /* bool initiator = 18; */ - if (message.initiator !== false) - writer.tag(18, WireType.Varint).bool(message.initiator); - /* string chan_status_flags = 19; */ - if (message.chanStatusFlags !== "") - writer.tag(19, WireType.LengthDelimited).string(message.chanStatusFlags); - /* int64 local_chan_reserve_sat = 20 [deprecated = true]; */ - if (message.localChanReserveSat !== 0) - writer.tag(20, WireType.Varint).int64(message.localChanReserveSat); - /* int64 remote_chan_reserve_sat = 21 [deprecated = true]; */ - if (message.remoteChanReserveSat !== 0) - writer.tag(21, WireType.Varint).int64(message.remoteChanReserveSat); - /* bool static_remote_key = 22 [deprecated = true]; */ - if (message.staticRemoteKey !== false) - writer.tag(22, WireType.Varint).bool(message.staticRemoteKey); - /* lnrpc.CommitmentType commitment_type = 26; */ - if (message.commitmentType !== 0) - writer.tag(26, WireType.Varint).int32(message.commitmentType); - /* int64 lifetime = 23; */ - if (message.lifetime !== 0) - writer.tag(23, WireType.Varint).int64(message.lifetime); - /* int64 uptime = 24; */ - if (message.uptime !== 0) - 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) - writer.tag(27, WireType.Varint).uint64(message.pushAmountSat); - /* uint32 thaw_height = 28; */ - if (message.thawHeight !== 0) - writer.tag(28, WireType.Varint).uint32(message.thawHeight); - /* lnrpc.ChannelConstraints local_constraints = 29; */ - if (message.localConstraints) - ChannelConstraints.internalBinaryWrite(message.localConstraints, writer.tag(29, WireType.LengthDelimited).fork(), options).join(); - /* 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 !== 0) - writer.tag(33, WireType.Varint).uint64(message.zeroConfConfirmedScid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Channel - */ -export const Channel = new Channel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListChannelsRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListChannelsRequest", [ - { no: 1, name: "active_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "inactive_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "public_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 4, name: "private_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 5, name: "peer", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { activeOnly: false, inactiveOnly: false, publicOnly: false, privateOnly: false, peer: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool active_only */ 1: - message.activeOnly = reader.bool(); - break; - case /* bool inactive_only */ 2: - message.inactiveOnly = reader.bool(); - break; - case /* bool public_only */ 3: - message.publicOnly = reader.bool(); - break; - case /* bool private_only */ 4: - message.privateOnly = reader.bool(); - break; - case /* bytes peer */ 5: - message.peer = 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, writer, options) { - /* bool active_only = 1; */ - if (message.activeOnly !== false) - writer.tag(1, WireType.Varint).bool(message.activeOnly); - /* bool inactive_only = 2; */ - if (message.inactiveOnly !== false) - writer.tag(2, WireType.Varint).bool(message.inactiveOnly); - /* bool public_only = 3; */ - if (message.publicOnly !== false) - writer.tag(3, WireType.Varint).bool(message.publicOnly); - /* bool private_only = 4; */ - if (message.privateOnly !== false) - writer.tag(4, WireType.Varint).bool(message.privateOnly); - /* bytes peer = 5; */ - if (message.peer.length) - writer.tag(5, WireType.LengthDelimited).bytes(message.peer); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListChannelsRequest - */ -export const ListChannelsRequest = new ListChannelsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListChannelsResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListChannelsResponse", [ - { no: 11, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Channel } - ]); - } - create(value) { - const message = { channels: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Channel channels */ 11: - message.channels.push(Channel.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, writer, options) { - /* repeated lnrpc.Channel channels = 11; */ - for (let i = 0; i < message.channels.length; i++) - Channel.internalBinaryWrite(message.channels[i], writer.tag(11, 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.ListChannelsResponse - */ -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: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "aliases", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { baseScid: 0, aliases: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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().toNumber(); - 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().toNumber()); - else - message.aliases.push(reader.uint64().toNumber()); - 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, writer, options) { - /* uint64 base_scid = 1; */ - if (message.baseScid !== 0) - 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) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - 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) { - const message = { aliasMaps: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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, writer, options) { - /* 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", [ - { no: 1, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "close_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 8, name: "settled_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 9, name: "time_locked_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 14, name: "alias_scids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 15, name: "zero_conf_confirmed_scid", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } - ]); - } - create(value) { - const message = { channelPoint: "", chanId: "0", chainHash: "", closingTxHash: "", remotePubkey: "", capacity: 0, closeHeight: 0, settledBalance: 0, timeLockedBalance: 0, 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); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string channel_point */ 1: - message.channelPoint = reader.string(); - break; - case /* uint64 chan_id = 2 [jstype = JS_STRING];*/ 2: - message.chanId = reader.uint64().toString(); - break; - case /* string chain_hash */ 3: - message.chainHash = reader.string(); - break; - case /* string closing_tx_hash */ 4: - message.closingTxHash = reader.string(); - break; - case /* string remote_pubkey */ 5: - message.remotePubkey = reader.string(); - break; - case /* int64 capacity */ 6: - message.capacity = reader.int64().toNumber(); - break; - case /* uint32 close_height */ 7: - message.closeHeight = reader.uint32(); - break; - case /* int64 settled_balance */ 8: - message.settledBalance = reader.int64().toNumber(); - break; - case /* int64 time_locked_balance */ 9: - message.timeLockedBalance = reader.int64().toNumber(); - break; - case /* lnrpc.ChannelCloseSummary.ClosureType close_type */ 10: - message.closeType = reader.int32(); - break; - case /* lnrpc.Initiator open_initiator */ 11: - message.openInitiator = reader.int32(); - break; - case /* lnrpc.Initiator close_initiator */ 12: - message.closeInitiator = reader.int32(); - break; - 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().toNumber()); - else - message.aliasScids.push(reader.uint64().toNumber()); - 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") - 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, writer, options) { - /* string channel_point = 1; */ - if (message.channelPoint !== "") - writer.tag(1, WireType.LengthDelimited).string(message.channelPoint); - /* uint64 chan_id = 2 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(2, WireType.Varint).uint64(message.chanId); - /* string chain_hash = 3; */ - if (message.chainHash !== "") - writer.tag(3, WireType.LengthDelimited).string(message.chainHash); - /* string closing_tx_hash = 4; */ - if (message.closingTxHash !== "") - writer.tag(4, WireType.LengthDelimited).string(message.closingTxHash); - /* string remote_pubkey = 5; */ - if (message.remotePubkey !== "") - writer.tag(5, WireType.LengthDelimited).string(message.remotePubkey); - /* int64 capacity = 6; */ - if (message.capacity !== 0) - 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) - writer.tag(8, WireType.Varint).int64(message.settledBalance); - /* int64 time_locked_balance = 9; */ - if (message.timeLockedBalance !== 0) - writer.tag(9, WireType.Varint).int64(message.timeLockedBalance); - /* lnrpc.ChannelCloseSummary.ClosureType close_type = 10; */ - if (message.closeType !== 0) - writer.tag(10, WireType.Varint).int32(message.closeType); - /* lnrpc.Initiator open_initiator = 11; */ - if (message.openInitiator !== 0) - writer.tag(11, WireType.Varint).int32(message.openInitiator); - /* lnrpc.Initiator close_initiator = 12; */ - if (message.closeInitiator !== 0) - writer.tag(12, WireType.Varint).int32(message.closeInitiator); - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelCloseSummary - */ -export const ChannelCloseSummary = new ChannelCloseSummary$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Resolution$Type extends MessageType { - constructor() { - super("lnrpc.Resolution", [ - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "sweep_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { resolutionType: 0, outcome: 0, amountSat: 0, sweepTxid: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ResolutionType resolution_type */ 1: - message.resolutionType = reader.int32(); - break; - case /* lnrpc.ResolutionOutcome outcome */ 2: - message.outcome = reader.int32(); - break; - case /* lnrpc.OutPoint outpoint */ 3: - message.outpoint = OutPoint.internalBinaryRead(reader, reader.uint32(), options, message.outpoint); - break; - case /* uint64 amount_sat */ 4: - message.amountSat = reader.uint64().toNumber(); - break; - case /* string sweep_txid */ 5: - message.sweepTxid = 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, writer, options) { - /* lnrpc.ResolutionType resolution_type = 1; */ - if (message.resolutionType !== 0) - writer.tag(1, WireType.Varint).int32(message.resolutionType); - /* lnrpc.ResolutionOutcome outcome = 2; */ - if (message.outcome !== 0) - writer.tag(2, WireType.Varint).int32(message.outcome); - /* lnrpc.OutPoint outpoint = 3; */ - if (message.outpoint) - OutPoint.internalBinaryWrite(message.outpoint, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* uint64 amount_sat = 4; */ - if (message.amountSat !== 0) - writer.tag(4, WireType.Varint).uint64(message.amountSat); - /* string sweep_txid = 5; */ - if (message.sweepTxid !== "") - writer.tag(5, WireType.LengthDelimited).string(message.sweepTxid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Resolution - */ -export const Resolution = new Resolution$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ClosedChannelsRequest$Type extends MessageType { - constructor() { - super("lnrpc.ClosedChannelsRequest", [ - { no: 1, name: "cooperative", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "local_force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "remote_force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 4, name: "breach", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 5, name: "funding_canceled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 6, name: "abandoned", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { cooperative: false, localForce: false, remoteForce: false, breach: false, fundingCanceled: false, abandoned: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool cooperative */ 1: - message.cooperative = reader.bool(); - break; - case /* bool local_force */ 2: - message.localForce = reader.bool(); - break; - case /* bool remote_force */ 3: - message.remoteForce = reader.bool(); - break; - case /* bool breach */ 4: - message.breach = reader.bool(); - break; - case /* bool funding_canceled */ 5: - message.fundingCanceled = reader.bool(); - break; - case /* bool abandoned */ 6: - message.abandoned = 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, writer, options) { - /* bool cooperative = 1; */ - if (message.cooperative !== false) - writer.tag(1, WireType.Varint).bool(message.cooperative); - /* bool local_force = 2; */ - if (message.localForce !== false) - writer.tag(2, WireType.Varint).bool(message.localForce); - /* bool remote_force = 3; */ - if (message.remoteForce !== false) - writer.tag(3, WireType.Varint).bool(message.remoteForce); - /* bool breach = 4; */ - if (message.breach !== false) - writer.tag(4, WireType.Varint).bool(message.breach); - /* bool funding_canceled = 5; */ - if (message.fundingCanceled !== false) - writer.tag(5, WireType.Varint).bool(message.fundingCanceled); - /* bool abandoned = 6; */ - if (message.abandoned !== false) - writer.tag(6, WireType.Varint).bool(message.abandoned); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ClosedChannelsRequest - */ -export const ClosedChannelsRequest = new ClosedChannelsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ClosedChannelsResponse$Type extends MessageType { - constructor() { - super("lnrpc.ClosedChannelsResponse", [ - { no: 1, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelCloseSummary } - ]); - } - create(value) { - const message = { channels: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.ChannelCloseSummary channels */ 1: - message.channels.push(ChannelCloseSummary.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, writer, options) { - /* repeated lnrpc.ChannelCloseSummary channels = 1; */ - for (let i = 0; i < message.channels.length; i++) - ChannelCloseSummary.internalBinaryWrite(message.channels[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.ClosedChannelsResponse - */ -export const ClosedChannelsResponse = new ClosedChannelsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Peer$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "bytes_recv", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "sat_sent", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "sat_recv", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "inbound", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 9, name: "ping_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 15, name: "last_ping_payload", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { pubKey: "", address: "", bytesSent: 0, bytesRecv: 0, satSent: 0, satRecv: 0, inbound: false, pingTime: 0, syncType: 0, features: {}, errors: [], flapCount: 0, lastFlapNs: 0, lastPingPayload: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pub_key */ 1: - message.pubKey = reader.string(); - break; - case /* string address */ 3: - message.address = reader.string(); - break; - case /* uint64 bytes_sent */ 4: - message.bytesSent = reader.uint64().toNumber(); - break; - case /* uint64 bytes_recv */ 5: - message.bytesRecv = reader.uint64().toNumber(); - break; - case /* int64 sat_sent */ 6: - message.satSent = reader.int64().toNumber(); - break; - case /* int64 sat_recv */ 7: - message.satRecv = reader.int64().toNumber(); - break; - case /* bool inbound */ 8: - message.inbound = reader.bool(); - break; - case /* int64 ping_time */ 9: - message.pingTime = reader.int64().toNumber(); - break; - case /* lnrpc.Peer.SyncType sync_type */ 10: - message.syncType = reader.int32(); - break; - case /* map features */ 11: - this.binaryReadMap11(message.features, reader, options); - break; - case /* repeated lnrpc.TimestampedError errors */ 12: - message.errors.push(TimestampedError.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* int32 flap_count */ 13: - message.flapCount = reader.int32(); - break; - case /* int64 last_flap_ns */ 14: - message.lastFlapNs = reader.int64().toNumber(); - break; - case /* bytes last_ping_payload */ 15: - message.lastPingPayload = 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; - } - binaryReadMap11(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.Peer.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - internalBinaryWrite(message, writer, options) { - /* string pub_key = 1; */ - if (message.pubKey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubKey); - /* string address = 3; */ - if (message.address !== "") - writer.tag(3, WireType.LengthDelimited).string(message.address); - /* uint64 bytes_sent = 4; */ - if (message.bytesSent !== 0) - writer.tag(4, WireType.Varint).uint64(message.bytesSent); - /* uint64 bytes_recv = 5; */ - if (message.bytesRecv !== 0) - writer.tag(5, WireType.Varint).uint64(message.bytesRecv); - /* int64 sat_sent = 6; */ - if (message.satSent !== 0) - writer.tag(6, WireType.Varint).int64(message.satSent); - /* int64 sat_recv = 7; */ - if (message.satRecv !== 0) - 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) - writer.tag(9, WireType.Varint).int64(message.pingTime); - /* lnrpc.Peer.SyncType sync_type = 10; */ - if (message.syncType !== 0) - writer.tag(10, WireType.Varint).int32(message.syncType); - /* map features = 11; */ - for (let k of Object.keys(message.features)) { - writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k], writer, options); - writer.join().join(); - } - /* repeated lnrpc.TimestampedError errors = 12; */ - for (let i = 0; i < message.errors.length; i++) - TimestampedError.internalBinaryWrite(message.errors[i], writer.tag(12, WireType.LengthDelimited).fork(), options).join(); - /* int32 flap_count = 13; */ - if (message.flapCount !== 0) - writer.tag(13, WireType.Varint).int32(message.flapCount); - /* int64 last_flap_ns = 14; */ - if (message.lastFlapNs !== 0) - 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Peer - */ -export const Peer = new Peer$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class TimestampedError$Type extends MessageType { - constructor() { - super("lnrpc.TimestampedError", [ - { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { timestamp: 0, error: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 timestamp */ 1: - message.timestamp = reader.uint64().toNumber(); - break; - case /* string error */ 2: - message.error = 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, writer, options) { - /* uint64 timestamp = 1; */ - if (message.timestamp !== 0) - writer.tag(1, WireType.Varint).uint64(message.timestamp); - /* string error = 2; */ - if (message.error !== "") - writer.tag(2, WireType.LengthDelimited).string(message.error); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.TimestampedError - */ -export const TimestampedError = new TimestampedError$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListPeersRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListPeersRequest", [ - { no: 1, name: "latest_error", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { latestError: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool latest_error */ 1: - message.latestError = 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, writer, options) { - /* bool latest_error = 1; */ - if (message.latestError !== false) - writer.tag(1, WireType.Varint).bool(message.latestError); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListPeersRequest - */ -export const ListPeersRequest = new ListPeersRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListPeersResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListPeersResponse", [ - { no: 1, name: "peers", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Peer } - ]); - } - create(value) { - const message = { peers: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Peer peers */ 1: - message.peers.push(Peer.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, writer, options) { - /* repeated lnrpc.Peer peers = 1; */ - for (let i = 0; i < message.peers.length; i++) - Peer.internalBinaryWrite(message.peers[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.ListPeersResponse - */ -export const ListPeersResponse = new ListPeersResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PeerEventSubscription$Type extends MessageType { - constructor() { - super("lnrpc.PeerEventSubscription", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PeerEventSubscription - */ -export const PeerEventSubscription = new PeerEventSubscription$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PeerEvent$Type extends MessageType { - constructor() { - super("lnrpc.PeerEvent", [ - { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "type", kind: "enum", T: () => ["lnrpc.PeerEvent.EventType", PeerEvent_EventType] } - ]); - } - create(value) { - const message = { pubKey: "", type: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pub_key */ 1: - message.pubKey = reader.string(); - break; - case /* lnrpc.PeerEvent.EventType type */ 2: - message.type = 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, writer, options) { - /* string pub_key = 1; */ - if (message.pubKey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubKey); - /* lnrpc.PeerEvent.EventType type = 2; */ - if (message.type !== 0) - writer.tag(2, WireType.Varint).int32(message.type); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PeerEvent - */ -export const PeerEvent = new PeerEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetInfoRequest$Type extends MessageType { - constructor() { - super("lnrpc.GetInfoRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GetInfoRequest - */ -export const GetInfoRequest = new GetInfoRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetInfoResponse$Type extends MessageType { - constructor() { - super("lnrpc.GetInfoResponse", [ - { no: 14, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 20, name: "commit_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 1, name: "identity_pubkey", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "alias", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 17, name: "color", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "num_pending_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "num_active_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 15, name: "num_inactive_channels", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 21, name: "require_htlc_interceptor", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - 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: {}, requireHtlcInterceptor: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string version */ 14: - message.version = reader.string(); - break; - case /* string commit_hash */ 20: - message.commitHash = reader.string(); - break; - case /* string identity_pubkey */ 1: - message.identityPubkey = reader.string(); - break; - case /* string alias */ 2: - message.alias = reader.string(); - break; - case /* string color */ 17: - message.color = reader.string(); - break; - case /* uint32 num_pending_channels */ 3: - message.numPendingChannels = reader.uint32(); - break; - case /* uint32 num_active_channels */ 4: - message.numActiveChannels = reader.uint32(); - break; - case /* uint32 num_inactive_channels */ 15: - message.numInactiveChannels = reader.uint32(); - break; - case /* uint32 num_peers */ 5: - message.numPeers = reader.uint32(); - break; - case /* uint32 block_height */ 6: - message.blockHeight = reader.uint32(); - break; - case /* string block_hash */ 8: - message.blockHash = reader.string(); - break; - case /* int64 best_header_timestamp */ 13: - message.bestHeaderTimestamp = reader.int64().toNumber(); - break; - case /* bool synced_to_chain */ 9: - message.syncedToChain = reader.bool(); - break; - case /* bool synced_to_graph */ 18: - message.syncedToGraph = reader.bool(); - break; - case /* bool testnet = 10 [deprecated = true];*/ 10: - message.testnet = reader.bool(); - break; - case /* repeated lnrpc.Chain chains */ 16: - message.chains.push(Chain.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated string uris */ 12: - message.uris.push(reader.string()); - break; - 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") - 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; - } - binaryReadMap19(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.GetInfoResponse.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - internalBinaryWrite(message, writer, options) { - /* string version = 14; */ - if (message.version !== "") - writer.tag(14, WireType.LengthDelimited).string(message.version); - /* string commit_hash = 20; */ - if (message.commitHash !== "") - writer.tag(20, WireType.LengthDelimited).string(message.commitHash); - /* string identity_pubkey = 1; */ - if (message.identityPubkey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.identityPubkey); - /* string alias = 2; */ - if (message.alias !== "") - writer.tag(2, WireType.LengthDelimited).string(message.alias); - /* string color = 17; */ - if (message.color !== "") - writer.tag(17, WireType.LengthDelimited).string(message.color); - /* uint32 num_pending_channels = 3; */ - if (message.numPendingChannels !== 0) - writer.tag(3, WireType.Varint).uint32(message.numPendingChannels); - /* uint32 num_active_channels = 4; */ - if (message.numActiveChannels !== 0) - writer.tag(4, WireType.Varint).uint32(message.numActiveChannels); - /* uint32 num_inactive_channels = 15; */ - if (message.numInactiveChannels !== 0) - writer.tag(15, WireType.Varint).uint32(message.numInactiveChannels); - /* uint32 num_peers = 5; */ - if (message.numPeers !== 0) - writer.tag(5, WireType.Varint).uint32(message.numPeers); - /* uint32 block_height = 6; */ - if (message.blockHeight !== 0) - writer.tag(6, WireType.Varint).uint32(message.blockHeight); - /* string block_hash = 8; */ - if (message.blockHash !== "") - writer.tag(8, WireType.LengthDelimited).string(message.blockHash); - /* int64 best_header_timestamp = 13; */ - if (message.bestHeaderTimestamp !== 0) - writer.tag(13, WireType.Varint).int64(message.bestHeaderTimestamp); - /* bool synced_to_chain = 9; */ - if (message.syncedToChain !== false) - writer.tag(9, WireType.Varint).bool(message.syncedToChain); - /* bool synced_to_graph = 18; */ - if (message.syncedToGraph !== false) - writer.tag(18, WireType.Varint).bool(message.syncedToGraph); - /* bool testnet = 10 [deprecated = true]; */ - if (message.testnet !== false) - writer.tag(10, WireType.Varint).bool(message.testnet); - /* repeated lnrpc.Chain chains = 16; */ - for (let i = 0; i < message.chains.length; i++) - Chain.internalBinaryWrite(message.chains[i], writer.tag(16, WireType.LengthDelimited).fork(), options).join(); - /* repeated string uris = 12; */ - for (let i = 0; i < message.uris.length; i++) - writer.tag(12, WireType.LengthDelimited).string(message.uris[i]); - /* map features = 19; */ - for (let k of Object.keys(message.features)) { - writer.tag(19, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k], 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GetInfoResponse - */ -export const GetInfoResponse = new GetInfoResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetRecoveryInfoRequest$Type extends MessageType { - constructor() { - super("lnrpc.GetRecoveryInfoRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GetRecoveryInfoRequest - */ -export const GetRecoveryInfoRequest = new GetRecoveryInfoRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetRecoveryInfoResponse$Type extends MessageType { - constructor() { - super("lnrpc.GetRecoveryInfoResponse", [ - { no: 1, name: "recovery_mode", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "recovery_finished", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "progress", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value) { - const message = { recoveryMode: false, recoveryFinished: false, progress: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool recovery_mode */ 1: - message.recoveryMode = reader.bool(); - break; - case /* bool recovery_finished */ 2: - message.recoveryFinished = reader.bool(); - break; - case /* double progress */ 3: - message.progress = reader.double(); - 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, writer, options) { - /* bool recovery_mode = 1; */ - if (message.recoveryMode !== false) - writer.tag(1, WireType.Varint).bool(message.recoveryMode); - /* bool recovery_finished = 2; */ - if (message.recoveryFinished !== false) - writer.tag(2, WireType.Varint).bool(message.recoveryFinished); - /* double progress = 3; */ - if (message.progress !== 0) - writer.tag(3, WireType.Bit64).double(message.progress); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GetRecoveryInfoResponse - */ -export const GetRecoveryInfoResponse = new GetRecoveryInfoResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Chain$Type extends MessageType { - constructor() { - super("lnrpc.Chain", [ - { no: 1, name: "chain", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "network", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { chain: "", network: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string chain */ 1: - message.chain = reader.string(); - break; - case /* string network */ 2: - message.network = 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, writer, options) { - /* string chain = 1; */ - if (message.chain !== "") - writer.tag(1, WireType.LengthDelimited).string(message.chain); - /* string network = 2; */ - if (message.network !== "") - writer.tag(2, WireType.LengthDelimited).string(message.network); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Chain - */ -export const Chain = new Chain$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ConfirmationUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ConfirmationUpdate", [ - { no: 1, name: "block_sha", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "block_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 3, name: "num_confs_left", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = { blockSha: new Uint8Array(0), blockHeight: 0, numConfsLeft: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes block_sha */ 1: - message.blockSha = reader.bytes(); - break; - case /* int32 block_height */ 2: - message.blockHeight = reader.int32(); - break; - case /* uint32 num_confs_left */ 3: - message.numConfsLeft = reader.uint32(); - 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, writer, options) { - /* bytes block_sha = 1; */ - if (message.blockSha.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.blockSha); - /* int32 block_height = 2; */ - if (message.blockHeight !== 0) - writer.tag(2, WireType.Varint).int32(message.blockHeight); - /* uint32 num_confs_left = 3; */ - if (message.numConfsLeft !== 0) - writer.tag(3, WireType.Varint).uint32(message.numConfsLeft); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ConfirmationUpdate - */ -export const ConfirmationUpdate = new ConfirmationUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelOpenUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ChannelOpenUpdate", [ - { no: 1, name: "channel_point", kind: "message", T: () => ChannelPoint } - ]); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint channel_point */ 1: - message.channelPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channelPoint); - 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, writer, options) { - /* lnrpc.ChannelPoint channel_point = 1; */ - if (message.channelPoint) - ChannelPoint.internalBinaryWrite(message.channelPoint, 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.ChannelOpenUpdate - */ -export const ChannelOpenUpdate = new ChannelOpenUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelCloseUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ChannelCloseUpdate", [ - { no: 1, name: "closing_txid", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { closingTxid: new Uint8Array(0), success: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes closing_txid */ 1: - message.closingTxid = reader.bytes(); - break; - case /* bool success */ 2: - message.success = 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, writer, options) { - /* bytes closing_txid = 1; */ - if (message.closingTxid.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.closingTxid); - /* bool success = 2; */ - if (message.success !== false) - writer.tag(2, WireType.Varint).bool(message.success); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelCloseUpdate - */ -export const ChannelCloseUpdate = new ChannelCloseUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CloseChannelRequest$Type extends MessageType { - constructor() { - super("lnrpc.CloseChannelRequest", [ - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "delivery_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "sat_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "max_fee_per_vbyte", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { force: false, targetConf: 0, satPerByte: 0, deliveryAddress: "", satPerVbyte: 0, maxFeePerVbyte: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint channel_point */ 1: - message.channelPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channelPoint); - break; - case /* bool force */ 2: - message.force = reader.bool(); - break; - case /* int32 target_conf */ 3: - message.targetConf = reader.int32(); - break; - case /* int64 sat_per_byte = 4 [deprecated = true];*/ 4: - message.satPerByte = reader.int64().toNumber(); - break; - case /* string delivery_address */ 5: - message.deliveryAddress = reader.string(); - break; - case /* uint64 sat_per_vbyte */ 6: - message.satPerVbyte = reader.uint64().toNumber(); - break; - case /* uint64 max_fee_per_vbyte */ 7: - message.maxFeePerVbyte = reader.uint64().toNumber(); - 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, writer, options) { - /* lnrpc.ChannelPoint channel_point = 1; */ - if (message.channelPoint) - ChannelPoint.internalBinaryWrite(message.channelPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bool force = 2; */ - if (message.force !== false) - writer.tag(2, WireType.Varint).bool(message.force); - /* int32 target_conf = 3; */ - if (message.targetConf !== 0) - writer.tag(3, WireType.Varint).int32(message.targetConf); - /* int64 sat_per_byte = 4 [deprecated = true]; */ - if (message.satPerByte !== 0) - 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) - writer.tag(6, WireType.Varint).uint64(message.satPerVbyte); - /* uint64 max_fee_per_vbyte = 7; */ - if (message.maxFeePerVbyte !== 0) - writer.tag(7, WireType.Varint).uint64(message.maxFeePerVbyte); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.CloseChannelRequest - */ -export const CloseChannelRequest = new CloseChannelRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CloseStatusUpdate$Type extends MessageType { - constructor() { - super("lnrpc.CloseStatusUpdate", [ - { no: 1, name: "close_pending", kind: "message", oneof: "update", T: () => PendingUpdate }, - { no: 3, name: "chan_close", kind: "message", oneof: "update", T: () => ChannelCloseUpdate } - ]); - } - create(value) { - const message = { update: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingUpdate close_pending */ 1: - message.update = { - oneofKind: "closePending", - closePending: PendingUpdate.internalBinaryRead(reader, reader.uint32(), options, message.update.closePending) - }; - break; - case /* lnrpc.ChannelCloseUpdate chan_close */ 3: - message.update = { - oneofKind: "chanClose", - chanClose: ChannelCloseUpdate.internalBinaryRead(reader, reader.uint32(), options, message.update.chanClose) - }; - 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, writer, options) { - /* lnrpc.PendingUpdate close_pending = 1; */ - if (message.update.oneofKind === "closePending") - PendingUpdate.internalBinaryWrite(message.update.closePending, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelCloseUpdate chan_close = 3; */ - if (message.update.oneofKind === "chanClose") - ChannelCloseUpdate.internalBinaryWrite(message.update.chanClose, 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.CloseStatusUpdate - */ -export const CloseStatusUpdate = new CloseStatusUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingUpdate$Type extends MessageType { - constructor() { - super("lnrpc.PendingUpdate", [ - { no: 1, name: "txid", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "output_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = { txid: new Uint8Array(0), outputIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes txid */ 1: - message.txid = reader.bytes(); - break; - case /* uint32 output_index */ 2: - message.outputIndex = reader.uint32(); - 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, writer, options) { - /* bytes txid = 1; */ - if (message.txid.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.txid); - /* uint32 output_index = 2; */ - if (message.outputIndex !== 0) - writer.tag(2, WireType.Varint).uint32(message.outputIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingUpdate - */ -export const PendingUpdate = new PendingUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { fundingAddress: "", fundingAmount: 0, psbt: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string funding_address */ 1: - message.fundingAddress = reader.string(); - break; - case /* int64 funding_amount */ 2: - message.fundingAmount = reader.int64().toNumber(); - break; - case /* bytes psbt */ 3: - message.psbt = 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, writer, options) { - /* string funding_address = 1; */ - if (message.fundingAddress !== "") - writer.tag(1, WireType.LengthDelimited).string(message.fundingAddress); - /* int64 funding_amount = 2; */ - if (message.fundingAmount !== 0) - writer.tag(2, WireType.Varint).int64(message.fundingAmount); - /* bytes psbt = 3; */ - if (message.psbt.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.psbt); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ReadyForPsbtFunding - */ -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: 2 /*LongType.NUMBER*/ }, - { 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) { - const message = { channels: [], targetConf: 0, satPerVbyte: 0, 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, length, options, target) { - 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().toNumber(); - 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, writer, options) { - /* 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 !== 0) - 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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "push_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 5, name: "min_htlc_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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) { - const message = { nodePubkey: new Uint8Array(0), localFundingAmount: 0, pushSat: 0, private: false, minHtlcMsat: 0, 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, length, options, target) { - 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().toNumber(); - break; - case /* int64 push_sat */ 3: - message.pushSat = reader.int64().toNumber(); - break; - case /* bool private */ 4: - message.private = reader.bool(); - break; - case /* int64 min_htlc_msat */ 5: - message.minHtlcMsat = reader.int64().toNumber(); - 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, writer, options) { - /* bytes node_pubkey = 1; */ - if (message.nodePubkey.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.nodePubkey); - /* int64 local_funding_amount = 2; */ - if (message.localFundingAmount !== 0) - writer.tag(2, WireType.Varint).int64(message.localFundingAmount); - /* int64 push_sat = 3; */ - if (message.pushSat !== 0) - 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 !== 0) - 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) { - const message = { pendingChannels: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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, writer, options) { - /* 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "push_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "target_conf", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 7, name: "sat_per_byte", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 9, name: "min_htlc_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 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: 2 /*LongType.NUMBER*/ }, - { no: 22, name: "fee_rate", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - 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, commitmentType: 0, zeroConf: false, scidAlias: false, baseFee: 0, feeRate: 0, useBaseFee: false, useFeeRate: false, remoteChanReserveSat: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 sat_per_vbyte */ 1: - message.satPerVbyte = reader.uint64().toNumber(); - break; - case /* bytes node_pubkey */ 2: - message.nodePubkey = reader.bytes(); - break; - case /* string node_pubkey_string = 3 [deprecated = true];*/ 3: - message.nodePubkeyString = reader.string(); - break; - case /* int64 local_funding_amount */ 4: - message.localFundingAmount = reader.int64().toNumber(); - break; - case /* int64 push_sat */ 5: - message.pushSat = reader.int64().toNumber(); - break; - case /* int32 target_conf */ 6: - message.targetConf = reader.int32(); - break; - case /* int64 sat_per_byte = 7 [deprecated = true];*/ 7: - message.satPerByte = reader.int64().toNumber(); - break; - case /* bool private */ 8: - message.private = reader.bool(); - break; - case /* int64 min_htlc_msat */ 9: - message.minHtlcMsat = reader.int64().toNumber(); - break; - case /* uint32 remote_csv_delay */ 10: - message.remoteCsvDelay = reader.uint32(); - break; - case /* int32 min_confs */ 11: - message.minConfs = reader.int32(); - break; - case /* bool spend_unconfirmed */ 12: - message.spendUnconfirmed = reader.bool(); - break; - case /* string close_address */ 13: - message.closeAddress = reader.string(); - break; - case /* lnrpc.FundingShim funding_shim */ 14: - message.fundingShim = FundingShim.internalBinaryRead(reader, reader.uint32(), options, message.fundingShim); - break; - case /* uint64 remote_max_value_in_flight_msat */ 15: - message.remoteMaxValueInFlightMsat = reader.uint64().toNumber(); - break; - case /* uint32 remote_max_htlcs */ 16: - message.remoteMaxHtlcs = reader.uint32(); - break; - 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().toNumber(); - break; - case /* uint64 fee_rate */ 22: - message.feeRate = reader.uint64().toNumber(); - 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().toNumber(); - 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, writer, options) { - /* uint64 sat_per_vbyte = 1; */ - if (message.satPerVbyte !== 0) - writer.tag(1, WireType.Varint).uint64(message.satPerVbyte); - /* bytes node_pubkey = 2; */ - if (message.nodePubkey.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.nodePubkey); - /* string node_pubkey_string = 3 [deprecated = true]; */ - if (message.nodePubkeyString !== "") - writer.tag(3, WireType.LengthDelimited).string(message.nodePubkeyString); - /* int64 local_funding_amount = 4; */ - if (message.localFundingAmount !== 0) - writer.tag(4, WireType.Varint).int64(message.localFundingAmount); - /* int64 push_sat = 5; */ - if (message.pushSat !== 0) - 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) - 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) - writer.tag(9, WireType.Varint).int64(message.minHtlcMsat); - /* uint32 remote_csv_delay = 10; */ - if (message.remoteCsvDelay !== 0) - writer.tag(10, WireType.Varint).uint32(message.remoteCsvDelay); - /* int32 min_confs = 11; */ - if (message.minConfs !== 0) - writer.tag(11, WireType.Varint).int32(message.minConfs); - /* bool spend_unconfirmed = 12; */ - if (message.spendUnconfirmed !== false) - writer.tag(12, WireType.Varint).bool(message.spendUnconfirmed); - /* string close_address = 13; */ - if (message.closeAddress !== "") - writer.tag(13, WireType.LengthDelimited).string(message.closeAddress); - /* lnrpc.FundingShim funding_shim = 14; */ - 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) - writer.tag(15, WireType.Varint).uint64(message.remoteMaxValueInFlightMsat); - /* uint32 remote_max_htlcs = 16; */ - if (message.remoteMaxHtlcs !== 0) - writer.tag(16, WireType.Varint).uint32(message.remoteMaxHtlcs); - /* 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 !== 0) - writer.tag(21, WireType.Varint).uint64(message.baseFee); - /* uint64 fee_rate = 22; */ - if (message.feeRate !== 0) - 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 !== 0) - writer.tag(25, WireType.Varint).uint64(message.remoteChanReserveSat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.OpenChannelRequest - */ -export const OpenChannelRequest = new OpenChannelRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class OpenStatusUpdate$Type extends MessageType { - constructor() { - super("lnrpc.OpenStatusUpdate", [ - { no: 1, name: "chan_pending", kind: "message", oneof: "update", T: () => PendingUpdate }, - { no: 3, name: "chan_open", kind: "message", oneof: "update", T: () => ChannelOpenUpdate }, - { no: 5, name: "psbt_fund", kind: "message", oneof: "update", T: () => ReadyForPsbtFunding }, - { no: 4, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { update: { oneofKind: undefined }, pendingChanId: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingUpdate chan_pending */ 1: - message.update = { - oneofKind: "chanPending", - chanPending: PendingUpdate.internalBinaryRead(reader, reader.uint32(), options, message.update.chanPending) - }; - break; - case /* lnrpc.ChannelOpenUpdate chan_open */ 3: - message.update = { - oneofKind: "chanOpen", - chanOpen: ChannelOpenUpdate.internalBinaryRead(reader, reader.uint32(), options, message.update.chanOpen) - }; - break; - case /* lnrpc.ReadyForPsbtFunding psbt_fund */ 5: - message.update = { - oneofKind: "psbtFund", - psbtFund: ReadyForPsbtFunding.internalBinaryRead(reader, reader.uint32(), options, message.update.psbtFund) - }; - break; - case /* bytes pending_chan_id */ 4: - message.pendingChanId = 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, writer, options) { - /* lnrpc.PendingUpdate chan_pending = 1; */ - if (message.update.oneofKind === "chanPending") - PendingUpdate.internalBinaryWrite(message.update.chanPending, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelOpenUpdate chan_open = 3; */ - if (message.update.oneofKind === "chanOpen") - ChannelOpenUpdate.internalBinaryWrite(message.update.chanOpen, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ReadyForPsbtFunding psbt_fund = 5; */ - if (message.update.oneofKind === "psbtFund") - ReadyForPsbtFunding.internalBinaryWrite(message.update.psbtFund, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* bytes pending_chan_id = 4; */ - if (message.pendingChanId.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.pendingChanId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.OpenStatusUpdate - */ -export const OpenStatusUpdate = new OpenStatusUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class KeyLocator$Type extends MessageType { - constructor() { - super("lnrpc.KeyLocator", [ - { no: 1, name: "key_family", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 2, name: "key_index", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value) { - const message = { keyFamily: 0, keyIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int32 key_family */ 1: - message.keyFamily = reader.int32(); - break; - case /* int32 key_index */ 2: - message.keyIndex = 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, writer, options) { - /* int32 key_family = 1; */ - if (message.keyFamily !== 0) - writer.tag(1, WireType.Varint).int32(message.keyFamily); - /* int32 key_index = 2; */ - if (message.keyIndex !== 0) - writer.tag(2, WireType.Varint).int32(message.keyIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.KeyLocator - */ -export const KeyLocator = new KeyLocator$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class KeyDescriptor$Type extends MessageType { - constructor() { - super("lnrpc.KeyDescriptor", [ - { no: 1, name: "raw_key_bytes", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "key_loc", kind: "message", T: () => KeyLocator } - ]); - } - create(value) { - const message = { rawKeyBytes: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes raw_key_bytes */ 1: - message.rawKeyBytes = reader.bytes(); - break; - case /* lnrpc.KeyLocator key_loc */ 2: - message.keyLoc = KeyLocator.internalBinaryRead(reader, reader.uint32(), options, message.keyLoc); - 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, writer, options) { - /* bytes raw_key_bytes = 1; */ - if (message.rawKeyBytes.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.rawKeyBytes); - /* lnrpc.KeyLocator key_loc = 2; */ - if (message.keyLoc) - KeyLocator.internalBinaryWrite(message.keyLoc, writer.tag(2, 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.KeyDescriptor - */ -export const KeyDescriptor = new KeyDescriptor$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChanPointShim$Type extends MessageType { - constructor() { - super("lnrpc.ChanPointShim", [ - { no: 1, name: "amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/ }, - { no: 5, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 6, name: "thaw_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = { amt: 0, 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); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 amt */ 1: - message.amt = reader.int64().toNumber(); - break; - case /* lnrpc.ChannelPoint chan_point */ 2: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - break; - case /* lnrpc.KeyDescriptor local_key */ 3: - message.localKey = KeyDescriptor.internalBinaryRead(reader, reader.uint32(), options, message.localKey); - break; - case /* bytes remote_key */ 4: - message.remoteKey = reader.bytes(); - break; - case /* bytes pending_chan_id */ 5: - message.pendingChanId = reader.bytes(); - break; - case /* uint32 thaw_height */ 6: - message.thawHeight = reader.uint32(); - 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, writer, options) { - /* int64 amt = 1; */ - if (message.amt !== 0) - writer.tag(1, WireType.Varint).int64(message.amt); - /* lnrpc.ChannelPoint chan_point = 2; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.KeyDescriptor local_key = 3; */ - if (message.localKey) - KeyDescriptor.internalBinaryWrite(message.localKey, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* bytes remote_key = 4; */ - if (message.remoteKey.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.remoteKey); - /* bytes pending_chan_id = 5; */ - if (message.pendingChanId.length) - writer.tag(5, WireType.LengthDelimited).bytes(message.pendingChanId); - /* uint32 thaw_height = 6; */ - if (message.thawHeight !== 0) - writer.tag(6, WireType.Varint).uint32(message.thawHeight); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChanPointShim - */ -export const ChanPointShim = new ChanPointShim$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PsbtShim$Type extends MessageType { - constructor() { - super("lnrpc.PsbtShim", [ - { no: 1, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "base_psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "no_publish", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { pendingChanId: new Uint8Array(0), basePsbt: new Uint8Array(0), noPublish: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes pending_chan_id */ 1: - message.pendingChanId = reader.bytes(); - break; - case /* bytes base_psbt */ 2: - message.basePsbt = reader.bytes(); - break; - case /* bool no_publish */ 3: - message.noPublish = 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, writer, options) { - /* bytes pending_chan_id = 1; */ - if (message.pendingChanId.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.pendingChanId); - /* bytes base_psbt = 2; */ - if (message.basePsbt.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.basePsbt); - /* bool no_publish = 3; */ - if (message.noPublish !== false) - writer.tag(3, WireType.Varint).bool(message.noPublish); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PsbtShim - */ -export const PsbtShim = new PsbtShim$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FundingShim$Type extends MessageType { - constructor() { - super("lnrpc.FundingShim", [ - { no: 1, name: "chan_point_shim", kind: "message", oneof: "shim", T: () => ChanPointShim }, - { no: 2, name: "psbt_shim", kind: "message", oneof: "shim", T: () => PsbtShim } - ]); - } - create(value) { - const message = { shim: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChanPointShim chan_point_shim */ 1: - message.shim = { - oneofKind: "chanPointShim", - chanPointShim: ChanPointShim.internalBinaryRead(reader, reader.uint32(), options, message.shim.chanPointShim) - }; - break; - case /* lnrpc.PsbtShim psbt_shim */ 2: - message.shim = { - oneofKind: "psbtShim", - psbtShim: PsbtShim.internalBinaryRead(reader, reader.uint32(), options, message.shim.psbtShim) - }; - 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, writer, options) { - /* lnrpc.ChanPointShim chan_point_shim = 1; */ - if (message.shim.oneofKind === "chanPointShim") - ChanPointShim.internalBinaryWrite(message.shim.chanPointShim, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.PsbtShim psbt_shim = 2; */ - if (message.shim.oneofKind === "psbtShim") - PsbtShim.internalBinaryWrite(message.shim.psbtShim, writer.tag(2, 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.FundingShim - */ -export const FundingShim = new FundingShim$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FundingShimCancel$Type extends MessageType { - constructor() { - super("lnrpc.FundingShimCancel", [ - { no: 1, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { pendingChanId: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes pending_chan_id */ 1: - message.pendingChanId = 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, writer, options) { - /* bytes pending_chan_id = 1; */ - if (message.pendingChanId.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.pendingChanId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FundingShimCancel - */ -export const FundingShimCancel = new FundingShimCancel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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: 3, name: "skip_finalize", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - 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); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes funded_psbt */ 1: - message.fundedPsbt = reader.bytes(); - break; - 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") - 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, writer, options) { - /* bytes funded_psbt = 1; */ - if (message.fundedPsbt.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.fundedPsbt); - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FundingPsbtVerify - */ -export const FundingPsbtVerify = new FundingPsbtVerify$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FundingPsbtFinalize$Type extends MessageType { - constructor() { - super("lnrpc.FundingPsbtFinalize", [ - { no: 1, name: "signed_psbt", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "pending_chan_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "final_raw_tx", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { signedPsbt: new Uint8Array(0), pendingChanId: new Uint8Array(0), finalRawTx: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes signed_psbt */ 1: - message.signedPsbt = reader.bytes(); - break; - case /* bytes pending_chan_id */ 2: - message.pendingChanId = reader.bytes(); - break; - case /* bytes final_raw_tx */ 3: - message.finalRawTx = 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, writer, options) { - /* bytes signed_psbt = 1; */ - if (message.signedPsbt.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.signedPsbt); - /* bytes pending_chan_id = 2; */ - if (message.pendingChanId.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.pendingChanId); - /* bytes final_raw_tx = 3; */ - if (message.finalRawTx.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.finalRawTx); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FundingPsbtFinalize - */ -export const FundingPsbtFinalize = new FundingPsbtFinalize$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FundingTransitionMsg$Type extends MessageType { - constructor() { - super("lnrpc.FundingTransitionMsg", [ - { no: 1, name: "shim_register", kind: "message", oneof: "trigger", T: () => FundingShim }, - { no: 2, name: "shim_cancel", kind: "message", oneof: "trigger", T: () => FundingShimCancel }, - { no: 3, name: "psbt_verify", kind: "message", oneof: "trigger", T: () => FundingPsbtVerify }, - { no: 4, name: "psbt_finalize", kind: "message", oneof: "trigger", T: () => FundingPsbtFinalize } - ]); - } - create(value) { - const message = { trigger: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.FundingShim shim_register */ 1: - message.trigger = { - oneofKind: "shimRegister", - shimRegister: FundingShim.internalBinaryRead(reader, reader.uint32(), options, message.trigger.shimRegister) - }; - break; - case /* lnrpc.FundingShimCancel shim_cancel */ 2: - message.trigger = { - oneofKind: "shimCancel", - shimCancel: FundingShimCancel.internalBinaryRead(reader, reader.uint32(), options, message.trigger.shimCancel) - }; - break; - case /* lnrpc.FundingPsbtVerify psbt_verify */ 3: - message.trigger = { - oneofKind: "psbtVerify", - psbtVerify: FundingPsbtVerify.internalBinaryRead(reader, reader.uint32(), options, message.trigger.psbtVerify) - }; - break; - case /* lnrpc.FundingPsbtFinalize psbt_finalize */ 4: - message.trigger = { - oneofKind: "psbtFinalize", - psbtFinalize: FundingPsbtFinalize.internalBinaryRead(reader, reader.uint32(), options, message.trigger.psbtFinalize) - }; - 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, writer, options) { - /* lnrpc.FundingShim shim_register = 1; */ - if (message.trigger.oneofKind === "shimRegister") - FundingShim.internalBinaryWrite(message.trigger.shimRegister, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.FundingShimCancel shim_cancel = 2; */ - if (message.trigger.oneofKind === "shimCancel") - FundingShimCancel.internalBinaryWrite(message.trigger.shimCancel, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.FundingPsbtVerify psbt_verify = 3; */ - if (message.trigger.oneofKind === "psbtVerify") - FundingPsbtVerify.internalBinaryWrite(message.trigger.psbtVerify, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.FundingPsbtFinalize psbt_finalize = 4; */ - if (message.trigger.oneofKind === "psbtFinalize") - FundingPsbtFinalize.internalBinaryWrite(message.trigger.psbtFinalize, writer.tag(4, 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.FundingTransitionMsg - */ -export const FundingTransitionMsg = new FundingTransitionMsg$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FundingStateStepResp$Type extends MessageType { - constructor() { - super("lnrpc.FundingStateStepResp", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FundingStateStepResp - */ -export const FundingStateStepResp = new FundingStateStepResp$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/ }, - { no: 6, name: "stage", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = { incoming: false, amount: 0, outpoint: "", maturityHeight: 0, blocksTilMaturity: 0, stage: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool incoming */ 1: - message.incoming = reader.bool(); - break; - case /* int64 amount */ 2: - message.amount = reader.int64().toNumber(); - break; - case /* string outpoint */ 3: - message.outpoint = reader.string(); - break; - case /* uint32 maturity_height */ 4: - message.maturityHeight = reader.uint32(); - break; - case /* int32 blocks_til_maturity */ 5: - message.blocksTilMaturity = reader.int32(); - break; - case /* uint32 stage */ 6: - message.stage = reader.uint32(); - 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, writer, options) { - /* bool incoming = 1; */ - if (message.incoming !== false) - writer.tag(1, WireType.Varint).bool(message.incoming); - /* int64 amount = 2; */ - if (message.amount !== 0) - writer.tag(2, WireType.Varint).int64(message.amount); - /* string outpoint = 3; */ - if (message.outpoint !== "") - writer.tag(3, WireType.LengthDelimited).string(message.outpoint); - /* uint32 maturity_height = 4; */ - if (message.maturityHeight !== 0) - writer.tag(4, WireType.Varint).uint32(message.maturityHeight); - /* int32 blocks_til_maturity = 5; */ - if (message.blocksTilMaturity !== 0) - writer.tag(5, WireType.Varint).int32(message.blocksTilMaturity); - /* uint32 stage = 6; */ - if (message.stage !== 0) - writer.tag(6, WireType.Varint).uint32(message.stage); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingHTLC - */ -export const PendingHTLC = new PendingHTLC$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsRequest$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsRequest - */ -export const PendingChannelsRequest = new PendingChannelsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse", [ - { no: 1, name: "total_limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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 }, - { no: 5, name: "waiting_close_channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PendingChannelsResponse_WaitingCloseChannel } - ]); - } - create(value) { - const message = { totalLimboBalance: 0, pendingOpenChannels: [], pendingClosingChannels: [], pendingForceClosingChannels: [], waitingCloseChannels: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 total_limbo_balance */ 1: - message.totalLimboBalance = reader.int64().toNumber(); - break; - case /* repeated lnrpc.PendingChannelsResponse.PendingOpenChannel pending_open_channels */ 2: - message.pendingOpenChannels.push(PendingChannelsResponse_PendingOpenChannel.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.PendingChannelsResponse.ClosedChannel pending_closing_channels = 3 [deprecated = true];*/ 3: - message.pendingClosingChannels.push(PendingChannelsResponse_ClosedChannel.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.PendingChannelsResponse.ForceClosedChannel pending_force_closing_channels */ 4: - message.pendingForceClosingChannels.push(PendingChannelsResponse_ForceClosedChannel.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.PendingChannelsResponse.WaitingCloseChannel waiting_close_channels */ 5: - message.waitingCloseChannels.push(PendingChannelsResponse_WaitingCloseChannel.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, writer, options) { - /* int64 total_limbo_balance = 1; */ - if (message.totalLimboBalance !== 0) - 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++) - PendingChannelsResponse_PendingOpenChannel.internalBinaryWrite(message.pendingOpenChannels[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.PendingChannelsResponse.ClosedChannel pending_closing_channels = 3 [deprecated = true]; */ - for (let i = 0; i < message.pendingClosingChannels.length; i++) - PendingChannelsResponse_ClosedChannel.internalBinaryWrite(message.pendingClosingChannels[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.PendingChannelsResponse.ForceClosedChannel pending_force_closing_channels = 4; */ - for (let i = 0; i < message.pendingForceClosingChannels.length; i++) - PendingChannelsResponse_ForceClosedChannel.internalBinaryWrite(message.pendingForceClosingChannels[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.PendingChannelsResponse.WaitingCloseChannel waiting_close_channels = 5; */ - for (let i = 0; i < message.waitingCloseChannels.length; i++) - PendingChannelsResponse_WaitingCloseChannel.internalBinaryWrite(message.waitingCloseChannels[i], writer.tag(5, 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.PendingChannelsResponse - */ -export const PendingChannelsResponse = new PendingChannelsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_PendingChannel$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.PendingChannel", [ - { no: 1, name: "remote_node_pub", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "channel_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "capacity", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "local_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "remote_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "local_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "remote_chan_reserve_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "initiator", kind: "enum", T: () => ["lnrpc.Initiator", Initiator, "INITIATOR_"] }, - { no: 9, name: "commitment_type", kind: "enum", T: () => ["lnrpc.CommitmentType", CommitmentType] }, - { no: 10, name: "num_forwarding_packages", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 11, name: "chan_status_flags", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "private", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { remoteNodePub: "", channelPoint: "", capacity: 0, localBalance: 0, remoteBalance: 0, localChanReserveSat: 0, remoteChanReserveSat: 0, initiator: 0, commitmentType: 0, numForwardingPackages: 0, chanStatusFlags: "", private: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string remote_node_pub */ 1: - message.remoteNodePub = reader.string(); - break; - case /* string channel_point */ 2: - message.channelPoint = reader.string(); - break; - case /* int64 capacity */ 3: - message.capacity = reader.int64().toNumber(); - break; - case /* int64 local_balance */ 4: - message.localBalance = reader.int64().toNumber(); - break; - case /* int64 remote_balance */ 5: - message.remoteBalance = reader.int64().toNumber(); - break; - case /* int64 local_chan_reserve_sat */ 6: - message.localChanReserveSat = reader.int64().toNumber(); - break; - case /* int64 remote_chan_reserve_sat */ 7: - message.remoteChanReserveSat = reader.int64().toNumber(); - break; - case /* lnrpc.Initiator initiator */ 8: - message.initiator = reader.int32(); - break; - case /* lnrpc.CommitmentType commitment_type */ 9: - message.commitmentType = reader.int32(); - break; - case /* int64 num_forwarding_packages */ 10: - message.numForwardingPackages = reader.int64().toNumber(); - break; - case /* string chan_status_flags */ 11: - message.chanStatusFlags = reader.string(); - break; - case /* bool private */ 12: - message.private = 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, writer, options) { - /* string remote_node_pub = 1; */ - if (message.remoteNodePub !== "") - writer.tag(1, WireType.LengthDelimited).string(message.remoteNodePub); - /* string channel_point = 2; */ - if (message.channelPoint !== "") - writer.tag(2, WireType.LengthDelimited).string(message.channelPoint); - /* int64 capacity = 3; */ - if (message.capacity !== 0) - writer.tag(3, WireType.Varint).int64(message.capacity); - /* int64 local_balance = 4; */ - if (message.localBalance !== 0) - writer.tag(4, WireType.Varint).int64(message.localBalance); - /* int64 remote_balance = 5; */ - if (message.remoteBalance !== 0) - writer.tag(5, WireType.Varint).int64(message.remoteBalance); - /* int64 local_chan_reserve_sat = 6; */ - if (message.localChanReserveSat !== 0) - writer.tag(6, WireType.Varint).int64(message.localChanReserveSat); - /* int64 remote_chan_reserve_sat = 7; */ - if (message.remoteChanReserveSat !== 0) - writer.tag(7, WireType.Varint).int64(message.remoteChanReserveSat); - /* lnrpc.Initiator initiator = 8; */ - if (message.initiator !== 0) - writer.tag(8, WireType.Varint).int32(message.initiator); - /* lnrpc.CommitmentType commitment_type = 9; */ - if (message.commitmentType !== 0) - writer.tag(9, WireType.Varint).int32(message.commitmentType); - /* int64 num_forwarding_packages = 10; */ - if (message.numForwardingPackages !== 0) - writer.tag(10, WireType.Varint).int64(message.numForwardingPackages); - /* string chan_status_flags = 11; */ - if (message.chanStatusFlags !== "") - writer.tag(11, WireType.LengthDelimited).string(message.chanStatusFlags); - /* bool private = 12; */ - if (message.private !== false) - writer.tag(12, WireType.Varint).bool(message.private); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.PendingChannel - */ -export const PendingChannelsResponse_PendingChannel = new PendingChannelsResponse_PendingChannel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_PendingOpenChannel$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.PendingOpenChannel", [ - { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, - { no: 4, name: "commit_fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "commit_weight", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "fee_per_kw", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { commitFee: 0, commitWeight: 0, feePerKw: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: - message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); - break; - case /* int64 commit_fee */ 4: - message.commitFee = reader.int64().toNumber(); - break; - case /* int64 commit_weight */ 5: - message.commitWeight = reader.int64().toNumber(); - break; - case /* int64 fee_per_kw */ 6: - message.feePerKw = reader.int64().toNumber(); - 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, writer, options) { - /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ - if (message.channel) - PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* int64 commit_fee = 4; */ - if (message.commitFee !== 0) - writer.tag(4, WireType.Varint).int64(message.commitFee); - /* int64 commit_weight = 5; */ - if (message.commitWeight !== 0) - writer.tag(5, WireType.Varint).int64(message.commitWeight); - /* int64 fee_per_kw = 6; */ - if (message.feePerKw !== 0) - writer.tag(6, WireType.Varint).int64(message.feePerKw); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.PendingOpenChannel - */ -export const PendingChannelsResponse_PendingOpenChannel = new PendingChannelsResponse_PendingOpenChannel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_WaitingCloseChannel$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.WaitingCloseChannel", [ - { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, - { no: 2, name: "limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "commitments", kind: "message", T: () => PendingChannelsResponse_Commitments }, - { no: 4, name: "closing_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { limboBalance: 0, closingTxid: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: - message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); - break; - case /* int64 limbo_balance */ 2: - message.limboBalance = reader.int64().toNumber(); - break; - case /* lnrpc.PendingChannelsResponse.Commitments commitments */ 3: - message.commitments = PendingChannelsResponse_Commitments.internalBinaryRead(reader, reader.uint32(), options, message.commitments); - break; - case /* string closing_txid */ 4: - message.closingTxid = 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, writer, options) { - /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ - if (message.channel) - PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* int64 limbo_balance = 2; */ - if (message.limboBalance !== 0) - writer.tag(2, WireType.Varint).int64(message.limboBalance); - /* lnrpc.PendingChannelsResponse.Commitments commitments = 3; */ - if (message.commitments) - PendingChannelsResponse_Commitments.internalBinaryWrite(message.commitments, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* string closing_txid = 4; */ - if (message.closingTxid !== "") - writer.tag(4, WireType.LengthDelimited).string(message.closingTxid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.WaitingCloseChannel - */ -export const PendingChannelsResponse_WaitingCloseChannel = new PendingChannelsResponse_WaitingCloseChannel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_Commitments$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.Commitments", [ - { no: 1, name: "local_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "remote_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "remote_pending_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "local_commit_fee_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "remote_commit_fee_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "remote_pending_commit_fee_sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { localTxid: "", remoteTxid: "", remotePendingTxid: "", localCommitFeeSat: 0, remoteCommitFeeSat: 0, remotePendingCommitFeeSat: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string local_txid */ 1: - message.localTxid = reader.string(); - break; - case /* string remote_txid */ 2: - message.remoteTxid = reader.string(); - break; - case /* string remote_pending_txid */ 3: - message.remotePendingTxid = reader.string(); - break; - case /* uint64 local_commit_fee_sat */ 4: - message.localCommitFeeSat = reader.uint64().toNumber(); - break; - case /* uint64 remote_commit_fee_sat */ 5: - message.remoteCommitFeeSat = reader.uint64().toNumber(); - break; - case /* uint64 remote_pending_commit_fee_sat */ 6: - message.remotePendingCommitFeeSat = reader.uint64().toNumber(); - 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, writer, options) { - /* string local_txid = 1; */ - if (message.localTxid !== "") - writer.tag(1, WireType.LengthDelimited).string(message.localTxid); - /* string remote_txid = 2; */ - if (message.remoteTxid !== "") - writer.tag(2, WireType.LengthDelimited).string(message.remoteTxid); - /* string remote_pending_txid = 3; */ - if (message.remotePendingTxid !== "") - writer.tag(3, WireType.LengthDelimited).string(message.remotePendingTxid); - /* uint64 local_commit_fee_sat = 4; */ - if (message.localCommitFeeSat !== 0) - writer.tag(4, WireType.Varint).uint64(message.localCommitFeeSat); - /* uint64 remote_commit_fee_sat = 5; */ - if (message.remoteCommitFeeSat !== 0) - writer.tag(5, WireType.Varint).uint64(message.remoteCommitFeeSat); - /* uint64 remote_pending_commit_fee_sat = 6; */ - if (message.remotePendingCommitFeeSat !== 0) - writer.tag(6, WireType.Varint).uint64(message.remotePendingCommitFeeSat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.Commitments - */ -export const PendingChannelsResponse_Commitments = new PendingChannelsResponse_Commitments$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_ClosedChannel$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.ClosedChannel", [ - { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, - { no: 2, name: "closing_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { closingTxid: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: - message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); - break; - case /* string closing_txid */ 2: - message.closingTxid = 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, writer, options) { - /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ - if (message.channel) - PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* string closing_txid = 2; */ - if (message.closingTxid !== "") - writer.tag(2, WireType.LengthDelimited).string(message.closingTxid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.ClosedChannel - */ -export const PendingChannelsResponse_ClosedChannel = new PendingChannelsResponse_ClosedChannel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PendingChannelsResponse_ForceClosedChannel$Type extends MessageType { - constructor() { - super("lnrpc.PendingChannelsResponse.ForceClosedChannel", [ - { no: 1, name: "channel", kind: "message", T: () => PendingChannelsResponse_PendingChannel }, - { no: 2, name: "closing_txid", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "limbo_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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) { - const message = { closingTxid: "", limboBalance: 0, maturityHeight: 0, blocksTilMaturity: 0, recoveredBalance: 0, pendingHtlcs: [], anchor: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.PendingChannelsResponse.PendingChannel channel */ 1: - message.channel = PendingChannelsResponse_PendingChannel.internalBinaryRead(reader, reader.uint32(), options, message.channel); - break; - case /* string closing_txid */ 2: - message.closingTxid = reader.string(); - break; - case /* int64 limbo_balance */ 3: - message.limboBalance = reader.int64().toNumber(); - break; - case /* uint32 maturity_height */ 4: - message.maturityHeight = reader.uint32(); - break; - case /* int32 blocks_til_maturity */ 5: - message.blocksTilMaturity = reader.int32(); - break; - case /* int64 recovered_balance */ 6: - message.recoveredBalance = reader.int64().toNumber(); - break; - case /* repeated lnrpc.PendingHTLC pending_htlcs */ 8: - message.pendingHtlcs.push(PendingHTLC.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState anchor */ 9: - message.anchor = 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, writer, options) { - /* lnrpc.PendingChannelsResponse.PendingChannel channel = 1; */ - if (message.channel) - PendingChannelsResponse_PendingChannel.internalBinaryWrite(message.channel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* string closing_txid = 2; */ - if (message.closingTxid !== "") - writer.tag(2, WireType.LengthDelimited).string(message.closingTxid); - /* int64 limbo_balance = 3; */ - if (message.limboBalance !== 0) - writer.tag(3, WireType.Varint).int64(message.limboBalance); - /* uint32 maturity_height = 4; */ - if (message.maturityHeight !== 0) - writer.tag(4, WireType.Varint).uint32(message.maturityHeight); - /* int32 blocks_til_maturity = 5; */ - if (message.blocksTilMaturity !== 0) - writer.tag(5, WireType.Varint).int32(message.blocksTilMaturity); - /* int64 recovered_balance = 6; */ - if (message.recoveredBalance !== 0) - writer.tag(6, WireType.Varint).int64(message.recoveredBalance); - /* repeated lnrpc.PendingHTLC pending_htlcs = 8; */ - for (let i = 0; i < message.pendingHtlcs.length; i++) - PendingHTLC.internalBinaryWrite(message.pendingHtlcs[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState anchor = 9; */ - if (message.anchor !== 0) - writer.tag(9, WireType.Varint).int32(message.anchor); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PendingChannelsResponse.ForceClosedChannel - */ -export const PendingChannelsResponse_ForceClosedChannel = new PendingChannelsResponse_ForceClosedChannel$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelEventSubscription$Type extends MessageType { - constructor() { - super("lnrpc.ChannelEventSubscription", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEventSubscription - */ -export const ChannelEventSubscription = new ChannelEventSubscription$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelEventUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ChannelEventUpdate", [ - { no: 1, name: "open_channel", kind: "message", oneof: "channel", T: () => Channel }, - { no: 2, name: "closed_channel", kind: "message", oneof: "channel", T: () => ChannelCloseSummary }, - { 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] } - ]); - } - create(value) { - const message = { channel: { oneofKind: undefined }, type: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.Channel open_channel */ 1: - message.channel = { - oneofKind: "openChannel", - openChannel: Channel.internalBinaryRead(reader, reader.uint32(), options, message.channel.openChannel) - }; - break; - case /* lnrpc.ChannelCloseSummary closed_channel */ 2: - message.channel = { - oneofKind: "closedChannel", - closedChannel: ChannelCloseSummary.internalBinaryRead(reader, reader.uint32(), options, message.channel.closedChannel) - }; - break; - case /* lnrpc.ChannelPoint active_channel */ 3: - message.channel = { - oneofKind: "activeChannel", - activeChannel: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channel.activeChannel) - }; - break; - case /* lnrpc.ChannelPoint inactive_channel */ 4: - message.channel = { - oneofKind: "inactiveChannel", - inactiveChannel: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channel.inactiveChannel) - }; - break; - case /* lnrpc.PendingUpdate pending_open_channel */ 6: - message.channel = { - oneofKind: "pendingOpenChannel", - pendingOpenChannel: PendingUpdate.internalBinaryRead(reader, reader.uint32(), options, message.channel.pendingOpenChannel) - }; - break; - case /* lnrpc.ChannelPoint fully_resolved_channel */ 7: - message.channel = { - oneofKind: "fullyResolvedChannel", - fullyResolvedChannel: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channel.fullyResolvedChannel) - }; - break; - case /* lnrpc.ChannelEventUpdate.UpdateType type */ 5: - message.type = 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, writer, options) { - /* lnrpc.Channel open_channel = 1; */ - if (message.channel.oneofKind === "openChannel") - Channel.internalBinaryWrite(message.channel.openChannel, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelCloseSummary closed_channel = 2; */ - if (message.channel.oneofKind === "closedChannel") - ChannelCloseSummary.internalBinaryWrite(message.channel.closedChannel, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelPoint active_channel = 3; */ - if (message.channel.oneofKind === "activeChannel") - ChannelPoint.internalBinaryWrite(message.channel.activeChannel, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.ChannelPoint inactive_channel = 4; */ - if (message.channel.oneofKind === "inactiveChannel") - ChannelPoint.internalBinaryWrite(message.channel.inactiveChannel, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* 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); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEventUpdate - */ -export const ChannelEventUpdate = new ChannelEventUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class WalletAccountBalance$Type extends MessageType { - constructor() { - super("lnrpc.WalletAccountBalance", [ - { no: 1, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { confirmedBalance: 0, unconfirmedBalance: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 confirmed_balance */ 1: - message.confirmedBalance = reader.int64().toNumber(); - break; - case /* int64 unconfirmed_balance */ 2: - message.unconfirmedBalance = reader.int64().toNumber(); - 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, writer, options) { - /* int64 confirmed_balance = 1; */ - if (message.confirmedBalance !== 0) - writer.tag(1, WireType.Varint).int64(message.confirmedBalance); - /* int64 unconfirmed_balance = 2; */ - if (message.unconfirmedBalance !== 0) - writer.tag(2, WireType.Varint).int64(message.unconfirmedBalance); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.WalletAccountBalance - */ -export const WalletAccountBalance = new WalletAccountBalance$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class WalletBalanceRequest$Type extends MessageType { - constructor() { - super("lnrpc.WalletBalanceRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.WalletBalanceRequest - */ -export const WalletBalanceRequest = new WalletBalanceRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class WalletBalanceResponse$Type extends MessageType { - constructor() { - super("lnrpc.WalletBalanceResponse", [ - { no: 1, name: "total_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "confirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "unconfirmed_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "locked_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "reserved_balance_anchor_chan", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "account_balance", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => WalletAccountBalance } } - ]); - } - create(value) { - const message = { totalBalance: 0, confirmedBalance: 0, unconfirmedBalance: 0, lockedBalance: 0, reservedBalanceAnchorChan: 0, accountBalance: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 total_balance */ 1: - message.totalBalance = reader.int64().toNumber(); - break; - case /* int64 confirmed_balance */ 2: - message.confirmedBalance = reader.int64().toNumber(); - break; - case /* int64 unconfirmed_balance */ 3: - message.unconfirmedBalance = reader.int64().toNumber(); - break; - case /* int64 locked_balance */ 5: - message.lockedBalance = reader.int64().toNumber(); - break; - case /* int64 reserved_balance_anchor_chan */ 6: - message.reservedBalanceAnchorChan = reader.int64().toNumber(); - break; - case /* map account_balance */ 4: - this.binaryReadMap4(message.accountBalance, reader, 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; - } - binaryReadMap4(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = WalletAccountBalance.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.WalletBalanceResponse.account_balance"); - } - } - map[key ?? ""] = val ?? WalletAccountBalance.create(); - } - internalBinaryWrite(message, writer, options) { - /* int64 total_balance = 1; */ - if (message.totalBalance !== 0) - writer.tag(1, WireType.Varint).int64(message.totalBalance); - /* int64 confirmed_balance = 2; */ - if (message.confirmedBalance !== 0) - writer.tag(2, WireType.Varint).int64(message.confirmedBalance); - /* int64 unconfirmed_balance = 3; */ - if (message.unconfirmedBalance !== 0) - writer.tag(3, WireType.Varint).int64(message.unconfirmedBalance); - /* int64 locked_balance = 5; */ - if (message.lockedBalance !== 0) - writer.tag(5, WireType.Varint).int64(message.lockedBalance); - /* int64 reserved_balance_anchor_chan = 6; */ - if (message.reservedBalanceAnchorChan !== 0) - 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); - writer.tag(2, WireType.LengthDelimited).fork(); - WalletAccountBalance.internalBinaryWrite(message.accountBalance[k], writer, options); - writer.join().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.WalletBalanceResponse - */ -export const WalletBalanceResponse = new WalletBalanceResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Amount$Type extends MessageType { - constructor() { - super("lnrpc.Amount", [ - { no: 1, name: "sat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { sat: 0, msat: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 sat */ 1: - message.sat = reader.uint64().toNumber(); - break; - case /* uint64 msat */ 2: - message.msat = reader.uint64().toNumber(); - 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, writer, options) { - /* uint64 sat = 1; */ - if (message.sat !== 0) - writer.tag(1, WireType.Varint).uint64(message.sat); - /* uint64 msat = 2; */ - if (message.msat !== 0) - writer.tag(2, WireType.Varint).uint64(message.msat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Amount - */ -export const Amount = new Amount$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelBalanceRequest$Type extends MessageType { - constructor() { - super("lnrpc.ChannelBalanceRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBalanceRequest - */ -export const ChannelBalanceRequest = new ChannelBalanceRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelBalanceResponse$Type extends MessageType { - constructor() { - super("lnrpc.ChannelBalanceResponse", [ - { no: 1, name: "balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "pending_open_balance", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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 }, - { no: 6, name: "unsettled_remote_balance", kind: "message", T: () => Amount }, - { no: 7, name: "pending_open_local_balance", kind: "message", T: () => Amount }, - { no: 8, name: "pending_open_remote_balance", kind: "message", T: () => Amount } - ]); - } - create(value) { - const message = { balance: 0, pendingOpenBalance: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 balance = 1 [deprecated = true];*/ 1: - message.balance = reader.int64().toNumber(); - break; - case /* int64 pending_open_balance = 2 [deprecated = true];*/ 2: - message.pendingOpenBalance = reader.int64().toNumber(); - break; - case /* lnrpc.Amount local_balance */ 3: - message.localBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.localBalance); - break; - case /* lnrpc.Amount remote_balance */ 4: - message.remoteBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.remoteBalance); - break; - case /* lnrpc.Amount unsettled_local_balance */ 5: - message.unsettledLocalBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.unsettledLocalBalance); - break; - case /* lnrpc.Amount unsettled_remote_balance */ 6: - message.unsettledRemoteBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.unsettledRemoteBalance); - break; - case /* lnrpc.Amount pending_open_local_balance */ 7: - message.pendingOpenLocalBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.pendingOpenLocalBalance); - break; - case /* lnrpc.Amount pending_open_remote_balance */ 8: - message.pendingOpenRemoteBalance = Amount.internalBinaryRead(reader, reader.uint32(), options, message.pendingOpenRemoteBalance); - 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, writer, options) { - /* int64 balance = 1 [deprecated = true]; */ - if (message.balance !== 0) - writer.tag(1, WireType.Varint).int64(message.balance); - /* int64 pending_open_balance = 2 [deprecated = true]; */ - if (message.pendingOpenBalance !== 0) - writer.tag(2, WireType.Varint).int64(message.pendingOpenBalance); - /* lnrpc.Amount local_balance = 3; */ - if (message.localBalance) - Amount.internalBinaryWrite(message.localBalance, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Amount remote_balance = 4; */ - if (message.remoteBalance) - Amount.internalBinaryWrite(message.remoteBalance, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Amount unsettled_local_balance = 5; */ - if (message.unsettledLocalBalance) - Amount.internalBinaryWrite(message.unsettledLocalBalance, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Amount unsettled_remote_balance = 6; */ - if (message.unsettledRemoteBalance) - Amount.internalBinaryWrite(message.unsettledRemoteBalance, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Amount pending_open_local_balance = 7; */ - if (message.pendingOpenLocalBalance) - Amount.internalBinaryWrite(message.pendingOpenLocalBalance, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Amount pending_open_remote_balance = 8; */ - if (message.pendingOpenRemoteBalance) - Amount.internalBinaryWrite(message.pendingOpenRemoteBalance, writer.tag(8, 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.ChannelBalanceResponse - */ -export const ChannelBalanceResponse = new ChannelBalanceResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/ }, - { no: 7, name: "ignored_edges", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => EdgeLocator }, - { no: 8, name: "source_pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "use_mission_control", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 10, name: "ignored_pairs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodePair }, - { no: 11, name: "cltv_limit", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 13, name: "dest_custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, - { 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: 18, name: "time_pref", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value) { - 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: [], timePref: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pub_key */ 1: - message.pubKey = reader.string(); - break; - case /* int64 amt */ 2: - message.amt = reader.int64().toNumber(); - break; - case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toNumber(); - break; - case /* int32 final_cltv_delta */ 4: - message.finalCltvDelta = reader.int32(); - break; - case /* lnrpc.FeeLimit fee_limit */ 5: - message.feeLimit = FeeLimit.internalBinaryRead(reader, reader.uint32(), options, message.feeLimit); - break; - case /* repeated bytes ignored_nodes */ 6: - message.ignoredNodes.push(reader.bytes()); - break; - case /* repeated lnrpc.EdgeLocator ignored_edges = 7 [deprecated = true];*/ 7: - message.ignoredEdges.push(EdgeLocator.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* string source_pub_key */ 8: - message.sourcePubKey = reader.string(); - break; - case /* bool use_mission_control */ 9: - message.useMissionControl = reader.bool(); - break; - case /* repeated lnrpc.NodePair ignored_pairs */ 10: - message.ignoredPairs.push(NodePair.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint32 cltv_limit */ 11: - message.cltvLimit = reader.uint32(); - break; - case /* map dest_custom_records */ 13: - this.binaryReadMap13(message.destCustomRecords, reader, options); - break; - case /* uint64 outgoing_chan_id = 14 [jstype = JS_STRING];*/ 14: - message.outgoingChanId = reader.uint64().toString(); - break; - case /* bytes last_hop_pubkey */ 15: - message.lastHopPubkey = reader.bytes(); - break; - case /* repeated lnrpc.RouteHint route_hints */ 16: - message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.FeatureBit dest_features */ 17: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.destFeatures.push(reader.int32()); - 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") - 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; - } - binaryReadMap13(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - 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.QueryRoutesRequest.dest_custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message, writer, options) { - /* string pub_key = 1; */ - if (message.pubKey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubKey); - /* int64 amt = 2; */ - if (message.amt !== 0) - writer.tag(2, WireType.Varint).int64(message.amt); - /* int64 amt_msat = 12; */ - if (message.amtMsat !== 0) - writer.tag(12, WireType.Varint).int64(message.amtMsat); - /* int32 final_cltv_delta = 4; */ - if (message.finalCltvDelta !== 0) - writer.tag(4, WireType.Varint).int32(message.finalCltvDelta); - /* lnrpc.FeeLimit fee_limit = 5; */ - if (message.feeLimit) - FeeLimit.internalBinaryWrite(message.feeLimit, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* repeated bytes ignored_nodes = 6; */ - for (let i = 0; i < message.ignoredNodes.length; i++) - writer.tag(6, WireType.LengthDelimited).bytes(message.ignoredNodes[i]); - /* repeated lnrpc.EdgeLocator ignored_edges = 7 [deprecated = true]; */ - for (let i = 0; i < message.ignoredEdges.length; i++) - EdgeLocator.internalBinaryWrite(message.ignoredEdges[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* string source_pub_key = 8; */ - if (message.sourcePubKey !== "") - writer.tag(8, WireType.LengthDelimited).string(message.sourcePubKey); - /* bool use_mission_control = 9; */ - if (message.useMissionControl !== false) - writer.tag(9, WireType.Varint).bool(message.useMissionControl); - /* repeated lnrpc.NodePair ignored_pairs = 10; */ - for (let i = 0; i < message.ignoredPairs.length; i++) - NodePair.internalBinaryWrite(message.ignoredPairs[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join(); - /* uint32 cltv_limit = 11; */ - if (message.cltvLimit !== 0) - writer.tag(11, WireType.Varint).uint32(message.cltvLimit); - /* map dest_custom_records = 13; */ - for (let k of Object.keys(message.destCustomRecords)) - writer.tag(13, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.destCustomRecords[k]).join(); - /* uint64 outgoing_chan_id = 14 [jstype = JS_STRING]; */ - if (message.outgoingChanId !== "0") - writer.tag(14, WireType.Varint).uint64(message.outgoingChanId); - /* bytes last_hop_pubkey = 15; */ - if (message.lastHopPubkey.length) - writer.tag(15, WireType.LengthDelimited).bytes(message.lastHopPubkey); - /* repeated lnrpc.RouteHint route_hints = 16; */ - for (let i = 0; i < message.routeHints.length; i++) - RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(16, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.FeatureBit dest_features = 17; */ - if (message.destFeatures.length) { - writer.tag(17, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.destFeatures.length; i++) - 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.QueryRoutesRequest - */ -export const QueryRoutesRequest = new QueryRoutesRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodePair$Type extends MessageType { - constructor() { - super("lnrpc.NodePair", [ - { no: 1, name: "from", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "to", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { from: new Uint8Array(0), to: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes from */ 1: - message.from = reader.bytes(); - break; - case /* bytes to */ 2: - message.to = 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, writer, options) { - /* bytes from = 1; */ - if (message.from.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.from); - /* bytes to = 2; */ - if (message.to.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.to); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NodePair - */ -export const NodePair = new NodePair$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class EdgeLocator$Type extends MessageType { - constructor() { - super("lnrpc.EdgeLocator", [ - { no: 1, name: "channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "direction_reverse", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { channelId: "0", directionReverse: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 channel_id = 1 [jstype = JS_STRING];*/ 1: - message.channelId = reader.uint64().toString(); - break; - case /* bool direction_reverse */ 2: - message.directionReverse = 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, writer, options) { - /* uint64 channel_id = 1 [jstype = JS_STRING]; */ - if (message.channelId !== "0") - writer.tag(1, WireType.Varint).uint64(message.channelId); - /* bool direction_reverse = 2; */ - if (message.directionReverse !== false) - writer.tag(2, WireType.Varint).bool(message.directionReverse); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.EdgeLocator - */ -export const EdgeLocator = new EdgeLocator$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class QueryRoutesResponse$Type extends MessageType { - constructor() { - super("lnrpc.QueryRoutesResponse", [ - { no: 1, name: "routes", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Route }, - { no: 2, name: "success_prob", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value) { - const message = { routes: [], successProb: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Route routes */ 1: - message.routes.push(Route.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* double success_prob */ 2: - message.successProb = reader.double(); - 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, writer, options) { - /* repeated lnrpc.Route routes = 1; */ - for (let i = 0; i < message.routes.length; i++) - Route.internalBinaryWrite(message.routes[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* double success_prob = 2; */ - if (message.successProb !== 0) - writer.tag(2, WireType.Bit64).double(message.successProb); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.QueryRoutesResponse - */ -export const QueryRoutesResponse = new QueryRoutesResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "amt_to_forward", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "expiry", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "amt_to_forward_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 13, name: "metadata", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { chanId: "0", chanCapacity: 0, amtToForward: 0, fee: 0, expiry: 0, amtToForwardMsat: 0, feeMsat: 0, 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); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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 [jstype = JS_STRING];*/ 1: - message.chanId = reader.uint64().toString(); - break; - case /* int64 chan_capacity = 2 [deprecated = true];*/ 2: - message.chanCapacity = reader.int64().toNumber(); - break; - case /* int64 amt_to_forward = 3 [deprecated = true];*/ 3: - message.amtToForward = reader.int64().toNumber(); - break; - case /* int64 fee = 4 [deprecated = true];*/ 4: - message.fee = reader.int64().toNumber(); - break; - case /* uint32 expiry */ 5: - message.expiry = reader.uint32(); - break; - case /* int64 amt_to_forward_msat */ 6: - message.amtToForwardMsat = reader.int64().toNumber(); - break; - case /* int64 fee_msat */ 7: - message.feeMsat = reader.int64().toNumber(); - break; - case /* string pub_key */ 8: - message.pubKey = reader.string(); - break; - case /* bool tlv_payload = 9 [deprecated = true];*/ 9: - message.tlvPayload = reader.bool(); - break; - case /* lnrpc.MPPRecord mpp_record */ 10: - message.mppRecord = MPPRecord.internalBinaryRead(reader, reader.uint32(), options, message.mppRecord); - break; - case /* lnrpc.AMPRecord amp_record */ 12: - message.ampRecord = AMPRecord.internalBinaryRead(reader, reader.uint32(), options, message.ampRecord); - break; - 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") - 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; - } - binaryReadMap11(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - 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.Hop.custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message, writer, options) { - /* uint64 chan_id = 1 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* int64 chan_capacity = 2 [deprecated = true]; */ - if (message.chanCapacity !== 0) - writer.tag(2, WireType.Varint).int64(message.chanCapacity); - /* int64 amt_to_forward = 3 [deprecated = true]; */ - if (message.amtToForward !== 0) - writer.tag(3, WireType.Varint).int64(message.amtToForward); - /* int64 fee = 4 [deprecated = true]; */ - if (message.fee !== 0) - 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) - writer.tag(6, WireType.Varint).int64(message.amtToForwardMsat); - /* int64 fee_msat = 7; */ - if (message.feeMsat !== 0) - 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 [deprecated = true]; */ - if (message.tlvPayload !== false) - writer.tag(9, WireType.Varint).bool(message.tlvPayload); - /* lnrpc.MPPRecord mpp_record = 10; */ - if (message.mppRecord) - MPPRecord.internalBinaryWrite(message.mppRecord, writer.tag(10, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.AMPRecord amp_record = 12; */ - if (message.ampRecord) - AMPRecord.internalBinaryWrite(message.ampRecord, writer.tag(12, WireType.LengthDelimited).fork(), options).join(); - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Hop - */ -export const Hop = new Hop$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { paymentAddr: new Uint8Array(0), totalAmtMsat: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes payment_addr */ 11: - message.paymentAddr = reader.bytes(); - break; - case /* int64 total_amt_msat */ 10: - message.totalAmtMsat = reader.int64().toNumber(); - 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, writer, options) { - /* bytes payment_addr = 11; */ - if (message.paymentAddr.length) - writer.tag(11, WireType.LengthDelimited).bytes(message.paymentAddr); - /* int64 total_amt_msat = 10; */ - if (message.totalAmtMsat !== 0) - writer.tag(10, WireType.Varint).int64(message.totalAmtMsat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.MPPRecord - */ -export const MPPRecord = new MPPRecord$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AMPRecord$Type extends MessageType { - constructor() { - super("lnrpc.AMPRecord", [ - { no: 1, name: "root_share", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "set_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "child_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = { rootShare: new Uint8Array(0), setId: new Uint8Array(0), childIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes root_share */ 1: - message.rootShare = reader.bytes(); - break; - case /* bytes set_id */ 2: - message.setId = reader.bytes(); - break; - case /* uint32 child_index */ 3: - message.childIndex = reader.uint32(); - 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, writer, options) { - /* bytes root_share = 1; */ - if (message.rootShare.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.rootShare); - /* bytes set_id = 2; */ - if (message.setId.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.setId); - /* uint32 child_index = 3; */ - if (message.childIndex !== 0) - writer.tag(3, WireType.Varint).uint32(message.childIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AMPRecord - */ -export const AMPRecord = new AMPRecord$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "total_amt", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "hops", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Hop }, - { no: 5, name: "total_fees_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "total_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { totalTimeLock: 0, totalFees: 0, totalAmt: 0, hops: [], totalFeesMsat: 0, totalAmtMsat: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 total_time_lock */ 1: - message.totalTimeLock = reader.uint32(); - break; - case /* int64 total_fees = 2 [deprecated = true];*/ 2: - message.totalFees = reader.int64().toNumber(); - break; - case /* int64 total_amt = 3 [deprecated = true];*/ 3: - message.totalAmt = reader.int64().toNumber(); - 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().toNumber(); - break; - case /* int64 total_amt_msat */ 6: - message.totalAmtMsat = reader.int64().toNumber(); - 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, writer, options) { - /* uint32 total_time_lock = 1; */ - if (message.totalTimeLock !== 0) - writer.tag(1, WireType.Varint).uint32(message.totalTimeLock); - /* int64 total_fees = 2 [deprecated = true]; */ - if (message.totalFees !== 0) - writer.tag(2, WireType.Varint).int64(message.totalFees); - /* int64 total_amt = 3 [deprecated = true]; */ - if (message.totalAmt !== 0) - 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) - writer.tag(5, WireType.Varint).int64(message.totalFeesMsat); - /* int64 total_amt_msat = 6; */ - if (message.totalAmtMsat !== 0) - writer.tag(6, WireType.Varint).int64(message.totalAmtMsat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Route - */ -export const Route = new Route$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeInfoRequest$Type extends MessageType { - constructor() { - super("lnrpc.NodeInfoRequest", [ - { no: 1, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "include_channels", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { pubKey: "", includeChannels: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pub_key */ 1: - message.pubKey = reader.string(); - break; - case /* bool include_channels */ 2: - message.includeChannels = 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, writer, options) { - /* string pub_key = 1; */ - if (message.pubKey !== "") - writer.tag(1, WireType.LengthDelimited).string(message.pubKey); - /* bool include_channels = 2; */ - if (message.includeChannels !== false) - writer.tag(2, WireType.Varint).bool(message.includeChannels); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NodeInfoRequest - */ -export const NodeInfoRequest = new NodeInfoRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeInfo$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "channels", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelEdge } - ]); - } - create(value) { - const message = { numChannels: 0, totalCapacity: 0, channels: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.LightningNode node */ 1: - message.node = LightningNode.internalBinaryRead(reader, reader.uint32(), options, message.node); - break; - case /* uint32 num_channels */ 2: - message.numChannels = reader.uint32(); - break; - case /* int64 total_capacity */ 3: - message.totalCapacity = reader.int64().toNumber(); - break; - case /* repeated lnrpc.ChannelEdge channels */ 4: - message.channels.push(ChannelEdge.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, writer, options) { - /* lnrpc.LightningNode node = 1; */ - if (message.node) - LightningNode.internalBinaryWrite(message.node, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* uint32 num_channels = 2; */ - if (message.numChannels !== 0) - writer.tag(2, WireType.Varint).uint32(message.numChannels); - /* int64 total_capacity = 3; */ - if (message.totalCapacity !== 0) - writer.tag(3, WireType.Varint).int64(message.totalCapacity); - /* repeated lnrpc.ChannelEdge channels = 4; */ - for (let i = 0; i < message.channels.length; i++) - ChannelEdge.internalBinaryWrite(message.channels[i], writer.tag(4, 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.NodeInfo - */ -export const NodeInfo = new NodeInfo$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LightningNode$Type extends MessageType { - constructor() { - super("lnrpc.LightningNode", [ - { no: 1, name: "last_update", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "pub_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { 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: 7, name: "custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } } - ]); - } - create(value) { - 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); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 last_update */ 1: - message.lastUpdate = reader.uint32(); - break; - case /* string pub_key */ 2: - message.pubKey = reader.string(); - break; - case /* string alias */ 3: - message.alias = reader.string(); - break; - case /* repeated lnrpc.NodeAddress addresses */ 4: - message.addresses.push(NodeAddress.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* string color */ 5: - message.color = reader.string(); - break; - 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") - 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; - } - binaryReadMap6(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.LightningNode.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - binaryReadMap7(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - 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, writer, options) { - /* uint32 last_update = 1; */ - if (message.lastUpdate !== 0) - writer.tag(1, WireType.Varint).uint32(message.lastUpdate); - /* string pub_key = 2; */ - if (message.pubKey !== "") - writer.tag(2, WireType.LengthDelimited).string(message.pubKey); - /* string alias = 3; */ - if (message.alias !== "") - writer.tag(3, WireType.LengthDelimited).string(message.alias); - /* repeated lnrpc.NodeAddress addresses = 4; */ - for (let i = 0; i < message.addresses.length; i++) - NodeAddress.internalBinaryWrite(message.addresses[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* string color = 5; */ - if (message.color !== "") - writer.tag(5, WireType.LengthDelimited).string(message.color); - /* map features = 6; */ - for (let k of Object.keys(message.features)) { - writer.tag(6, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k], 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.LightningNode - */ -export const LightningNode = new LightningNode$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeAddress$Type extends MessageType { - constructor() { - super("lnrpc.NodeAddress", [ - { no: 1, name: "network", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { network: "", addr: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string network */ 1: - message.network = reader.string(); - break; - case /* string addr */ 2: - message.addr = 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, writer, options) { - /* string network = 1; */ - if (message.network !== "") - writer.tag(1, WireType.LengthDelimited).string(message.network); - /* string addr = 2; */ - if (message.addr !== "") - writer.tag(2, WireType.LengthDelimited).string(message.addr); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NodeAddress - */ -export const NodeAddress = new NodeAddress$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "fee_base_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "fee_rate_milli_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "disabled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 6, name: "max_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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) { - const message = { timeLockDelta: 0, minHtlc: 0, feeBaseMsat: 0, feeRateMilliMsat: 0, disabled: false, maxHtlcMsat: 0, lastUpdate: 0, customRecords: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 time_lock_delta */ 1: - message.timeLockDelta = reader.uint32(); - break; - case /* int64 min_htlc */ 2: - message.minHtlc = reader.int64().toNumber(); - break; - case /* int64 fee_base_msat */ 3: - message.feeBaseMsat = reader.int64().toNumber(); - break; - case /* int64 fee_rate_milli_msat */ 4: - message.feeRateMilliMsat = reader.int64().toNumber(); - break; - case /* bool disabled */ 5: - message.disabled = reader.bool(); - break; - case /* uint64 max_htlc_msat */ 6: - message.maxHtlcMsat = reader.uint64().toNumber(); - 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") - 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; - } - binaryReadMap8(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - 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, writer, options) { - /* 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) - writer.tag(2, WireType.Varint).int64(message.minHtlc); - /* int64 fee_base_msat = 3; */ - if (message.feeBaseMsat !== 0) - writer.tag(3, WireType.Varint).int64(message.feeBaseMsat); - /* int64 fee_rate_milli_msat = 4; */ - if (message.feeRateMilliMsat !== 0) - 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) - 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.RoutingPolicy - */ -export const RoutingPolicy = new RoutingPolicy$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelEdge$Type extends MessageType { - constructor() { - super("lnrpc.ChannelEdge", [ - { no: 1, name: "channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 2, name: "chan_point", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "node1_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) { - const message = { channelId: "0", chanPoint: "", lastUpdate: 0, node1Pub: "", node2Pub: "", capacity: 0, customRecords: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 channel_id = 1 [jstype = JS_STRING];*/ 1: - message.channelId = reader.uint64().toString(); - break; - case /* string chan_point */ 2: - message.chanPoint = reader.string(); - break; - case /* uint32 last_update = 3 [deprecated = true];*/ 3: - message.lastUpdate = reader.uint32(); - break; - case /* string node1_pub */ 4: - message.node1Pub = reader.string(); - break; - case /* string node2_pub */ 5: - message.node2Pub = reader.string(); - break; - case /* int64 capacity */ 6: - message.capacity = reader.int64().toNumber(); - break; - case /* lnrpc.RoutingPolicy node1_policy */ 7: - message.node1Policy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.node1Policy); - break; - 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") - 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; - } - binaryReadMap9(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - 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, writer, options) { - /* uint64 channel_id = 1 [jstype = JS_STRING]; */ - if (message.channelId !== "0") - writer.tag(1, WireType.Varint).uint64(message.channelId); - /* string chan_point = 2; */ - if (message.chanPoint !== "") - writer.tag(2, WireType.LengthDelimited).string(message.chanPoint); - /* uint32 last_update = 3 [deprecated = true]; */ - if (message.lastUpdate !== 0) - writer.tag(3, WireType.Varint).uint32(message.lastUpdate); - /* string node1_pub = 4; */ - if (message.node1Pub !== "") - writer.tag(4, WireType.LengthDelimited).string(message.node1Pub); - /* string node2_pub = 5; */ - if (message.node2Pub !== "") - writer.tag(5, WireType.LengthDelimited).string(message.node2Pub); - /* int64 capacity = 6; */ - if (message.capacity !== 0) - writer.tag(6, WireType.Varint).int64(message.capacity); - /* lnrpc.RoutingPolicy node1_policy = 7; */ - if (message.node1Policy) - RoutingPolicy.internalBinaryWrite(message.node1Policy, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEdge - */ -export const ChannelEdge = new ChannelEdge$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelGraphRequest$Type extends MessageType { - constructor() { - super("lnrpc.ChannelGraphRequest", [ - { no: 1, name: "include_unannounced", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { includeUnannounced: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool include_unannounced */ 1: - message.includeUnannounced = 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, writer, options) { - /* bool include_unannounced = 1; */ - if (message.includeUnannounced !== false) - writer.tag(1, WireType.Varint).bool(message.includeUnannounced); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelGraphRequest - */ -export const ChannelGraphRequest = new ChannelGraphRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelGraph$Type extends MessageType { - constructor() { - super("lnrpc.ChannelGraph", [ - { no: 1, name: "nodes", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => LightningNode }, - { no: 2, name: "edges", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelEdge } - ]); - } - create(value) { - const message = { nodes: [], edges: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.LightningNode nodes */ 1: - message.nodes.push(LightningNode.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.ChannelEdge edges */ 2: - message.edges.push(ChannelEdge.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, writer, options) { - /* repeated lnrpc.LightningNode nodes = 1; */ - for (let i = 0; i < message.nodes.length; i++) - LightningNode.internalBinaryWrite(message.nodes[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.ChannelEdge edges = 2; */ - for (let i = 0; i < message.edges.length; i++) - ChannelEdge.internalBinaryWrite(message.edges[i], writer.tag(2, 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.ChannelGraph - */ -export const ChannelGraph = new ChannelGraph$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeMetricsRequest$Type extends MessageType { - constructor() { - super("lnrpc.NodeMetricsRequest", [ - { no: 1, name: "types", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["lnrpc.NodeMetricType", NodeMetricType] } - ]); - } - create(value) { - const message = { types: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.NodeMetricType types */ 1: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.types.push(reader.int32()); - else - message.types.push(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, writer, options) { - /* repeated lnrpc.NodeMetricType types = 1; */ - if (message.types.length) { - writer.tag(1, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.types.length; i++) - writer.int32(message.types[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.NodeMetricsRequest - */ -export const NodeMetricsRequest = new NodeMetricsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeMetricsResponse$Type extends MessageType { - constructor() { - super("lnrpc.NodeMetricsResponse", [ - { no: 1, name: "betweenness_centrality", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => FloatMetric } } - ]); - } - create(value) { - const message = { betweennessCentrality: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* map betweenness_centrality */ 1: - this.binaryReadMap1(message.betweennessCentrality, reader, 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; - } - binaryReadMap1(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = FloatMetric.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.NodeMetricsResponse.betweenness_centrality"); - } - } - map[key ?? ""] = val ?? FloatMetric.create(); - } - internalBinaryWrite(message, writer, options) { - /* map betweenness_centrality = 1; */ - for (let k of Object.keys(message.betweennessCentrality)) { - writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); - writer.tag(2, WireType.LengthDelimited).fork(); - FloatMetric.internalBinaryWrite(message.betweennessCentrality[k], writer, options); - writer.join().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.NodeMetricsResponse - */ -export const NodeMetricsResponse = new NodeMetricsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FloatMetric$Type extends MessageType { - constructor() { - super("lnrpc.FloatMetric", [ - { no: 1, name: "value", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, - { no: 2, name: "normalized_value", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value) { - const message = { value: 0, normalizedValue: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* double value */ 1: - message.value = reader.double(); - break; - case /* double normalized_value */ 2: - message.normalizedValue = reader.double(); - 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, writer, options) { - /* double value = 1; */ - if (message.value !== 0) - writer.tag(1, WireType.Bit64).double(message.value); - /* double normalized_value = 2; */ - if (message.normalizedValue !== 0) - writer.tag(2, WireType.Bit64).double(message.normalizedValue); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FloatMetric - */ -export const FloatMetric = new FloatMetric$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChanInfoRequest$Type extends MessageType { - constructor() { - super("lnrpc.ChanInfoRequest", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ } - ]); - } - create(value) { - const message = { chanId: "0" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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 [jstype = JS_STRING];*/ 1: - message.chanId = reader.uint64().toString(); - 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, writer, options) { - /* uint64 chan_id = 1 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(1, WireType.Varint).uint64(message.chanId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChanInfoRequest - */ -export const ChanInfoRequest = new ChanInfoRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NetworkInfoRequest$Type extends MessageType { - constructor() { - super("lnrpc.NetworkInfoRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NetworkInfoRequest - */ -export const NetworkInfoRequest = new NetworkInfoRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NetworkInfo$Type extends MessageType { - constructor() { - super("lnrpc.NetworkInfo", [ - { no: 1, name: "graph_diameter", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "avg_out_degree", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "avg_channel_size", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, - { no: 8, name: "min_channel_size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 9, name: "max_channel_size", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 10, name: "median_channel_size_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 11, name: "num_zombie_chans", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { graphDiameter: 0, avgOutDegree: 0, maxOutDegree: 0, numNodes: 0, numChannels: 0, totalNetworkCapacity: 0, avgChannelSize: 0, minChannelSize: 0, maxChannelSize: 0, medianChannelSizeSat: 0, numZombieChans: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 graph_diameter */ 1: - message.graphDiameter = reader.uint32(); - break; - case /* double avg_out_degree */ 2: - message.avgOutDegree = reader.double(); - break; - case /* uint32 max_out_degree */ 3: - message.maxOutDegree = reader.uint32(); - break; - case /* uint32 num_nodes */ 4: - message.numNodes = reader.uint32(); - break; - case /* uint32 num_channels */ 5: - message.numChannels = reader.uint32(); - break; - case /* int64 total_network_capacity */ 6: - message.totalNetworkCapacity = reader.int64().toNumber(); - break; - case /* double avg_channel_size */ 7: - message.avgChannelSize = reader.double(); - break; - case /* int64 min_channel_size */ 8: - message.minChannelSize = reader.int64().toNumber(); - break; - case /* int64 max_channel_size */ 9: - message.maxChannelSize = reader.int64().toNumber(); - break; - case /* int64 median_channel_size_sat */ 10: - message.medianChannelSizeSat = reader.int64().toNumber(); - break; - case /* uint64 num_zombie_chans */ 11: - message.numZombieChans = reader.uint64().toNumber(); - 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, writer, options) { - /* uint32 graph_diameter = 1; */ - if (message.graphDiameter !== 0) - writer.tag(1, WireType.Varint).uint32(message.graphDiameter); - /* double avg_out_degree = 2; */ - if (message.avgOutDegree !== 0) - writer.tag(2, WireType.Bit64).double(message.avgOutDegree); - /* uint32 max_out_degree = 3; */ - if (message.maxOutDegree !== 0) - writer.tag(3, WireType.Varint).uint32(message.maxOutDegree); - /* uint32 num_nodes = 4; */ - if (message.numNodes !== 0) - writer.tag(4, WireType.Varint).uint32(message.numNodes); - /* uint32 num_channels = 5; */ - if (message.numChannels !== 0) - writer.tag(5, WireType.Varint).uint32(message.numChannels); - /* int64 total_network_capacity = 6; */ - if (message.totalNetworkCapacity !== 0) - 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) - writer.tag(8, WireType.Varint).int64(message.minChannelSize); - /* int64 max_channel_size = 9; */ - if (message.maxChannelSize !== 0) - writer.tag(9, WireType.Varint).int64(message.maxChannelSize); - /* int64 median_channel_size_sat = 10; */ - if (message.medianChannelSizeSat !== 0) - writer.tag(10, WireType.Varint).int64(message.medianChannelSizeSat); - /* uint64 num_zombie_chans = 11; */ - if (message.numZombieChans !== 0) - writer.tag(11, WireType.Varint).uint64(message.numZombieChans); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.NetworkInfo - */ -export const NetworkInfo = new NetworkInfo$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class StopRequest$Type extends MessageType { - constructor() { - super("lnrpc.StopRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.StopRequest - */ -export const StopRequest = new StopRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class StopResponse$Type extends MessageType { - constructor() { - super("lnrpc.StopResponse", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.StopResponse - */ -export const StopResponse = new StopResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GraphTopologySubscription$Type extends MessageType { - constructor() { - super("lnrpc.GraphTopologySubscription", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.GraphTopologySubscription - */ -export const GraphTopologySubscription = new GraphTopologySubscription$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GraphTopologyUpdate$Type extends MessageType { - constructor() { - super("lnrpc.GraphTopologyUpdate", [ - { no: 1, name: "node_updates", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodeUpdate }, - { no: 2, name: "channel_updates", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelEdgeUpdate }, - { no: 3, name: "closed_chans", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ClosedChannelUpdate } - ]); - } - create(value) { - const message = { nodeUpdates: [], channelUpdates: [], closedChans: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.NodeUpdate node_updates */ 1: - message.nodeUpdates.push(NodeUpdate.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.ChannelEdgeUpdate channel_updates */ 2: - message.channelUpdates.push(ChannelEdgeUpdate.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* repeated lnrpc.ClosedChannelUpdate closed_chans */ 3: - message.closedChans.push(ClosedChannelUpdate.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, writer, options) { - /* repeated lnrpc.NodeUpdate node_updates = 1; */ - for (let i = 0; i < message.nodeUpdates.length; i++) - NodeUpdate.internalBinaryWrite(message.nodeUpdates[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.ChannelEdgeUpdate channel_updates = 2; */ - for (let i = 0; i < message.channelUpdates.length; i++) - ChannelEdgeUpdate.internalBinaryWrite(message.channelUpdates[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* repeated lnrpc.ClosedChannelUpdate closed_chans = 3; */ - for (let i = 0; i < message.closedChans.length; i++) - ClosedChannelUpdate.internalBinaryWrite(message.closedChans[i], 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.GraphTopologyUpdate - */ -export const GraphTopologyUpdate = new GraphTopologyUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class NodeUpdate$Type extends MessageType { - constructor() { - super("lnrpc.NodeUpdate", [ - { no: 1, name: "addresses", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "identity_key", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "global_features", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "alias", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "color", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "node_addresses", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => NodeAddress }, - { no: 6, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } } - ]); - } - create(value) { - const message = { addresses: [], identityKey: "", globalFeatures: new Uint8Array(0), alias: "", color: "", nodeAddresses: [], features: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated string addresses = 1 [deprecated = true];*/ 1: - message.addresses.push(reader.string()); - break; - case /* string identity_key */ 2: - message.identityKey = reader.string(); - break; - case /* bytes global_features = 3 [deprecated = true];*/ 3: - message.globalFeatures = reader.bytes(); - break; - case /* string alias */ 4: - message.alias = reader.string(); - break; - case /* string color */ 5: - message.color = reader.string(); - break; - case /* repeated lnrpc.NodeAddress node_addresses */ 7: - message.nodeAddresses.push(NodeAddress.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* map features */ 6: - this.binaryReadMap6(message.features, reader, 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; - } - binaryReadMap6(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.NodeUpdate.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - internalBinaryWrite(message, writer, options) { - /* repeated string addresses = 1 [deprecated = true]; */ - for (let i = 0; i < message.addresses.length; i++) - writer.tag(1, WireType.LengthDelimited).string(message.addresses[i]); - /* string identity_key = 2; */ - if (message.identityKey !== "") - writer.tag(2, WireType.LengthDelimited).string(message.identityKey); - /* bytes global_features = 3 [deprecated = true]; */ - if (message.globalFeatures.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.globalFeatures); - /* string alias = 4; */ - if (message.alias !== "") - writer.tag(4, WireType.LengthDelimited).string(message.alias); - /* string color = 5; */ - if (message.color !== "") - writer.tag(5, WireType.LengthDelimited).string(message.color); - /* repeated lnrpc.NodeAddress node_addresses = 7; */ - for (let i = 0; i < message.nodeAddresses.length; i++) - NodeAddress.internalBinaryWrite(message.nodeAddresses[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* map features = 6; */ - for (let k of Object.keys(message.features)) { - writer.tag(6, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k], writer, options); - writer.join().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.NodeUpdate - */ -export const NodeUpdate = new NodeUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelEdgeUpdate$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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) { - const message = { chanId: "0", capacity: 0, advertisingNode: "", connectingNode: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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 [jstype = JS_STRING];*/ 1: - message.chanId = reader.uint64().toString(); - break; - case /* lnrpc.ChannelPoint chan_point */ 2: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - break; - case /* int64 capacity */ 3: - message.capacity = reader.int64().toNumber(); - break; - case /* lnrpc.RoutingPolicy routing_policy */ 4: - message.routingPolicy = RoutingPolicy.internalBinaryRead(reader, reader.uint32(), options, message.routingPolicy); - break; - case /* string advertising_node */ 5: - message.advertisingNode = reader.string(); - break; - case /* string connecting_node */ 6: - message.connectingNode = 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, writer, options) { - /* uint64 chan_id = 1 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* lnrpc.ChannelPoint chan_point = 2; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* int64 capacity = 3; */ - if (message.capacity !== 0) - writer.tag(3, WireType.Varint).int64(message.capacity); - /* lnrpc.RoutingPolicy routing_policy = 4; */ - if (message.routingPolicy) - RoutingPolicy.internalBinaryWrite(message.routingPolicy, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); - /* string advertising_node = 5; */ - if (message.advertisingNode !== "") - writer.tag(5, WireType.LengthDelimited).string(message.advertisingNode); - /* string connecting_node = 6; */ - if (message.connectingNode !== "") - writer.tag(6, WireType.LengthDelimited).string(message.connectingNode); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelEdgeUpdate - */ -export const ChannelEdgeUpdate = new ChannelEdgeUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "closed_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "chan_point", kind: "message", T: () => ChannelPoint } - ]); - } - create(value) { - const message = { chanId: "0", capacity: 0, closedHeight: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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 [jstype = JS_STRING];*/ 1: - message.chanId = reader.uint64().toString(); - break; - case /* int64 capacity */ 2: - message.capacity = reader.int64().toNumber(); - break; - case /* uint32 closed_height */ 3: - message.closedHeight = reader.uint32(); - break; - case /* lnrpc.ChannelPoint chan_point */ 4: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - 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, writer, options) { - /* uint64 chan_id = 1 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* int64 capacity = 2; */ - if (message.capacity !== 0) - writer.tag(2, WireType.Varint).int64(message.capacity); - /* uint32 closed_height = 3; */ - if (message.closedHeight !== 0) - writer.tag(3, WireType.Varint).uint32(message.closedHeight); - /* lnrpc.ChannelPoint chan_point = 4; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(4, 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.ClosedChannelUpdate - */ -export const ClosedChannelUpdate = new ClosedChannelUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class HopHint$Type extends MessageType { - constructor() { - super("lnrpc.HopHint", [ - { no: 1, name: "node_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 3, name: "fee_base_msat", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "fee_proportional_millionths", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "cltv_expiry_delta", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = { nodeId: "", chanId: "0", feeBaseMsat: 0, feeProportionalMillionths: 0, cltvExpiryDelta: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string node_id */ 1: - message.nodeId = reader.string(); - break; - case /* uint64 chan_id = 2 [jstype = JS_STRING];*/ 2: - message.chanId = reader.uint64().toString(); - break; - case /* uint32 fee_base_msat */ 3: - message.feeBaseMsat = reader.uint32(); - break; - case /* uint32 fee_proportional_millionths */ 4: - message.feeProportionalMillionths = reader.uint32(); - break; - case /* uint32 cltv_expiry_delta */ 5: - message.cltvExpiryDelta = reader.uint32(); - 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, writer, options) { - /* string node_id = 1; */ - if (message.nodeId !== "") - writer.tag(1, WireType.LengthDelimited).string(message.nodeId); - /* uint64 chan_id = 2 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(2, WireType.Varint).uint64(message.chanId); - /* uint32 fee_base_msat = 3; */ - if (message.feeBaseMsat !== 0) - writer.tag(3, WireType.Varint).uint32(message.feeBaseMsat); - /* uint32 fee_proportional_millionths = 4; */ - if (message.feeProportionalMillionths !== 0) - writer.tag(4, WireType.Varint).uint32(message.feeProportionalMillionths); - /* uint32 cltv_expiry_delta = 5; */ - if (message.cltvExpiryDelta !== 0) - writer.tag(5, WireType.Varint).uint32(message.cltvExpiryDelta); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.HopHint - */ -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) { - 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, length, options, target) { - 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, writer, options) { - /* 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", [ - { no: 1, name: "hop_hints", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HopHint } - ]); - } - create(value) { - const message = { hopHints: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.HopHint hop_hints */ 1: - message.hopHints.push(HopHint.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, writer, options) { - /* repeated lnrpc.HopHint hop_hints = 1; */ - for (let i = 0; i < message.hopHints.length; i++) - HopHint.internalBinaryWrite(message.hopHints[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.RouteHint - */ -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: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "settle_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "amt_paid_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { state: 0, settleIndex: 0, settleTime: 0, amtPaidMsat: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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().toNumber(); - break; - case /* int64 settle_time */ 3: - message.settleTime = reader.int64().toNumber(); - break; - case /* int64 amt_paid_msat */ 5: - message.amtPaidMsat = reader.int64().toNumber(); - 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, writer, options) { - /* lnrpc.InvoiceHTLCState state = 1; */ - if (message.state !== 0) - writer.tag(1, WireType.Varint).int32(message.state); - /* uint64 settle_index = 2; */ - if (message.settleIndex !== 0) - writer.tag(2, WireType.Varint).uint64(message.settleIndex); - /* int64 settle_time = 3; */ - if (message.settleTime !== 0) - writer.tag(3, WireType.Varint).int64(message.settleTime); - /* int64 amt_paid_msat = 5; */ - if (message.amtPaidMsat !== 0) - 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 23, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "settled", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 7, name: "creation_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "settle_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "fallback_addr", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "cltv_expiry", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 17, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 18, name: "amt_paid", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 19, name: "amt_paid_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 20, name: "amt_paid_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 28, name: "amp_invoice_state", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => AMPInvoiceState } } - ]); - } - create(value) { - 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, ampInvoiceState: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string memo */ 1: - message.memo = reader.string(); - break; - case /* bytes r_preimage */ 3: - message.rPreimage = reader.bytes(); - break; - case /* bytes r_hash */ 4: - message.rHash = reader.bytes(); - break; - case /* int64 value */ 5: - message.value = reader.int64().toNumber(); - break; - case /* int64 value_msat */ 23: - message.valueMsat = reader.int64().toNumber(); - break; - case /* bool settled = 6 [deprecated = true];*/ 6: - message.settled = reader.bool(); - break; - case /* int64 creation_date */ 7: - message.creationDate = reader.int64().toNumber(); - break; - case /* int64 settle_date */ 8: - message.settleDate = reader.int64().toNumber(); - break; - case /* string payment_request */ 9: - message.paymentRequest = reader.string(); - break; - case /* bytes description_hash */ 10: - message.descriptionHash = reader.bytes(); - break; - case /* int64 expiry */ 11: - message.expiry = reader.int64().toNumber(); - break; - case /* string fallback_addr */ 12: - message.fallbackAddr = reader.string(); - break; - case /* uint64 cltv_expiry */ 13: - message.cltvExpiry = reader.uint64().toNumber(); - break; - case /* repeated lnrpc.RouteHint route_hints */ 14: - message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* bool private */ 15: - message.private = reader.bool(); - break; - case /* uint64 add_index */ 16: - message.addIndex = reader.uint64().toNumber(); - break; - case /* uint64 settle_index */ 17: - message.settleIndex = reader.uint64().toNumber(); - break; - case /* int64 amt_paid = 18 [deprecated = true];*/ 18: - message.amtPaid = reader.int64().toNumber(); - break; - case /* int64 amt_paid_sat */ 19: - message.amtPaidSat = reader.int64().toNumber(); - break; - case /* int64 amt_paid_msat */ 20: - message.amtPaidMsat = reader.int64().toNumber(); - break; - case /* lnrpc.Invoice.InvoiceState state */ 21: - message.state = reader.int32(); - break; - case /* repeated lnrpc.InvoiceHTLC htlcs */ 22: - message.htlcs.push(InvoiceHTLC.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* map features */ 24: - this.binaryReadMap24(message.features, reader, options); - break; - case /* bool is_keysend */ 25: - message.isKeysend = reader.bool(); - break; - case /* bytes payment_addr */ 26: - message.paymentAddr = reader.bytes(); - break; - 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") - 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; - } - binaryReadMap24(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.Invoice.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - binaryReadMap28(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - 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, writer, options) { - /* string memo = 1; */ - if (message.memo !== "") - writer.tag(1, WireType.LengthDelimited).string(message.memo); - /* bytes r_preimage = 3; */ - if (message.rPreimage.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.rPreimage); - /* bytes r_hash = 4; */ - if (message.rHash.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.rHash); - /* int64 value = 5; */ - if (message.value !== 0) - writer.tag(5, WireType.Varint).int64(message.value); - /* int64 value_msat = 23; */ - if (message.valueMsat !== 0) - 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) - writer.tag(7, WireType.Varint).int64(message.creationDate); - /* int64 settle_date = 8; */ - if (message.settleDate !== 0) - writer.tag(8, WireType.Varint).int64(message.settleDate); - /* string payment_request = 9; */ - if (message.paymentRequest !== "") - writer.tag(9, WireType.LengthDelimited).string(message.paymentRequest); - /* bytes description_hash = 10; */ - if (message.descriptionHash.length) - writer.tag(10, WireType.LengthDelimited).bytes(message.descriptionHash); - /* int64 expiry = 11; */ - if (message.expiry !== 0) - 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) - writer.tag(13, WireType.Varint).uint64(message.cltvExpiry); - /* repeated lnrpc.RouteHint route_hints = 14; */ - for (let i = 0; i < message.routeHints.length; i++) - RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(14, WireType.LengthDelimited).fork(), options).join(); - /* bool private = 15; */ - if (message.private !== false) - writer.tag(15, WireType.Varint).bool(message.private); - /* uint64 add_index = 16; */ - if (message.addIndex !== 0) - writer.tag(16, WireType.Varint).uint64(message.addIndex); - /* uint64 settle_index = 17; */ - if (message.settleIndex !== 0) - writer.tag(17, WireType.Varint).uint64(message.settleIndex); - /* int64 amt_paid = 18 [deprecated = true]; */ - if (message.amtPaid !== 0) - writer.tag(18, WireType.Varint).int64(message.amtPaid); - /* int64 amt_paid_sat = 19; */ - if (message.amtPaidSat !== 0) - writer.tag(19, WireType.Varint).int64(message.amtPaidSat); - /* int64 amt_paid_msat = 20; */ - if (message.amtPaidMsat !== 0) - writer.tag(20, WireType.Varint).int64(message.amtPaidMsat); - /* lnrpc.Invoice.InvoiceState state = 21; */ - if (message.state !== 0) - writer.tag(21, WireType.Varint).int32(message.state); - /* repeated lnrpc.InvoiceHTLC htlcs = 22; */ - for (let i = 0; i < message.htlcs.length; i++) - InvoiceHTLC.internalBinaryWrite(message.htlcs[i], writer.tag(22, WireType.LengthDelimited).fork(), options).join(); - /* map features = 24; */ - for (let k of Object.keys(message.features)) { - writer.tag(24, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k], writer, options); - writer.join().join(); - } - /* bool is_keysend = 25; */ - if (message.isKeysend !== false) - writer.tag(25, WireType.Varint).bool(message.isKeysend); - /* bytes payment_addr = 26; */ - if (message.paymentAddr.length) - writer.tag(26, WireType.LengthDelimited).bytes(message.paymentAddr); - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Invoice - */ -export const Invoice = new Invoice$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "accept_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "accept_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "resolve_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 11, name: "amp", kind: "message", T: () => AMP } - ]); - } - create(value) { - const message = { chanId: "0", htlcIndex: 0, amtMsat: 0, acceptHeight: 0, acceptTime: 0, resolveTime: 0, expiryHeight: 0, state: 0, customRecords: {}, mppTotalAmtMsat: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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 [jstype = JS_STRING];*/ 1: - message.chanId = reader.uint64().toString(); - break; - case /* uint64 htlc_index */ 2: - message.htlcIndex = reader.uint64().toNumber(); - break; - case /* uint64 amt_msat */ 3: - message.amtMsat = reader.uint64().toNumber(); - break; - case /* int32 accept_height */ 4: - message.acceptHeight = reader.int32(); - break; - case /* int64 accept_time */ 5: - message.acceptTime = reader.int64().toNumber(); - break; - case /* int64 resolve_time */ 6: - message.resolveTime = reader.int64().toNumber(); - break; - case /* int32 expiry_height */ 7: - message.expiryHeight = reader.int32(); - break; - case /* lnrpc.InvoiceHTLCState state */ 8: - message.state = reader.int32(); - break; - case /* map custom_records */ 9: - this.binaryReadMap9(message.customRecords, reader, options); - break; - case /* uint64 mpp_total_amt_msat */ 10: - message.mppTotalAmtMsat = reader.uint64().toNumber(); - break; - case /* lnrpc.AMP amp */ 11: - message.amp = AMP.internalBinaryRead(reader, reader.uint32(), options, message.amp); - 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; - } - binaryReadMap9(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - 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.InvoiceHTLC.custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message, writer, options) { - /* uint64 chan_id = 1 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* uint64 htlc_index = 2; */ - if (message.htlcIndex !== 0) - writer.tag(2, WireType.Varint).uint64(message.htlcIndex); - /* uint64 amt_msat = 3; */ - if (message.amtMsat !== 0) - 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) - writer.tag(5, WireType.Varint).int64(message.acceptTime); - /* int64 resolve_time = 6; */ - if (message.resolveTime !== 0) - writer.tag(6, WireType.Varint).int64(message.resolveTime); - /* int32 expiry_height = 7; */ - if (message.expiryHeight !== 0) - writer.tag(7, WireType.Varint).int32(message.expiryHeight); - /* lnrpc.InvoiceHTLCState state = 8; */ - if (message.state !== 0) - writer.tag(8, WireType.Varint).int32(message.state); - /* 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(); - /* uint64 mpp_total_amt_msat = 10; */ - if (message.mppTotalAmtMsat !== 0) - writer.tag(10, WireType.Varint).uint64(message.mppTotalAmtMsat); - /* lnrpc.AMP amp = 11; */ - if (message.amp) - AMP.internalBinaryWrite(message.amp, writer.tag(11, 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.InvoiceHTLC - */ -export const InvoiceHTLC = new InvoiceHTLC$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AMP$Type extends MessageType { - constructor() { - super("lnrpc.AMP", [ - { no: 1, name: "root_share", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "set_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "child_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 5, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { rootShare: new Uint8Array(0), setId: new Uint8Array(0), childIndex: 0, hash: new Uint8Array(0), 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, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes root_share */ 1: - message.rootShare = reader.bytes(); - break; - case /* bytes set_id */ 2: - message.setId = reader.bytes(); - break; - case /* uint32 child_index */ 3: - message.childIndex = reader.uint32(); - break; - case /* bytes hash */ 4: - message.hash = reader.bytes(); - break; - case /* bytes preimage */ 5: - 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, writer, options) { - /* bytes root_share = 1; */ - if (message.rootShare.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.rootShare); - /* bytes set_id = 2; */ - if (message.setId.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.setId); - /* uint32 child_index = 3; */ - if (message.childIndex !== 0) - writer.tag(3, WireType.Varint).uint32(message.childIndex); - /* bytes hash = 4; */ - if (message.hash.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.hash); - /* bytes preimage = 5; */ - if (message.preimage.length) - writer.tag(5, WireType.LengthDelimited).bytes(message.preimage); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AMP - */ -export const AMP = new AMP$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AddInvoiceResponse$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 17, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { rHash: new Uint8Array(0), paymentRequest: "", addIndex: 0, paymentAddr: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes r_hash */ 1: - message.rHash = reader.bytes(); - break; - case /* string payment_request */ 2: - message.paymentRequest = reader.string(); - break; - case /* uint64 add_index */ 16: - message.addIndex = reader.uint64().toNumber(); - break; - case /* bytes payment_addr */ 17: - message.paymentAddr = 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, writer, options) { - /* bytes r_hash = 1; */ - if (message.rHash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.rHash); - /* string payment_request = 2; */ - if (message.paymentRequest !== "") - writer.tag(2, WireType.LengthDelimited).string(message.paymentRequest); - /* uint64 add_index = 16; */ - if (message.addIndex !== 0) - writer.tag(16, WireType.Varint).uint64(message.addIndex); - /* bytes payment_addr = 17; */ - if (message.paymentAddr.length) - writer.tag(17, WireType.LengthDelimited).bytes(message.paymentAddr); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AddInvoiceResponse - */ -export const AddInvoiceResponse = new AddInvoiceResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PaymentHash$Type extends MessageType { - constructor() { - super("lnrpc.PaymentHash", [ - { no: 1, name: "r_hash_str", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "r_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { rHashStr: "", rHash: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string r_hash_str = 1 [deprecated = true];*/ 1: - message.rHashStr = reader.string(); - break; - case /* bytes r_hash */ 2: - message.rHash = 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, writer, options) { - /* string r_hash_str = 1 [deprecated = true]; */ - if (message.rHashStr !== "") - writer.tag(1, WireType.LengthDelimited).string(message.rHashStr); - /* bytes r_hash = 2; */ - if (message.rHash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.rHash); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PaymentHash - */ -export const PaymentHash = new PaymentHash$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "num_max_invoices", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "reversed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { pendingOnly: false, indexOffset: 0, numMaxInvoices: 0, reversed: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool pending_only */ 1: - message.pendingOnly = reader.bool(); - break; - case /* uint64 index_offset */ 4: - message.indexOffset = reader.uint64().toNumber(); - break; - case /* uint64 num_max_invoices */ 5: - message.numMaxInvoices = reader.uint64().toNumber(); - break; - case /* bool reversed */ 6: - message.reversed = 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, writer, options) { - /* bool pending_only = 1; */ - if (message.pendingOnly !== false) - writer.tag(1, WireType.Varint).bool(message.pendingOnly); - /* uint64 index_offset = 4; */ - if (message.indexOffset !== 0) - writer.tag(4, WireType.Varint).uint64(message.indexOffset); - /* uint64 num_max_invoices = 5; */ - if (message.numMaxInvoices !== 0) - writer.tag(5, WireType.Varint).uint64(message.numMaxInvoices); - /* bool reversed = 6; */ - if (message.reversed !== false) - writer.tag(6, WireType.Varint).bool(message.reversed); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListInvoiceRequest - */ -export const ListInvoiceRequest = new ListInvoiceRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "first_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { invoices: [], lastIndexOffset: 0, firstIndexOffset: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Invoice invoices */ 1: - message.invoices.push(Invoice.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint64 last_index_offset */ 2: - message.lastIndexOffset = reader.uint64().toNumber(); - break; - case /* uint64 first_index_offset */ 3: - message.firstIndexOffset = reader.uint64().toNumber(); - 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, writer, options) { - /* repeated lnrpc.Invoice invoices = 1; */ - 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) - writer.tag(2, WireType.Varint).uint64(message.lastIndexOffset); - /* uint64 first_index_offset = 3; */ - if (message.firstIndexOffset !== 0) - writer.tag(3, WireType.Varint).uint64(message.firstIndexOffset); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListInvoiceResponse - */ -export const ListInvoiceResponse = new ListInvoiceResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class InvoiceSubscription$Type extends MessageType { - constructor() { - super("lnrpc.InvoiceSubscription", [ - { no: 1, name: "add_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "settle_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { addIndex: 0, settleIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 add_index */ 1: - message.addIndex = reader.uint64().toNumber(); - break; - case /* uint64 settle_index */ 2: - message.settleIndex = reader.uint64().toNumber(); - 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, writer, options) { - /* uint64 add_index = 1; */ - if (message.addIndex !== 0) - writer.tag(1, WireType.Varint).uint64(message.addIndex); - /* uint64 settle_index = 2; */ - if (message.settleIndex !== 0) - writer.tag(2, WireType.Varint).uint64(message.settleIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.InvoiceSubscription - */ -export const InvoiceSubscription = new InvoiceSubscription$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "creation_date", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "fee", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "payment_preimage", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "value_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "value_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 13, name: "creation_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 14, name: "htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HTLCAttempt }, - { no: 15, name: "payment_index", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 16, name: "failure_reason", kind: "enum", T: () => ["lnrpc.PaymentFailureReason", PaymentFailureReason] } - ]); - } - create(value) { - 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 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string payment_hash */ 1: - message.paymentHash = reader.string(); - break; - case /* int64 value = 2 [deprecated = true];*/ 2: - message.value = reader.int64().toNumber(); - break; - case /* int64 creation_date = 3 [deprecated = true];*/ 3: - message.creationDate = reader.int64().toNumber(); - break; - case /* int64 fee = 5 [deprecated = true];*/ 5: - message.fee = reader.int64().toNumber(); - break; - case /* string payment_preimage */ 6: - message.paymentPreimage = reader.string(); - break; - case /* int64 value_sat */ 7: - message.valueSat = reader.int64().toNumber(); - break; - case /* int64 value_msat */ 8: - message.valueMsat = reader.int64().toNumber(); - break; - case /* string payment_request */ 9: - message.paymentRequest = reader.string(); - break; - case /* lnrpc.Payment.PaymentStatus status */ 10: - message.status = reader.int32(); - break; - case /* int64 fee_sat */ 11: - message.feeSat = reader.int64().toNumber(); - break; - case /* int64 fee_msat */ 12: - message.feeMsat = reader.int64().toNumber(); - break; - case /* int64 creation_time_ns */ 13: - message.creationTimeNs = reader.int64().toNumber(); - 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().toNumber(); - break; - case /* lnrpc.PaymentFailureReason failure_reason */ 16: - message.failureReason = 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, writer, options) { - /* string payment_hash = 1; */ - if (message.paymentHash !== "") - writer.tag(1, WireType.LengthDelimited).string(message.paymentHash); - /* int64 value = 2 [deprecated = true]; */ - if (message.value !== 0) - writer.tag(2, WireType.Varint).int64(message.value); - /* int64 creation_date = 3 [deprecated = true]; */ - if (message.creationDate !== 0) - writer.tag(3, WireType.Varint).int64(message.creationDate); - /* int64 fee = 5 [deprecated = true]; */ - if (message.fee !== 0) - 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) - writer.tag(7, WireType.Varint).int64(message.valueSat); - /* int64 value_msat = 8; */ - if (message.valueMsat !== 0) - writer.tag(8, WireType.Varint).int64(message.valueMsat); - /* string payment_request = 9; */ - if (message.paymentRequest !== "") - writer.tag(9, WireType.LengthDelimited).string(message.paymentRequest); - /* lnrpc.Payment.PaymentStatus status = 10; */ - if (message.status !== 0) - writer.tag(10, WireType.Varint).int32(message.status); - /* int64 fee_sat = 11; */ - if (message.feeSat !== 0) - writer.tag(11, WireType.Varint).int64(message.feeSat); - /* int64 fee_msat = 12; */ - if (message.feeMsat !== 0) - writer.tag(12, WireType.Varint).int64(message.feeMsat); - /* int64 creation_time_ns = 13; */ - if (message.creationTimeNs !== 0) - 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) - writer.tag(15, WireType.Varint).uint64(message.paymentIndex); - /* lnrpc.PaymentFailureReason failure_reason = 16; */ - if (message.failureReason !== 0) - writer.tag(16, WireType.Varint).int32(message.failureReason); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Payment - */ -export const Payment = new Payment$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class HTLCAttempt$Type extends MessageType { - constructor() { - super("lnrpc.HTLCAttempt", [ - { no: 7, name: "attempt_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "resolve_time_ns", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "failure", kind: "message", T: () => Failure }, - { no: 6, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { attemptId: 0, status: 0, attemptTimeNs: 0, resolveTimeNs: 0, 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, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 attempt_id */ 7: - message.attemptId = reader.uint64().toNumber(); - break; - case /* lnrpc.HTLCAttempt.HTLCStatus status */ 1: - message.status = reader.int32(); - break; - case /* lnrpc.Route route */ 2: - message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); - break; - case /* int64 attempt_time_ns */ 3: - message.attemptTimeNs = reader.int64().toNumber(); - break; - case /* int64 resolve_time_ns */ 4: - message.resolveTimeNs = reader.int64().toNumber(); - break; - case /* lnrpc.Failure failure */ 5: - message.failure = Failure.internalBinaryRead(reader, reader.uint32(), options, message.failure); - break; - case /* bytes preimage */ 6: - 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, writer, options) { - /* uint64 attempt_id = 7; */ - if (message.attemptId !== 0) - writer.tag(7, WireType.Varint).uint64(message.attemptId); - /* lnrpc.HTLCAttempt.HTLCStatus status = 1; */ - if (message.status !== 0) - writer.tag(1, WireType.Varint).int32(message.status); - /* lnrpc.Route route = 2; */ - if (message.route) - Route.internalBinaryWrite(message.route, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); - /* int64 attempt_time_ns = 3; */ - if (message.attemptTimeNs !== 0) - writer.tag(3, WireType.Varint).int64(message.attemptTimeNs); - /* int64 resolve_time_ns = 4; */ - if (message.resolveTimeNs !== 0) - writer.tag(4, WireType.Varint).int64(message.resolveTimeNs); - /* lnrpc.Failure failure = 5; */ - if (message.failure) - Failure.internalBinaryWrite(message.failure, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); - /* bytes preimage = 6; */ - if (message.preimage.length) - writer.tag(6, WireType.LengthDelimited).bytes(message.preimage); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.HTLCAttempt - */ -export const HTLCAttempt = new HTLCAttempt$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "max_payments", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "reversed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 5, name: "count_total_payments", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { includeIncomplete: false, indexOffset: 0, maxPayments: 0, reversed: false, countTotalPayments: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool include_incomplete */ 1: - message.includeIncomplete = reader.bool(); - break; - case /* uint64 index_offset */ 2: - message.indexOffset = reader.uint64().toNumber(); - break; - case /* uint64 max_payments */ 3: - message.maxPayments = reader.uint64().toNumber(); - 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") - 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, writer, options) { - /* bool include_incomplete = 1; */ - if (message.includeIncomplete !== false) - writer.tag(1, WireType.Varint).bool(message.includeIncomplete); - /* uint64 index_offset = 2; */ - if (message.indexOffset !== 0) - writer.tag(2, WireType.Varint).uint64(message.indexOffset); - /* uint64 max_payments = 3; */ - if (message.maxPayments !== 0) - 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListPaymentsRequest - */ -export const ListPaymentsRequest = new ListPaymentsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "last_index_offset", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "total_num_payments", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { payments: [], firstIndexOffset: 0, lastIndexOffset: 0, totalNumPayments: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.Payment payments */ 1: - message.payments.push(Payment.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint64 first_index_offset */ 2: - message.firstIndexOffset = reader.uint64().toNumber(); - break; - case /* uint64 last_index_offset */ 3: - message.lastIndexOffset = reader.uint64().toNumber(); - break; - case /* uint64 total_num_payments */ 4: - message.totalNumPayments = reader.uint64().toNumber(); - 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, writer, options) { - /* repeated lnrpc.Payment payments = 1; */ - 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) - writer.tag(2, WireType.Varint).uint64(message.firstIndexOffset); - /* uint64 last_index_offset = 3; */ - if (message.lastIndexOffset !== 0) - writer.tag(3, WireType.Varint).uint64(message.lastIndexOffset); - /* uint64 total_num_payments = 4; */ - if (message.totalNumPayments !== 0) - writer.tag(4, WireType.Varint).uint64(message.totalNumPayments); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListPaymentsResponse - */ -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) { - 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, length, options, target) { - 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, writer, options) { - /* 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", [ - { no: 1, name: "failed_payments_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "failed_htlcs_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { failedPaymentsOnly: false, failedHtlcsOnly: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool failed_payments_only */ 1: - message.failedPaymentsOnly = reader.bool(); - 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, writer, options) { - /* bool failed_payments_only = 1; */ - if (message.failedPaymentsOnly !== false) - writer.tag(1, WireType.Varint).bool(message.failedPaymentsOnly); - /* 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.DeleteAllPaymentsRequest - */ -export const DeleteAllPaymentsRequest = new DeleteAllPaymentsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DeletePaymentResponse$Type extends MessageType { - constructor() { - super("lnrpc.DeletePaymentResponse", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - 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", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DeleteAllPaymentsResponse - */ -export const DeleteAllPaymentsResponse = new DeleteAllPaymentsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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: 3, name: "i_know_what_i_am_doing", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { pendingFundingShimOnly: false, iKnowWhatIAmDoing: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint channel_point */ 1: - message.channelPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.channelPoint); - break; - 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") - 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, writer, options) { - /* lnrpc.ChannelPoint channel_point = 1; */ - if (message.channelPoint) - ChannelPoint.internalBinaryWrite(message.channelPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AbandonChannelRequest - */ -export const AbandonChannelRequest = new AbandonChannelRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AbandonChannelResponse$Type extends MessageType { - constructor() { - super("lnrpc.AbandonChannelResponse", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.AbandonChannelResponse - */ -export const AbandonChannelResponse = new AbandonChannelResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DebugLevelRequest$Type extends MessageType { - constructor() { - super("lnrpc.DebugLevelRequest", [ - { no: 1, name: "show", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "level_spec", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { show: false, levelSpec: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool show */ 1: - message.show = reader.bool(); - break; - case /* string level_spec */ 2: - message.levelSpec = 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, writer, options) { - /* bool show = 1; */ - if (message.show !== false) - writer.tag(1, WireType.Varint).bool(message.show); - /* string level_spec = 2; */ - if (message.levelSpec !== "") - writer.tag(2, WireType.LengthDelimited).string(message.levelSpec); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DebugLevelRequest - */ -export const DebugLevelRequest = new DebugLevelRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DebugLevelResponse$Type extends MessageType { - constructor() { - super("lnrpc.DebugLevelResponse", [ - { no: 1, name: "sub_systems", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { subSystems: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string sub_systems */ 1: - message.subSystems = 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, writer, options) { - /* string sub_systems = 1; */ - if (message.subSystems !== "") - writer.tag(1, WireType.LengthDelimited).string(message.subSystems); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DebugLevelResponse - */ -export const DebugLevelResponse = new DebugLevelResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PayReqString$Type extends MessageType { - constructor() { - super("lnrpc.PayReqString", [ - { no: 1, name: "pay_req", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { payReq: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string pay_req */ 1: - message.payReq = 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, writer, options) { - /* string pay_req = 1; */ - if (message.payReq !== "") - writer.tag(1, WireType.LengthDelimited).string(message.payReq); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PayReqString - */ -export const PayReqString = new PayReqString$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PayReq$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "timestamp", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "expiry", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 13, name: "features", kind: "map", K: 13 /*ScalarType.UINT32*/, V: { kind: "message", T: () => Feature } } - ]); - } - create(value) { - const message = { destination: "", paymentHash: "", numSatoshis: 0, timestamp: 0, expiry: 0, description: "", descriptionHash: "", fallbackAddr: "", cltvExpiry: 0, routeHints: [], paymentAddr: new Uint8Array(0), numMsat: 0, features: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string destination */ 1: - message.destination = reader.string(); - break; - case /* string payment_hash */ 2: - message.paymentHash = reader.string(); - break; - case /* int64 num_satoshis */ 3: - message.numSatoshis = reader.int64().toNumber(); - break; - case /* int64 timestamp */ 4: - message.timestamp = reader.int64().toNumber(); - break; - case /* int64 expiry */ 5: - message.expiry = reader.int64().toNumber(); - break; - case /* string description */ 6: - message.description = reader.string(); - break; - case /* string description_hash */ 7: - message.descriptionHash = reader.string(); - break; - case /* string fallback_addr */ 8: - message.fallbackAddr = reader.string(); - break; - case /* int64 cltv_expiry */ 9: - message.cltvExpiry = reader.int64().toNumber(); - break; - case /* repeated lnrpc.RouteHint route_hints */ 10: - message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* bytes payment_addr */ 11: - message.paymentAddr = reader.bytes(); - break; - case /* int64 num_msat */ 12: - message.numMsat = reader.int64().toNumber(); - break; - case /* map features */ 13: - this.binaryReadMap13(message.features, reader, 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; - } - binaryReadMap13(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.uint32(); - break; - case 2: - val = Feature.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.PayReq.features"); - } - } - map[key ?? 0] = val ?? Feature.create(); - } - internalBinaryWrite(message, writer, options) { - /* string destination = 1; */ - if (message.destination !== "") - writer.tag(1, WireType.LengthDelimited).string(message.destination); - /* string payment_hash = 2; */ - if (message.paymentHash !== "") - writer.tag(2, WireType.LengthDelimited).string(message.paymentHash); - /* int64 num_satoshis = 3; */ - if (message.numSatoshis !== 0) - writer.tag(3, WireType.Varint).int64(message.numSatoshis); - /* int64 timestamp = 4; */ - if (message.timestamp !== 0) - writer.tag(4, WireType.Varint).int64(message.timestamp); - /* int64 expiry = 5; */ - if (message.expiry !== 0) - writer.tag(5, WireType.Varint).int64(message.expiry); - /* string description = 6; */ - if (message.description !== "") - writer.tag(6, WireType.LengthDelimited).string(message.description); - /* string description_hash = 7; */ - if (message.descriptionHash !== "") - writer.tag(7, WireType.LengthDelimited).string(message.descriptionHash); - /* string fallback_addr = 8; */ - if (message.fallbackAddr !== "") - writer.tag(8, WireType.LengthDelimited).string(message.fallbackAddr); - /* int64 cltv_expiry = 9; */ - if (message.cltvExpiry !== 0) - writer.tag(9, WireType.Varint).int64(message.cltvExpiry); - /* repeated lnrpc.RouteHint route_hints = 10; */ - for (let i = 0; i < message.routeHints.length; i++) - RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join(); - /* bytes payment_addr = 11; */ - if (message.paymentAddr.length) - writer.tag(11, WireType.LengthDelimited).bytes(message.paymentAddr); - /* int64 num_msat = 12; */ - if (message.numMsat !== 0) - writer.tag(12, WireType.Varint).int64(message.numMsat); - /* map features = 13; */ - for (let k of Object.keys(message.features)) { - writer.tag(13, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint32(parseInt(k)); - writer.tag(2, WireType.LengthDelimited).fork(); - Feature.internalBinaryWrite(message.features[k], writer, options); - writer.join().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.PayReq - */ -export const PayReq = new PayReq$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Feature$Type extends MessageType { - constructor() { - super("lnrpc.Feature", [ - { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "is_required", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 4, name: "is_known", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { name: "", isRequired: false, isKnown: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string name */ 2: - message.name = reader.string(); - break; - case /* bool is_required */ 3: - message.isRequired = reader.bool(); - break; - case /* bool is_known */ 4: - message.isKnown = 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, writer, options) { - /* string name = 2; */ - if (message.name !== "") - writer.tag(2, WireType.LengthDelimited).string(message.name); - /* bool is_required = 3; */ - if (message.isRequired !== false) - writer.tag(3, WireType.Varint).bool(message.isRequired); - /* bool is_known = 4; */ - if (message.isKnown !== false) - writer.tag(4, WireType.Varint).bool(message.isKnown); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Feature - */ -export const Feature = new Feature$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class FeeReportRequest$Type extends MessageType { - constructor() { - super("lnrpc.FeeReportRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FeeReportRequest - */ -export const FeeReportRequest = new FeeReportRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelFeeReport$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "fee_per_mil", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "fee_rate", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value) { - const message = { chanId: "0", channelPoint: "", baseFeeMsat: 0, feePerMil: 0, feeRate: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 chan_id = 5 [jstype = JS_STRING];*/ 5: - message.chanId = reader.uint64().toString(); - break; - case /* string channel_point */ 1: - message.channelPoint = reader.string(); - break; - case /* int64 base_fee_msat */ 2: - message.baseFeeMsat = reader.int64().toNumber(); - break; - case /* int64 fee_per_mil */ 3: - message.feePerMil = reader.int64().toNumber(); - break; - case /* double fee_rate */ 4: - message.feeRate = reader.double(); - 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, writer, options) { - /* uint64 chan_id = 5 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(5, WireType.Varint).uint64(message.chanId); - /* string channel_point = 1; */ - if (message.channelPoint !== "") - writer.tag(1, WireType.LengthDelimited).string(message.channelPoint); - /* int64 base_fee_msat = 2; */ - if (message.baseFeeMsat !== 0) - writer.tag(2, WireType.Varint).int64(message.baseFeeMsat); - /* int64 fee_per_mil = 3; */ - if (message.feePerMil !== 0) - writer.tag(3, WireType.Varint).int64(message.feePerMil); - /* double fee_rate = 4; */ - if (message.feeRate !== 0) - writer.tag(4, WireType.Bit64).double(message.feeRate); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelFeeReport - */ -export const ChannelFeeReport = new ChannelFeeReport$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "week_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "month_fee_sum", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { channelFees: [], dayFeeSum: 0, weekFeeSum: 0, monthFeeSum: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.ChannelFeeReport channel_fees */ 1: - message.channelFees.push(ChannelFeeReport.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint64 day_fee_sum */ 2: - message.dayFeeSum = reader.uint64().toNumber(); - break; - case /* uint64 week_fee_sum */ 3: - message.weekFeeSum = reader.uint64().toNumber(); - break; - case /* uint64 month_fee_sum */ 4: - message.monthFeeSum = reader.uint64().toNumber(); - 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, writer, options) { - /* repeated lnrpc.ChannelFeeReport channel_fees = 1; */ - 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) - writer.tag(2, WireType.Varint).uint64(message.dayFeeSum); - /* uint64 week_fee_sum = 3; */ - if (message.weekFeeSum !== 0) - writer.tag(3, WireType.Varint).uint64(message.weekFeeSum); - /* uint64 month_fee_sum = 4; */ - if (message.monthFeeSum !== 0) - writer.tag(4, WireType.Varint).uint64(message.monthFeeSum); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.FeeReportResponse - */ -export const FeeReportResponse = new FeeReportResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PolicyUpdateRequest$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "min_htlc_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "min_htlc_msat_specified", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { scope: { oneofKind: undefined }, baseFeeMsat: 0, feeRate: 0, feeRatePpm: 0, timeLockDelta: 0, maxHtlcMsat: 0, minHtlcMsat: 0, minHtlcMsatSpecified: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool global */ 1: - message.scope = { - oneofKind: "global", - global: reader.bool() - }; - break; - case /* lnrpc.ChannelPoint chan_point */ 2: - message.scope = { - oneofKind: "chanPoint", - chanPoint: ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.scope.chanPoint) - }; - break; - case /* int64 base_fee_msat */ 3: - message.baseFeeMsat = reader.int64().toNumber(); - 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().toNumber(); - break; - case /* uint64 min_htlc_msat */ 7: - message.minHtlcMsat = reader.uint64().toNumber(); - break; - case /* bool min_htlc_msat_specified */ 8: - message.minHtlcMsatSpecified = 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, writer, options) { - /* bool global = 1; */ - if (message.scope.oneofKind === "global") - writer.tag(1, WireType.Varint).bool(message.scope.global); - /* lnrpc.ChannelPoint chan_point = 2; */ - 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) - 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) - writer.tag(6, WireType.Varint).uint64(message.maxHtlcMsat); - /* uint64 min_htlc_msat = 7; */ - if (message.minHtlcMsat !== 0) - writer.tag(7, WireType.Varint).uint64(message.minHtlcMsat); - /* bool min_htlc_msat_specified = 8; */ - if (message.minHtlcMsatSpecified !== false) - writer.tag(8, WireType.Varint).bool(message.minHtlcMsatSpecified); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PolicyUpdateRequest - */ -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) { - 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, length, options, target) { - 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, writer, options) { - /* 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", [ - { no: 1, name: "failed_updates", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => FailedUpdate } - ]); - } - create(value) { - const message = { failedUpdates: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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, writer, options) { - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.PolicyUpdateResponse - */ -export const PolicyUpdateResponse = new PolicyUpdateResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardingHistoryRequest$Type extends MessageType { - constructor() { - super("lnrpc.ForwardingHistoryRequest", [ - { no: 1, name: "start_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "end_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "index_offset", 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) { - const message = { startTime: 0, endTime: 0, indexOffset: 0, numMaxEvents: 0, peerAliasLookup: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 start_time */ 1: - message.startTime = reader.uint64().toNumber(); - break; - case /* uint64 end_time */ 2: - message.endTime = reader.uint64().toNumber(); - break; - case /* uint32 index_offset */ 3: - message.indexOffset = reader.uint32(); - break; - case /* uint32 num_max_events */ 4: - message.numMaxEvents = reader.uint32(); - break; - case /* bool peer_alias_lookup */ 5: - message.peerAliasLookup = 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, writer, options) { - /* uint64 start_time = 1; */ - if (message.startTime !== 0) - writer.tag(1, WireType.Varint).uint64(message.startTime); - /* uint64 end_time = 2; */ - if (message.endTime !== 0) - writer.tag(2, WireType.Varint).uint64(message.endTime); - /* uint32 index_offset = 3; */ - if (message.indexOffset !== 0) - writer.tag(3, WireType.Varint).uint32(message.indexOffset); - /* uint32 num_max_events = 4; */ - if (message.numMaxEvents !== 0) - writer.tag(4, WireType.Varint).uint32(message.numMaxEvents); - /* bool peer_alias_lookup = 5; */ - if (message.peerAliasLookup !== false) - writer.tag(5, WireType.Varint).bool(message.peerAliasLookup); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ForwardingHistoryRequest - */ -export const ForwardingHistoryRequest = new ForwardingHistoryRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardingEvent$Type extends MessageType { - constructor() { - super("lnrpc.ForwardingEvent", [ - { no: 1, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "amt_out", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "fee", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 8, name: "fee_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 9, name: "amt_in_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 10, name: "amt_out_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 11, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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) { - const message = { timestamp: 0, chanIdIn: "0", chanIdOut: "0", amtIn: 0, amtOut: 0, fee: 0, feeMsat: 0, amtInMsat: 0, amtOutMsat: 0, timestampNs: 0, peerAliasIn: "", peerAliasOut: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 timestamp = 1 [deprecated = true];*/ 1: - message.timestamp = reader.uint64().toNumber(); - break; - case /* uint64 chan_id_in = 2 [jstype = JS_STRING];*/ 2: - message.chanIdIn = reader.uint64().toString(); - break; - case /* uint64 chan_id_out = 4 [jstype = JS_STRING];*/ 4: - message.chanIdOut = reader.uint64().toString(); - break; - case /* uint64 amt_in */ 5: - message.amtIn = reader.uint64().toNumber(); - break; - case /* uint64 amt_out */ 6: - message.amtOut = reader.uint64().toNumber(); - break; - case /* uint64 fee */ 7: - message.fee = reader.uint64().toNumber(); - break; - case /* uint64 fee_msat */ 8: - message.feeMsat = reader.uint64().toNumber(); - break; - case /* uint64 amt_in_msat */ 9: - message.amtInMsat = reader.uint64().toNumber(); - break; - case /* uint64 amt_out_msat */ 10: - message.amtOutMsat = reader.uint64().toNumber(); - break; - case /* uint64 timestamp_ns */ 11: - message.timestampNs = reader.uint64().toNumber(); - 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; - 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, writer, options) { - /* uint64 timestamp = 1 [deprecated = true]; */ - if (message.timestamp !== 0) - writer.tag(1, WireType.Varint).uint64(message.timestamp); - /* uint64 chan_id_in = 2 [jstype = JS_STRING]; */ - if (message.chanIdIn !== "0") - writer.tag(2, WireType.Varint).uint64(message.chanIdIn); - /* uint64 chan_id_out = 4 [jstype = JS_STRING]; */ - if (message.chanIdOut !== "0") - writer.tag(4, WireType.Varint).uint64(message.chanIdOut); - /* uint64 amt_in = 5; */ - if (message.amtIn !== 0) - writer.tag(5, WireType.Varint).uint64(message.amtIn); - /* uint64 amt_out = 6; */ - if (message.amtOut !== 0) - writer.tag(6, WireType.Varint).uint64(message.amtOut); - /* uint64 fee = 7; */ - if (message.fee !== 0) - writer.tag(7, WireType.Varint).uint64(message.fee); - /* uint64 fee_msat = 8; */ - if (message.feeMsat !== 0) - writer.tag(8, WireType.Varint).uint64(message.feeMsat); - /* uint64 amt_in_msat = 9; */ - if (message.amtInMsat !== 0) - writer.tag(9, WireType.Varint).uint64(message.amtInMsat); - /* uint64 amt_out_msat = 10; */ - if (message.amtOutMsat !== 0) - writer.tag(10, WireType.Varint).uint64(message.amtOutMsat); - /* uint64 timestamp_ns = 11; */ - if (message.timestampNs !== 0) - 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ForwardingEvent - */ -export const ForwardingEvent = new ForwardingEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardingHistoryResponse$Type extends MessageType { - constructor() { - super("lnrpc.ForwardingHistoryResponse", [ - { no: 1, name: "forwarding_events", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ForwardingEvent }, - { no: 2, name: "last_offset_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = { forwardingEvents: [], lastOffsetIndex: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.ForwardingEvent forwarding_events */ 1: - message.forwardingEvents.push(ForwardingEvent.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint32 last_offset_index */ 2: - message.lastOffsetIndex = reader.uint32(); - 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, writer, options) { - /* repeated lnrpc.ForwardingEvent forwarding_events = 1; */ - for (let i = 0; i < message.forwardingEvents.length; i++) - ForwardingEvent.internalBinaryWrite(message.forwardingEvents[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* uint32 last_offset_index = 2; */ - if (message.lastOffsetIndex !== 0) - writer.tag(2, WireType.Varint).uint32(message.lastOffsetIndex); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ForwardingHistoryResponse - */ -export const ForwardingHistoryResponse = new ForwardingHistoryResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ExportChannelBackupRequest$Type extends MessageType { - constructor() { - super("lnrpc.ExportChannelBackupRequest", [ - { no: 1, name: "chan_point", kind: "message", T: () => ChannelPoint } - ]); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint chan_point */ 1: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - 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, writer, options) { - /* lnrpc.ChannelPoint chan_point = 1; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, 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.ExportChannelBackupRequest - */ -export const ExportChannelBackupRequest = new ExportChannelBackupRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelBackup$Type extends MessageType { - constructor() { - super("lnrpc.ChannelBackup", [ - { no: 1, name: "chan_point", kind: "message", T: () => ChannelPoint }, - { no: 2, name: "chan_backup", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { chanBackup: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint chan_point */ 1: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - break; - case /* bytes chan_backup */ 2: - message.chanBackup = 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, writer, options) { - /* lnrpc.ChannelPoint chan_point = 1; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bytes chan_backup = 2; */ - if (message.chanBackup.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.chanBackup); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBackup - */ -export const ChannelBackup = new ChannelBackup$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MultiChanBackup$Type extends MessageType { - constructor() { - super("lnrpc.MultiChanBackup", [ - { no: 1, name: "chan_points", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelPoint }, - { no: 2, name: "multi_chan_backup", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { chanPoints: [], multiChanBackup: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.ChannelPoint chan_points */ 1: - message.chanPoints.push(ChannelPoint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* bytes multi_chan_backup */ 2: - message.multiChanBackup = 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, writer, options) { - /* repeated lnrpc.ChannelPoint chan_points = 1; */ - for (let i = 0; i < message.chanPoints.length; i++) - ChannelPoint.internalBinaryWrite(message.chanPoints[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bytes multi_chan_backup = 2; */ - if (message.multiChanBackup.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.multiChanBackup); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.MultiChanBackup - */ -export const MultiChanBackup = new MultiChanBackup$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChanBackupExportRequest$Type extends MessageType { - constructor() { - super("lnrpc.ChanBackupExportRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChanBackupExportRequest - */ -export const ChanBackupExportRequest = new ChanBackupExportRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChanBackupSnapshot$Type extends MessageType { - constructor() { - super("lnrpc.ChanBackupSnapshot", [ - { no: 1, name: "single_chan_backups", kind: "message", T: () => ChannelBackups }, - { no: 2, name: "multi_chan_backup", kind: "message", T: () => MultiChanBackup } - ]); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelBackups single_chan_backups */ 1: - message.singleChanBackups = ChannelBackups.internalBinaryRead(reader, reader.uint32(), options, message.singleChanBackups); - break; - case /* lnrpc.MultiChanBackup multi_chan_backup */ 2: - message.multiChanBackup = MultiChanBackup.internalBinaryRead(reader, reader.uint32(), options, message.multiChanBackup); - 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, writer, options) { - /* lnrpc.ChannelBackups single_chan_backups = 1; */ - if (message.singleChanBackups) - ChannelBackups.internalBinaryWrite(message.singleChanBackups, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.MultiChanBackup multi_chan_backup = 2; */ - if (message.multiChanBackup) - MultiChanBackup.internalBinaryWrite(message.multiChanBackup, writer.tag(2, 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.ChanBackupSnapshot - */ -export const ChanBackupSnapshot = new ChanBackupSnapshot$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelBackups$Type extends MessageType { - constructor() { - super("lnrpc.ChannelBackups", [ - { no: 1, name: "chan_backups", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => ChannelBackup } - ]); - } - create(value) { - const message = { chanBackups: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.ChannelBackup chan_backups */ 1: - message.chanBackups.push(ChannelBackup.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, writer, options) { - /* repeated lnrpc.ChannelBackup chan_backups = 1; */ - for (let i = 0; i < message.chanBackups.length; i++) - ChannelBackup.internalBinaryWrite(message.chanBackups[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.ChannelBackups - */ -export const ChannelBackups = new ChannelBackups$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RestoreChanBackupRequest$Type extends MessageType { - constructor() { - super("lnrpc.RestoreChanBackupRequest", [ - { no: 1, name: "chan_backups", kind: "message", oneof: "backup", T: () => ChannelBackups }, - { no: 2, name: "multi_chan_backup", kind: "scalar", oneof: "backup", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { backup: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelBackups chan_backups */ 1: - message.backup = { - oneofKind: "chanBackups", - chanBackups: ChannelBackups.internalBinaryRead(reader, reader.uint32(), options, message.backup.chanBackups) - }; - break; - case /* bytes multi_chan_backup */ 2: - message.backup = { - oneofKind: "multiChanBackup", - multiChanBackup: 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, writer, options) { - /* lnrpc.ChannelBackups chan_backups = 1; */ - if (message.backup.oneofKind === "chanBackups") - ChannelBackups.internalBinaryWrite(message.backup.chanBackups, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bytes multi_chan_backup = 2; */ - if (message.backup.oneofKind === "multiChanBackup") - writer.tag(2, WireType.LengthDelimited).bytes(message.backup.multiChanBackup); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.RestoreChanBackupRequest - */ -export const RestoreChanBackupRequest = new RestoreChanBackupRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RestoreBackupResponse$Type extends MessageType { - constructor() { - super("lnrpc.RestoreBackupResponse", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.RestoreBackupResponse - */ -export const RestoreBackupResponse = new RestoreBackupResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelBackupSubscription$Type extends MessageType { - constructor() { - super("lnrpc.ChannelBackupSubscription", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelBackupSubscription - */ -export const ChannelBackupSubscription = new ChannelBackupSubscription$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class VerifyChanBackupResponse$Type extends MessageType { - constructor() { - super("lnrpc.VerifyChanBackupResponse", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.VerifyChanBackupResponse - */ -export const VerifyChanBackupResponse = new VerifyChanBackupResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MacaroonPermission$Type extends MessageType { - constructor() { - super("lnrpc.MacaroonPermission", [ - { no: 1, name: "entity", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "action", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { entity: "", action: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string entity */ 1: - message.entity = reader.string(); - break; - case /* string action */ 2: - message.action = 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, writer, options) { - /* string entity = 1; */ - if (message.entity !== "") - writer.tag(1, WireType.LengthDelimited).string(message.entity); - /* string action = 2; */ - if (message.action !== "") - writer.tag(2, WireType.LengthDelimited).string(message.action); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.MacaroonPermission - */ -export const MacaroonPermission = new MacaroonPermission$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "allow_external_permissions", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { permissions: [], rootKeyId: 0, allowExternalPermissions: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.MacaroonPermission permissions */ 1: - message.permissions.push(MacaroonPermission.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* uint64 root_key_id */ 2: - message.rootKeyId = reader.uint64().toNumber(); - break; - case /* bool allow_external_permissions */ 3: - message.allowExternalPermissions = 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, writer, options) { - /* repeated lnrpc.MacaroonPermission permissions = 1; */ - 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) - 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.BakeMacaroonRequest - */ -export const BakeMacaroonRequest = new BakeMacaroonRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class BakeMacaroonResponse$Type extends MessageType { - constructor() { - super("lnrpc.BakeMacaroonResponse", [ - { no: 1, name: "macaroon", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { macaroon: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string macaroon */ 1: - message.macaroon = 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, writer, options) { - /* string macaroon = 1; */ - if (message.macaroon !== "") - writer.tag(1, WireType.LengthDelimited).string(message.macaroon); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.BakeMacaroonResponse - */ -export const BakeMacaroonResponse = new BakeMacaroonResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListMacaroonIDsRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListMacaroonIDsRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListMacaroonIDsRequest - */ -export const ListMacaroonIDsRequest = new ListMacaroonIDsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { rootKeyIds: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - 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().toNumber()); - else - message.rootKeyIds.push(reader.uint64().toNumber()); - 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, writer, options) { - /* repeated uint64 root_key_ids = 1; */ - if (message.rootKeyIds.length) { - writer.tag(1, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.rootKeyIds.length; i++) - writer.uint64(message.rootKeyIds[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.ListMacaroonIDsResponse - */ -export const ListMacaroonIDsResponse = new ListMacaroonIDsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteMacaroonIDRequest$Type extends MessageType { - constructor() { - super("lnrpc.DeleteMacaroonIDRequest", [ - { no: 1, name: "root_key_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { rootKeyId: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 root_key_id */ 1: - message.rootKeyId = reader.uint64().toNumber(); - 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, writer, options) { - /* uint64 root_key_id = 1; */ - if (message.rootKeyId !== 0) - writer.tag(1, WireType.Varint).uint64(message.rootKeyId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DeleteMacaroonIDRequest - */ -export const DeleteMacaroonIDRequest = new DeleteMacaroonIDRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteMacaroonIDResponse$Type extends MessageType { - constructor() { - super("lnrpc.DeleteMacaroonIDResponse", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { deleted: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: - message.deleted = 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, writer, options) { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, WireType.Varint).bool(message.deleted); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.DeleteMacaroonIDResponse - */ -export const DeleteMacaroonIDResponse = new DeleteMacaroonIDResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MacaroonPermissionList$Type extends MessageType { - constructor() { - super("lnrpc.MacaroonPermissionList", [ - { no: 1, name: "permissions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MacaroonPermission } - ]); - } - create(value) { - const message = { permissions: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated lnrpc.MacaroonPermission permissions */ 1: - message.permissions.push(MacaroonPermission.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, writer, options) { - /* repeated lnrpc.MacaroonPermission permissions = 1; */ - for (let i = 0; i < message.permissions.length; i++) - MacaroonPermission.internalBinaryWrite(message.permissions[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.MacaroonPermissionList - */ -export const MacaroonPermissionList = new MacaroonPermissionList$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListPermissionsRequest$Type extends MessageType { - constructor() { - super("lnrpc.ListPermissionsRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ListPermissionsRequest - */ -export const ListPermissionsRequest = new ListPermissionsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListPermissionsResponse$Type extends MessageType { - constructor() { - super("lnrpc.ListPermissionsResponse", [ - { no: 1, name: "method_permissions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => MacaroonPermissionList } } - ]); - } - create(value) { - const message = { methodPermissions: {} }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* map method_permissions */ 1: - this.binaryReadMap1(message.methodPermissions, reader, 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; - } - binaryReadMap1(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case 1: - key = reader.string(); - break; - case 2: - val = MacaroonPermissionList.internalBinaryRead(reader, reader.uint32(), options); - break; - default: throw new globalThis.Error("unknown map entry field for field lnrpc.ListPermissionsResponse.method_permissions"); - } - } - map[key ?? ""] = val ?? MacaroonPermissionList.create(); - } - internalBinaryWrite(message, writer, options) { - /* map method_permissions = 1; */ - for (let k of Object.keys(message.methodPermissions)) { - writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); - writer.tag(2, WireType.LengthDelimited).fork(); - MacaroonPermissionList.internalBinaryWrite(message.methodPermissions[k], writer, options); - writer.join().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.ListPermissionsResponse - */ -export const ListPermissionsResponse = new ListPermissionsResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Failure$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/ }, - { no: 8, name: "failure_source_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 9, name: "height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = { code: 0, htlcMsat: 0, 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); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.Failure.FailureCode code */ 1: - message.code = reader.int32(); - break; - case /* lnrpc.ChannelUpdate channel_update */ 3: - message.channelUpdate = ChannelUpdate.internalBinaryRead(reader, reader.uint32(), options, message.channelUpdate); - break; - case /* uint64 htlc_msat */ 4: - message.htlcMsat = reader.uint64().toNumber(); - break; - case /* bytes onion_sha_256 */ 5: - message.onionSha256 = reader.bytes(); - break; - case /* uint32 cltv_expiry */ 6: - message.cltvExpiry = reader.uint32(); - break; - case /* uint32 flags */ 7: - message.flags = reader.uint32(); - break; - case /* uint32 failure_source_index */ 8: - message.failureSourceIndex = reader.uint32(); - break; - case /* uint32 height */ 9: - message.height = reader.uint32(); - 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, writer, options) { - /* lnrpc.Failure.FailureCode code = 1; */ - if (message.code !== 0) - writer.tag(1, WireType.Varint).int32(message.code); - /* lnrpc.ChannelUpdate channel_update = 3; */ - if (message.channelUpdate) - ChannelUpdate.internalBinaryWrite(message.channelUpdate, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - /* uint64 htlc_msat = 4; */ - if (message.htlcMsat !== 0) - writer.tag(4, WireType.Varint).uint64(message.htlcMsat); - /* bytes onion_sha_256 = 5; */ - if (message.onionSha256.length) - writer.tag(5, WireType.LengthDelimited).bytes(message.onionSha256); - /* uint32 cltv_expiry = 6; */ - if (message.cltvExpiry !== 0) - writer.tag(6, WireType.Varint).uint32(message.cltvExpiry); - /* uint32 flags = 7; */ - if (message.flags !== 0) - writer.tag(7, WireType.Varint).uint32(message.flags); - /* uint32 failure_source_index = 8; */ - if (message.failureSourceIndex !== 0) - writer.tag(8, WireType.Varint).uint32(message.failureSourceIndex); - /* uint32 height = 9; */ - if (message.height !== 0) - writer.tag(9, WireType.Varint).uint32(message.height); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.Failure - */ -export const Failure = new Failure$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ChannelUpdate$Type extends MessageType { - constructor() { - super("lnrpc.ChannelUpdate", [ - { no: 1, name: "signature", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "chain_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, - { no: 4, name: "timestamp", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "extra_opaque_data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - 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) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes signature */ 1: - message.signature = reader.bytes(); - break; - case /* bytes chain_hash */ 2: - message.chainHash = reader.bytes(); - break; - case /* uint64 chan_id = 3 [jstype = JS_STRING];*/ 3: - message.chanId = reader.uint64().toString(); - break; - case /* uint32 timestamp */ 4: - message.timestamp = reader.uint32(); - break; - case /* uint32 message_flags */ 10: - message.messageFlags = reader.uint32(); - break; - case /* uint32 channel_flags */ 5: - message.channelFlags = reader.uint32(); - break; - case /* uint32 time_lock_delta */ 6: - message.timeLockDelta = reader.uint32(); - break; - case /* uint64 htlc_minimum_msat */ 7: - message.htlcMinimumMsat = reader.uint64().toNumber(); - break; - case /* uint32 base_fee */ 8: - message.baseFee = reader.uint32(); - break; - case /* uint32 fee_rate */ 9: - message.feeRate = reader.uint32(); - break; - case /* uint64 htlc_maximum_msat */ 11: - message.htlcMaximumMsat = reader.uint64().toNumber(); - break; - case /* bytes extra_opaque_data */ 12: - message.extraOpaqueData = 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, writer, options) { - /* bytes signature = 1; */ - if (message.signature.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.signature); - /* bytes chain_hash = 2; */ - if (message.chainHash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.chainHash); - /* uint64 chan_id = 3 [jstype = JS_STRING]; */ - if (message.chanId !== "0") - writer.tag(3, WireType.Varint).uint64(message.chanId); - /* uint32 timestamp = 4; */ - if (message.timestamp !== 0) - writer.tag(4, WireType.Varint).uint32(message.timestamp); - /* uint32 message_flags = 10; */ - if (message.messageFlags !== 0) - writer.tag(10, WireType.Varint).uint32(message.messageFlags); - /* uint32 channel_flags = 5; */ - if (message.channelFlags !== 0) - writer.tag(5, WireType.Varint).uint32(message.channelFlags); - /* uint32 time_lock_delta = 6; */ - if (message.timeLockDelta !== 0) - writer.tag(6, WireType.Varint).uint32(message.timeLockDelta); - /* uint64 htlc_minimum_msat = 7; */ - if (message.htlcMinimumMsat !== 0) - writer.tag(7, WireType.Varint).uint64(message.htlcMinimumMsat); - /* uint32 base_fee = 8; */ - if (message.baseFee !== 0) - writer.tag(8, WireType.Varint).uint32(message.baseFee); - /* uint32 fee_rate = 9; */ - if (message.feeRate !== 0) - writer.tag(9, WireType.Varint).uint32(message.feeRate); - /* uint64 htlc_maximum_msat = 11; */ - if (message.htlcMaximumMsat !== 0) - writer.tag(11, WireType.Varint).uint64(message.htlcMaximumMsat); - /* bytes extra_opaque_data = 12; */ - if (message.extraOpaqueData.length) - writer.tag(12, WireType.LengthDelimited).bytes(message.extraOpaqueData); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message lnrpc.ChannelUpdate - */ -export const ChannelUpdate = new ChannelUpdate$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MacaroonId$Type extends MessageType { - constructor() { - super("lnrpc.MacaroonId", [ - { no: 1, name: "nonce", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "storageId", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 3, name: "ops", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Op } - ]); - } - create(value) { - const message = { nonce: new Uint8Array(0), storageId: new Uint8Array(0), ops: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes nonce */ 1: - message.nonce = reader.bytes(); - break; - case /* bytes storageId */ 2: - message.storageId = reader.bytes(); - break; - case /* repeated lnrpc.Op ops */ 3: - message.ops.push(Op.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, writer, options) { - /* bytes nonce = 1; */ - if (message.nonce.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.nonce); - /* bytes storageId = 2; */ - if (message.storageId.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.storageId); - /* repeated lnrpc.Op ops = 3; */ - for (let i = 0; i < message.ops.length; i++) - Op.internalBinaryWrite(message.ops[i], 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.MacaroonId - */ -export const MacaroonId = new MacaroonId$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Op$Type extends MessageType { - constructor() { - super("lnrpc.Op", [ - { no: 1, name: "entity", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "actions", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { entity: "", actions: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string entity */ 1: - message.entity = reader.string(); - break; - case /* repeated string actions */ 2: - message.actions.push(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, writer, options) { - /* string entity = 1; */ - if (message.entity !== "") - writer.tag(1, WireType.LengthDelimited).string(message.entity); - /* repeated string actions = 2; */ - for (let i = 0; i < message.actions.length; i++) - writer.tag(2, WireType.LengthDelimited).string(message.actions[i]); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @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) { - 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, length, options, target) { - 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, writer, options) { - /* 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) { - 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, length, options, target) { - 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, writer, options) { - /* 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: 2 /*LongType.NUMBER*/ }, - { 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: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { requestId: 0, rawMacaroon: new Uint8Array(0), customCaveatCondition: "", interceptType: { oneofKind: undefined }, msgId: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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().toNumber(); - 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.streamAuth) - }; - break; - case /* lnrpc.RPCMessage request */ 5: - message.interceptType = { - oneofKind: "request", - request: RPCMessage.internalBinaryRead(reader, reader.uint32(), options, message.interceptType.request) - }; - break; - case /* lnrpc.RPCMessage response */ 6: - message.interceptType = { - oneofKind: "response", - response: RPCMessage.internalBinaryRead(reader, reader.uint32(), options, message.interceptType.response) - }; - break; - case /* bool reg_complete */ 8: - message.interceptType = { - oneofKind: "regComplete", - regComplete: reader.bool() - }; - break; - case /* uint64 msg_id */ 7: - message.msgId = reader.uint64().toNumber(); - 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, writer, options) { - /* uint64 request_id = 1; */ - if (message.requestId !== 0) - 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 !== 0) - 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) { - const message = { methodFullUri: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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, writer, options) { - /* 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) { - 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, length, options, target) { - 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, writer, options) { - /* 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: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "register", kind: "message", oneof: "middlewareMessage", T: () => MiddlewareRegistration }, - { no: 3, name: "feedback", kind: "message", oneof: "middlewareMessage", T: () => InterceptFeedback } - ]); - } - create(value) { - const message = { refMsgId: 0, middlewareMessage: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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().toNumber(); - break; - case /* lnrpc.MiddlewareRegistration register */ 2: - message.middlewareMessage = { - oneofKind: "register", - register: MiddlewareRegistration.internalBinaryRead(reader, reader.uint32(), options, message.middlewareMessage.register) - }; - break; - case /* lnrpc.InterceptFeedback feedback */ 3: - message.middlewareMessage = { - oneofKind: "feedback", - feedback: InterceptFeedback.internalBinaryRead(reader, reader.uint32(), options, message.middlewareMessage.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, writer, options) { - /* uint64 ref_msg_id = 1; */ - if (message.refMsgId !== 0) - 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) { - 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, length, options, target) { - 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, writer, options) { - /* 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) { - 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, length, options, target) { - 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, writer, options) { - /* 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 - */ -export const Lightning = new ServiceType("lnrpc.Lightning", [ - { name: "WalletBalance", options: {}, I: WalletBalanceRequest, O: WalletBalanceResponse }, - { name: "ChannelBalance", options: {}, I: ChannelBalanceRequest, O: ChannelBalanceResponse }, - { name: "GetTransactions", options: {}, I: GetTransactionsRequest, O: TransactionDetails }, - { name: "EstimateFee", options: {}, I: EstimateFeeRequest, O: EstimateFeeResponse }, - { name: "SendCoins", options: {}, I: SendCoinsRequest, O: SendCoinsResponse }, - { name: "ListUnspent", options: {}, I: ListUnspentRequest, O: ListUnspentResponse }, - { name: "SubscribeTransactions", serverStreaming: true, options: {}, I: GetTransactionsRequest, O: Transaction }, - { name: "SendMany", options: {}, I: SendManyRequest, O: SendManyResponse }, - { name: "NewAddress", options: {}, I: NewAddressRequest, O: NewAddressResponse }, - { name: "SignMessage", options: {}, I: SignMessageRequest, O: SignMessageResponse }, - { name: "VerifyMessage", options: {}, I: VerifyMessageRequest, O: VerifyMessageResponse }, - { name: "ConnectPeer", options: {}, I: ConnectPeerRequest, O: ConnectPeerResponse }, - { name: "DisconnectPeer", options: {}, I: DisconnectPeerRequest, O: DisconnectPeerResponse }, - { name: "ListPeers", options: {}, I: ListPeersRequest, O: ListPeersResponse }, - { name: "SubscribePeerEvents", serverStreaming: true, options: {}, I: PeerEventSubscription, O: PeerEvent }, - { name: "GetInfo", options: {}, I: GetInfoRequest, O: GetInfoResponse }, - { name: "GetRecoveryInfo", options: {}, I: GetRecoveryInfoRequest, O: GetRecoveryInfoResponse }, - { name: "PendingChannels", options: {}, I: PendingChannelsRequest, O: PendingChannelsResponse }, - { name: "ListChannels", options: {}, I: ListChannelsRequest, O: ListChannelsResponse }, - { name: "SubscribeChannelEvents", serverStreaming: true, options: {}, I: ChannelEventSubscription, O: ChannelEventUpdate }, - { 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 }, - { name: "AbandonChannel", options: {}, I: AbandonChannelRequest, O: AbandonChannelResponse }, - { name: "SendPayment", serverStreaming: true, clientStreaming: true, options: {}, I: SendRequest, O: SendResponse }, - { name: "SendPaymentSync", options: {}, I: SendRequest, O: SendResponse }, - { name: "SendToRoute", serverStreaming: true, clientStreaming: true, options: {}, I: SendToRouteRequest, O: SendResponse }, - { name: "SendToRouteSync", options: {}, I: SendToRouteRequest, O: SendResponse }, - { name: "AddInvoice", options: {}, I: Invoice, O: AddInvoiceResponse }, - { name: "ListInvoices", options: {}, I: ListInvoiceRequest, O: ListInvoiceResponse }, - { name: "LookupInvoice", options: {}, I: PaymentHash, O: Invoice }, - { 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 }, - { name: "GetChanInfo", options: {}, I: ChanInfoRequest, O: ChannelEdge }, - { name: "GetNodeInfo", options: {}, I: NodeInfoRequest, O: NodeInfo }, - { name: "QueryRoutes", options: {}, I: QueryRoutesRequest, O: QueryRoutesResponse }, - { name: "GetNetworkInfo", options: {}, I: NetworkInfoRequest, O: NetworkInfo }, - { name: "StopDaemon", options: {}, I: StopRequest, O: StopResponse }, - { name: "SubscribeChannelGraph", serverStreaming: true, options: {}, I: GraphTopologySubscription, O: GraphTopologyUpdate }, - { name: "DebugLevel", options: {}, I: DebugLevelRequest, O: DebugLevelResponse }, - { name: "FeeReport", options: {}, I: FeeReportRequest, O: FeeReportResponse }, - { name: "UpdateChannelPolicy", options: {}, I: PolicyUpdateRequest, O: PolicyUpdateResponse }, - { name: "ForwardingHistory", options: {}, I: ForwardingHistoryRequest, O: ForwardingHistoryResponse }, - { name: "ExportChannelBackup", options: {}, I: ExportChannelBackupRequest, O: ChannelBackup }, - { name: "ExportAllChannelBackups", options: {}, I: ChanBackupExportRequest, O: ChanBackupSnapshot }, - { name: "VerifyChanBackup", options: {}, I: ChanBackupSnapshot, O: VerifyChanBackupResponse }, - { name: "RestoreChannelBackups", options: {}, I: RestoreChanBackupRequest, O: RestoreBackupResponse }, - { name: "SubscribeChannelBackups", serverStreaming: true, options: {}, I: ChannelBackupSubscription, O: ChanBackupSnapshot }, - { 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: "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.d.ts b/proto/lnd/router.client.d.ts deleted file mode 100644 index 615290d9..00000000 --- a/proto/lnd/router.client.d.ts +++ /dev/null @@ -1,390 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) -// tslint:disable -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import type { UpdateChanStatusResponse } from "./router"; -import type { UpdateChanStatusRequest } from "./router"; -import type { ForwardHtlcInterceptRequest } from "./router"; -import type { ForwardHtlcInterceptResponse } from "./router"; -import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc"; -import type { PaymentStatus } from "./router"; -import type { HtlcEvent } from "./router"; -import type { SubscribeHtlcEventsRequest } from "./router"; -import type { BuildRouteResponse } from "./router"; -import type { BuildRouteRequest } from "./router"; -import type { QueryProbabilityResponse } from "./router"; -import type { QueryProbabilityRequest } from "./router"; -import type { SetMissionControlConfigResponse } from "./router"; -import type { SetMissionControlConfigRequest } from "./router"; -import type { GetMissionControlConfigResponse } from "./router"; -import type { GetMissionControlConfigRequest } from "./router"; -import type { XImportMissionControlResponse } from "./router"; -import type { XImportMissionControlRequest } from "./router"; -import type { QueryMissionControlResponse } from "./router"; -import type { QueryMissionControlRequest } from "./router"; -import type { ResetMissionControlResponse } from "./router"; -import type { ResetMissionControlRequest } from "./router"; -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 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"; -/** - * Router is a service that offers advanced interaction with the router - * subsystem of the daemon. - * - * @generated from protobuf service routerrpc.Router - */ -export interface IRouterClient { - /** - * - * SendPaymentV2 attempts to route a payment described by the passed - * PaymentRequest to the final destination. The call returns a stream of - * payment updates. - * - * @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment); - */ - sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * TrackPaymentV2 returns an update stream for the payment identified by the - * payment hash. - * - * @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 - * may cost to send an HTLC to the target end destination. - * - * @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse); - */ - estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall; - /** - * - * Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via - * the specified route. This method differs from SendPayment in that it - * allows users to specify a full route manually. This can be used for - * things like rebalancing, and atomic swaps. It differs from the newer - * SendToRouteV2 in that it doesn't return the full HTLC information. - * - * @deprecated - * @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse); - */ - sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; - /** - * - * SendToRouteV2 attempts to make a payment via the specified route. This - * method differs from SendPayment in that it allows users to specify a full - * route manually. This can be used for things like rebalancing, and atomic - * swaps. - * - * @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt); - */ - sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; - /** - * - * ResetMissionControl clears all mission control state and starts with a clean - * slate. - * - * @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse); - */ - resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall; - /** - * - * QueryMissionControl exposes the internal mission control state to callers. - * It is a development feature. - * - * @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse); - */ - queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall; - /** - * - * XImportMissionControl is an experimental API that imports the state provided - * to the internal mission control's state, using all results which are more - * recent than our existing values. These values will only be imported - * in-memory, and will not be persisted across restarts. - * - * @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse); - */ - xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall; - /** - * - * GetMissionControlConfig returns mission control's current config. - * - * @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse); - */ - getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall; - /** - * - * SetMissionControlConfig will set mission control's config, if the config - * provided is valid. - * - * @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse); - */ - setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall; - /** - * - * QueryProbability returns the current success probability estimate for a - * given node pair and amount. - * - * @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse); - */ - queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall; - /** - * - * BuildRoute builds a fully specified route based on a list of hop public - * keys. It retrieves the relevant channel policies from the graph in order to - * calculate the correct fees and time locks. - * - * @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse); - */ - buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeHtlcEvents creates a uni-directional stream from the server to - * the client which delivers a stream of htlc events. - * - * @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent); - */ - subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * Deprecated, use SendPaymentV2. SendPayment attempts to route a payment - * described by the passed PaymentRequest to the final destination. The call - * returns a stream of payment status updates. - * - * @deprecated - * @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus); - */ - sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for - * the payment identified by the payment hash. - * - * @deprecated - * @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus); - */ - trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall; - /** - * * - * HtlcInterceptor dispatches a bi-directional streaming RPC in which - * Forwarded HTLC requests are sent to the client and the client responds with - * a boolean that tells LND if this htlc should be intercepted. - * In case of interception, the htlc can be either settled, cancelled or - * resumed later by using the ResolveHoldForward endpoint. - * - * @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest); - */ - htlcInterceptor(options?: RpcOptions): DuplexStreamingCall; - /** - * - * UpdateChanStatus attempts to manually set the state of a channel - * (enabled, disabled, or auto). A manual "disable" request will cause the - * channel to stay disabled until a subsequent manual request of either - * "enable" or "auto". - * - * @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse); - */ - updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall; -} -/** - * Router is a service that offers advanced interaction with the router - * subsystem of the daemon. - * - * @generated from protobuf service routerrpc.Router - */ -export declare class RouterClient implements IRouterClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * - * SendPaymentV2 attempts to route a payment described by the passed - * PaymentRequest to the final destination. The call returns a stream of - * payment updates. - * - * @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment); - */ - sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * TrackPaymentV2 returns an update stream for the payment identified by the - * payment hash. - * - * @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 - * may cost to send an HTLC to the target end destination. - * - * @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse); - */ - estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall; - /** - * - * Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via - * the specified route. This method differs from SendPayment in that it - * allows users to specify a full route manually. This can be used for - * things like rebalancing, and atomic swaps. It differs from the newer - * SendToRouteV2 in that it doesn't return the full HTLC information. - * - * @deprecated - * @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse); - */ - sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; - /** - * - * SendToRouteV2 attempts to make a payment via the specified route. This - * method differs from SendPayment in that it allows users to specify a full - * route manually. This can be used for things like rebalancing, and atomic - * swaps. - * - * @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt); - */ - sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall; - /** - * - * ResetMissionControl clears all mission control state and starts with a clean - * slate. - * - * @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse); - */ - resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall; - /** - * - * QueryMissionControl exposes the internal mission control state to callers. - * It is a development feature. - * - * @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse); - */ - queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall; - /** - * - * XImportMissionControl is an experimental API that imports the state provided - * to the internal mission control's state, using all results which are more - * recent than our existing values. These values will only be imported - * in-memory, and will not be persisted across restarts. - * - * @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse); - */ - xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall; - /** - * - * GetMissionControlConfig returns mission control's current config. - * - * @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse); - */ - getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall; - /** - * - * SetMissionControlConfig will set mission control's config, if the config - * provided is valid. - * - * @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse); - */ - setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall; - /** - * - * QueryProbability returns the current success probability estimate for a - * given node pair and amount. - * - * @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse); - */ - queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall; - /** - * - * BuildRoute builds a fully specified route based on a list of hop public - * keys. It retrieves the relevant channel policies from the graph in order to - * calculate the correct fees and time locks. - * - * @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse); - */ - buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall; - /** - * - * SubscribeHtlcEvents creates a uni-directional stream from the server to - * the client which delivers a stream of htlc events. - * - * @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent); - */ - subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * Deprecated, use SendPaymentV2. SendPayment attempts to route a payment - * described by the passed PaymentRequest to the final destination. The call - * returns a stream of payment status updates. - * - * @deprecated - * @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus); - */ - sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall; - /** - * - * Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for - * the payment identified by the payment hash. - * - * @deprecated - * @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus); - */ - trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall; - /** - * * - * HtlcInterceptor dispatches a bi-directional streaming RPC in which - * Forwarded HTLC requests are sent to the client and the client responds with - * a boolean that tells LND if this htlc should be intercepted. - * In case of interception, the htlc can be either settled, cancelled or - * resumed later by using the ResolveHoldForward endpoint. - * - * @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest); - */ - htlcInterceptor(options?: RpcOptions): DuplexStreamingCall; - /** - * - * UpdateChanStatus attempts to manually set the state of a channel - * (enabled, disabled, or auto). A manual "disable" request will cause the - * channel to stay disabled until a subsequent manual request of either - * "enable" or "auto". - * - * @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse); - */ - updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall; -} diff --git a/proto/lnd/router.client.js b/proto/lnd/router.client.js deleted file mode 100644 index 578dabab..00000000 --- a/proto/lnd/router.client.js +++ /dev/null @@ -1,238 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) -// tslint:disable -import { Router } from "./router.js"; -import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -/** - * Router is a service that offers advanced interaction with the router - * subsystem of the daemon. - * - * @generated from protobuf service routerrpc.Router - */ -export class RouterClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = Router.typeName; - this.methods = Router.methods; - this.options = Router.options; - } - /** - * - * SendPaymentV2 attempts to route a payment described by the passed - * PaymentRequest to the final destination. The call returns a stream of - * payment updates. - * - * @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment); - */ - sendPaymentV2(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * TrackPaymentV2 returns an update stream for the payment identified by the - * payment hash. - * - * @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment); - */ - trackPaymentV2(input, options) { - 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, options) { - 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 - * may cost to send an HTLC to the target end destination. - * - * @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse); - */ - estimateRouteFee(input, options) { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via - * the specified route. This method differs from SendPayment in that it - * allows users to specify a full route manually. This can be used for - * things like rebalancing, and atomic swaps. It differs from the newer - * SendToRouteV2 in that it doesn't return the full HTLC information. - * - * @deprecated - * @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse); - */ - sendToRoute(input, options) { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SendToRouteV2 attempts to make a payment via the specified route. This - * method differs from SendPayment in that it allows users to specify a full - * route manually. This can be used for things like rebalancing, and atomic - * swaps. - * - * @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt); - */ - sendToRouteV2(input, options) { - const method = this.methods[5], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * ResetMissionControl clears all mission control state and starts with a clean - * slate. - * - * @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse); - */ - resetMissionControl(input, options) { - const method = this.methods[6], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * QueryMissionControl exposes the internal mission control state to callers. - * It is a development feature. - * - * @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse); - */ - queryMissionControl(input, options) { - const method = this.methods[7], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * XImportMissionControl is an experimental API that imports the state provided - * to the internal mission control's state, using all results which are more - * recent than our existing values. These values will only be imported - * in-memory, and will not be persisted across restarts. - * - * @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse); - */ - xImportMissionControl(input, options) { - const method = this.methods[8], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * GetMissionControlConfig returns mission control's current config. - * - * @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse); - */ - getMissionControlConfig(input, options) { - const method = this.methods[9], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SetMissionControlConfig will set mission control's config, if the config - * provided is valid. - * - * @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse); - */ - setMissionControlConfig(input, options) { - const method = this.methods[10], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * QueryProbability returns the current success probability estimate for a - * given node pair and amount. - * - * @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse); - */ - queryProbability(input, options) { - const method = this.methods[11], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * BuildRoute builds a fully specified route based on a list of hop public - * keys. It retrieves the relevant channel policies from the graph in order to - * calculate the correct fees and time locks. - * - * @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse); - */ - buildRoute(input, options) { - const method = this.methods[12], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * - * SubscribeHtlcEvents creates a uni-directional stream from the server to - * the client which delivers a stream of htlc events. - * - * @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent); - */ - subscribeHtlcEvents(input, options) { - const method = this.methods[13], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * Deprecated, use SendPaymentV2. SendPayment attempts to route a payment - * described by the passed PaymentRequest to the final destination. The call - * returns a stream of payment status updates. - * - * @deprecated - * @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus); - */ - sendPayment(input, options) { - const method = this.methods[14], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * - * Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for - * the payment identified by the payment hash. - * - * @deprecated - * @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus); - */ - trackPayment(input, options) { - const method = this.methods[15], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } - /** - * * - * HtlcInterceptor dispatches a bi-directional streaming RPC in which - * Forwarded HTLC requests are sent to the client and the client responds with - * a boolean that tells LND if this htlc should be intercepted. - * In case of interception, the htlc can be either settled, cancelled or - * resumed later by using the ResolveHoldForward endpoint. - * - * @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest); - */ - htlcInterceptor(options) { - const method = this.methods[16], opt = this._transport.mergeOptions(options); - return stackIntercept("duplex", this._transport, method, opt); - } - /** - * - * UpdateChanStatus attempts to manually set the state of a channel - * (enabled, disabled, or auto). A manual "disable" request will cause the - * channel to stay disabled until a subsequent manual request of either - * "enable" or "auto". - * - * @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse); - */ - updateChanStatus(input, 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.client.ts b/proto/lnd/router.client.ts index ed3a38e1..bea1ae0a 100644 --- a/proto/lnd/router.client.ts +++ b/proto/lnd/router.client.ts @@ -3,40 +3,40 @@ // tslint:disable import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import { Router } from "./router"; -import type { UpdateChanStatusResponse } from "./router"; -import type { UpdateChanStatusRequest } from "./router"; -import type { ForwardHtlcInterceptRequest } from "./router"; -import type { ForwardHtlcInterceptResponse } from "./router"; +import { Router } from "./router.js"; +import type { UpdateChanStatusResponse } from "./router.js"; +import type { UpdateChanStatusRequest } from "./router.js"; +import type { ForwardHtlcInterceptRequest } from "./router.js"; +import type { ForwardHtlcInterceptResponse } from "./router.js"; import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc"; -import type { PaymentStatus } from "./router"; -import type { HtlcEvent } from "./router"; -import type { SubscribeHtlcEventsRequest } from "./router"; -import type { BuildRouteResponse } from "./router"; -import type { BuildRouteRequest } from "./router"; -import type { QueryProbabilityResponse } from "./router"; -import type { QueryProbabilityRequest } from "./router"; -import type { SetMissionControlConfigResponse } from "./router"; -import type { SetMissionControlConfigRequest } from "./router"; -import type { GetMissionControlConfigResponse } from "./router"; -import type { GetMissionControlConfigRequest } from "./router"; -import type { XImportMissionControlResponse } from "./router"; -import type { XImportMissionControlRequest } from "./router"; -import type { QueryMissionControlResponse } from "./router"; -import type { QueryMissionControlRequest } from "./router"; -import type { ResetMissionControlResponse } from "./router"; -import type { ResetMissionControlRequest } from "./router"; -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 { PaymentStatus } from "./router.js"; +import type { HtlcEvent } from "./router.js"; +import type { SubscribeHtlcEventsRequest } from "./router.js"; +import type { BuildRouteResponse } from "./router.js"; +import type { BuildRouteRequest } from "./router.js"; +import type { QueryProbabilityResponse } from "./router.js"; +import type { QueryProbabilityRequest } from "./router.js"; +import type { SetMissionControlConfigResponse } from "./router.js"; +import type { SetMissionControlConfigRequest } from "./router.js"; +import type { GetMissionControlConfigResponse } from "./router.js"; +import type { GetMissionControlConfigRequest } from "./router.js"; +import type { XImportMissionControlResponse } from "./router.js"; +import type { XImportMissionControlRequest } from "./router.js"; +import type { QueryMissionControlResponse } from "./router.js"; +import type { QueryMissionControlRequest } from "./router.js"; +import type { ResetMissionControlResponse } from "./router.js"; +import type { ResetMissionControlRequest } from "./router.js"; +import type { HTLCAttempt } from "./lightning.js"; +import type { SendToRouteResponse } from "./router.js"; +import type { SendToRouteRequest } from "./router.js"; +import type { RouteFeeResponse } from "./router.js"; +import type { RouteFeeRequest } from "./router.js"; import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { TrackPaymentsRequest } from "./router"; -import type { TrackPaymentRequest } from "./router"; +import type { TrackPaymentsRequest } from "./router.js"; +import type { TrackPaymentRequest } from "./router.js"; import { stackIntercept } from "@protobuf-ts/runtime-rpc"; -import type { Payment } from "./lightning"; -import type { SendPaymentRequest } from "./router"; +import type { Payment } from "./lightning.js"; +import type { SendPaymentRequest } from "./router.js"; import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; /** diff --git a/proto/lnd/router.d.ts b/proto/lnd/router.d.ts deleted file mode 100644 index 09ea3f39..00000000 --- a/proto/lnd/router.d.ts +++ /dev/null @@ -1,1649 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) -// tslint:disable -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -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 - */ -export interface SendPaymentRequest { - /** - * The identity pubkey of the payment recipient - * - * @generated from protobuf field: bytes dest = 1; - */ - dest: Uint8Array; - /** - * - * Number of satoshis to send. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt = 2; - */ - amt: number; - /** - * - * Number of millisatoshis to send. - * - * The fields amt and amt_msat are mutually exclusive. - * - * @generated from protobuf field: int64 amt_msat = 12; - */ - amtMsat: number; - /** - * The hash to use within the payment's HTLC - * - * @generated from protobuf field: bytes payment_hash = 3; - */ - paymentHash: Uint8Array; - /** - * - * The CLTV delta from the current height that should be used to set the - * timelock for the final hop. - * - * @generated from protobuf field: int32 final_cltv_delta = 4; - */ - finalCltvDelta: number; - /** - * An optional payment addr to be included within the last hop of the route. - * - * @generated from protobuf field: bytes payment_addr = 20; - */ - paymentAddr: Uint8Array; - /** - * - * 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. The amount in the payment request may be zero. In - * that case it is required to set the amt field as well. If no payment request - * is specified, the following fields are required: dest, amt and payment_hash. - * - * @generated from protobuf field: string payment_request = 5; - */ - paymentRequest: string; - /** - * - * An upper limit on the amount of time we should spend when attempting to - * fulfill the payment. This is expressed in seconds. If we cannot make a - * successful payment within this time frame, an error will be returned. - * This field must be non-zero. - * - * @generated from protobuf field: int32 timeout_seconds = 6; - */ - timeoutSeconds: number; - /** - * - * The maximum number of satoshis that will be paid as a fee of the payment. - * If this field is left to the default value of 0, only zero-fee routes will - * be considered. This usually means single hop routes connecting directly to - * the destination. To send the payment without a fee limit, use max int here. - * - * The fields fee_limit_sat and fee_limit_msat are mutually exclusive. - * - * @generated from protobuf field: int64 fee_limit_sat = 7; - */ - feeLimitSat: number; - /** - * - * The maximum number of millisatoshis that will be paid as a fee of the - * payment. If this field is left to the default value of 0, only zero-fee - * routes will be considered. This usually means single hop routes connecting - * directly to the destination. To send the payment without a fee limit, use - * max int here. - * - * The fields fee_limit_sat and fee_limit_msat are mutually exclusive. - * - * @generated from protobuf field: int64 fee_limit_msat = 13; - */ - feeLimitMsat: number; - /** - * - * Deprecated, use outgoing_chan_ids. The channel id of the channel that must - * be taken to the first hop. If zero, any channel may be used (unless - * outgoing_chan_ids are set). - * - * @deprecated - * @generated from protobuf field: uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING]; - */ - outgoingChanId: string; - /** - * - * The channel ids of the channels are allowed for the first hop. If empty, - * any channel may be used. - * - * @generated from protobuf field: repeated uint64 outgoing_chan_ids = 19; - */ - outgoingChanIds: number[]; - /** - * - * The pubkey of the last hop of the route. If empty, any hop may be used. - * - * @generated from protobuf field: bytes last_hop_pubkey = 14; - */ - lastHopPubkey: Uint8Array; - /** - * - * An optional maximum total time lock for the route. This should not exceed - * lnd's `--max-cltv-expiry` setting. If zero, then the value of - * `--max-cltv-expiry` is enforced. - * - * @generated from protobuf field: int32 cltv_limit = 9; - */ - cltvLimit: number; - /** - * - * Optional route hints to reach the destination through private channels. - * - * @generated from protobuf field: repeated lnrpc.RouteHint route_hints = 10; - */ - routeHints: RouteHint[]; - /** - * - * 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. Record types are - * required to be in the custom range >= 65536. When using REST, the values - * must be encoded as base64. - * - * @generated from protobuf field: map dest_custom_records = 11; - */ - destCustomRecords: { - [key: string]: Uint8Array; - }; - /** - * If set, circular payments to self are permitted. - * - * @generated from protobuf field: bool allow_self_payment = 15; - */ - allowSelfPayment: boolean; - /** - * - * Features assumed to be supported by the final node. All transitive feature - * dependencies must also be set properly. For a given feature bit pair, either - * optional or remote may be set, but not both. If this field is nil or empty, - * the router will try to load destination features from the graph as a - * fallback. - * - * @generated from protobuf field: repeated lnrpc.FeatureBit dest_features = 16; - */ - destFeatures: FeatureBit[]; - /** - * - * The maximum number of partial payments that may be use to complete the full - * amount. - * - * @generated from protobuf field: uint32 max_parts = 17; - */ - maxParts: number; - /** - * - * If set, only the final payment update is streamed back. Intermediate updates - * that show which htlcs are still in flight are suppressed. - * - * @generated from protobuf field: bool no_inflight_updates = 18; - */ - noInflightUpdates: boolean; - /** - * - * The largest payment split that should be attempted when making a payment if - * splitting is necessary. Setting this value will effectively cause lnd to - * split more aggressively, vs only when it thinks it needs to. Note that this - * value is in milli-satoshis. - * - * @generated from protobuf field: uint64 max_shard_size_msat = 21; - */ - maxShardSizeMsat: number; - /** - * - * If set, an AMP-payment will be attempted. - * - * @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 - */ -export interface TrackPaymentRequest { - /** - * The hash of the payment to look up. - * - * @generated from protobuf field: bytes payment_hash = 1; - */ - paymentHash: Uint8Array; - /** - * - * If set, only the final payment update is streamed back. Intermediate updates - * that show which htlcs are still in flight are suppressed. - * - * @generated from protobuf field: bool no_inflight_updates = 2; - */ - 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 - */ -export interface RouteFeeRequest { - /** - * - * The destination once wishes to obtain a routing fee quote to. - * - * @generated from protobuf field: bytes dest = 1; - */ - dest: Uint8Array; - /** - * - * The amount one wishes to send to the target destination. - * - * @generated from protobuf field: int64 amt_sat = 2; - */ - amtSat: number; -} -/** - * @generated from protobuf message routerrpc.RouteFeeResponse - */ -export interface RouteFeeResponse { - /** - * - * A lower bound of the estimated fee to the target destination within the - * network, expressed in milli-satoshis. - * - * @generated from protobuf field: int64 routing_fee_msat = 1; - */ - routingFeeMsat: number; - /** - * - * An estimate of the worst case time delay that can occur. Note that callers - * will still need to factor in the final CLTV delta of the last hop into this - * value. - * - * @generated from protobuf field: int64 time_lock_delay = 2; - */ - timeLockDelay: number; -} -/** - * @generated from protobuf message routerrpc.SendToRouteRequest - */ -export interface SendToRouteRequest { - /** - * The payment hash to use for the HTLC. - * - * @generated from protobuf field: bytes payment_hash = 1; - */ - paymentHash: Uint8Array; - /** - * Route that should be used to attempt to complete the payment. - * - * @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 - */ -export interface SendToRouteResponse { - /** - * The preimage obtained by making the payment. - * - * @generated from protobuf field: bytes preimage = 1; - */ - preimage: Uint8Array; - /** - * The failure message in case the payment failed. - * - * @generated from protobuf field: lnrpc.Failure failure = 2; - */ - failure?: Failure; -} -/** - * @generated from protobuf message routerrpc.ResetMissionControlRequest - */ -export interface ResetMissionControlRequest { -} -/** - * @generated from protobuf message routerrpc.ResetMissionControlResponse - */ -export interface ResetMissionControlResponse { -} -/** - * @generated from protobuf message routerrpc.QueryMissionControlRequest - */ -export interface QueryMissionControlRequest { -} -/** - * QueryMissionControlResponse contains mission control state. - * - * @generated from protobuf message routerrpc.QueryMissionControlResponse - */ -export interface QueryMissionControlResponse { - /** - * Node pair-level mission control state. - * - * @generated from protobuf field: repeated routerrpc.PairHistory pairs = 2; - */ - pairs: PairHistory[]; -} -/** - * @generated from protobuf message routerrpc.XImportMissionControlRequest - */ -export interface XImportMissionControlRequest { - /** - * Node pair-level mission control state to be imported. - * - * @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 - */ -export interface XImportMissionControlResponse { -} -/** - * PairHistory contains the mission control state for a particular node pair. - * - * @generated from protobuf message routerrpc.PairHistory - */ -export interface PairHistory { - /** - * The source node pubkey of the pair. - * - * @generated from protobuf field: bytes node_from = 1; - */ - nodeFrom: Uint8Array; - /** - * The destination node pubkey of the pair. - * - * @generated from protobuf field: bytes node_to = 2; - */ - nodeTo: Uint8Array; - /** - * @generated from protobuf field: routerrpc.PairData history = 7; - */ - history?: PairData; -} -/** - * @generated from protobuf message routerrpc.PairData - */ -export interface PairData { - /** - * Time of last failure. - * - * @generated from protobuf field: int64 fail_time = 1; - */ - failTime: number; - /** - * - * Lowest amount that failed to forward rounded to whole sats. This may be - * set to zero if the failure is independent of amount. - * - * @generated from protobuf field: int64 fail_amt_sat = 2; - */ - failAmtSat: number; - /** - * - * Lowest amount that failed to forward in millisats. This may be - * set to zero if the failure is independent of amount. - * - * @generated from protobuf field: int64 fail_amt_msat = 4; - */ - failAmtMsat: number; - /** - * Time of last success. - * - * @generated from protobuf field: int64 success_time = 5; - */ - successTime: number; - /** - * Highest amount that we could successfully forward rounded to whole sats. - * - * @generated from protobuf field: int64 success_amt_sat = 6; - */ - successAmtSat: number; - /** - * Highest amount that we could successfully forward in millisats. - * - * @generated from protobuf field: int64 success_amt_msat = 7; - */ - successAmtMsat: number; -} -/** - * @generated from protobuf message routerrpc.GetMissionControlConfigRequest - */ -export interface GetMissionControlConfigRequest { -} -/** - * @generated from protobuf message routerrpc.GetMissionControlConfigResponse - */ -export interface GetMissionControlConfigResponse { - /** - * - * Mission control's currently active config. - * - * @generated from protobuf field: routerrpc.MissionControlConfig config = 1; - */ - config?: MissionControlConfig; -} -/** - * @generated from protobuf message routerrpc.SetMissionControlConfigRequest - */ -export interface SetMissionControlConfigRequest { - /** - * - * The config to set for mission control. Note that all values *must* be set, - * because the full config will be applied. - * - * @generated from protobuf field: routerrpc.MissionControlConfig config = 1; - */ - config?: MissionControlConfig; -} -/** - * @generated from protobuf message routerrpc.SetMissionControlConfigResponse - */ -export interface SetMissionControlConfigResponse { -} -/** - * @generated from protobuf message routerrpc.MissionControlConfig - */ -export interface MissionControlConfig { - /** - * - * The amount of time mission control will take to restore a penalized node - * or channel back to 50% success probability, expressed in seconds. Setting - * this value to a higher value will penalize failures for longer, making - * mission control less likely to route through nodes and channels that we - * have previously recorded failures for. - * - * @generated from protobuf field: uint64 half_life_seconds = 1; - */ - halfLifeSeconds: number; - /** - * - * The probability of success mission control should assign to hop in a route - * where it has no other information available. Higher values will make mission - * control more willing to try hops that we have no information about, lower - * values will discourage trying these hops. - * - * @generated from protobuf field: float hop_probability = 2; - */ - hopProbability: number; - /** - * - * The importance that mission control should place on historical results, - * expressed as a value in [0;1]. Setting this value to 1 will ignore all - * historical payments and just use the hop probability to assess the - * probability of success for each hop. A zero value ignores hop probability - * completely and relies entirely on historical results, unless none are - * available. - * - * @generated from protobuf field: float weight = 3; - */ - weight: number; - /** - * - * The maximum number of payment results that mission control will store. - * - * @generated from protobuf field: uint32 maximum_payment_results = 4; - */ - maximumPaymentResults: number; - /** - * - * The minimum time that must have passed since the previously recorded failure - * before we raise the failure amount. - * - * @generated from protobuf field: uint64 minimum_failure_relax_interval = 5; - */ - minimumFailureRelaxInterval: number; -} -/** - * @generated from protobuf message routerrpc.QueryProbabilityRequest - */ -export interface QueryProbabilityRequest { - /** - * The source node pubkey of the pair. - * - * @generated from protobuf field: bytes from_node = 1; - */ - fromNode: Uint8Array; - /** - * The destination node pubkey of the pair. - * - * @generated from protobuf field: bytes to_node = 2; - */ - toNode: Uint8Array; - /** - * The amount for which to calculate a probability. - * - * @generated from protobuf field: int64 amt_msat = 3; - */ - amtMsat: number; -} -/** - * @generated from protobuf message routerrpc.QueryProbabilityResponse - */ -export interface QueryProbabilityResponse { - /** - * The success probability for the requested pair. - * - * @generated from protobuf field: double probability = 1; - */ - probability: number; - /** - * The historical data for the requested pair. - * - * @generated from protobuf field: routerrpc.PairData history = 2; - */ - history?: PairData; -} -/** - * @generated from protobuf message routerrpc.BuildRouteRequest - */ -export interface BuildRouteRequest { - /** - * - * The amount to send expressed in msat. If set to zero, the minimum routable - * amount is used. - * - * @generated from protobuf field: int64 amt_msat = 1; - */ - amtMsat: number; - /** - * - * CLTV delta from the current height that should be used for the timelock - * of the final hop - * - * @generated from protobuf field: int32 final_cltv_delta = 2; - */ - finalCltvDelta: number; - /** - * - * The channel id of the channel that must be taken to the first hop. If zero, - * any channel may be used. - * - * @generated from protobuf field: uint64 outgoing_chan_id = 3 [jstype = JS_STRING]; - */ - outgoingChanId: string; - /** - * - * A list of hops that defines the route. This does not include the source hop - * pubkey. - * - * @generated from protobuf field: repeated bytes hop_pubkeys = 4; - */ - hopPubkeys: Uint8Array[]; - /** - * An optional payment addr to be included within the last hop of the route. - * - * @generated from protobuf field: bytes payment_addr = 5; - */ - paymentAddr: Uint8Array; -} -/** - * @generated from protobuf message routerrpc.BuildRouteResponse - */ -export interface BuildRouteResponse { - /** - * - * Fully specified route that can be used to execute the payment. - * - * @generated from protobuf field: lnrpc.Route route = 1; - */ - route?: Route; -} -/** - * @generated from protobuf message routerrpc.SubscribeHtlcEventsRequest - */ -export interface SubscribeHtlcEventsRequest { -} -/** - * - * HtlcEvent contains the htlc event that was processed. These are served on a - * best-effort basis; events are not persisted, delivery is not guaranteed - * (in the event of a crash in the switch, forward events may be lost) and - * some events may be replayed upon restart. Events consumed from this package - * should be de-duplicated by the htlc's unique combination of incoming and - * outgoing channel id and htlc id. [EXPERIMENTAL] - * - * @generated from protobuf message routerrpc.HtlcEvent - */ -export interface HtlcEvent { - /** - * - * The short channel id that the incoming htlc arrived at our node on. This - * value is zero for sends. - * - * @generated from protobuf field: uint64 incoming_channel_id = 1; - */ - incomingChannelId: number; - /** - * - * The short channel id that the outgoing htlc left our node on. This value - * is zero for receives. - * - * @generated from protobuf field: uint64 outgoing_channel_id = 2; - */ - outgoingChannelId: number; - /** - * - * Incoming id is the index of the incoming htlc in the incoming channel. - * This value is zero for sends. - * - * @generated from protobuf field: uint64 incoming_htlc_id = 3; - */ - incomingHtlcId: number; - /** - * - * Outgoing id is the index of the outgoing htlc in the outgoing channel. - * This value is zero for receives. - * - * @generated from protobuf field: uint64 outgoing_htlc_id = 4; - */ - outgoingHtlcId: number; - /** - * - * The time in unix nanoseconds that the event occurred. - * - * @generated from protobuf field: uint64 timestamp_ns = 5; - */ - timestampNs: number; - /** - * - * The event type indicates whether the htlc was part of a send, receive or - * forward. - * - * @generated from protobuf field: routerrpc.HtlcEvent.EventType event_type = 6; - */ - eventType: HtlcEvent_EventType; - /** - * @generated from protobuf oneof: event - */ - event: { - oneofKind: "forwardEvent"; - /** - * @generated from protobuf field: routerrpc.ForwardEvent forward_event = 7; - */ - forwardEvent: ForwardEvent; - } | { - oneofKind: "forwardFailEvent"; - /** - * @generated from protobuf field: routerrpc.ForwardFailEvent forward_fail_event = 8; - */ - forwardFailEvent: ForwardFailEvent; - } | { - oneofKind: "settleEvent"; - /** - * @generated from protobuf field: routerrpc.SettleEvent settle_event = 9; - */ - settleEvent: SettleEvent; - } | { - oneofKind: "linkFailEvent"; - /** - * @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; - }; -} -/** - * @generated from protobuf enum routerrpc.HtlcEvent.EventType - */ -export declare enum HtlcEvent_EventType { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: SEND = 1; - */ - SEND = 1, - /** - * @generated from protobuf enum value: RECEIVE = 2; - */ - RECEIVE = 2, - /** - * @generated from protobuf enum value: FORWARD = 3; - */ - FORWARD = 3 -} -/** - * @generated from protobuf message routerrpc.HtlcInfo - */ -export interface HtlcInfo { - /** - * The timelock on the incoming htlc. - * - * @generated from protobuf field: uint32 incoming_timelock = 1; - */ - incomingTimelock: number; - /** - * The timelock on the outgoing htlc. - * - * @generated from protobuf field: uint32 outgoing_timelock = 2; - */ - outgoingTimelock: number; - /** - * The amount of the incoming htlc. - * - * @generated from protobuf field: uint64 incoming_amt_msat = 3; - */ - incomingAmtMsat: number; - /** - * The amount of the outgoing htlc. - * - * @generated from protobuf field: uint64 outgoing_amt_msat = 4; - */ - outgoingAmtMsat: number; -} -/** - * @generated from protobuf message routerrpc.ForwardEvent - */ -export interface ForwardEvent { - /** - * Info contains details about the htlc that was forwarded. - * - * @generated from protobuf field: routerrpc.HtlcInfo info = 1; - */ - info?: HtlcInfo; -} -/** - * @generated from protobuf message routerrpc.ForwardFailEvent - */ -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 - */ -export interface LinkFailEvent { - /** - * Info contains details about the htlc that we failed. - * - * @generated from protobuf field: routerrpc.HtlcInfo info = 1; - */ - info?: HtlcInfo; - /** - * FailureCode is the BOLT error code for the failure. - * - * @generated from protobuf field: lnrpc.Failure.FailureCode wire_failure = 2; - */ - wireFailure: Failure_FailureCode; - /** - * - * FailureDetail provides additional information about the reason for the - * failure. This detail enriches the information provided by the wire message - * and may be 'no detail' if the wire message requires no additional metadata. - * - * @generated from protobuf field: routerrpc.FailureDetail failure_detail = 3; - */ - failureDetail: FailureDetail; - /** - * A string representation of the link failure. - * - * @generated from protobuf field: string failure_string = 4; - */ - failureString: string; -} -/** - * @generated from protobuf message routerrpc.PaymentStatus - */ -export interface PaymentStatus { - /** - * Current state the payment is in. - * - * @generated from protobuf field: routerrpc.PaymentState state = 1; - */ - state: PaymentState; - /** - * - * The pre-image of the payment when state is SUCCEEDED. - * - * @generated from protobuf field: bytes preimage = 2; - */ - preimage: Uint8Array; - /** - * - * The HTLCs made in attempt to settle the payment [EXPERIMENTAL]. - * - * @generated from protobuf field: repeated lnrpc.HTLCAttempt htlcs = 4; - */ - htlcs: HTLCAttempt[]; -} -/** - * @generated from protobuf message routerrpc.CircuitKey - */ -export interface CircuitKey { - /** - * / The id of the channel that the is part of this circuit. - * - * @generated from protobuf field: uint64 chan_id = 1; - */ - chanId: number; - /** - * / The index of the incoming htlc in the incoming channel. - * - * @generated from protobuf field: uint64 htlc_id = 2; - */ - htlcId: number; -} -/** - * @generated from protobuf message routerrpc.ForwardHtlcInterceptRequest - */ -export interface ForwardHtlcInterceptRequest { - /** - * - * The key of this forwarded htlc. It defines the incoming channel id and - * the index in this channel. - * - * @generated from protobuf field: routerrpc.CircuitKey incoming_circuit_key = 1; - */ - incomingCircuitKey?: CircuitKey; - /** - * The incoming htlc amount. - * - * @generated from protobuf field: uint64 incoming_amount_msat = 5; - */ - incomingAmountMsat: number; - /** - * The incoming htlc expiry. - * - * @generated from protobuf field: uint32 incoming_expiry = 6; - */ - incomingExpiry: number; - /** - * - * The htlc payment hash. This value is not guaranteed to be unique per - * request. - * - * @generated from protobuf field: bytes payment_hash = 2; - */ - paymentHash: Uint8Array; - /** - * The requested outgoing channel id for this forwarded htlc. Because of - * non-strict forwarding, this isn't necessarily the channel over which the - * packet will be forwarded eventually. A different channel to the same peer - * may be selected as well. - * - * @generated from protobuf field: uint64 outgoing_requested_chan_id = 7; - */ - outgoingRequestedChanId: number; - /** - * The outgoing htlc amount. - * - * @generated from protobuf field: uint64 outgoing_amount_msat = 3; - */ - outgoingAmountMsat: number; - /** - * The outgoing htlc expiry. - * - * @generated from protobuf field: uint32 outgoing_expiry = 4; - */ - outgoingExpiry: number; - /** - * Any custom records that were present in the payload. - * - * @generated from protobuf field: map custom_records = 8; - */ - customRecords: { - [key: string]: Uint8Array; - }; - /** - * The onion blob for the next hop - * - * @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; -} -/** - * * - * ForwardHtlcInterceptResponse enables the caller to resolve a previously hold - * forward. The caller can choose either to: - * - `Resume`: Execute the default behavior (usually forward). - * - `Reject`: Fail the htlc backwards. - * - `Settle`: Settle this htlc with a given preimage. - * - * @generated from protobuf message routerrpc.ForwardHtlcInterceptResponse - */ -export interface ForwardHtlcInterceptResponse { - /** - * * - * The key of this forwarded htlc. It defines the incoming channel id and - * the index in this channel. - * - * @generated from protobuf field: routerrpc.CircuitKey incoming_circuit_key = 1; - */ - incomingCircuitKey?: CircuitKey; - /** - * The resolve action for this intercepted htlc. - * - * @generated from protobuf field: routerrpc.ResolveHoldForwardAction action = 2; - */ - action: ResolveHoldForwardAction; - /** - * The preimage in case the resolve action is Settle. - * - * @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 - */ -export interface UpdateChanStatusRequest { - /** - * @generated from protobuf field: lnrpc.ChannelPoint chan_point = 1; - */ - chanPoint?: ChannelPoint; - /** - * @generated from protobuf field: routerrpc.ChanStatusAction action = 2; - */ - action: ChanStatusAction; -} -/** - * @generated from protobuf message routerrpc.UpdateChanStatusResponse - */ -export interface UpdateChanStatusResponse { -} -/** - * @generated from protobuf enum routerrpc.FailureDetail - */ -export declare enum FailureDetail { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - UNKNOWN = 0, - /** - * @generated from protobuf enum value: NO_DETAIL = 1; - */ - NO_DETAIL = 1, - /** - * @generated from protobuf enum value: ONION_DECODE = 2; - */ - ONION_DECODE = 2, - /** - * @generated from protobuf enum value: LINK_NOT_ELIGIBLE = 3; - */ - LINK_NOT_ELIGIBLE = 3, - /** - * @generated from protobuf enum value: ON_CHAIN_TIMEOUT = 4; - */ - ON_CHAIN_TIMEOUT = 4, - /** - * @generated from protobuf enum value: HTLC_EXCEEDS_MAX = 5; - */ - HTLC_EXCEEDS_MAX = 5, - /** - * @generated from protobuf enum value: INSUFFICIENT_BALANCE = 6; - */ - INSUFFICIENT_BALANCE = 6, - /** - * @generated from protobuf enum value: INCOMPLETE_FORWARD = 7; - */ - INCOMPLETE_FORWARD = 7, - /** - * @generated from protobuf enum value: HTLC_ADD_FAILED = 8; - */ - HTLC_ADD_FAILED = 8, - /** - * @generated from protobuf enum value: FORWARDS_DISABLED = 9; - */ - FORWARDS_DISABLED = 9, - /** - * @generated from protobuf enum value: INVOICE_CANCELED = 10; - */ - INVOICE_CANCELED = 10, - /** - * @generated from protobuf enum value: INVOICE_UNDERPAID = 11; - */ - INVOICE_UNDERPAID = 11, - /** - * @generated from protobuf enum value: INVOICE_EXPIRY_TOO_SOON = 12; - */ - INVOICE_EXPIRY_TOO_SOON = 12, - /** - * @generated from protobuf enum value: INVOICE_NOT_OPEN = 13; - */ - INVOICE_NOT_OPEN = 13, - /** - * @generated from protobuf enum value: MPP_INVOICE_TIMEOUT = 14; - */ - MPP_INVOICE_TIMEOUT = 14, - /** - * @generated from protobuf enum value: ADDRESS_MISMATCH = 15; - */ - ADDRESS_MISMATCH = 15, - /** - * @generated from protobuf enum value: SET_TOTAL_MISMATCH = 16; - */ - SET_TOTAL_MISMATCH = 16, - /** - * @generated from protobuf enum value: SET_TOTAL_TOO_LOW = 17; - */ - SET_TOTAL_TOO_LOW = 17, - /** - * @generated from protobuf enum value: SET_OVERPAID = 18; - */ - SET_OVERPAID = 18, - /** - * @generated from protobuf enum value: UNKNOWN_INVOICE = 19; - */ - UNKNOWN_INVOICE = 19, - /** - * @generated from protobuf enum value: INVALID_KEYSEND = 20; - */ - INVALID_KEYSEND = 20, - /** - * @generated from protobuf enum value: MPP_IN_PROGRESS = 21; - */ - MPP_IN_PROGRESS = 21, - /** - * @generated from protobuf enum value: CIRCULAR_ROUTE = 22; - */ - CIRCULAR_ROUTE = 22 -} -/** - * @generated from protobuf enum routerrpc.PaymentState - */ -export declare enum PaymentState { - /** - * - * Payment is still in flight. - * - * @generated from protobuf enum value: IN_FLIGHT = 0; - */ - IN_FLIGHT = 0, - /** - * - * Payment completed successfully. - * - * @generated from protobuf enum value: SUCCEEDED = 1; - */ - SUCCEEDED = 1, - /** - * - * There are more routes to try, but the payment timeout was exceeded. - * - * @generated from protobuf enum value: FAILED_TIMEOUT = 2; - */ - FAILED_TIMEOUT = 2, - /** - * - * All possible routes were tried and failed permanently. Or were no - * routes to the destination at all. - * - * @generated from protobuf enum value: FAILED_NO_ROUTE = 3; - */ - FAILED_NO_ROUTE = 3, - /** - * - * A non-recoverable error has occurred. - * - * @generated from protobuf enum value: FAILED_ERROR = 4; - */ - FAILED_ERROR = 4, - /** - * - * Payment details incorrect (unknown hash, invalid amt or - * invalid final cltv delta) - * - * @generated from protobuf enum value: FAILED_INCORRECT_PAYMENT_DETAILS = 5; - */ - FAILED_INCORRECT_PAYMENT_DETAILS = 5, - /** - * - * Insufficient local balance. - * - * @generated from protobuf enum value: FAILED_INSUFFICIENT_BALANCE = 6; - */ - FAILED_INSUFFICIENT_BALANCE = 6 -} -/** - * @generated from protobuf enum routerrpc.ResolveHoldForwardAction - */ -export declare enum ResolveHoldForwardAction { - /** - * @generated from protobuf enum value: SETTLE = 0; - */ - SETTLE = 0, - /** - * @generated from protobuf enum value: FAIL = 1; - */ - FAIL = 1, - /** - * @generated from protobuf enum value: RESUME = 2; - */ - RESUME = 2 -} -/** - * @generated from protobuf enum routerrpc.ChanStatusAction - */ -export declare enum ChanStatusAction { - /** - * @generated from protobuf enum value: ENABLE = 0; - */ - ENABLE = 0, - /** - * @generated from protobuf enum value: DISABLE = 1; - */ - DISABLE = 1, - /** - * @generated from protobuf enum value: AUTO = 2; - */ - AUTO = 2 -} -declare class SendPaymentRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendPaymentRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendPaymentRequest): SendPaymentRequest; - private binaryReadMap11; - internalBinaryWrite(message: SendPaymentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.SendPaymentRequest - */ -export declare const SendPaymentRequest: SendPaymentRequest$Type; -declare class TrackPaymentRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): TrackPaymentRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackPaymentRequest): TrackPaymentRequest; - internalBinaryWrite(message: TrackPaymentRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.TrackPaymentRequest - */ -export declare const TrackPaymentRequest: TrackPaymentRequest$Type; -declare class TrackPaymentsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): TrackPaymentsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackPaymentsRequest): TrackPaymentsRequest; - internalBinaryWrite(message: TrackPaymentsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.TrackPaymentsRequest - */ -export declare const TrackPaymentsRequest: TrackPaymentsRequest$Type; -declare class RouteFeeRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RouteFeeRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RouteFeeRequest): RouteFeeRequest; - internalBinaryWrite(message: RouteFeeRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.RouteFeeRequest - */ -export declare const RouteFeeRequest: RouteFeeRequest$Type; -declare class RouteFeeResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RouteFeeResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RouteFeeResponse): RouteFeeResponse; - internalBinaryWrite(message: RouteFeeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.RouteFeeResponse - */ -export declare const RouteFeeResponse: RouteFeeResponse$Type; -declare class SendToRouteRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendToRouteRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendToRouteRequest): SendToRouteRequest; - internalBinaryWrite(message: SendToRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.SendToRouteRequest - */ -export declare const SendToRouteRequest: SendToRouteRequest$Type; -declare class SendToRouteResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendToRouteResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendToRouteResponse): SendToRouteResponse; - internalBinaryWrite(message: SendToRouteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.SendToRouteResponse - */ -export declare const SendToRouteResponse: SendToRouteResponse$Type; -declare class ResetMissionControlRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ResetMissionControlRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResetMissionControlRequest): ResetMissionControlRequest; - internalBinaryWrite(message: ResetMissionControlRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.ResetMissionControlRequest - */ -export declare const ResetMissionControlRequest: ResetMissionControlRequest$Type; -declare class ResetMissionControlResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ResetMissionControlResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResetMissionControlResponse): ResetMissionControlResponse; - internalBinaryWrite(message: ResetMissionControlResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.ResetMissionControlResponse - */ -export declare const ResetMissionControlResponse: ResetMissionControlResponse$Type; -declare class QueryMissionControlRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): QueryMissionControlRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryMissionControlRequest): QueryMissionControlRequest; - internalBinaryWrite(message: QueryMissionControlRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.QueryMissionControlRequest - */ -export declare const QueryMissionControlRequest: QueryMissionControlRequest$Type; -declare class QueryMissionControlResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): QueryMissionControlResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryMissionControlResponse): QueryMissionControlResponse; - internalBinaryWrite(message: QueryMissionControlResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.QueryMissionControlResponse - */ -export declare const QueryMissionControlResponse: QueryMissionControlResponse$Type; -declare class XImportMissionControlRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): XImportMissionControlRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: XImportMissionControlRequest): XImportMissionControlRequest; - internalBinaryWrite(message: XImportMissionControlRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.XImportMissionControlRequest - */ -export declare const XImportMissionControlRequest: XImportMissionControlRequest$Type; -declare class XImportMissionControlResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): XImportMissionControlResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: XImportMissionControlResponse): XImportMissionControlResponse; - internalBinaryWrite(message: XImportMissionControlResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.XImportMissionControlResponse - */ -export declare const XImportMissionControlResponse: XImportMissionControlResponse$Type; -declare class PairHistory$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PairHistory; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PairHistory): PairHistory; - internalBinaryWrite(message: PairHistory, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.PairHistory - */ -export declare const PairHistory: PairHistory$Type; -declare class PairData$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PairData; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PairData): PairData; - internalBinaryWrite(message: PairData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.PairData - */ -export declare const PairData: PairData$Type; -declare class GetMissionControlConfigRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetMissionControlConfigRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetMissionControlConfigRequest): GetMissionControlConfigRequest; - internalBinaryWrite(message: GetMissionControlConfigRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.GetMissionControlConfigRequest - */ -export declare const GetMissionControlConfigRequest: GetMissionControlConfigRequest$Type; -declare class GetMissionControlConfigResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetMissionControlConfigResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetMissionControlConfigResponse): GetMissionControlConfigResponse; - internalBinaryWrite(message: GetMissionControlConfigResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.GetMissionControlConfigResponse - */ -export declare const GetMissionControlConfigResponse: GetMissionControlConfigResponse$Type; -declare class SetMissionControlConfigRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SetMissionControlConfigRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetMissionControlConfigRequest): SetMissionControlConfigRequest; - internalBinaryWrite(message: SetMissionControlConfigRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.SetMissionControlConfigRequest - */ -export declare const SetMissionControlConfigRequest: SetMissionControlConfigRequest$Type; -declare class SetMissionControlConfigResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SetMissionControlConfigResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetMissionControlConfigResponse): SetMissionControlConfigResponse; - internalBinaryWrite(message: SetMissionControlConfigResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.SetMissionControlConfigResponse - */ -export declare const SetMissionControlConfigResponse: SetMissionControlConfigResponse$Type; -declare class MissionControlConfig$Type extends MessageType { - constructor(); - create(value?: PartialMessage): MissionControlConfig; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MissionControlConfig): MissionControlConfig; - internalBinaryWrite(message: MissionControlConfig, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.MissionControlConfig - */ -export declare const MissionControlConfig: MissionControlConfig$Type; -declare class QueryProbabilityRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): QueryProbabilityRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryProbabilityRequest): QueryProbabilityRequest; - internalBinaryWrite(message: QueryProbabilityRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.QueryProbabilityRequest - */ -export declare const QueryProbabilityRequest: QueryProbabilityRequest$Type; -declare class QueryProbabilityResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): QueryProbabilityResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryProbabilityResponse): QueryProbabilityResponse; - internalBinaryWrite(message: QueryProbabilityResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.QueryProbabilityResponse - */ -export declare const QueryProbabilityResponse: QueryProbabilityResponse$Type; -declare class BuildRouteRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): BuildRouteRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BuildRouteRequest): BuildRouteRequest; - internalBinaryWrite(message: BuildRouteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.BuildRouteRequest - */ -export declare const BuildRouteRequest: BuildRouteRequest$Type; -declare class BuildRouteResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): BuildRouteResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BuildRouteResponse): BuildRouteResponse; - internalBinaryWrite(message: BuildRouteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.BuildRouteResponse - */ -export declare const BuildRouteResponse: BuildRouteResponse$Type; -declare class SubscribeHtlcEventsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SubscribeHtlcEventsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribeHtlcEventsRequest): SubscribeHtlcEventsRequest; - internalBinaryWrite(message: SubscribeHtlcEventsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.SubscribeHtlcEventsRequest - */ -export declare const SubscribeHtlcEventsRequest: SubscribeHtlcEventsRequest$Type; -declare class HtlcEvent$Type extends MessageType { - constructor(); - create(value?: PartialMessage): HtlcEvent; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HtlcEvent): HtlcEvent; - internalBinaryWrite(message: HtlcEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.HtlcEvent - */ -export declare const HtlcEvent: HtlcEvent$Type; -declare class HtlcInfo$Type extends MessageType { - constructor(); - create(value?: PartialMessage): HtlcInfo; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HtlcInfo): HtlcInfo; - internalBinaryWrite(message: HtlcInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.HtlcInfo - */ -export declare const HtlcInfo: HtlcInfo$Type; -declare class ForwardEvent$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ForwardEvent; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardEvent): ForwardEvent; - internalBinaryWrite(message: ForwardEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.ForwardEvent - */ -export declare const ForwardEvent: ForwardEvent$Type; -declare class ForwardFailEvent$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ForwardFailEvent; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardFailEvent): ForwardFailEvent; - internalBinaryWrite(message: ForwardFailEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.ForwardFailEvent - */ -export declare const ForwardFailEvent: ForwardFailEvent$Type; -declare class SettleEvent$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SettleEvent; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SettleEvent): SettleEvent; - internalBinaryWrite(message: SettleEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.SettleEvent - */ -export declare const SettleEvent: SettleEvent$Type; -declare class FinalHtlcEvent$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FinalHtlcEvent; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FinalHtlcEvent): FinalHtlcEvent; - internalBinaryWrite(message: FinalHtlcEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.FinalHtlcEvent - */ -export declare const FinalHtlcEvent: FinalHtlcEvent$Type; -declare class SubscribedEvent$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SubscribedEvent; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubscribedEvent): SubscribedEvent; - internalBinaryWrite(message: SubscribedEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.SubscribedEvent - */ -export declare const SubscribedEvent: SubscribedEvent$Type; -declare class LinkFailEvent$Type extends MessageType { - constructor(); - create(value?: PartialMessage): LinkFailEvent; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LinkFailEvent): LinkFailEvent; - internalBinaryWrite(message: LinkFailEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.LinkFailEvent - */ -export declare const LinkFailEvent: LinkFailEvent$Type; -declare class PaymentStatus$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PaymentStatus; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PaymentStatus): PaymentStatus; - internalBinaryWrite(message: PaymentStatus, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.PaymentStatus - */ -export declare const PaymentStatus: PaymentStatus$Type; -declare class CircuitKey$Type extends MessageType { - constructor(); - create(value?: PartialMessage): CircuitKey; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CircuitKey): CircuitKey; - internalBinaryWrite(message: CircuitKey, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.CircuitKey - */ -export declare const CircuitKey: CircuitKey$Type; -declare class ForwardHtlcInterceptRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ForwardHtlcInterceptRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardHtlcInterceptRequest): ForwardHtlcInterceptRequest; - private binaryReadMap8; - internalBinaryWrite(message: ForwardHtlcInterceptRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.ForwardHtlcInterceptRequest - */ -export declare const ForwardHtlcInterceptRequest: ForwardHtlcInterceptRequest$Type; -declare class ForwardHtlcInterceptResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ForwardHtlcInterceptResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForwardHtlcInterceptResponse): ForwardHtlcInterceptResponse; - internalBinaryWrite(message: ForwardHtlcInterceptResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.ForwardHtlcInterceptResponse - */ -export declare const ForwardHtlcInterceptResponse: ForwardHtlcInterceptResponse$Type; -declare class UpdateChanStatusRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateChanStatusRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateChanStatusRequest): UpdateChanStatusRequest; - internalBinaryWrite(message: UpdateChanStatusRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.UpdateChanStatusRequest - */ -export declare const UpdateChanStatusRequest: UpdateChanStatusRequest$Type; -declare class UpdateChanStatusResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateChanStatusResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateChanStatusResponse): UpdateChanStatusResponse; - internalBinaryWrite(message: UpdateChanStatusResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message routerrpc.UpdateChanStatusResponse - */ -export declare const UpdateChanStatusResponse: UpdateChanStatusResponse$Type; -/** - * @generated ServiceType for protobuf service routerrpc.Router - */ -export declare const Router: any; -export {}; diff --git a/proto/lnd/router.js b/proto/lnd/router.js deleted file mode 100644 index de199014..00000000 --- a/proto/lnd/router.js +++ /dev/null @@ -1,2519 +0,0 @@ -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) -// tslint:disable -// @generated by protobuf-ts 2.8.1 with parameter long_type_number,output_javascript -// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) -// tslint:disable -import { Payment } from "./lightning.js"; -import { ServiceType } from "@protobuf-ts/runtime-rpc"; -import { UnknownFieldHandler } from "@protobuf-ts/runtime"; -import { WireType } 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 "./lightning.js"; -import { HTLCAttempt } from "./lightning.js"; -import { Failure_FailureCode } from "./lightning.js"; -import { Failure } from "./lightning.js"; -import { Route } from "./lightning.js"; -import { FeatureBit } from "./lightning.js"; -import { RouteHint } from "./lightning.js"; -/** - * @generated from protobuf enum routerrpc.HtlcEvent.EventType - */ -export var HtlcEvent_EventType; -(function (HtlcEvent_EventType) { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - HtlcEvent_EventType[HtlcEvent_EventType["UNKNOWN"] = 0] = "UNKNOWN"; - /** - * @generated from protobuf enum value: SEND = 1; - */ - HtlcEvent_EventType[HtlcEvent_EventType["SEND"] = 1] = "SEND"; - /** - * @generated from protobuf enum value: RECEIVE = 2; - */ - HtlcEvent_EventType[HtlcEvent_EventType["RECEIVE"] = 2] = "RECEIVE"; - /** - * @generated from protobuf enum value: FORWARD = 3; - */ - HtlcEvent_EventType[HtlcEvent_EventType["FORWARD"] = 3] = "FORWARD"; -})(HtlcEvent_EventType || (HtlcEvent_EventType = {})); -/** - * @generated from protobuf enum routerrpc.FailureDetail - */ -export var FailureDetail; -(function (FailureDetail) { - /** - * @generated from protobuf enum value: UNKNOWN = 0; - */ - FailureDetail[FailureDetail["UNKNOWN"] = 0] = "UNKNOWN"; - /** - * @generated from protobuf enum value: NO_DETAIL = 1; - */ - FailureDetail[FailureDetail["NO_DETAIL"] = 1] = "NO_DETAIL"; - /** - * @generated from protobuf enum value: ONION_DECODE = 2; - */ - FailureDetail[FailureDetail["ONION_DECODE"] = 2] = "ONION_DECODE"; - /** - * @generated from protobuf enum value: LINK_NOT_ELIGIBLE = 3; - */ - FailureDetail[FailureDetail["LINK_NOT_ELIGIBLE"] = 3] = "LINK_NOT_ELIGIBLE"; - /** - * @generated from protobuf enum value: ON_CHAIN_TIMEOUT = 4; - */ - FailureDetail[FailureDetail["ON_CHAIN_TIMEOUT"] = 4] = "ON_CHAIN_TIMEOUT"; - /** - * @generated from protobuf enum value: HTLC_EXCEEDS_MAX = 5; - */ - FailureDetail[FailureDetail["HTLC_EXCEEDS_MAX"] = 5] = "HTLC_EXCEEDS_MAX"; - /** - * @generated from protobuf enum value: INSUFFICIENT_BALANCE = 6; - */ - FailureDetail[FailureDetail["INSUFFICIENT_BALANCE"] = 6] = "INSUFFICIENT_BALANCE"; - /** - * @generated from protobuf enum value: INCOMPLETE_FORWARD = 7; - */ - FailureDetail[FailureDetail["INCOMPLETE_FORWARD"] = 7] = "INCOMPLETE_FORWARD"; - /** - * @generated from protobuf enum value: HTLC_ADD_FAILED = 8; - */ - FailureDetail[FailureDetail["HTLC_ADD_FAILED"] = 8] = "HTLC_ADD_FAILED"; - /** - * @generated from protobuf enum value: FORWARDS_DISABLED = 9; - */ - FailureDetail[FailureDetail["FORWARDS_DISABLED"] = 9] = "FORWARDS_DISABLED"; - /** - * @generated from protobuf enum value: INVOICE_CANCELED = 10; - */ - FailureDetail[FailureDetail["INVOICE_CANCELED"] = 10] = "INVOICE_CANCELED"; - /** - * @generated from protobuf enum value: INVOICE_UNDERPAID = 11; - */ - FailureDetail[FailureDetail["INVOICE_UNDERPAID"] = 11] = "INVOICE_UNDERPAID"; - /** - * @generated from protobuf enum value: INVOICE_EXPIRY_TOO_SOON = 12; - */ - FailureDetail[FailureDetail["INVOICE_EXPIRY_TOO_SOON"] = 12] = "INVOICE_EXPIRY_TOO_SOON"; - /** - * @generated from protobuf enum value: INVOICE_NOT_OPEN = 13; - */ - FailureDetail[FailureDetail["INVOICE_NOT_OPEN"] = 13] = "INVOICE_NOT_OPEN"; - /** - * @generated from protobuf enum value: MPP_INVOICE_TIMEOUT = 14; - */ - FailureDetail[FailureDetail["MPP_INVOICE_TIMEOUT"] = 14] = "MPP_INVOICE_TIMEOUT"; - /** - * @generated from protobuf enum value: ADDRESS_MISMATCH = 15; - */ - FailureDetail[FailureDetail["ADDRESS_MISMATCH"] = 15] = "ADDRESS_MISMATCH"; - /** - * @generated from protobuf enum value: SET_TOTAL_MISMATCH = 16; - */ - FailureDetail[FailureDetail["SET_TOTAL_MISMATCH"] = 16] = "SET_TOTAL_MISMATCH"; - /** - * @generated from protobuf enum value: SET_TOTAL_TOO_LOW = 17; - */ - FailureDetail[FailureDetail["SET_TOTAL_TOO_LOW"] = 17] = "SET_TOTAL_TOO_LOW"; - /** - * @generated from protobuf enum value: SET_OVERPAID = 18; - */ - FailureDetail[FailureDetail["SET_OVERPAID"] = 18] = "SET_OVERPAID"; - /** - * @generated from protobuf enum value: UNKNOWN_INVOICE = 19; - */ - FailureDetail[FailureDetail["UNKNOWN_INVOICE"] = 19] = "UNKNOWN_INVOICE"; - /** - * @generated from protobuf enum value: INVALID_KEYSEND = 20; - */ - FailureDetail[FailureDetail["INVALID_KEYSEND"] = 20] = "INVALID_KEYSEND"; - /** - * @generated from protobuf enum value: MPP_IN_PROGRESS = 21; - */ - FailureDetail[FailureDetail["MPP_IN_PROGRESS"] = 21] = "MPP_IN_PROGRESS"; - /** - * @generated from protobuf enum value: CIRCULAR_ROUTE = 22; - */ - FailureDetail[FailureDetail["CIRCULAR_ROUTE"] = 22] = "CIRCULAR_ROUTE"; -})(FailureDetail || (FailureDetail = {})); -/** - * @generated from protobuf enum routerrpc.PaymentState - */ -export var PaymentState; -(function (PaymentState) { - /** - * - * Payment is still in flight. - * - * @generated from protobuf enum value: IN_FLIGHT = 0; - */ - PaymentState[PaymentState["IN_FLIGHT"] = 0] = "IN_FLIGHT"; - /** - * - * Payment completed successfully. - * - * @generated from protobuf enum value: SUCCEEDED = 1; - */ - PaymentState[PaymentState["SUCCEEDED"] = 1] = "SUCCEEDED"; - /** - * - * There are more routes to try, but the payment timeout was exceeded. - * - * @generated from protobuf enum value: FAILED_TIMEOUT = 2; - */ - PaymentState[PaymentState["FAILED_TIMEOUT"] = 2] = "FAILED_TIMEOUT"; - /** - * - * All possible routes were tried and failed permanently. Or were no - * routes to the destination at all. - * - * @generated from protobuf enum value: FAILED_NO_ROUTE = 3; - */ - PaymentState[PaymentState["FAILED_NO_ROUTE"] = 3] = "FAILED_NO_ROUTE"; - /** - * - * A non-recoverable error has occurred. - * - * @generated from protobuf enum value: FAILED_ERROR = 4; - */ - PaymentState[PaymentState["FAILED_ERROR"] = 4] = "FAILED_ERROR"; - /** - * - * Payment details incorrect (unknown hash, invalid amt or - * invalid final cltv delta) - * - * @generated from protobuf enum value: FAILED_INCORRECT_PAYMENT_DETAILS = 5; - */ - PaymentState[PaymentState["FAILED_INCORRECT_PAYMENT_DETAILS"] = 5] = "FAILED_INCORRECT_PAYMENT_DETAILS"; - /** - * - * Insufficient local balance. - * - * @generated from protobuf enum value: FAILED_INSUFFICIENT_BALANCE = 6; - */ - PaymentState[PaymentState["FAILED_INSUFFICIENT_BALANCE"] = 6] = "FAILED_INSUFFICIENT_BALANCE"; -})(PaymentState || (PaymentState = {})); -/** - * @generated from protobuf enum routerrpc.ResolveHoldForwardAction - */ -export var ResolveHoldForwardAction; -(function (ResolveHoldForwardAction) { - /** - * @generated from protobuf enum value: SETTLE = 0; - */ - ResolveHoldForwardAction[ResolveHoldForwardAction["SETTLE"] = 0] = "SETTLE"; - /** - * @generated from protobuf enum value: FAIL = 1; - */ - ResolveHoldForwardAction[ResolveHoldForwardAction["FAIL"] = 1] = "FAIL"; - /** - * @generated from protobuf enum value: RESUME = 2; - */ - ResolveHoldForwardAction[ResolveHoldForwardAction["RESUME"] = 2] = "RESUME"; -})(ResolveHoldForwardAction || (ResolveHoldForwardAction = {})); -/** - * @generated from protobuf enum routerrpc.ChanStatusAction - */ -export var ChanStatusAction; -(function (ChanStatusAction) { - /** - * @generated from protobuf enum value: ENABLE = 0; - */ - ChanStatusAction[ChanStatusAction["ENABLE"] = 0] = "ENABLE"; - /** - * @generated from protobuf enum value: DISABLE = 1; - */ - ChanStatusAction[ChanStatusAction["DISABLE"] = 1] = "DISABLE"; - /** - * @generated from protobuf enum value: AUTO = 2; - */ - ChanStatusAction[ChanStatusAction["AUTO"] = 2] = "AUTO"; -})(ChanStatusAction || (ChanStatusAction = {})); -// @generated message type with reflection information, may provide speed optimized methods -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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 12, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 13, name: "fee_limit_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { 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 }, - { no: 11, name: "dest_custom_records", kind: "map", K: 4 /*ScalarType.UINT64*/, V: { kind: "scalar", T: 12 /*ScalarType.BYTES*/ } }, - { no: 15, name: "allow_self_payment", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 22, name: "amp", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 23, name: "time_pref", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } - ]); - } - create(value) { - 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, timePref: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes dest */ 1: - message.dest = reader.bytes(); - break; - case /* int64 amt */ 2: - message.amt = reader.int64().toNumber(); - break; - case /* int64 amt_msat */ 12: - message.amtMsat = reader.int64().toNumber(); - break; - case /* bytes payment_hash */ 3: - message.paymentHash = reader.bytes(); - break; - case /* int32 final_cltv_delta */ 4: - message.finalCltvDelta = reader.int32(); - break; - case /* bytes payment_addr */ 20: - message.paymentAddr = reader.bytes(); - break; - case /* string payment_request */ 5: - message.paymentRequest = reader.string(); - break; - case /* int32 timeout_seconds */ 6: - message.timeoutSeconds = reader.int32(); - break; - case /* int64 fee_limit_sat */ 7: - message.feeLimitSat = reader.int64().toNumber(); - break; - case /* int64 fee_limit_msat */ 13: - message.feeLimitMsat = reader.int64().toNumber(); - break; - case /* uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING];*/ 8: - message.outgoingChanId = reader.uint64().toString(); - break; - 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().toNumber()); - else - message.outgoingChanIds.push(reader.uint64().toNumber()); - break; - case /* bytes last_hop_pubkey */ 14: - message.lastHopPubkey = reader.bytes(); - break; - case /* int32 cltv_limit */ 9: - message.cltvLimit = reader.int32(); - break; - case /* repeated lnrpc.RouteHint route_hints */ 10: - message.routeHints.push(RouteHint.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* map dest_custom_records */ 11: - this.binaryReadMap11(message.destCustomRecords, reader, options); - break; - case /* bool allow_self_payment */ 15: - message.allowSelfPayment = reader.bool(); - break; - case /* repeated lnrpc.FeatureBit dest_features */ 16: - if (wireType === WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.destFeatures.push(reader.int32()); - else - message.destFeatures.push(reader.int32()); - break; - case /* uint32 max_parts */ 17: - message.maxParts = reader.uint32(); - break; - case /* bool no_inflight_updates */ 18: - message.noInflightUpdates = reader.bool(); - break; - case /* uint64 max_shard_size_msat */ 21: - message.maxShardSizeMsat = reader.uint64().toNumber(); - 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") - 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; - } - binaryReadMap11(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - 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 routerrpc.SendPaymentRequest.dest_custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message, writer, options) { - /* bytes dest = 1; */ - if (message.dest.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.dest); - /* int64 amt = 2; */ - if (message.amt !== 0) - writer.tag(2, WireType.Varint).int64(message.amt); - /* int64 amt_msat = 12; */ - if (message.amtMsat !== 0) - writer.tag(12, WireType.Varint).int64(message.amtMsat); - /* bytes payment_hash = 3; */ - if (message.paymentHash.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.paymentHash); - /* int32 final_cltv_delta = 4; */ - if (message.finalCltvDelta !== 0) - writer.tag(4, WireType.Varint).int32(message.finalCltvDelta); - /* bytes payment_addr = 20; */ - if (message.paymentAddr.length) - writer.tag(20, WireType.LengthDelimited).bytes(message.paymentAddr); - /* string payment_request = 5; */ - if (message.paymentRequest !== "") - writer.tag(5, WireType.LengthDelimited).string(message.paymentRequest); - /* int32 timeout_seconds = 6; */ - if (message.timeoutSeconds !== 0) - writer.tag(6, WireType.Varint).int32(message.timeoutSeconds); - /* int64 fee_limit_sat = 7; */ - if (message.feeLimitSat !== 0) - writer.tag(7, WireType.Varint).int64(message.feeLimitSat); - /* int64 fee_limit_msat = 13; */ - if (message.feeLimitMsat !== 0) - writer.tag(13, WireType.Varint).int64(message.feeLimitMsat); - /* uint64 outgoing_chan_id = 8 [deprecated = true, jstype = JS_STRING]; */ - if (message.outgoingChanId !== "0") - writer.tag(8, WireType.Varint).uint64(message.outgoingChanId); - /* repeated uint64 outgoing_chan_ids = 19; */ - if (message.outgoingChanIds.length) { - writer.tag(19, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.outgoingChanIds.length; i++) - writer.uint64(message.outgoingChanIds[i]); - writer.join(); - } - /* bytes last_hop_pubkey = 14; */ - if (message.lastHopPubkey.length) - writer.tag(14, WireType.LengthDelimited).bytes(message.lastHopPubkey); - /* int32 cltv_limit = 9; */ - if (message.cltvLimit !== 0) - writer.tag(9, WireType.Varint).int32(message.cltvLimit); - /* repeated lnrpc.RouteHint route_hints = 10; */ - for (let i = 0; i < message.routeHints.length; i++) - RouteHint.internalBinaryWrite(message.routeHints[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join(); - /* map dest_custom_records = 11; */ - for (let k of Object.keys(message.destCustomRecords)) - writer.tag(11, WireType.LengthDelimited).fork().tag(1, WireType.Varint).uint64(k).tag(2, WireType.LengthDelimited).bytes(message.destCustomRecords[k]).join(); - /* bool allow_self_payment = 15; */ - if (message.allowSelfPayment !== false) - writer.tag(15, WireType.Varint).bool(message.allowSelfPayment); - /* repeated lnrpc.FeatureBit dest_features = 16; */ - if (message.destFeatures.length) { - writer.tag(16, WireType.LengthDelimited).fork(); - for (let i = 0; i < message.destFeatures.length; i++) - writer.int32(message.destFeatures[i]); - writer.join(); - } - /* uint32 max_parts = 17; */ - if (message.maxParts !== 0) - writer.tag(17, WireType.Varint).uint32(message.maxParts); - /* bool no_inflight_updates = 18; */ - if (message.noInflightUpdates !== false) - writer.tag(18, WireType.Varint).bool(message.noInflightUpdates); - /* uint64 max_shard_size_msat = 21; */ - if (message.maxShardSizeMsat !== 0) - 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SendPaymentRequest - */ -export const SendPaymentRequest = new SendPaymentRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class TrackPaymentRequest$Type extends MessageType { - constructor() { - super("routerrpc.TrackPaymentRequest", [ - { no: 1, name: "payment_hash", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "no_inflight_updates", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { paymentHash: new Uint8Array(0), noInflightUpdates: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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 no_inflight_updates */ 2: - 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, writer, options) { - /* bytes payment_hash = 1; */ - if (message.paymentHash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); - /* bool no_inflight_updates = 2; */ - if (message.noInflightUpdates !== false) - writer.tag(2, 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.TrackPaymentRequest - */ -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) { - 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, length, options, target) { - 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, writer, options) { - /* 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*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { dest: new Uint8Array(0), amtSat: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes dest */ 1: - message.dest = reader.bytes(); - break; - case /* int64 amt_sat */ 2: - message.amtSat = reader.int64().toNumber(); - 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, writer, options) { - /* bytes dest = 1; */ - if (message.dest.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.dest); - /* int64 amt_sat = 2; */ - if (message.amtSat !== 0) - writer.tag(2, WireType.Varint).int64(message.amtSat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.RouteFeeRequest - */ -export const RouteFeeRequest = new RouteFeeRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RouteFeeResponse$Type extends MessageType { - constructor() { - super("routerrpc.RouteFeeResponse", [ - { no: 1, name: "routing_fee_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "time_lock_delay", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { routingFeeMsat: 0, timeLockDelay: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 routing_fee_msat */ 1: - message.routingFeeMsat = reader.int64().toNumber(); - break; - case /* int64 time_lock_delay */ 2: - message.timeLockDelay = reader.int64().toNumber(); - 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, writer, options) { - /* int64 routing_fee_msat = 1; */ - if (message.routingFeeMsat !== 0) - writer.tag(1, WireType.Varint).int64(message.routingFeeMsat); - /* int64 time_lock_delay = 2; */ - if (message.timeLockDelay !== 0) - writer.tag(2, WireType.Varint).int64(message.timeLockDelay); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.RouteFeeResponse - */ -export const RouteFeeResponse = new RouteFeeResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -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: 3, name: "skip_temp_err", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - 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); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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 /* 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") - 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, writer, options) { - /* bytes payment_hash = 1; */ - if (message.paymentHash.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.paymentHash); - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SendToRouteRequest - */ -export const SendToRouteRequest = new SendToRouteRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendToRouteResponse$Type extends MessageType { - constructor() { - super("routerrpc.SendToRouteResponse", [ - { no: 1, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "failure", kind: "message", T: () => Failure } - ]); - } - create(value) { - 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, length, options, target) { - 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; - case /* lnrpc.Failure failure */ 2: - message.failure = Failure.internalBinaryRead(reader, reader.uint32(), options, message.failure); - 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, writer, options) { - /* bytes preimage = 1; */ - if (message.preimage.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.preimage); - /* lnrpc.Failure failure = 2; */ - if (message.failure) - Failure.internalBinaryWrite(message.failure, writer.tag(2, 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 routerrpc.SendToRouteResponse - */ -export const SendToRouteResponse = new SendToRouteResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ResetMissionControlRequest$Type extends MessageType { - constructor() { - super("routerrpc.ResetMissionControlRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.ResetMissionControlRequest - */ -export const ResetMissionControlRequest = new ResetMissionControlRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ResetMissionControlResponse$Type extends MessageType { - constructor() { - super("routerrpc.ResetMissionControlResponse", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.ResetMissionControlResponse - */ -export const ResetMissionControlResponse = new ResetMissionControlResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class QueryMissionControlRequest$Type extends MessageType { - constructor() { - super("routerrpc.QueryMissionControlRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.QueryMissionControlRequest - */ -export const QueryMissionControlRequest = new QueryMissionControlRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class QueryMissionControlResponse$Type extends MessageType { - constructor() { - super("routerrpc.QueryMissionControlResponse", [ - { no: 2, name: "pairs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PairHistory } - ]); - } - create(value) { - const message = { pairs: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated routerrpc.PairHistory pairs */ 2: - message.pairs.push(PairHistory.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, writer, options) { - /* repeated routerrpc.PairHistory pairs = 2; */ - for (let i = 0; i < message.pairs.length; i++) - PairHistory.internalBinaryWrite(message.pairs[i], writer.tag(2, 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 routerrpc.QueryMissionControlResponse - */ -export const QueryMissionControlResponse = new QueryMissionControlResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class XImportMissionControlRequest$Type extends MessageType { - constructor() { - super("routerrpc.XImportMissionControlRequest", [ - { no: 1, name: "pairs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => PairHistory }, - { no: 2, name: "force", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = { pairs: [], force: false }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated routerrpc.PairHistory pairs */ 1: - message.pairs.push(PairHistory.internalBinaryRead(reader, reader.uint32(), options)); - break; - case /* bool force */ 2: - message.force = 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, writer, options) { - /* repeated routerrpc.PairHistory pairs = 1; */ - for (let i = 0; i < message.pairs.length; i++) - PairHistory.internalBinaryWrite(message.pairs[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* bool force = 2; */ - if (message.force !== false) - writer.tag(2, WireType.Varint).bool(message.force); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.XImportMissionControlRequest - */ -export const XImportMissionControlRequest = new XImportMissionControlRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class XImportMissionControlResponse$Type extends MessageType { - constructor() { - super("routerrpc.XImportMissionControlResponse", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.XImportMissionControlResponse - */ -export const XImportMissionControlResponse = new XImportMissionControlResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PairHistory$Type extends MessageType { - constructor() { - super("routerrpc.PairHistory", [ - { no: 1, name: "node_from", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 2, name: "node_to", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 7, name: "history", kind: "message", T: () => PairData } - ]); - } - create(value) { - const message = { nodeFrom: new Uint8Array(0), nodeTo: new Uint8Array(0) }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes node_from */ 1: - message.nodeFrom = reader.bytes(); - break; - case /* bytes node_to */ 2: - message.nodeTo = reader.bytes(); - break; - case /* routerrpc.PairData history */ 7: - message.history = PairData.internalBinaryRead(reader, reader.uint32(), options, message.history); - 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, writer, options) { - /* bytes node_from = 1; */ - if (message.nodeFrom.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.nodeFrom); - /* bytes node_to = 2; */ - if (message.nodeTo.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.nodeTo); - /* routerrpc.PairData history = 7; */ - if (message.history) - PairData.internalBinaryWrite(message.history, writer.tag(7, 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 routerrpc.PairHistory - */ -export const PairHistory = new PairHistory$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PairData$Type extends MessageType { - constructor() { - super("routerrpc.PairData", [ - { no: 1, name: "fail_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "fail_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "fail_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "success_time", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 6, name: "success_amt_sat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 7, name: "success_amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { failTime: 0, failAmtSat: 0, failAmtMsat: 0, successTime: 0, successAmtSat: 0, successAmtMsat: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 fail_time */ 1: - message.failTime = reader.int64().toNumber(); - break; - case /* int64 fail_amt_sat */ 2: - message.failAmtSat = reader.int64().toNumber(); - break; - case /* int64 fail_amt_msat */ 4: - message.failAmtMsat = reader.int64().toNumber(); - break; - case /* int64 success_time */ 5: - message.successTime = reader.int64().toNumber(); - break; - case /* int64 success_amt_sat */ 6: - message.successAmtSat = reader.int64().toNumber(); - break; - case /* int64 success_amt_msat */ 7: - message.successAmtMsat = reader.int64().toNumber(); - 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, writer, options) { - /* int64 fail_time = 1; */ - if (message.failTime !== 0) - writer.tag(1, WireType.Varint).int64(message.failTime); - /* int64 fail_amt_sat = 2; */ - if (message.failAmtSat !== 0) - writer.tag(2, WireType.Varint).int64(message.failAmtSat); - /* int64 fail_amt_msat = 4; */ - if (message.failAmtMsat !== 0) - writer.tag(4, WireType.Varint).int64(message.failAmtMsat); - /* int64 success_time = 5; */ - if (message.successTime !== 0) - writer.tag(5, WireType.Varint).int64(message.successTime); - /* int64 success_amt_sat = 6; */ - if (message.successAmtSat !== 0) - writer.tag(6, WireType.Varint).int64(message.successAmtSat); - /* int64 success_amt_msat = 7; */ - if (message.successAmtMsat !== 0) - writer.tag(7, WireType.Varint).int64(message.successAmtMsat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.PairData - */ -export const PairData = new PairData$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetMissionControlConfigRequest$Type extends MessageType { - constructor() { - super("routerrpc.GetMissionControlConfigRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.GetMissionControlConfigRequest - */ -export const GetMissionControlConfigRequest = new GetMissionControlConfigRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetMissionControlConfigResponse$Type extends MessageType { - constructor() { - super("routerrpc.GetMissionControlConfigResponse", [ - { no: 1, name: "config", kind: "message", T: () => MissionControlConfig } - ]); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.MissionControlConfig config */ 1: - message.config = MissionControlConfig.internalBinaryRead(reader, reader.uint32(), options, message.config); - 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, writer, options) { - /* routerrpc.MissionControlConfig config = 1; */ - if (message.config) - MissionControlConfig.internalBinaryWrite(message.config, 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 routerrpc.GetMissionControlConfigResponse - */ -export const GetMissionControlConfigResponse = new GetMissionControlConfigResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SetMissionControlConfigRequest$Type extends MessageType { - constructor() { - super("routerrpc.SetMissionControlConfigRequest", [ - { no: 1, name: "config", kind: "message", T: () => MissionControlConfig } - ]); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.MissionControlConfig config */ 1: - message.config = MissionControlConfig.internalBinaryRead(reader, reader.uint32(), options, message.config); - 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, writer, options) { - /* routerrpc.MissionControlConfig config = 1; */ - if (message.config) - MissionControlConfig.internalBinaryWrite(message.config, 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 routerrpc.SetMissionControlConfigRequest - */ -export const SetMissionControlConfigRequest = new SetMissionControlConfigRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SetMissionControlConfigResponse$Type extends MessageType { - constructor() { - super("routerrpc.SetMissionControlConfigResponse", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SetMissionControlConfigResponse - */ -export const SetMissionControlConfigResponse = new SetMissionControlConfigResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class MissionControlConfig$Type extends MessageType { - constructor() { - super("routerrpc.MissionControlConfig", [ - { no: 1, name: "half_life_seconds", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { halfLifeSeconds: 0, hopProbability: 0, weight: 0, maximumPaymentResults: 0, minimumFailureRelaxInterval: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 half_life_seconds */ 1: - message.halfLifeSeconds = reader.uint64().toNumber(); - break; - case /* float hop_probability */ 2: - message.hopProbability = reader.float(); - break; - case /* float weight */ 3: - message.weight = reader.float(); - break; - case /* uint32 maximum_payment_results */ 4: - message.maximumPaymentResults = reader.uint32(); - break; - case /* uint64 minimum_failure_relax_interval */ 5: - message.minimumFailureRelaxInterval = reader.uint64().toNumber(); - 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, writer, options) { - /* uint64 half_life_seconds = 1; */ - if (message.halfLifeSeconds !== 0) - writer.tag(1, WireType.Varint).uint64(message.halfLifeSeconds); - /* float hop_probability = 2; */ - if (message.hopProbability !== 0) - writer.tag(2, WireType.Bit32).float(message.hopProbability); - /* float weight = 3; */ - if (message.weight !== 0) - writer.tag(3, WireType.Bit32).float(message.weight); - /* uint32 maximum_payment_results = 4; */ - if (message.maximumPaymentResults !== 0) - writer.tag(4, WireType.Varint).uint32(message.maximumPaymentResults); - /* uint64 minimum_failure_relax_interval = 5; */ - if (message.minimumFailureRelaxInterval !== 0) - writer.tag(5, WireType.Varint).uint64(message.minimumFailureRelaxInterval); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.MissionControlConfig - */ -export const MissionControlConfig = new MissionControlConfig$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class QueryProbabilityRequest$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { fromNode: new Uint8Array(0), toNode: new Uint8Array(0), amtMsat: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bytes from_node */ 1: - message.fromNode = reader.bytes(); - break; - case /* bytes to_node */ 2: - message.toNode = reader.bytes(); - break; - case /* int64 amt_msat */ 3: - message.amtMsat = reader.int64().toNumber(); - 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, writer, options) { - /* bytes from_node = 1; */ - if (message.fromNode.length) - writer.tag(1, WireType.LengthDelimited).bytes(message.fromNode); - /* bytes to_node = 2; */ - if (message.toNode.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.toNode); - /* int64 amt_msat = 3; */ - if (message.amtMsat !== 0) - writer.tag(3, WireType.Varint).int64(message.amtMsat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.QueryProbabilityRequest - */ -export const QueryProbabilityRequest = new QueryProbabilityRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class QueryProbabilityResponse$Type extends MessageType { - constructor() { - super("routerrpc.QueryProbabilityResponse", [ - { no: 1, name: "probability", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, - { no: 2, name: "history", kind: "message", T: () => PairData } - ]); - } - create(value) { - const message = { probability: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* double probability */ 1: - message.probability = reader.double(); - break; - case /* routerrpc.PairData history */ 2: - message.history = PairData.internalBinaryRead(reader, reader.uint32(), options, message.history); - 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, writer, options) { - /* double probability = 1; */ - if (message.probability !== 0) - writer.tag(1, WireType.Bit64).double(message.probability); - /* routerrpc.PairData history = 2; */ - if (message.history) - PairData.internalBinaryWrite(message.history, writer.tag(2, 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 routerrpc.QueryProbabilityResponse - */ -export const QueryProbabilityResponse = new QueryProbabilityResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class BuildRouteRequest$Type extends MessageType { - constructor() { - super("routerrpc.BuildRouteRequest", [ - { no: 1, name: "amt_msat", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/ }, - { no: 5, name: "payment_addr", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = { amtMsat: 0, 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); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* int64 amt_msat */ 1: - message.amtMsat = reader.int64().toNumber(); - break; - case /* int32 final_cltv_delta */ 2: - message.finalCltvDelta = reader.int32(); - break; - case /* uint64 outgoing_chan_id = 3 [jstype = JS_STRING];*/ 3: - message.outgoingChanId = reader.uint64().toString(); - break; - case /* repeated bytes hop_pubkeys */ 4: - message.hopPubkeys.push(reader.bytes()); - break; - case /* bytes payment_addr */ 5: - message.paymentAddr = 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, writer, options) { - /* int64 amt_msat = 1; */ - if (message.amtMsat !== 0) - writer.tag(1, WireType.Varint).int64(message.amtMsat); - /* int32 final_cltv_delta = 2; */ - if (message.finalCltvDelta !== 0) - writer.tag(2, WireType.Varint).int32(message.finalCltvDelta); - /* uint64 outgoing_chan_id = 3 [jstype = JS_STRING]; */ - if (message.outgoingChanId !== "0") - writer.tag(3, WireType.Varint).uint64(message.outgoingChanId); - /* repeated bytes hop_pubkeys = 4; */ - for (let i = 0; i < message.hopPubkeys.length; i++) - writer.tag(4, WireType.LengthDelimited).bytes(message.hopPubkeys[i]); - /* bytes payment_addr = 5; */ - if (message.paymentAddr.length) - writer.tag(5, WireType.LengthDelimited).bytes(message.paymentAddr); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.BuildRouteRequest - */ -export const BuildRouteRequest = new BuildRouteRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class BuildRouteResponse$Type extends MessageType { - constructor() { - super("routerrpc.BuildRouteResponse", [ - { no: 1, name: "route", kind: "message", T: () => Route } - ]); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.Route route */ 1: - message.route = Route.internalBinaryRead(reader, reader.uint32(), options, message.route); - 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, writer, options) { - /* lnrpc.Route route = 1; */ - if (message.route) - Route.internalBinaryWrite(message.route, 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 routerrpc.BuildRouteResponse - */ -export const BuildRouteResponse = new BuildRouteResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SubscribeHtlcEventsRequest$Type extends MessageType { - constructor() { - super("routerrpc.SubscribeHtlcEventsRequest", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SubscribeHtlcEventsRequest - */ -export const SubscribeHtlcEventsRequest = new SubscribeHtlcEventsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class HtlcEvent$Type extends MessageType { - constructor() { - super("routerrpc.HtlcEvent", [ - { no: 1, name: "incoming_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "outgoing_channel_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "incoming_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "outgoing_htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 5, name: "timestamp_ns", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 11, name: "subscribed_event", kind: "message", oneof: "event", T: () => SubscribedEvent }, - { no: 12, name: "final_htlc_event", kind: "message", oneof: "event", T: () => FinalHtlcEvent } - ]); - } - create(value) { - const message = { incomingChannelId: 0, outgoingChannelId: 0, incomingHtlcId: 0, outgoingHtlcId: 0, timestampNs: 0, eventType: 0, event: { oneofKind: undefined } }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 incoming_channel_id */ 1: - message.incomingChannelId = reader.uint64().toNumber(); - break; - case /* uint64 outgoing_channel_id */ 2: - message.outgoingChannelId = reader.uint64().toNumber(); - break; - case /* uint64 incoming_htlc_id */ 3: - message.incomingHtlcId = reader.uint64().toNumber(); - break; - case /* uint64 outgoing_htlc_id */ 4: - message.outgoingHtlcId = reader.uint64().toNumber(); - break; - case /* uint64 timestamp_ns */ 5: - message.timestampNs = reader.uint64().toNumber(); - break; - case /* routerrpc.HtlcEvent.EventType event_type */ 6: - message.eventType = reader.int32(); - break; - case /* routerrpc.ForwardEvent forward_event */ 7: - message.event = { - oneofKind: "forwardEvent", - forwardEvent: ForwardEvent.internalBinaryRead(reader, reader.uint32(), options, message.event.forwardEvent) - }; - break; - case /* routerrpc.ForwardFailEvent forward_fail_event */ 8: - message.event = { - oneofKind: "forwardFailEvent", - forwardFailEvent: ForwardFailEvent.internalBinaryRead(reader, reader.uint32(), options, message.event.forwardFailEvent) - }; - break; - case /* routerrpc.SettleEvent settle_event */ 9: - message.event = { - oneofKind: "settleEvent", - settleEvent: SettleEvent.internalBinaryRead(reader, reader.uint32(), options, message.event.settleEvent) - }; - break; - case /* routerrpc.LinkFailEvent link_fail_event */ 10: - message.event = { - oneofKind: "linkFailEvent", - linkFailEvent: LinkFailEvent.internalBinaryRead(reader, reader.uint32(), options, message.event.linkFailEvent) - }; - break; - case /* routerrpc.SubscribedEvent subscribed_event */ 11: - message.event = { - oneofKind: "subscribedEvent", - subscribedEvent: SubscribedEvent.internalBinaryRead(reader, reader.uint32(), options, message.event.subscribedEvent) - }; - break; - case /* routerrpc.FinalHtlcEvent final_htlc_event */ 12: - message.event = { - oneofKind: "finalHtlcEvent", - finalHtlcEvent: FinalHtlcEvent.internalBinaryRead(reader, reader.uint32(), options, message.event.finalHtlcEvent) - }; - 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, writer, options) { - /* uint64 incoming_channel_id = 1; */ - if (message.incomingChannelId !== 0) - writer.tag(1, WireType.Varint).uint64(message.incomingChannelId); - /* uint64 outgoing_channel_id = 2; */ - if (message.outgoingChannelId !== 0) - writer.tag(2, WireType.Varint).uint64(message.outgoingChannelId); - /* uint64 incoming_htlc_id = 3; */ - if (message.incomingHtlcId !== 0) - writer.tag(3, WireType.Varint).uint64(message.incomingHtlcId); - /* uint64 outgoing_htlc_id = 4; */ - if (message.outgoingHtlcId !== 0) - writer.tag(4, WireType.Varint).uint64(message.outgoingHtlcId); - /* uint64 timestamp_ns = 5; */ - if (message.timestampNs !== 0) - writer.tag(5, WireType.Varint).uint64(message.timestampNs); - /* routerrpc.HtlcEvent.EventType event_type = 6; */ - if (message.eventType !== 0) - writer.tag(6, WireType.Varint).int32(message.eventType); - /* routerrpc.ForwardEvent forward_event = 7; */ - if (message.event.oneofKind === "forwardEvent") - ForwardEvent.internalBinaryWrite(message.event.forwardEvent, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); - /* routerrpc.ForwardFailEvent forward_fail_event = 8; */ - if (message.event.oneofKind === "forwardFailEvent") - ForwardFailEvent.internalBinaryWrite(message.event.forwardFailEvent, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); - /* routerrpc.SettleEvent settle_event = 9; */ - if (message.event.oneofKind === "settleEvent") - SettleEvent.internalBinaryWrite(message.event.settleEvent, writer.tag(9, WireType.LengthDelimited).fork(), options).join(); - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.HtlcEvent - */ -export const HtlcEvent = new HtlcEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class HtlcInfo$Type extends MessageType { - constructor() { - 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 4, name: "outgoing_amt_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { incomingTimelock: 0, outgoingTimelock: 0, incomingAmtMsat: 0, outgoingAmtMsat: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 incoming_timelock */ 1: - message.incomingTimelock = reader.uint32(); - break; - case /* uint32 outgoing_timelock */ 2: - message.outgoingTimelock = reader.uint32(); - break; - case /* uint64 incoming_amt_msat */ 3: - message.incomingAmtMsat = reader.uint64().toNumber(); - break; - case /* uint64 outgoing_amt_msat */ 4: - message.outgoingAmtMsat = reader.uint64().toNumber(); - 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, writer, options) { - /* uint32 incoming_timelock = 1; */ - if (message.incomingTimelock !== 0) - writer.tag(1, WireType.Varint).uint32(message.incomingTimelock); - /* uint32 outgoing_timelock = 2; */ - if (message.outgoingTimelock !== 0) - writer.tag(2, WireType.Varint).uint32(message.outgoingTimelock); - /* uint64 incoming_amt_msat = 3; */ - if (message.incomingAmtMsat !== 0) - writer.tag(3, WireType.Varint).uint64(message.incomingAmtMsat); - /* uint64 outgoing_amt_msat = 4; */ - if (message.outgoingAmtMsat !== 0) - writer.tag(4, WireType.Varint).uint64(message.outgoingAmtMsat); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.HtlcInfo - */ -export const HtlcInfo = new HtlcInfo$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardEvent$Type extends MessageType { - constructor() { - super("routerrpc.ForwardEvent", [ - { no: 1, name: "info", kind: "message", T: () => HtlcInfo } - ]); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.HtlcInfo info */ 1: - message.info = HtlcInfo.internalBinaryRead(reader, reader.uint32(), options, message.info); - 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, writer, options) { - /* routerrpc.HtlcInfo info = 1; */ - if (message.info) - HtlcInfo.internalBinaryWrite(message.info, 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 routerrpc.ForwardEvent - */ -export const ForwardEvent = new ForwardEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardFailEvent$Type extends MessageType { - constructor() { - super("routerrpc.ForwardFailEvent", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.ForwardFailEvent - */ -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", [ - { no: 1, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - 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, length, options, target) { - 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, writer, options) { - /* 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); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.SettleEvent - */ -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) { - 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, length, options, target) { - 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, writer, options) { - /* 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) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - 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", [ - { no: 1, name: "info", kind: "message", T: () => HtlcInfo }, - { no: 2, name: "wire_failure", kind: "enum", T: () => ["lnrpc.Failure.FailureCode", Failure_FailureCode] }, - { no: 3, name: "failure_detail", kind: "enum", T: () => ["routerrpc.FailureDetail", FailureDetail] }, - { no: 4, name: "failure_string", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = { wireFailure: 0, failureDetail: 0, failureString: "" }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.HtlcInfo info */ 1: - message.info = HtlcInfo.internalBinaryRead(reader, reader.uint32(), options, message.info); - break; - case /* lnrpc.Failure.FailureCode wire_failure */ 2: - message.wireFailure = reader.int32(); - break; - case /* routerrpc.FailureDetail failure_detail */ 3: - message.failureDetail = reader.int32(); - break; - case /* string failure_string */ 4: - message.failureString = 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, writer, options) { - /* routerrpc.HtlcInfo info = 1; */ - if (message.info) - HtlcInfo.internalBinaryWrite(message.info, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* lnrpc.Failure.FailureCode wire_failure = 2; */ - if (message.wireFailure !== 0) - writer.tag(2, WireType.Varint).int32(message.wireFailure); - /* routerrpc.FailureDetail failure_detail = 3; */ - if (message.failureDetail !== 0) - writer.tag(3, WireType.Varint).int32(message.failureDetail); - /* string failure_string = 4; */ - if (message.failureString !== "") - writer.tag(4, WireType.LengthDelimited).string(message.failureString); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.LinkFailEvent - */ -export const LinkFailEvent = new LinkFailEvent$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class PaymentStatus$Type extends MessageType { - constructor() { - super("routerrpc.PaymentStatus", [ - { no: 1, name: "state", kind: "enum", T: () => ["routerrpc.PaymentState", PaymentState] }, - { no: 2, name: "preimage", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 4, name: "htlcs", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HTLCAttempt } - ]); - } - create(value) { - const message = { state: 0, preimage: new Uint8Array(0), htlcs: [] }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.PaymentState state */ 1: - message.state = reader.int32(); - break; - case /* bytes preimage */ 2: - message.preimage = reader.bytes(); - break; - case /* repeated lnrpc.HTLCAttempt htlcs */ 4: - message.htlcs.push(HTLCAttempt.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, writer, options) { - /* routerrpc.PaymentState state = 1; */ - if (message.state !== 0) - writer.tag(1, WireType.Varint).int32(message.state); - /* bytes preimage = 2; */ - if (message.preimage.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.preimage); - /* repeated lnrpc.HTLCAttempt htlcs = 4; */ - for (let i = 0; i < message.htlcs.length; i++) - HTLCAttempt.internalBinaryWrite(message.htlcs[i], writer.tag(4, 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 routerrpc.PaymentStatus - */ -export const PaymentStatus = new PaymentStatus$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class CircuitKey$Type extends MessageType { - constructor() { - super("routerrpc.CircuitKey", [ - { no: 1, name: "chan_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { no: 2, name: "htlc_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ } - ]); - } - create(value) { - const message = { chanId: 0, htlcId: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - 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().toNumber(); - break; - case /* uint64 htlc_id */ 2: - message.htlcId = reader.uint64().toNumber(); - 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, writer, options) { - /* uint64 chan_id = 1; */ - if (message.chanId !== 0) - writer.tag(1, WireType.Varint).uint64(message.chanId); - /* uint64 htlc_id = 2; */ - if (message.htlcId !== 0) - writer.tag(2, WireType.Varint).uint64(message.htlcId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.CircuitKey - */ -export const CircuitKey = new CircuitKey$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardHtlcInterceptRequest$Type extends MessageType { - constructor() { - super("routerrpc.ForwardHtlcInterceptRequest", [ - { no: 1, name: "incoming_circuit_key", kind: "message", T: () => CircuitKey }, - { no: 5, name: "incoming_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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*/, L: 2 /*LongType.NUMBER*/ }, - { no: 3, name: "outgoing_amount_msat", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 2 /*LongType.NUMBER*/ }, - { 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: 10, name: "auto_fail_height", kind: "scalar", T: 5 /*ScalarType.INT32*/ } - ]); - } - create(value) { - const message = { incomingAmountMsat: 0, incomingExpiry: 0, paymentHash: new Uint8Array(0), outgoingRequestedChanId: 0, outgoingAmountMsat: 0, 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); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.CircuitKey incoming_circuit_key */ 1: - message.incomingCircuitKey = CircuitKey.internalBinaryRead(reader, reader.uint32(), options, message.incomingCircuitKey); - break; - case /* uint64 incoming_amount_msat */ 5: - message.incomingAmountMsat = reader.uint64().toNumber(); - break; - case /* uint32 incoming_expiry */ 6: - message.incomingExpiry = reader.uint32(); - break; - case /* bytes payment_hash */ 2: - message.paymentHash = reader.bytes(); - break; - case /* uint64 outgoing_requested_chan_id */ 7: - message.outgoingRequestedChanId = reader.uint64().toNumber(); - break; - case /* uint64 outgoing_amount_msat */ 3: - message.outgoingAmountMsat = reader.uint64().toNumber(); - break; - case /* uint32 outgoing_expiry */ 4: - message.outgoingExpiry = reader.uint32(); - break; - case /* map custom_records */ 8: - this.binaryReadMap8(message.customRecords, reader, options); - break; - case /* bytes onion_blob */ 9: - message.onionBlob = reader.bytes(); - break; - case /* int32 auto_fail_height */ 10: - message.autoFailHeight = 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; - } - binaryReadMap8(map, reader, options) { - let len = reader.uint32(), end = reader.pos + len, key, val; - 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 routerrpc.ForwardHtlcInterceptRequest.custom_records"); - } - } - map[key ?? "0"] = val ?? new Uint8Array(0); - } - internalBinaryWrite(message, writer, options) { - /* routerrpc.CircuitKey incoming_circuit_key = 1; */ - if (message.incomingCircuitKey) - CircuitKey.internalBinaryWrite(message.incomingCircuitKey, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* uint64 incoming_amount_msat = 5; */ - if (message.incomingAmountMsat !== 0) - writer.tag(5, WireType.Varint).uint64(message.incomingAmountMsat); - /* uint32 incoming_expiry = 6; */ - if (message.incomingExpiry !== 0) - writer.tag(6, WireType.Varint).uint32(message.incomingExpiry); - /* bytes payment_hash = 2; */ - if (message.paymentHash.length) - writer.tag(2, WireType.LengthDelimited).bytes(message.paymentHash); - /* uint64 outgoing_requested_chan_id = 7; */ - if (message.outgoingRequestedChanId !== 0) - writer.tag(7, WireType.Varint).uint64(message.outgoingRequestedChanId); - /* uint64 outgoing_amount_msat = 3; */ - if (message.outgoingAmountMsat !== 0) - writer.tag(3, WireType.Varint).uint64(message.outgoingAmountMsat); - /* uint32 outgoing_expiry = 4; */ - if (message.outgoingExpiry !== 0) - writer.tag(4, WireType.Varint).uint32(message.outgoingExpiry); - /* 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(); - /* bytes onion_blob = 9; */ - if (message.onionBlob.length) - writer.tag(9, WireType.LengthDelimited).bytes(message.onionBlob); - /* int32 auto_fail_height = 10; */ - if (message.autoFailHeight !== 0) - writer.tag(10, WireType.Varint).int32(message.autoFailHeight); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.ForwardHtlcInterceptRequest - */ -export const ForwardHtlcInterceptRequest = new ForwardHtlcInterceptRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForwardHtlcInterceptResponse$Type extends MessageType { - constructor() { - super("routerrpc.ForwardHtlcInterceptResponse", [ - { no: 1, name: "incoming_circuit_key", kind: "message", T: () => CircuitKey }, - { no: 2, name: "action", kind: "enum", T: () => ["routerrpc.ResolveHoldForwardAction", ResolveHoldForwardAction] }, - { 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) { - 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); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* routerrpc.CircuitKey incoming_circuit_key */ 1: - message.incomingCircuitKey = CircuitKey.internalBinaryRead(reader, reader.uint32(), options, message.incomingCircuitKey); - break; - case /* routerrpc.ResolveHoldForwardAction action */ 2: - message.action = reader.int32(); - break; - case /* bytes preimage */ 3: - message.preimage = reader.bytes(); - break; - case /* bytes failure_message */ 4: - message.failureMessage = reader.bytes(); - break; - case /* lnrpc.Failure.FailureCode failure_code */ 5: - message.failureCode = 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, writer, options) { - /* routerrpc.CircuitKey incoming_circuit_key = 1; */ - if (message.incomingCircuitKey) - CircuitKey.internalBinaryWrite(message.incomingCircuitKey, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* routerrpc.ResolveHoldForwardAction action = 2; */ - if (message.action !== 0) - writer.tag(2, WireType.Varint).int32(message.action); - /* bytes preimage = 3; */ - if (message.preimage.length) - writer.tag(3, WireType.LengthDelimited).bytes(message.preimage); - /* bytes failure_message = 4; */ - if (message.failureMessage.length) - writer.tag(4, WireType.LengthDelimited).bytes(message.failureMessage); - /* lnrpc.Failure.FailureCode failure_code = 5; */ - if (message.failureCode !== 0) - writer.tag(5, WireType.Varint).int32(message.failureCode); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.ForwardHtlcInterceptResponse - */ -export const ForwardHtlcInterceptResponse = new ForwardHtlcInterceptResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateChanStatusRequest$Type extends MessageType { - constructor() { - super("routerrpc.UpdateChanStatusRequest", [ - { no: 1, name: "chan_point", kind: "message", T: () => ChannelPoint }, - { no: 2, name: "action", kind: "enum", T: () => ["routerrpc.ChanStatusAction", ChanStatusAction] } - ]); - } - create(value) { - const message = { action: 0 }; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* lnrpc.ChannelPoint chan_point */ 1: - message.chanPoint = ChannelPoint.internalBinaryRead(reader, reader.uint32(), options, message.chanPoint); - break; - case /* routerrpc.ChanStatusAction action */ 2: - message.action = 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, writer, options) { - /* lnrpc.ChannelPoint chan_point = 1; */ - if (message.chanPoint) - ChannelPoint.internalBinaryWrite(message.chanPoint, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); - /* routerrpc.ChanStatusAction action = 2; */ - if (message.action !== 0) - writer.tag(2, WireType.Varint).int32(message.action); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.UpdateChanStatusRequest - */ -export const UpdateChanStatusRequest = new UpdateChanStatusRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateChanStatusResponse$Type extends MessageType { - constructor() { - super("routerrpc.UpdateChanStatusResponse", []); - } - create(value) { - const message = {}; - globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message routerrpc.UpdateChanStatusResponse - */ -export const UpdateChanStatusResponse = new UpdateChanStatusResponse$Type(); -/** - * @generated ServiceType for protobuf service routerrpc.Router - */ -export const Router = new ServiceType("routerrpc.Router", [ - { name: "SendPaymentV2", serverStreaming: true, options: {}, I: SendPaymentRequest, O: Payment }, - { name: "TrackPaymentV2", serverStreaming: true, options: {}, I: TrackPaymentRequest, O: Payment }, - { name: "TrackPayments", serverStreaming: true, options: {}, I: TrackPaymentsRequest, O: Payment }, - { name: "EstimateRouteFee", options: {}, I: RouteFeeRequest, O: RouteFeeResponse }, - { name: "SendToRoute", options: {}, I: SendToRouteRequest, O: SendToRouteResponse }, - { name: "SendToRouteV2", options: {}, I: SendToRouteRequest, O: HTLCAttempt }, - { name: "ResetMissionControl", options: {}, I: ResetMissionControlRequest, O: ResetMissionControlResponse }, - { name: "QueryMissionControl", options: {}, I: QueryMissionControlRequest, O: QueryMissionControlResponse }, - { name: "XImportMissionControl", options: {}, I: XImportMissionControlRequest, O: XImportMissionControlResponse }, - { name: "GetMissionControlConfig", options: {}, I: GetMissionControlConfigRequest, O: GetMissionControlConfigResponse }, - { name: "SetMissionControlConfig", options: {}, I: SetMissionControlConfigRequest, O: SetMissionControlConfigResponse }, - { name: "QueryProbability", options: {}, I: QueryProbabilityRequest, O: QueryProbabilityResponse }, - { name: "BuildRoute", options: {}, I: BuildRouteRequest, O: BuildRouteResponse }, - { name: "SubscribeHtlcEvents", serverStreaming: true, options: {}, I: SubscribeHtlcEventsRequest, O: HtlcEvent }, - { name: "SendPayment", serverStreaming: true, options: {}, I: SendPaymentRequest, O: PaymentStatus }, - { name: "TrackPayment", serverStreaming: true, options: {}, I: TrackPaymentRequest, O: PaymentStatus }, - { name: "HtlcInterceptor", serverStreaming: true, clientStreaming: true, options: {}, I: ForwardHtlcInterceptResponse, O: ForwardHtlcInterceptRequest }, - { name: "UpdateChanStatus", options: {}, I: UpdateChanStatusRequest, O: UpdateChanStatusResponse } -]); diff --git a/proto/lnd/router.ts b/proto/lnd/router.ts index 745bd8c1..e4371c17 100644 --- a/proto/lnd/router.ts +++ b/proto/lnd/router.ts @@ -1,7 +1,7 @@ // @generated by protobuf-ts 2.8.1 with parameter long_type_number // @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) // tslint:disable -import { Payment } from "./lightning"; +import { Payment } from "./lightning.js"; 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 "./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"; +import { ChannelPoint } from "./lightning.js"; +import { HTLCAttempt } from "./lightning.js"; +import { Failure_FailureCode } from "./lightning.js"; +import { Failure } from "./lightning.js"; +import { Route } from "./lightning.js"; +import { FeatureBit } from "./lightning.js"; +import { RouteHint } from "./lightning.js"; /** * @generated from protobuf message routerrpc.SendPaymentRequest */ diff --git a/proto/protoc-gen-pub.exe b/proto/protoc-gen-pub.exe index 80ef68cb..9946f980 100644 Binary files a/proto/protoc-gen-pub.exe and b/proto/protoc-gen-pub.exe differ diff --git a/proto/service/methods.proto b/proto/service/methods.proto index a7125bc4..4bb3181b 100644 --- a/proto/service/methods.proto +++ b/proto/service/methods.proto @@ -114,9 +114,38 @@ service LightningPub { option (http_method) = "post"; option (http_route) = "/api/user/open/channel"; } - rpc GetOpenChannelLNURL(structs.Empty) returns (structs.GetOpenChannelLNURLResponse){ + rpc GetLnurlWithdrawLink(structs.Empty) returns (structs.LnurlLinkResponse){ + option (auth_type) = "User"; + option (http_method) = "get"; + option (http_route) = "/api/user/lnurl_withdraw/link"; + } + rpc GetLnurlWithdrawInfo(structs.Empty) returns (structs.LnurlWithdrawInfoResponse){ + option (auth_type) = "Guest"; + option (http_method) = "get"; + option (http_route) = "/api/guest/lnurl_withdraw/info"; + option (query) = {items: ["k1"]}; + } + rpc HandleLnurlWithdraw(structs.Empty) returns (structs.Empty){ + option (auth_type) = "Guest"; + option (http_method) = "get"; + option (http_route) = "/api/guest/lnurl_withdraw/handle"; + option (query) = {items: ["k1", "pr"]}; + } + rpc GetLnurlPayInfo(structs.Empty)returns (structs.LnurlPayInfoResponse) { + option (auth_type) = "Guest"; + option (http_method) = "get"; + option (http_route) = "/api/guest/lnurl_pay/info"; + option (query) = {items: ["k1"]}; + } + rpc HandleLnurlPay(structs.Empty)returns (structs.HandleLnurlPayResponse) { + option (auth_type) = "Guest"; + option (http_method) = "get"; + option (http_route) = "/api/guest/lnurl_pay/handle"; + option (query) = {items: ["k1", "amount"]}; + } + rpc GetLNURLChannelLink(structs.Empty) returns (structs.LnurlLinkResponse){ option (auth_type) = "User"; option (http_method) = "post"; - option (http_route) = "/api/user/lnurl_channel"; + option (http_route) = "/api/user/lnurl_channel/url"; } } \ No newline at end of file diff --git a/proto/service/structs.proto b/proto/service/structs.proto index 06956528..75339743 100644 --- a/proto/service/structs.proto +++ b/proto/service/structs.proto @@ -8,12 +8,12 @@ message Empty {} message EncryptionExchangeRequest { - string public_key = 1; - string device_id = 2; + string publicKey = 1; + string deviceId = 2; } message LndGetInfoRequest { - int64 node_id = 1; + int64 nodeId = 1; } message LndGetInfoResponse { @@ -25,23 +25,24 @@ enum AddressType { TAPROOT_PUBKEY = 2; } message NewAddressRequest { - AddressType address_type = 1; + AddressType addressType = 1; } message NewAddressResponse{ string address = 1; } message PayAddressRequest{ string address = 1; - int64 amout_sats = 2; - int64 target_conf = 3; + int64 amoutSats = 2; + int64 targetConf = 3; } message PayAddressResponse{ - string tx_id = 1; + string txId = 1; } message NewInvoiceRequest{ - int64 amount_sats = 1; + int64 amountSats = 1; + string memo = 2; } message NewInvoiceResponse{ @@ -59,28 +60,50 @@ message PayInvoiceResponse{ message OpenChannelRequest{ string destination = 1; - int64 funding_amount = 2; - int64 push_amount = 3; - string close_address = 4; + int64 fundingAmount = 2; + int64 pushAmount = 3; + string closeAddress = 4; } message OpenChannelResponse{ - string channel_id = 1; + string channelId = 1; } -message GetOpenChannelLNURLResponse{ +message LnurlLinkResponse{ string lnurl = 1; + string k1 = 2; } +message LnurlWithdrawInfoResponse { + string tag = 1; + string callback = 2; + string k1 = 3; + string defaultDescription = 4; + int64 minWithdrawable = 5; // millisatoshi - unsafe overflow possible, but very unlikely + int64 maxWithdrawable = 6; // millisatoshi - unsafe overflow possible, but very unlikely + string balanceCheck = 7; + string payLink = 8; +} +message LnurlPayInfoResponse { + string tag = 1; + string callback = 2; + int64 maxSendable = 3; // millisatoshi - unsafe overflow possible, but very unlikely + int64 minSendable = 4; // millisatoshi - unsafe overflow possible, but very unlikely + string metadata = 5; +} +message HandleLnurlPayResponse { + string pr = 1; + repeated Empty routes = 2; +} message AddUserRequest{ - string callback_url = 1; + string callbackUrl = 1; string name = 2; string secret = 3; } message AddUserResponse{ - string user_id = 1; - string auth_token = 2; + string userId = 1; + string authToken = 2; } message AuthUserRequest{ @@ -89,6 +112,6 @@ message AuthUserRequest{ } message AuthUserResponse{ - string user_id = 1; - string auth_token = 2; -} \ No newline at end of file + string userId = 1; + string authToken = 2; +} diff --git a/src/index.spec.ts b/src/index.spec.ts index da946979..0ca81677 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -8,6 +8,7 @@ import Main, { LoadMainSettingsFromEnv } from './services/main/index.js' import * as Types from '../proto/autogenerated/ts/types.js'; import nostrMiddleware from './nostrMiddleware.js' import { LoadNosrtSettingsFromEnv } from './services/nostr/index.js'; +import { expect } from 'chai'; import NostrHandler from './services/nostr/index.js' @@ -35,12 +36,13 @@ const clientNostr = new NostrHandler({ privateKey: clientPrivateKey, publicKey: clientPublicKey, relays: settings.relays -}, (event, getContent) => { - console.log(getContent()) +}, (event) => { + console.log(event.content) }) -const mainHandler = new Main(LoadMainSettingsFromEnv(true)) // TODO - test env file +const mainSettings = LoadMainSettingsFromEnv(true) +const mainHandler = new Main(mainSettings) // TODO - test env file const serverMethods = GetServerMethods(mainHandler) -nostrMiddleware(serverMethods, mainHandler, { +const serverNostr = nostrMiddleware(serverMethods, mainHandler, { allowedPubs: [clientPublicKey], privateKey: serverPrivateKey, publicKey: serverPublicKey, @@ -55,6 +57,8 @@ export const setup = async () => { server.Listen(testPort) } export const teardown = async () => { + clientNostr.Stop() + serverNostr.Stop() mainHandler.lnd.Stop() server.Close() } @@ -64,20 +68,33 @@ export default async (d: (message: string, failure?: boolean) => void) => { await client.Health() d("health ok") - console.log(await client.LndGetInfo({ node_id: 0 })) + console.log(await client.LndGetInfo({ nodeId: 0 })) d("lnd info ok") - const res = await client.AddUser({ name: "test", callback_url: "http://...", secret: "shhhhhht" }) + const res = await client.AddUser({ name: "test", callbackUrl: "http://...", secret: "shhhhhht" }) if (res.status === 'ERROR') throw new Error(res.reason) - console.log(res.result) - const user = await mainHandler.storage.GetUser(res.result.user_id) + console.log(res) + const user = await mainHandler.storage.GetUser(res.userId) console.log(user) - userAuthHeader = res.result.auth_token + userAuthHeader = res.authToken d("create user ok") - console.log(await client.NewAddress({ address_type: Types.AddressType.WITNESS_PUBKEY_HASH })) + console.log(await client.NewAddress({ addressType: Types.AddressType.WITNESS_PUBKEY_HASH })) d("new address ok") await new Promise(res => setTimeout(res, 2000)) clientNostr.Send(serverPublicKey, JSON.stringify({ requestId: "a", method: '/api/user/chain/new', body: { address_type: 'WITNESS_PUBKEY_HASH' } })) + const lnurlWithdrawLink = await client.GetLnurlWithdrawLink() + if (lnurlWithdrawLink.status === 'ERROR') throw new Error(lnurlWithdrawLink.reason) + const lnurlWithdrawInfo = await client.GetLnurlWithdrawInfo({ k1: lnurlWithdrawLink.k1 }) + const expectedInfo: Partial & { status: 'OK' } = { + status: 'OK', + tag: "withdrawRequest", + defaultDescription: "lnurl withdraw from lightning.pub", + maxWithdrawable: 0, + minWithdrawable: 0, + } + expect(lnurlWithdrawInfo).to.deep.include(expectedInfo) + d("lnurl info ok") + } diff --git a/src/nostrMiddleware.ts b/src/nostrMiddleware.ts index 358bdf80..9280ddc5 100644 --- a/src/nostrMiddleware.ts +++ b/src/nostrMiddleware.ts @@ -1,10 +1,8 @@ import Main from "./services/main/index.js" import Nostr from "./services/nostr/index.js" -import { NostrSettings } from "./services/nostr/index.js" +import { NostrSettings } from "./services/nostr/handler.js" import * as Types from '../proto/autogenerated/ts/types.js' -import GetServerMethods from './services/serverMethods/index.js' -import serverOptions from './auth.js'; -const handledEvents: string[] = [] // TODO: - big memory leak here, add TTL + const handledRequests: string[] = [] // TODO: - big memory leak here, add TTL type EventRequest = { requestId: string @@ -14,30 +12,22 @@ type EventRequest = { query: Record } -export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSettings: NostrSettings) => { +export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSettings: NostrSettings): Nostr => { // TODO: - move to codegen const nostr = new Nostr(nostrSettings, - async (event, getContent) => { - //@ts-ignore - const eventId = event.id - if (handledEvents.includes(eventId)) { - console.log("event already handled") - return - } - handledEvents.push(eventId) - const nostrPub = event.pubkey as string - if (!nostrSettings.allowedPubs.includes(nostrPub)) { + async (event) => { + if (!nostrSettings.allowedPubs.includes(event.pub)) { console.log("nostr pub not allowed") return } - let nostrUser = await mainHandler.storage.FindNostrUser(nostrPub) + let nostrUser = await mainHandler.storage.FindNostrUser(event.pub) if (!nostrUser) { - nostrUser = await mainHandler.storage.AddNostrUser(nostrPub) + nostrUser = await mainHandler.storage.AddNostrUser(event.pub) } let j: EventRequest try { - j = JSON.parse(getContent()) + j = JSON.parse(event.content) } catch { console.error("invalid json event received", event.content) return @@ -51,14 +41,15 @@ export default (serverMethods: Types.ServerMethods, mainHandler: Main, nostrSett case '/api/user/chain/new': const error = Types.NewAddressRequestValidate(j.body) if (error !== null) { - console.error("invalid request from", nostrPub, j)// TODO: dont dox + console.error("invalid request from", event.pub, j)// TODO: dont dox return // TODO: respond } if (!serverMethods.NewAddress) { throw new Error("unimplemented NewInvoice") } const res = await serverMethods.NewAddress({ user_id: nostrUser.user.user_id }, j.body) - nostr.Send(nostrPub, JSON.stringify({ ...res, requestId: j.requestId })) + nostr.Send(event.pub, JSON.stringify({ ...res, requestId: j.requestId })) } }) + return nostr } \ No newline at end of file diff --git a/src/services/lnd/index.spec.ts b/src/services/lnd/index.spec.ts index c154326c..0d87f8af 100644 --- a/src/services/lnd/index.spec.ts +++ b/src/services/lnd/index.spec.ts @@ -2,9 +2,10 @@ import 'dotenv/config' // TODO - test env import { expect } from 'chai' import LndHandler, { LoadLndSettingsFromEnv } from './index.js' import * as Types from '../../../proto/autogenerated/ts/types.js'; -const lnd = new LndHandler(LoadLndSettingsFromEnv(true), console.log, console.log) +let lnd: LndHandler export const ignore = true export const setup = async () => { + lnd = new LndHandler(LoadLndSettingsFromEnv(true), console.log, console.log) await lnd.Warmup() } export const teardown = () => { diff --git a/src/services/lnd/index.ts b/src/services/lnd/index.ts index 9ae11ce0..d2299bd2 100644 --- a/src/services/lnd/index.ts +++ b/src/services/lnd/index.ts @@ -140,9 +140,9 @@ export default class { return res.response } - async NewInvoice(value: number): Promise { + async NewInvoice(value: number, memo: string): Promise { this.checkReady() - const res = await this.lightning.addInvoice(AddInvoiceReq(value), DeadLineMetadata()) + const res = await this.lightning.addInvoice(AddInvoiceReq(value, memo), DeadLineMetadata()) return res.response } @@ -155,6 +155,10 @@ export default class { return Math.ceil(amount * this.settings.feeRateLimit + this.settings.feeFixedLimit); } + GetMaxWithinLimit(amount: number) { + return Math.max(0, Math.floor(amount * (1 - this.settings.feeRateLimit) - this.settings.feeFixedLimit)) + } + async PayInvoice(invoice: string, amount: number, feeLimit: number): Promise { this.checkReady() const abortController = new AbortController() diff --git a/src/services/main/index.ts b/src/services/main/index.ts index 61609dca..7c9fc7c3 100644 --- a/src/services/main/index.ts +++ b/src/services/main/index.ts @@ -1,4 +1,5 @@ import jwt from 'jsonwebtoken' +import { bech32 } from 'bech32' import Storage, { LoadStorageSettingsFromEnv, StorageSettings } from '../storage/index.js' import * as Types from '../../../proto/autogenerated/ts/types.js' import LND, { AddressPaidCb, InvoicePaidCb, LndSettings, LoadLndSettingsFromEnv } from '../lnd/index.js' @@ -11,6 +12,7 @@ export type MainSettings = { outgoingTxFee: number incomingInvoiceFee: number outgoingInvoiceFee: number + serviceUrl: string } export const LoadMainSettingsFromEnv = (test = false): MainSettings => { return { @@ -21,6 +23,7 @@ export const LoadMainSettingsFromEnv = (test = false): MainSettings => { outgoingTxFee: EnvMustBeInteger("SERVICE_FEE_OUTGOING_TX_PERCENT") / 100, incomingInvoiceFee: EnvMustBeInteger("SERVICE_FEE_INCOMING_INVOICE_PERCENT") / 100, outgoingInvoiceFee: EnvMustBeInteger("SERVICE_FEE_OUTGOING_INVOICE_PERCENT") / 100, + serviceUrl: EnvMustBeNonEmptyString("SERVICE_URL") } } enum ActionType { @@ -30,6 +33,7 @@ enum ActionType { OUTGOING_INVOICE = "OUTGOING_INVOICE" } +const defaultLnurlPayMetadata = '[["text/plain", "lnurl pay to Lightning.pub"]]' export default class { storage: Storage lnd: LND @@ -91,13 +95,13 @@ export default class { async AddBasicUser(req: Types.AddUserRequest): Promise { const { user } = await this.storage.AddBasicUser(req.name, req.secret) return { - user_id: user.user_id, - auth_token: this.SignUserToken(user.user_id) + userId: user.user_id, + authToken: this.SignUserToken(user.user_id) } } async NewAddress(userId: string, req: Types.NewAddressRequest): Promise { - const res = await this.lnd.NewAddress(req.address_type) + const res = await this.lnd.NewAddress(req.addressType) const userAddress = await this.storage.AddUserAddress(userId, res.address) return { address: userAddress.address @@ -105,7 +109,7 @@ export default class { } async NewInvoice(userId: string, req: Types.NewInvoiceRequest): Promise { - const res = await this.lnd.NewInvoice(req.amount_sats) + const res = await this.lnd.NewInvoice(req.amountSats, req.memo) const userInvoice = await this.storage.AddUserInvoice(userId, res.paymentRequest) return { invoice: userInvoice.invoice @@ -123,6 +127,11 @@ export default class { }) } + GetMaxPayableInvoice(balance: number): number { + const maxWithinServiceFee = Math.max(0, Math.floor(balance * (1 - this.settings.outgoingInvoiceFee))) + return this.lnd.GetMaxWithinLimit(maxWithinServiceFee) + } + async PayInvoice(userId: string, req: Types.PayInvoiceRequest): Promise { const decoded = await this.lnd.DecodeInvoice(req.invoice) if (decoded.numSatoshis !== 0 && req.amount !== 0) { @@ -148,22 +157,98 @@ export default class { } async PayAddress(userId: string, req: Types.PayAddressRequest): Promise { - const estimate = await this.lnd.EstimateChainFees(req.address, req.amout_sats, req.target_conf) + const estimate = await this.lnd.EstimateChainFees(req.address, req.amoutSats, req.targetConf) const satPerVByte = Number(estimate.satPerVbyte) const chainFees = Number(estimate.feeSat) - const total = req.amout_sats + chainFees - const serviceFee = this.getServiceFee(ActionType.OUTGOING_INVOICE, req.amout_sats) + const total = req.amoutSats + chainFees + const serviceFee = this.getServiceFee(ActionType.OUTGOING_INVOICE, req.amoutSats) await this.lockUserWithMinBalance(userId, total + serviceFee) - const payment = await this.lnd.PayAddress(req.address, req.amout_sats, satPerVByte) + const payment = await this.lnd.PayAddress(req.address, req.amoutSats, satPerVByte) await this.storage.DecrementUserBalance(userId, total + serviceFee) await this.storage.UnlockUser(userId) - await this.storage.AddUserTransactionPayment(userId, req.address, payment.txid, 0, req.amout_sats, chainFees, serviceFee) + await this.storage.AddUserTransactionPayment(userId, req.address, payment.txid, 0, req.amoutSats, chainFees, serviceFee) return { - tx_id: payment.txid + txId: payment.txid } } + balanceCheckUrl(k1: string): string { + return `${this.settings.serviceUrl}/api/guest/lnurl_withdraw/info?k1=${k1}` + } + + async GetLnurlChannelLink(userId: string): Promise { + const key = await this.storage.AddUserEphemeralKey(userId, 'balanceCheck') + return { + lnurl: this.encodeLnurl(this.balanceCheckUrl(key.key)), + k1: key.key + } + } + + async GetLnurlWithdrawInfo(balanceCheckK1: string): Promise { + const key = await this.storage.UseUserEphemeralKey(balanceCheckK1, 'balanceCheck') + const maxWithdrawable = this.GetMaxPayableInvoice(key.user.balance_sats) + const callbackK1 = await this.storage.AddUserEphemeralKey(key.user.user_id, 'withdraw') + const newBalanceCheckK1 = await this.storage.AddUserEphemeralKey(key.user.user_id, 'balanceCheck') + const payInfoK1 = await this.storage.AddUserEphemeralKey(key.user.user_id, 'pay') + return { + tag: "withdrawRequest", + callback: `${this.settings.serviceUrl}/api/guest/lnurl_withdraw/handle`, + defaultDescription: "lnurl withdraw from lightning.pub", + k1: callbackK1.key, + maxWithdrawable: maxWithdrawable, + minWithdrawable: 0, + balanceCheck: this.balanceCheckUrl(newBalanceCheckK1.key), + payLink: `${this.settings.serviceUrl}/api/guest/lnurl_pay/info?k1=${payInfoK1.key}`, + } + } + + async HandleLnurlWithdraw(k1: string, invoice: string): Promise { + const key = await this.storage.UseUserEphemeralKey(k1, 'withdraw') + this.PayInvoice(key.user.user_id, { + invoice: invoice, + amount: 0 + }).catch(err => { + console.error("error sending payment for lnurl withdraw to ", key.user.user_id, err) + }) + } + + async GetLnurlPayInfo(payInfoK1: string): Promise { + const key = await this.storage.UseUserEphemeralKey(payInfoK1, 'payInfo') + const payK1 = await this.storage.AddUserEphemeralKey(key.user.user_id, 'pay') + return { + tag: 'payRequest', + callback: `${this.settings.serviceUrl}/api/guest/lnurl_pay/handle?k1=${payK1.key}`, + maxSendable: 10000000, + minSendable: 0, + metadata: defaultLnurlPayMetadata + } + } + + async HandleLnurlPay(payK1: string, amountMillis: number): Promise { + const key = await this.storage.UseUserEphemeralKey(payK1, 'pay') + const sats = amountMillis / 1000 + if (!Number.isInteger(sats)) { + throw new Error("millisats amount must be integer sats amount") + } + const invoice = await this.NewInvoice(key.user.user_id, { + amountSats: sats, + memo: defaultLnurlPayMetadata + }) + return { + pr: invoice.invoice, + routes: [] + } + } + + async OpenChannel(userId: string, req: Types.OpenChannelRequest): Promise { throw new Error("WIP") } + encodeLnurl(base: string) { + if (!base || typeof base !== 'string') { + throw new Error("provided string for lnurl encode is not a string or is an empty string") + } + let words = bech32.toWords(Buffer.from(base, 'utf8')); + return bech32.encode('lnurl', words, 1023); + } } \ No newline at end of file diff --git a/src/services/nostr/handler.ts b/src/services/nostr/handler.ts new file mode 100644 index 00000000..29c1a2db --- /dev/null +++ b/src/services/nostr/handler.ts @@ -0,0 +1,124 @@ +import { relayPool, Subscription, Event } from 'nostr-tools' +//@ts-ignore +import { decrypt, encrypt } from 'nostr-tools/nip04.js' +const handledEvents: string[] = [] // TODO: - big memory leak here, add TTL +export type NostrSettings = { + privateKey: string + publicKey: string + relays: string[] + allowedPubs: string[] +} +export type NostrEvent = { + id: string + pub: string + content: string +} +type SettingsRequest = { + type: 'settings' + settings: NostrSettings +} + +type SendRequest = { + type: 'send' + pub: string + message: string +} +type ReadyResponse = { + type: 'ready' +} +type EventResponse = { + type: 'event' + event: NostrEvent +} + +export type ChildProcessRequest = SettingsRequest | SendRequest +export type ChildProcessResponse = ReadyResponse | EventResponse +const send = (message: ChildProcessResponse) => { + if (process.send) { + process.send(message) + } +} +let subProcessHandler: Handler | undefined +process.on("message", (message: ChildProcessRequest) => { + switch (message.type) { + case 'settings': + initSubprocessHandler(message.settings) + break + case 'send': + sendToNostr(message.pub, message.message) + default: + console.error("unknown nostr request", message) + break + } +}) +const initSubprocessHandler = (settings: NostrSettings) => { + if (subProcessHandler) { + console.error("nostr settings ignored since handler already exists") + return + } + subProcessHandler = new Handler(settings, event => { + send({ + type: 'event', + event: event + }) + }) +} +const sendToNostr = (pub: string, message: string) => { + if (!subProcessHandler) { + console.error("nostr was not initialized") + return + } + subProcessHandler.Send(pub, message) +} +send({ type: 'ready' }) + +export default class Handler { + pool = relayPool() + settings: NostrSettings + sub: Subscription + constructor(settings: NostrSettings, eventCallback: (event: NostrEvent) => void) { + this.settings = settings + this.pool.setPrivateKey(settings.privateKey) + settings.relays.forEach(relay => { + try { + this.pool.addRelay(relay, { read: true, write: true }) + } catch (e) { + console.error("cannot add relay:", relay) + } + }); + this.sub = this.pool.sub({ + //@ts-ignore + filter: { + since: Math.ceil(Date.now() / 1000), + kinds: [4], + '#p': [settings.publicKey], + }, + cb: async (e, relay) => { + if (e.kind !== 4 || !e.pubkey) { + return + } + //@ts-ignore + const eventId = e.id as string + if (handledEvents.includes(eventId)) { + console.log("event already handled") + return + } + handledEvents.push(eventId) + eventCallback({ id: eventId, content: decrypt(this.settings.privateKey, e.pubkey, e.content), pub: e.pubkey }) + } + }) + } + + Send(nostrPub: string, message: string) { + this.pool.publish({ + content: encrypt(this.settings.privateKey, nostrPub, message), + created_at: Math.floor(Date.now() / 1000), + kind: 4, + pubkey: this.settings.publicKey, + //@ts-ignore + tags: [['p', nostrPub]] + }, (status, url) => { + console.log(status, url) // TODO + }) + } +} \ No newline at end of file diff --git a/src/services/nostr/index.spec.ts b/src/services/nostr/index.spec.ts index b1fc5667..0b556508 100644 --- a/src/services/nostr/index.spec.ts +++ b/src/services/nostr/index.spec.ts @@ -1,9 +1,8 @@ import 'dotenv/config' // TODO - test env import { Buffer } from 'buffer' -import { generatePrivateKey, getPublicKey, relayPool } from 'nostr-tools' -//@ts-ignore -import { decrypt, encrypt } from 'nostr-tools/nip04.js' -import NostrHandler, { LoadNosrtSettingsFromEnv, NostrSettings } from './index.js' +import { generatePrivateKey, getPublicKey } from 'nostr-tools' + +import NostrHandler, { LoadNosrtSettingsFromEnv } from './index.js' import { expect } from 'chai' export const ignore = true const settings = LoadNosrtSettingsFromEnv(true) @@ -13,28 +12,36 @@ const clientPublicKey = getPublicKey(Buffer.from(clientPrivateKey, "hex")) const serverPrivateKey = generatePrivateKey() const serverPublicKey = getPublicKey(Buffer.from(serverPrivateKey, "hex")) +let clientNostr: NostrHandler +let serverNostr: NostrHandler -export default async (d: (message: string, failure?: boolean) => void) => { - - const clientNostr = new NostrHandler({ +let receivedServerEvents = 0 +let latestReceivedServerEvent = "" +export const setup = () => { + clientNostr = new NostrHandler({ allowedPubs: [], privateKey: clientPrivateKey, publicKey: clientPublicKey, relays: settings.relays - }, (event, getContent) => { + }, (event) => { }) - let receivedServerEvents = 0 - let latestReceivedServerEvent = "" - const serverNostr = new NostrHandler({ + serverNostr = new NostrHandler({ allowedPubs: [clientPublicKey], privateKey: serverPrivateKey, publicKey: serverPublicKey, relays: settings.relays - }, (event, getContent) => { + }, (event) => { receivedServerEvents++ - latestReceivedServerEvent = getContent() + latestReceivedServerEvent = event.content }) +} +export const teardown = () => { + clientNostr.Stop() + serverNostr.Stop() +} + +export default async (d: (message: string, failure?: boolean) => void) => { await new Promise(res => setTimeout(res, 2000)) clientNostr.Send(serverPublicKey, "test") await new Promise(res => setTimeout(res, 1000)) diff --git a/src/services/nostr/index.ts b/src/services/nostr/index.ts index 06882c57..b8dbe7c1 100644 --- a/src/services/nostr/index.ts +++ b/src/services/nostr/index.ts @@ -1,15 +1,8 @@ -import { relayPool, Subscription, Event } from 'nostr-tools' -//@ts-ignore -import { decrypt, encrypt } from 'nostr-tools/nip04.js' -import { EnvMustBeNonEmptyString } from '../helpers/envParser.js'; - -export type NostrSettings = { - privateKey: string - publicKey: string - relays: string[] - allowedPubs: string[] -} -export const LoadNosrtSettingsFromEnv = (test = false): NostrSettings => { +import { ChildProcess, fork } from 'child_process' +import { EnvMustBeNonEmptyString } from "../helpers/envParser.js" +import { NostrSettings, NostrEvent, ChildProcessRequest, ChildProcessResponse } from "./handler.js" +type EventCallback = (event: NostrEvent) => void +export const LoadNosrtSettingsFromEnv = (test = false) => { return { allowedPubs: EnvMustBeNonEmptyString("NOSTR_ALLOWED_PUBS").split(' '), privateKey: EnvMustBeNonEmptyString("NOSTR_PRIVATE_KEY"), @@ -17,48 +10,34 @@ export const LoadNosrtSettingsFromEnv = (test = false): NostrSettings => { relays: EnvMustBeNonEmptyString("NOSTR_RELAYS").split(' ') } } -export default class { - pool = relayPool() +export default class NostrSubprocess { settings: NostrSettings - sub: Subscription - constructor(settings: NostrSettings, eventCallback: (event: Event, getContent: () => string) => void) { - this.settings = settings - this.pool.setPrivateKey(settings.privateKey) - settings.relays.forEach(relay => { - try { - this.pool.addRelay(relay, { read: true, write: true }) - } catch (e) { - console.error("cannot add relay:", relay) - } - }); - this.sub = this.pool.sub({ - //@ts-ignore - filter: { - since: Math.ceil(Date.now() / 1000), - kinds: [4], - '#p': [settings.publicKey], - }, - cb: async (e, relay) => { - if (e.kind !== 4 || !e.pubkey) { - return - } - eventCallback(e, () => { - return decrypt(this.settings.privateKey, e.pubkey, e.content) - }) + childProcess: ChildProcess + constructor(settings: NostrSettings, eventCallback: EventCallback) { + this.childProcess = fork("./build/src/services/nostr/handler") + this.childProcess.on("error", console.error) + this.childProcess.on("message", (message: ChildProcessResponse) => { + switch (message.type) { + case 'ready': + this.sendToChildProcess({ type: 'settings', settings: settings }) + break; + case 'event': + eventCallback(message.event) + break + default: + console.error("unknown nostr event response", message) + break; } }) } + sendToChildProcess(message: ChildProcessRequest) { + this.childProcess.send(message) + } - Send(nostrPub: string, message: string) { - this.pool.publish({ - content: encrypt(this.settings.privateKey, nostrPub, message), - created_at: Math.floor(Date.now() / 1000), - kind: 4, - pubkey: this.settings.publicKey, - //@ts-ignore - tags: [['p', nostrPub]] - }, (status, url) => { - console.log(status, url) // TODO - }) + Send(pub: string, message: string) { + this.sendToChildProcess({ type: 'send', pub: pub, message: message }) + } + Stop() { + this.childProcess.kill() } } \ No newline at end of file diff --git a/src/services/serverMethods/index.ts b/src/services/serverMethods/index.ts index f1567fe5..f9969d3e 100644 --- a/src/services/serverMethods/index.ts +++ b/src/services/serverMethods/index.ts @@ -2,52 +2,67 @@ import * as Types from '../../../proto/autogenerated/ts/types.js' import Main from '../main/index.js' export default (mainHandler: Main): Types.ServerMethods => { return { - EncryptionExchange: async (ctx: Types.EncryptionExchange_Context, req: Types.EncryptionExchangeRequest): Promise => { }, - Health: async (ctx: Types.Health_Context): Promise => { }, - LndGetInfo: async (ctx: Types.LndGetInfo_Context): Promise => { + EncryptionExchange: async (ctx, req) => { }, + Health: async (ctx) => { }, + LndGetInfo: async (ctx) => { const info = await mainHandler.lnd.GetInfo() return { alias: info.alias } }, - AddUser: async (ctx: Types.GuestContext, req: Types.AddUserRequest): Promise => { + AddUser: async (ctx, req) => { const err = Types.AddUserRequestValidate(req, { - callback_url_CustomCheck: url => url.startsWith("http://") || url.startsWith("https://"), + callbackUrl_CustomCheck: url => url.startsWith("http://") || url.startsWith("https://"), name_CustomCheck: name => name.length > 0, secret_CustomCheck: secret => secret.length >= 8 }) if (err != null) throw new Error(err.message) return mainHandler.AddBasicUser(req) }, - AuthUser: async (ctx: Types.GuestContext, req: Types.AuthUserRequest): Promise => { + AuthUser: async (ctx, req) => { throw new Error("unimplemented") }, - OpenChannel: async (ctx: Types.UserContext, req: Types.OpenChannelRequest): Promise => { + OpenChannel: async (ctx, req) => { const err = Types.OpenChannelRequestValidate(req, { - funding_amount_CustomCheck: amt => amt > 0, - push_amount_CustomCheck: amt => amt > 0, + fundingAmount_CustomCheck: amt => amt > 0, + pushAmount_CustomCheck: amt => amt > 0, destination_CustomCheck: dest => dest !== "" }) if (err != null) throw new Error(err.message) return mainHandler.OpenChannel(ctx.user_id, req) }, - NewAddress: async (ctx: Types.UserContext, req: Types.NewAddressRequest): Promise => { + NewAddress: async (ctx, req) => { return mainHandler.NewAddress(ctx.user_id, req) }, - PayAddress: async (ctx: Types.UserContext, req: Types.PayAddressRequest): Promise => { + PayAddress: async (ctx, req) => { const err = Types.PayAddressRequestValidate(req, { address_CustomCheck: addr => addr !== '', - amout_sats_CustomCheck: amt => amt > 0, - target_conf_CustomCheck: target => target > 0 + amoutSats_CustomCheck: amt => amt > 0, + targetConf_CustomCheck: target => target > 0 }) if (err != null) throw new Error(err.message) return mainHandler.PayAddress(ctx.user_id, req) }, - NewInvoice: async (ctx: Types.UserContext, req: Types.NewInvoiceRequest): Promise => { + NewInvoice: async (ctx, req) => { throw new Error("unimplemented") }, - PayInvoice: async (ctx: Types.UserContext, req: Types.PayInvoiceRequest): Promise => { + PayInvoice: async (ctx, req) => { throw new Error("unimplemented") }, - GetOpenChannelLNURL: async (ctx: Types.UserContext): Promise => { + GetLnurlWithdrawLink: async (ctx) => { + return mainHandler.GetLnurlChannelLink(ctx.user_id) + }, + GetLnurlWithdrawInfo: async (ctx) => { + if (!ctx.k1) { + throw new Error("invalid lnurl to get info") + } + return mainHandler.GetLnurlWithdrawInfo(ctx.k1) + }, + HandleLnurlWithdraw: async (ctx) => { + if (!ctx.k1 || !ctx.pr) { + throw new Error("invalid lnurl to handle") + } + await mainHandler.HandleLnurlWithdraw(ctx.k1, ctx.pr) + }, + GetLNURLChannelLink: async (ctx) => { throw new Error("unimplemented") } } diff --git a/src/services/storage/db.ts b/src/services/storage/db.ts index a1e95cf3..85e67589 100644 --- a/src/services/storage/db.ts +++ b/src/services/storage/db.ts @@ -9,6 +9,7 @@ import { EnvMustBeNonEmptyString } from "../helpers/envParser.js" import { UserTransactionPayment } from "./entity/UserTransactionPayment.js" import { UserNostrAuth } from "./entity/UserNostrAuth.js" import { UserBasicAuth } from "./entity/UserBasicAuth.js" +import { UserEphemeralKey } from "./entity/UserEphemeralKey.js" export type DbSettings = { databaseFile: string } @@ -20,7 +21,7 @@ export default async (settings: DbSettings) => { type: "sqlite", database: settings.databaseFile, //logging: true, - entities: [User, UserReceivingInvoice, UserReceivingAddress, AddressReceivingTransaction, UserInvoicePayment, UserTransactionPayment, UserNostrAuth, UserBasicAuth], + entities: [User, UserReceivingInvoice, UserReceivingAddress, AddressReceivingTransaction, UserInvoicePayment, UserTransactionPayment, UserNostrAuth, UserBasicAuth, UserEphemeralKey], synchronize: true }).initialize() } \ No newline at end of file diff --git a/src/services/storage/entity/AddressReceivingTransaction.ts b/src/services/storage/entity/AddressReceivingTransaction.ts index fcad5ec1..e8e2967c 100644 --- a/src/services/storage/entity/AddressReceivingTransaction.ts +++ b/src/services/storage/entity/AddressReceivingTransaction.ts @@ -1,4 +1,4 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne } from "typeorm" +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn } from "typeorm" import { UserReceivingAddress } from "./UserReceivingAddress.js" @@ -9,7 +9,8 @@ export class AddressReceivingTransaction { @PrimaryGeneratedColumn() serial_id: number - @ManyToOne(type => UserReceivingAddress) + @ManyToOne(type => UserReceivingAddress, { eager: true }) + @JoinColumn() user_address: UserReceivingAddress @Column() diff --git a/src/services/storage/entity/UserBasicAuth.ts b/src/services/storage/entity/UserBasicAuth.ts index f518e8e7..8e7e1e3e 100644 --- a/src/services/storage/entity/UserBasicAuth.ts +++ b/src/services/storage/entity/UserBasicAuth.ts @@ -1,4 +1,4 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne } from "typeorm" +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn } from "typeorm" import { User } from "./User.js" @Entity() @@ -7,7 +7,8 @@ export class UserBasicAuth { @PrimaryGeneratedColumn() serial_id: number - @ManyToOne(type => User) + @ManyToOne(type => User, { eager: true }) + @JoinColumn() user: User @Column() diff --git a/src/services/storage/entity/UserEphemeralKey.ts b/src/services/storage/entity/UserEphemeralKey.ts new file mode 100644 index 00000000..fd32a4ed --- /dev/null +++ b/src/services/storage/entity/UserEphemeralKey.ts @@ -0,0 +1,20 @@ +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn } from "typeorm" +import { User } from "./User.js" +export type EphemeralKeyType = 'balanceCheck' | 'payInfo' | 'pay' | 'withdraw' +@Entity() +export class UserEphemeralKey { + + @PrimaryGeneratedColumn() + serial_id: number + + @ManyToOne(type => User, { eager: true }) + @JoinColumn() + user: User + + @Column() + @Index({ unique: true }) + key: string + + @Column() + type: EphemeralKeyType +} diff --git a/src/services/storage/entity/UserInvoicePayment.ts b/src/services/storage/entity/UserInvoicePayment.ts index cff0fdac..8e3fd1b7 100644 --- a/src/services/storage/entity/UserInvoicePayment.ts +++ b/src/services/storage/entity/UserInvoicePayment.ts @@ -1,4 +1,4 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne } from "typeorm" +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn } from "typeorm" import { User } from "./User.js" @Entity() @@ -7,7 +7,8 @@ export class UserInvoicePayment { @PrimaryGeneratedColumn() serial_id: number - @ManyToOne(type => User) + @ManyToOne(type => User, { eager: true }) + @JoinColumn() user: User @Column() diff --git a/src/services/storage/entity/UserNostrAuth.ts b/src/services/storage/entity/UserNostrAuth.ts index 4e486edf..1493e4db 100644 --- a/src/services/storage/entity/UserNostrAuth.ts +++ b/src/services/storage/entity/UserNostrAuth.ts @@ -1,4 +1,4 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne } from "typeorm" +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn } from "typeorm" import { User } from "./User.js" @Entity() @@ -7,7 +7,8 @@ export class UserNostrAuth { @PrimaryGeneratedColumn() serial_id: number - @ManyToOne(type => User) + @ManyToOne(type => User, { eager: true }) + @JoinColumn() user: User @Column() diff --git a/src/services/storage/entity/UserReceivingAddress.ts b/src/services/storage/entity/UserReceivingAddress.ts index e37a2a94..7c4acc65 100644 --- a/src/services/storage/entity/UserReceivingAddress.ts +++ b/src/services/storage/entity/UserReceivingAddress.ts @@ -1,4 +1,4 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne } from "typeorm" +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn } from "typeorm" import { User } from "./User.js" @Entity() @@ -7,7 +7,8 @@ export class UserReceivingAddress { @PrimaryGeneratedColumn() serial_id: number - @ManyToOne(type => User) + @ManyToOne(type => User, { eager: true }) + @JoinColumn() user: User @Column() diff --git a/src/services/storage/entity/UserReceivingInvoice.ts b/src/services/storage/entity/UserReceivingInvoice.ts index 5b2d5a40..64c24b59 100644 --- a/src/services/storage/entity/UserReceivingInvoice.ts +++ b/src/services/storage/entity/UserReceivingInvoice.ts @@ -1,4 +1,4 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne } from "typeorm" +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn } from "typeorm" import { User } from "./User.js" @Entity() @@ -7,7 +7,8 @@ export class UserReceivingInvoice { @PrimaryGeneratedColumn() serial_id: number - @ManyToOne(type => User) + @ManyToOne(type => User, { eager: true }) + @JoinColumn() user: User @Column() diff --git a/src/services/storage/entity/UserTransactionPayment.ts b/src/services/storage/entity/UserTransactionPayment.ts index 17a5fd3d..f6ce95f2 100644 --- a/src/services/storage/entity/UserTransactionPayment.ts +++ b/src/services/storage/entity/UserTransactionPayment.ts @@ -1,4 +1,4 @@ -import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne } from "typeorm" +import { Entity, PrimaryGeneratedColumn, Column, Index, Check, ManyToOne, JoinColumn } from "typeorm" import { User } from "./User.js" @Entity() @@ -8,7 +8,8 @@ export class UserTransactionPayment { @PrimaryGeneratedColumn() serial_id: number - @ManyToOne(type => User) + @ManyToOne(type => User, { eager: true }) + @JoinColumn() user: User @Column() diff --git a/src/services/storage/index.ts b/src/services/storage/index.ts index 80845f5d..ab6fb41a 100644 --- a/src/services/storage/index.ts +++ b/src/services/storage/index.ts @@ -9,6 +9,7 @@ import { UserInvoicePayment } from "./entity/UserInvoicePayment.js"; import { UserTransactionPayment } from "./entity/UserTransactionPayment.js"; import { UserNostrAuth } from "./entity/UserNostrAuth.js"; import { UserBasicAuth } from "./entity/UserBasicAuth.js"; +import { EphemeralKeyType, UserEphemeralKey } from "./entity/UserEphemeralKey.js"; export type StorageSettings = { dbSettings: DbSettings } @@ -185,5 +186,26 @@ export default class { } } + async AddUserEphemeralKey(userId: string, keyType: EphemeralKeyType, entityManager = this.DB): Promise { + const newKey = entityManager.getRepository(UserEphemeralKey).create({ + user: await this.GetUser(userId, entityManager), + key: crypto.randomBytes(31).toString('hex'), + type: keyType + }) + return entityManager.getRepository(UserEphemeralKey).save(newKey) + } + async UseUserEphemeralKey(key: string, keyType: EphemeralKeyType, entityManager = this.DB): Promise { + const found = await entityManager.getRepository(UserEphemeralKey).findOne({ + where: { + key: key, + type: keyType + } + }) + if (!found) { + throw new Error("the provided ephemeral key is invalid") + } + await entityManager.getRepository(UserEphemeralKey).delete(found.serial_id) + return found + } } \ No newline at end of file diff --git a/src/test.ts b/src/test.ts index 3b916687..16a3d5f5 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,4 +1,3 @@ -import { LightningClientImpl } from '../proto/lnd/lightning' const failure = true export default async (describe: (message: string, failure?: boolean) => void) => { describe("all good") diff --git a/testRunner.ts b/src/testRunner.ts similarity index 86% rename from testRunner.ts rename to src/testRunner.ts index 106f66d1..3af99a58 100644 --- a/testRunner.ts +++ b/src/testRunner.ts @@ -9,9 +9,10 @@ type TestModule = { } const start = async () => { - const files = await globby("**/*.spec.ts") + const files = await globby("**/*.spec.js") for (const file of files) { - const module = await import(`./${file}`) as TestModule + console.log(file) + const module = await import(`./${file.slice("build/src/".length)}`) as TestModule await runTestFile(file, module) } @@ -19,10 +20,11 @@ const start = async () => { const runTestFile = async (fileName: string, mod: TestModule) => { + const d = getDescribe(fileName) if (mod.ignore) { + d("-----ignoring file-----") return } - const d = getDescribe(fileName) try { if (mod.setup) { d("setup started")