astra-lightning 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/unit-test.yml +20 -0
- package/CHANGELOG.md +46 -1
- package/README.md +2 -0
- package/bolt02/ids.json +1 -0
- package/grpc/grpc_services.json +1 -1
- package/grpc/protos/lightning.proto +251 -28
- package/grpc/protos/rfqrpc/rfq.proto +53 -5
- package/grpc/protos/router.proto +9 -4
- package/grpc/protos/routerrpc/router.proto +26 -4
- package/grpc/protos/{tapchannelrpc.proto → tapchannel.proto} +105 -25
- package/grpc/protos/tapcommon.proto +36 -0
- package/grpc/protos/taprootassets.proto +544 -23
- package/grpc/protos/walletkit.proto +78 -6
- package/index.js +162 -160
- package/lnd_methods/generic/get_height.js +1 -1
- package/lnd_methods/index.js +162 -160
- package/lnd_methods/info/constants.json +7 -0
- package/lnd_methods/invoices/create_invoice.js +10 -14
- package/lnd_methods/invoices/subscribe_to_invoice.d.ts +4 -0
- package/lnd_methods/invoices/subscribe_to_invoice.js +21 -21
- package/lnd_methods/macaroon/methods.json +4 -0
- package/lnd_methods/offchain/decode_asset_pay_req.d.ts +69 -28
- package/lnd_methods/offchain/decode_asset_pay_req.js +54 -61
- package/lnd_methods/offchain/get_pending_channels.d.ts +16 -0
- package/lnd_methods/offchain/get_pending_channels.js +6 -0
- package/lnd_methods/offchain/get_routing_fee_estimate.d.ts +32 -0
- package/lnd_methods/offchain/get_routing_fee_estimate.js +86 -0
- package/lnd_methods/offchain/index.d.ts +60 -60
- package/lnd_methods/offchain/index.js +6 -4
- package/lnd_methods/offchain/pay_via_routes.d.ts +4 -0
- package/lnd_methods/onchain/close_channel.d.ts +4 -0
- package/lnd_methods/onchain/close_channel.js +4 -0
- package/lnd_methods/onchain/open_channels.d.ts +1 -0
- package/lnd_methods/onchain/open_channels.js +7 -1
- package/lnd_methods/onchain/request_chain_fee_increase.js +5 -0
- package/lnd_methods/onchain/subscribe_to_blocks.js +1 -1
- package/lnd_responses/confirmed_from_payment_status.js +38 -40
- package/lnd_responses/constants.json +1 -0
- package/lnd_responses/forward_from_htlc_event.js +31 -31
- package/lnd_responses/info_as_wallet_info.js +28 -28
- package/lnd_responses/payment_request_details.js +28 -32
- package/lnd_responses/pending_as_pending_channels.js +8 -0
- package/lnd_responses/pending_from_payment.js +24 -24
- package/lnd_responses/routes_from_query_routes.js +30 -30
- package/lnd_responses/rpc_channel_as_channel.js +10 -9
- package/lnd_responses/rpc_fees_as_channel_fees.js +16 -16
- package/lnd_responses/rpc_forward_as_forward_request.js +27 -27
- package/lnd_responses/rpc_payment_as_payment.js +28 -31
- package/package.json +24 -20
- package/test/lnd_methods/offchain/test_get_routing_fee_estimate.js +82 -0
- package/test/lnd_methods/onchain/test_close_channel.js +5 -0
- package/test/lnd_methods/onchain/test_open_channels.js +5 -1
- package/test/lnd_methods/onchain/test_request_chain_fee_increase.js +13 -0
- package/test/lnd_responses/test_pending_as_pending_channels.js +34 -1
- package/test.js +194 -22
- package/.yarn/cache/@babel-code-frame-npm-7.25.7-40a9f53f43-f235cdf9c5.zip +0 -0
- package/.yarn/cache/@babel-helper-validator-identifier-npm-7.25.7-1c758f0472-062f55208d.zip +0 -0
- package/.yarn/cache/@babel-highlight-npm-7.25.7-308b20da71-b6aa45c5bf.zip +0 -0
- package/.yarn/cache/@grpc-grpc-js-npm-1.12.2-733ec8eabe-ee51317f92.zip +0 -0
- package/.yarn/cache/@grpc-proto-loader-npm-0.7.13-be5b6af1c1-399c1b8a46.zip +0 -0
- package/.yarn/cache/@jest-schemas-npm-29.6.3-292730e442-910040425f.zip +0 -0
- package/.yarn/cache/@js-sdsl-ordered-map-npm-4.4.2-158f6c6b74-a927ae4ff8.zip +0 -0
- package/.yarn/cache/@noble-hashes-npm-1.5.0-87c768d742-9cc031d5c8.zip +0 -0
- package/.yarn/cache/@nodelib-fs.scandir-npm-2.1.5-89c67370dd-a970d595bd.zip +0 -0
- package/.yarn/cache/@nodelib-fs.stat-npm-2.0.5-01f4dd3030-012480b5ca.zip +0 -0
- package/.yarn/cache/@nodelib-fs.walk-npm-1.2.8-b4a89da548-190c643f15.zip +0 -0
- package/.yarn/cache/@protobufjs-aspromise-npm-1.1.2-71d00b938f-011fe7ef08.zip +0 -0
- package/.yarn/cache/@protobufjs-base64-npm-1.1.2-cd8ca6814a-67173ac34d.zip +0 -0
- package/.yarn/cache/@protobufjs-codegen-npm-2.0.4-36e188bbe6-59240c850b.zip +0 -0
- package/.yarn/cache/@protobufjs-eventemitter-npm-1.1.0-029cc7d431-0369163a3d.zip +0 -0
- package/.yarn/cache/@protobufjs-fetch-npm-1.1.0-ca857b7df4-3fce7e09eb.zip +0 -0
- package/.yarn/cache/@protobufjs-float-npm-1.0.2-5678f64d08-5781e12412.zip +0 -0
- package/.yarn/cache/@protobufjs-inquire-npm-1.1.0-3c7759e9ce-ca06f02eaf.zip +0 -0
- package/.yarn/cache/@protobufjs-path-npm-1.1.2-641d08de76-856eeb532b.zip +0 -0
- package/.yarn/cache/@protobufjs-pool-npm-1.1.0-47a76f96a1-d6a34fbbd2.zip +0 -0
- package/.yarn/cache/@protobufjs-utf8-npm-1.1.0-02c590807c-f9bf3163d1.zip +0 -0
- package/.yarn/cache/@sinclair-typebox-npm-0.27.8-23e206d653-00bd7362a3.zip +0 -0
- package/.yarn/cache/@tsd-typescript-npm-5.4.5-31c3b104b3-86498d5e15.zip +0 -0
- package/.yarn/cache/@types-caseless-npm-0.12.5-d7dbdab81c-f6a3628add.zip +0 -0
- package/.yarn/cache/@types-eslint-npm-7.29.0-46534a7300-df13991c55.zip +0 -0
- package/.yarn/cache/@types-estree-npm-1.0.6-b5e23f2ea2-8825d6e729.zip +0 -0
- package/.yarn/cache/@types-json-schema-npm-7.0.15-fd16381786-97ed0cb44d.zip +0 -0
- package/.yarn/cache/@types-minimist-npm-1.2.5-c85664a9d8-477047b606.zip +0 -0
- package/.yarn/cache/@types-node-npm-22.7.5-0428b60a8c-1a8bbb504e.zip +0 -0
- package/.yarn/cache/@types-node-npm-22.7.6-cbb64e0ad4-6afe2a1bd7.zip +0 -0
- package/.yarn/cache/@types-normalize-package-data-npm-2.4.4-676a8ba353-65dff72b54.zip +0 -0
- package/.yarn/cache/@types-request-npm-2.48.12-d921ef35cb-20dfad0a46.zip +0 -0
- package/.yarn/cache/@types-tough-cookie-npm-4.0.5-8c5e2162e1-f19409d019.zip +0 -0
- package/.yarn/cache/@types-ws-npm-8.5.12-90c42288cf-ddefb6ad16.zip +0 -0
- package/.yarn/cache/ansi-escapes-npm-4.3.2-3ad173702f-93111c4218.zip +0 -0
- package/.yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip +0 -0
- package/.yarn/cache/ansi-styles-npm-3.2.1-8cb8107983-d85ade01c1.zip +0 -0
- package/.yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-513b44c3b2.zip +0 -0
- package/.yarn/cache/ansi-styles-npm-5.2.0-72fc7003e3-d7f4e97ce0.zip +0 -0
- package/.yarn/cache/array-union-npm-2.1.0-4e4852b221-5bee12395c.zip +0 -0
- package/.yarn/cache/arrify-npm-1.0.1-affafba9fe-745075dd4a.zip +0 -0
- package/.yarn/cache/async-npm-3.2.4-aba13508f9-43d07459a4.zip +0 -0
- package/.yarn/cache/async-npm-3.2.6-aa4f5aa081-ee6eb8cd8a.zip +0 -0
- package/.yarn/cache/asyncjs-util-npm-1.2.12-f1ef4c2905-55ff005a7f.zip +0 -0
- package/.yarn/cache/asynckit-npm-0.4.0-c718858525-7b78c451df.zip +0 -0
- package/.yarn/cache/base-x-npm-3.0.10-2d05c06792-5230773955.zip +0 -0
- package/.yarn/cache/base-x-npm-4.0.0-64a1f6fa5e-b25db9e07e.zip +0 -0
- package/.yarn/cache/bech32-npm-2.0.0-ad98b7dd79-fa15acb270.zip +0 -0
- package/.yarn/cache/bip174-npm-2.1.1-d9fcaf36f9-bc5b99e7d1.zip +0 -0
- package/.yarn/cache/bip66-npm-1.1.5-e1d2ea7768-956cff6e51.zip +0 -0
- package/.yarn/cache/bitcoin-ops-npm-1.4.1-e1e62763b3-3daa3303d6.zip +0 -0
- package/.yarn/cache/bitcoinjs-lib-npm-6.1.3-8b823f7e69-b1d9ffd999.zip +0 -0
- package/.yarn/cache/bitcoinjs-lib-npm-6.1.6-d063b5a8ff-04370cf699.zip +0 -0
- package/.yarn/cache/bn.js-npm-5.2.1-dc952b1965-3dd8c8d380.zip +0 -0
- package/.yarn/cache/bolt07-npm-1.8.4-297a4ac40d-58cdf15aba.zip +0 -0
- package/.yarn/cache/bolt07-npm-1.9.4-6f74865601-d18efc5f83.zip +0 -0
- package/.yarn/cache/bolt09-npm-1.0.0-b3d5b54cf9-09d53b86f2.zip +0 -0
- package/.yarn/cache/bolt09-npm-2.1.0-1fc0cfcef2-629cd3bdd4.zip +0 -0
- package/.yarn/cache/braces-npm-3.0.3-582c14023c-b95aa0b3bd.zip +0 -0
- package/.yarn/cache/bs58-npm-4.0.1-8d2a7822b1-b3c5365bb9.zip +0 -0
- package/.yarn/cache/bs58-npm-5.0.0-da02537b92-2475cb0684.zip +0 -0
- package/.yarn/cache/bs58check-npm-2.1.2-4e87e40195-43bdf08a5d.zip +0 -0
- package/.yarn/cache/bs58check-npm-3.0.1-be32851e5e-dbbecc7a09.zip +0 -0
- package/.yarn/cache/camelcase-keys-npm-6.2.2-d13777ec12-43c9af1adf.zip +0 -0
- package/.yarn/cache/camelcase-npm-5.3.1-5db8af62c5-e6effce26b.zip +0 -0
- package/.yarn/cache/chalk-npm-2.4.2-3ea16dd91e-ec3661d38f.zip +0 -0
- package/.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-fe75c9d5c7.zip +0 -0
- package/.yarn/cache/cipher-base-npm-1.0.4-2e98b97140-47d3568dbc.zip +0 -0
- package/.yarn/cache/cliui-npm-8.0.1-3b029092cf-79648b3b00.zip +0 -0
- package/.yarn/cache/color-convert-npm-1.9.3-1fe690075e-fd7a64a17c.zip +0 -0
- package/.yarn/cache/color-convert-npm-2.0.1-79730e935b-79e6bdb9fd.zip +0 -0
- package/.yarn/cache/color-name-npm-1.1.3-728b7b5d39-09c5d3e33d.zip +0 -0
- package/.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip +0 -0
- package/.yarn/cache/combined-stream-npm-1.0.8-dc14d4a63a-49fa4aeb49.zip +0 -0
- package/.yarn/cache/create-hash-npm-1.2.0-afd048e1ce-02a6ae3bb9.zip +0 -0
- package/.yarn/cache/decamelize-keys-npm-1.1.1-4cfa36ed4b-fc645fe20b.zip +0 -0
- package/.yarn/cache/decamelize-npm-1.2.0-c5a2fdc622-ad8c51a7e7.zip +0 -0
- package/.yarn/cache/delayed-stream-npm-1.0.0-c5a4c4cc02-46fe6e83e2.zip +0 -0
- package/.yarn/cache/diff-sequences-npm-29.6.3-18ab2c9949-f4914158e1.zip +0 -0
- package/.yarn/cache/dir-glob-npm-3.0.1-1aea628b1b-fa05e18324.zip +0 -0
- package/.yarn/cache/ecpair-npm-2.1.0-d034fc21e2-924a776808.zip +0 -0
- package/.yarn/cache/emoji-regex-npm-8.0.0-213764015c-d4c5c39d5a.zip +0 -0
- package/.yarn/cache/error-ex-npm-1.3.2-5654f80c0f-c1c2b8b65f.zip +0 -0
- package/.yarn/cache/escalade-npm-3.2.0-19b50dd48f-47b029c83d.zip +0 -0
- package/.yarn/cache/escape-string-regexp-npm-1.0.5-3284de402f-6092fda75c.zip +0 -0
- package/.yarn/cache/eslint-formatter-pretty-npm-4.1.0-30790f28b4-e8e0cd3843.zip +0 -0
- package/.yarn/cache/eslint-rule-docs-npm-1.1.235-64d33df34f-b163596f9a.zip +0 -0
- package/.yarn/cache/fast-glob-npm-3.3.2-0a8cb4f2ca-900e4979f4.zip +0 -0
- package/.yarn/cache/fastq-npm-1.17.1-56d4554993-a8c5b26788.zip +0 -0
- package/.yarn/cache/fill-range-npm-7.1.1-bf491486db-b4abfbca38.zip +0 -0
- package/.yarn/cache/find-up-npm-4.1.0-c3ccf8d855-4c172680e8.zip +0 -0
- package/.yarn/cache/form-data-npm-2.5.2-f40bcd738c-89ed3d9623.zip +0 -0
- package/.yarn/cache/function-bind-npm-1.1.2-7a55be9b03-2b0ff4ce70.zip +0 -0
- package/.yarn/cache/get-caller-file-npm-2.0.5-80e8a86305-b9769a836d.zip +0 -0
- package/.yarn/cache/glob-parent-npm-5.1.2-021ab32634-f4f2bfe242.zip +0 -0
- package/.yarn/cache/globby-npm-11.1.0-bdcdf20c71-b4be8885e0.zip +0 -0
- package/.yarn/cache/hard-rejection-npm-2.1.0-a80f2a977d-7baaf80a0c.zip +0 -0
- package/.yarn/cache/has-flag-npm-3.0.0-16ac11fe05-4a15638b45.zip +0 -0
- package/.yarn/cache/has-flag-npm-4.0.0-32af9f0536-261a135703.zip +0 -0
- package/.yarn/cache/hash-base-npm-3.1.0-26fc5711dd-26b7e97ac3.zip +0 -0
- package/.yarn/cache/hasown-npm-2.0.2-80fe6c9901-e8516f776a.zip +0 -0
- package/.yarn/cache/hosted-git-info-npm-2.8.9-62c44fa93f-c955394bda.zip +0 -0
- package/.yarn/cache/hosted-git-info-npm-4.1.0-4efcdf8fd3-c3f87b3c2f.zip +0 -0
- package/.yarn/cache/ignore-npm-5.3.2-346d3ba017-2acfd32a57.zip +0 -0
- package/.yarn/cache/indent-string-npm-4.0.0-7b717435b2-824cfb9929.zip +0 -0
- package/.yarn/cache/inherits-npm-2.0.4-c66b3957a0-4a48a73384.zip +0 -0
- package/.yarn/cache/invoices-npm-3.0.0-123907e565-27119b1449.zip +0 -0
- package/.yarn/cache/irregular-plurals-npm-3.5.0-2415613615-5b663091dc.zip +0 -0
- package/.yarn/cache/is-arrayish-npm-0.2.1-23927dfb15-eef4417e3c.zip +0 -0
- package/.yarn/cache/is-core-module-npm-2.15.1-34c73a6cbd-df134c1681.zip +0 -0
- package/.yarn/cache/is-extglob-npm-2.1.1-0870ea68b5-df033653d0.zip +0 -0
- package/.yarn/cache/is-fullwidth-code-point-npm-3.0.0-1ecf4ebee5-44a30c2945.zip +0 -0
- package/.yarn/cache/is-glob-npm-4.0.3-cb87bf1bdb-d381c1319f.zip +0 -0
- package/.yarn/cache/is-number-npm-7.0.0-060086935c-456ac6f8e0.zip +0 -0
- package/.yarn/cache/is-plain-obj-npm-1.1.0-1046f64c0b-0ee0480779.zip +0 -0
- package/.yarn/cache/is-unicode-supported-npm-0.1.0-0833e1bbfb-a2aab86ee7.zip +0 -0
- package/.yarn/cache/jest-diff-npm-29.7.0-0149e01930-08e24a9dd4.zip +0 -0
- package/.yarn/cache/jest-get-type-npm-29.6.3-500477292e-88ac9102d4.zip +0 -0
- package/.yarn/cache/js-tokens-npm-4.0.0-0ac852e9e2-8a95213a5a.zip +0 -0
- package/.yarn/cache/json-parse-even-better-errors-npm-2.3.1-144d62256e-798ed4cf33.zip +0 -0
- package/.yarn/cache/kind-of-npm-6.0.3-ab15f36220-3ab01e7b1d.zip +0 -0
- package/.yarn/cache/lines-and-columns-npm-1.2.4-d6c7cc5799-0c37f9f7fa.zip +0 -0
- package/.yarn/cache/locate-path-npm-5.0.0-46580c43e4-83e51725e6.zip +0 -0
- package/.yarn/cache/lodash.camelcase-npm-4.3.0-bf268e3bf0-cb9227612f.zip +0 -0
- package/.yarn/cache/log-symbols-npm-4.1.0-0a13492d8b-fce1497b31.zip +0 -0
- package/.yarn/cache/long-npm-5.2.3-61dddb7586-885ede7c3d.zip +0 -0
- package/.yarn/cache/lru-cache-npm-6.0.0-b4c8668fe1-f97f499f89.zip +0 -0
- package/.yarn/cache/map-obj-npm-1.0.1-fa55100fac-9949e7baec.zip +0 -0
- package/.yarn/cache/map-obj-npm-4.3.0-d53e32935d-fbc554934d.zip +0 -0
- package/.yarn/cache/md5.js-npm-1.3.5-130901125a-098494d885.zip +0 -0
- package/.yarn/cache/meow-npm-9.0.0-8b2707248e-99799c4724.zip +0 -0
- package/.yarn/cache/merge2-npm-1.4.1-a2507bd06c-7268db63ed.zip +0 -0
- package/.yarn/cache/micromatch-npm-4.0.8-c9570e4aca-79920eb634.zip +0 -0
- package/.yarn/cache/mime-db-npm-1.52.0-b5371d6fd2-0d99a03585.zip +0 -0
- package/.yarn/cache/mime-types-npm-2.1.35-dd9ea9f3e2-89a5b7f1de.zip +0 -0
- package/.yarn/cache/min-indent-npm-1.0.1-77031f50e1-bfc6dd03c5.zip +0 -0
- package/.yarn/cache/minimist-options-npm-4.1.0-64ca250fc1-8c040b3068.zip +0 -0
- package/.yarn/cache/normalize-package-data-npm-2.5.0-af0345deed-7999112efc.zip +0 -0
- package/.yarn/cache/normalize-package-data-npm-3.0.3-1a49056685-bbcee00339.zip +0 -0
- package/.yarn/cache/p-limit-npm-2.3.0-94a0310039-84ff17f1a3.zip +0 -0
- package/.yarn/cache/p-locate-npm-4.1.0-eec6872537-513bd14a45.zip +0 -0
- package/.yarn/cache/p-try-npm-2.2.0-e0390dbaf8-f8a8e9a769.zip +0 -0
- package/.yarn/cache/parse-json-npm-5.2.0-00a63b1199-62085b17d6.zip +0 -0
- package/.yarn/cache/path-exists-npm-4.0.0-e9e4f63eb0-505807199d.zip +0 -0
- package/.yarn/cache/path-parse-npm-1.0.7-09564527b7-49abf3d811.zip +0 -0
- package/.yarn/cache/path-type-npm-4.0.0-10d47fc86a-5b1e2daa24.zip +0 -0
- package/.yarn/cache/picocolors-npm-1.1.1-4fede47cf1-e1cf46bf84.zip +0 -0
- package/.yarn/cache/picomatch-npm-2.3.1-c782cfd986-050c865ce8.zip +0 -0
- package/.yarn/cache/plur-npm-4.0.0-96f2a49c24-fea2e903ef.zip +0 -0
- package/.yarn/cache/pretty-format-npm-29.7.0-7d330b2ea2-032c160238.zip +0 -0
- package/.yarn/cache/protobufjs-npm-7.4.0-12c56a3adc-ba0e6b6054.zip +0 -0
- package/.yarn/cache/psbt-npm-3.0.0-7f3e8059ba-1dddca470a.zip +0 -0
- package/.yarn/cache/pushdata-bitcoin-npm-1.0.1-959a90bb14-8452106d4b.zip +0 -0
- package/.yarn/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-b676f8c040.zip +0 -0
- package/.yarn/cache/quick-lru-npm-4.0.1-ef8aa17c9c-bea46e1abf.zip +0 -0
- package/.yarn/cache/randombytes-npm-2.1.0-e3da76bccf-d779499376.zip +0 -0
- package/.yarn/cache/react-is-npm-18.3.1-370a81e1e9-e20fe84c86.zip +0 -0
- package/.yarn/cache/read-pkg-npm-5.2.0-50426bd8dc-eb696e6052.zip +0 -0
- package/.yarn/cache/read-pkg-up-npm-7.0.1-11895bed9a-e4e93ce70e.zip +0 -0
- package/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip +0 -0
- package/.yarn/cache/redent-npm-3.0.0-31892f4906-fa1ef20404.zip +0 -0
- package/.yarn/cache/require-directory-npm-2.1.1-8608aee50b-fb47e70bf0.zip +0 -0
- package/.yarn/cache/resolve-npm-1.22.8-098f379dfe-f8a26958aa.zip +0 -0
- package/.yarn/cache/resolve-patch-f6b5304cab-5479b7d431.zip +0 -0
- package/.yarn/cache/reusify-npm-1.0.4-95ac4aec11-c3076ebcc2.zip +0 -0
- package/.yarn/cache/ripemd160-npm-2.0.2-7b1fb8dc76-006accc405.zip +0 -0
- package/.yarn/cache/run-parallel-npm-1.2.0-3f47ff2034-cb4f97ad25.zip +0 -0
- package/.yarn/cache/safe-buffer-npm-5.2.1-3481c8aa9b-b99c4b41fd.zip +0 -0
- package/.yarn/cache/semver-npm-5.7.2-938ee91eaa-fb4ab5e0dd.zip +0 -0
- package/.yarn/cache/semver-npm-7.6.3-57e82c14d5-4110ec5d01.zip +0 -0
- package/.yarn/cache/sha.js-npm-2.4.11-14868df4ca-ebd3f59d4b.zip +0 -0
- package/.yarn/cache/slash-npm-3.0.0-b87de2279a-94a93fff61.zip +0 -0
- package/.yarn/cache/spdx-correct-npm-3.2.0-ffae008484-e9ae98d22f.zip +0 -0
- package/.yarn/cache/spdx-exceptions-npm-2.5.0-718ed4b7d6-bb127d6e25.zip +0 -0
- package/.yarn/cache/spdx-expression-parse-npm-3.0.1-b718cbb35a-a1c6e104a2.zip +0 -0
- package/.yarn/cache/spdx-license-ids-npm-3.0.20-f08e1eabc0-0c57750bed.zip +0 -0
- package/.yarn/cache/string-width-npm-4.2.3-2c27177bae-e52c10dc3f.zip +0 -0
- package/.yarn/cache/string_decoder-npm-1.3.0-2422117fd0-8417646695.zip +0 -0
- package/.yarn/cache/strip-ansi-npm-6.0.1-caddc7cb40-f3cd25890a.zip +0 -0
- package/.yarn/cache/strip-indent-npm-3.0.0-519e75a28d-18f045d57d.zip +0 -0
- package/.yarn/cache/supports-color-npm-5.5.0-183ac537bc-95f6f4ba5a.zip +0 -0
- package/.yarn/cache/supports-color-npm-7.2.0-606bfcf7da-3dda818de0.zip +0 -0
- package/.yarn/cache/supports-hyperlinks-npm-2.3.0-d19176eba2-9ee0de3c8c.zip +0 -0
- package/.yarn/cache/supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-53b1e247e6.zip +0 -0
- package/.yarn/cache/tiny-secp256k1-npm-2.2.2-54168b74b6-2b38491186.zip +0 -0
- package/.yarn/cache/tiny-secp256k1-npm-2.2.3-8c5163b5d1-f7a74a1fce.zip +0 -0
- package/.yarn/cache/to-regex-range-npm-5.0.1-f1e8263b00-f76fa01b3d.zip +0 -0
- package/.yarn/cache/trim-newlines-npm-3.0.1-22f1f216de-b530f3fadf.zip +0 -0
- package/.yarn/cache/tsd-npm-0.31.2-07f84c93d0-23bb84f8ba.zip +0 -0
- package/.yarn/cache/type-fest-npm-0.18.1-47b079775d-e96dcee18a.zip +0 -0
- package/.yarn/cache/type-fest-npm-0.21.3-5ff2a9c6fd-e6b32a3b38.zip +0 -0
- package/.yarn/cache/type-fest-npm-0.6.0-76b229965b-b2188e6e4b.zip +0 -0
- package/.yarn/cache/type-fest-npm-0.8.1-351ad028fe-d61c4b2eba.zip +0 -0
- package/.yarn/cache/type-fest-npm-4.26.1-274c31182d-7188db3bca.zip +0 -0
- package/.yarn/cache/typeforce-npm-1.18.0-372e34e2a2-e3b21e27e7.zip +0 -0
- package/.yarn/cache/typescript-npm-5.6.3-cc9b3687b0-ba302f8822.zip +0 -0
- package/.yarn/cache/typescript-patch-be88537122-ade87bce23.zip +0 -0
- package/.yarn/cache/uint8array-tools-npm-0.0.7-96ca58a124-6ffc45c7d2.zip +0 -0
- package/.yarn/cache/undici-types-npm-6.19.8-9f12285b7a-de51f1b447.zip +0 -0
- package/.yarn/cache/util-deprecate-npm-1.0.2-e3fe1a219c-474acf1146.zip +0 -0
- package/.yarn/cache/validate-npm-package-license-npm-3.0.4-7af8adc7a8-35703ac889.zip +0 -0
- package/.yarn/cache/varuint-bitcoin-npm-1.1.2-83f928c112-1c900bf08f.zip +0 -0
- package/.yarn/cache/wif-npm-2.0.6-f351bf025a-8c3147ef98.zip +0 -0
- package/.yarn/cache/wrap-ansi-npm-7.0.0-ad6e1a0554-a790b846fd.zip +0 -0
- package/.yarn/cache/y18n-npm-5.0.8-5f3a0a7e62-54f0fb9562.zip +0 -0
- package/.yarn/cache/yallist-npm-4.0.0-b493d9e907-343617202a.zip +0 -0
- package/.yarn/cache/yargs-npm-17.7.2-80b62638e1-73b572e863.zip +0 -0
- package/.yarn/cache/yargs-parser-npm-20.2.9-a1d19e598d-8bb69015f2.zip +0 -0
- package/.yarn/cache/yargs-parser-npm-21.1.1-8fdc003314-ed2d96a616.zip +0 -0
- package/.yarn/install-state.gz +0 -0
|
@@ -1,57 +1,98 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
DecimalDisplay,
|
|
5
|
-
PaymentRequestDetails,
|
|
2
|
+
AuthenticatedLightningMethod,
|
|
3
|
+
LightningError,
|
|
6
4
|
} from '../../typescript';
|
|
7
5
|
|
|
6
|
+
/** Arguments for decodeAssetPayReq */
|
|
8
7
|
export type DecodeAssetPayReqArgs = {
|
|
9
|
-
/** Asset ID Hex String */
|
|
10
|
-
asset_id
|
|
11
|
-
/**
|
|
12
|
-
|
|
8
|
+
/** Asset ID Hex String (mutually exclusive with group_key) */
|
|
9
|
+
asset_id?: string;
|
|
10
|
+
/** Group Key Hex String (mutually exclusive with asset_id) */
|
|
11
|
+
group_key?: string;
|
|
13
12
|
/** BOLT 11 Payment Request String */
|
|
14
13
|
pay_req_string: string;
|
|
14
|
+
/** Price Oracle Metadata JSON String */
|
|
15
|
+
price_oracle_metadata?: string;
|
|
15
16
|
/** Authenticated TPR API Object */
|
|
16
|
-
tpr:
|
|
17
|
+
tpr: any;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** Decimal display configuration */
|
|
21
|
+
export type DecimalDisplay = {
|
|
22
|
+
/** Decimal Display Value */
|
|
23
|
+
decimal_display: number;
|
|
17
24
|
};
|
|
18
25
|
|
|
26
|
+
/** Asset group information from taprpc.AssetGroup */
|
|
19
27
|
export type AssetGroup = {
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
/** Tweaked Group Key String */
|
|
23
|
-
|
|
28
|
+
/** Raw Group Key Hex String */
|
|
29
|
+
raw_group_key?: string;
|
|
30
|
+
/** Tweaked Group Key Hex String */
|
|
31
|
+
tweaked_group_key?: string;
|
|
32
|
+
/** Asset Witness Hex String */
|
|
33
|
+
asset_witness?: string;
|
|
34
|
+
/** Tapscript Root Hex String */
|
|
35
|
+
tapscript_root?: string;
|
|
24
36
|
};
|
|
25
37
|
|
|
38
|
+
/** Asset type enum */
|
|
39
|
+
export type AssetType = 'NORMAL' | 'COLLECTIBLE';
|
|
40
|
+
|
|
41
|
+
/** Genesis information from taprpc.GenesisInfo */
|
|
26
42
|
export type GenesisInfo = {
|
|
27
|
-
/**
|
|
28
|
-
|
|
43
|
+
/** Genesis Point (txid:vout) */
|
|
44
|
+
genesis_point: string;
|
|
45
|
+
/** Asset Name */
|
|
46
|
+
name: string;
|
|
29
47
|
/** Meta Hash Hex String */
|
|
30
|
-
meta_hash
|
|
48
|
+
meta_hash?: string;
|
|
49
|
+
/** Asset ID Hex String */
|
|
50
|
+
asset_id?: string;
|
|
51
|
+
/** Asset Type */
|
|
52
|
+
asset_type?: AssetType;
|
|
53
|
+
/** Output Index */
|
|
54
|
+
output_index?: number;
|
|
31
55
|
};
|
|
32
56
|
|
|
57
|
+
/** LND PayReq object from lnrpc.PayReq */
|
|
58
|
+
export type PayReq = {
|
|
59
|
+
destination?: string;
|
|
60
|
+
payment_hash?: string;
|
|
61
|
+
num_satoshis?: string;
|
|
62
|
+
timestamp?: string;
|
|
63
|
+
expiry?: string;
|
|
64
|
+
description?: string;
|
|
65
|
+
description_hash?: string;
|
|
66
|
+
fallback_addr?: string;
|
|
67
|
+
cltv_expiry?: string;
|
|
68
|
+
route_hints?: any[];
|
|
69
|
+
payment_addr?: string;
|
|
70
|
+
num_msat?: string;
|
|
71
|
+
features?: Record<string, any>;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/** Result of decodeAssetPayReq */
|
|
33
75
|
export type DecodeAssetPayReqResult = {
|
|
34
|
-
/** Invoice Amount in Asset Units
|
|
35
|
-
asset_amount:
|
|
76
|
+
/** Invoice Amount in Asset Units (uint64 as string) */
|
|
77
|
+
asset_amount: string;
|
|
78
|
+
/** Decimal Display Configuration */
|
|
79
|
+
decimal_display?: DecimalDisplay;
|
|
36
80
|
/** Asset Group Information */
|
|
37
81
|
asset_group?: AssetGroup;
|
|
38
|
-
/**
|
|
39
|
-
decimal_display: DecimalDisplay;
|
|
40
|
-
/** Genesis Information */
|
|
82
|
+
/** Genesis Information (only set when decoded with asset_id, not group_key) */
|
|
41
83
|
genesis_info?: GenesisInfo;
|
|
42
|
-
/**
|
|
43
|
-
pay_req:
|
|
84
|
+
/** LND PayReq Object */
|
|
85
|
+
pay_req: PayReq;
|
|
44
86
|
};
|
|
45
87
|
|
|
46
88
|
/**
|
|
47
89
|
* Decode an asset payment request
|
|
48
90
|
*
|
|
91
|
+
* Either `asset_id` or `group_key` is required (mutually exclusive)
|
|
92
|
+
*
|
|
49
93
|
* Requires `offchain:read` permission
|
|
50
94
|
*/
|
|
51
|
-
export
|
|
95
|
+
export const decodeAssetPayReq: (
|
|
52
96
|
args: DecodeAssetPayReqArgs,
|
|
53
|
-
cbk?: (
|
|
54
|
-
err: Error | null,
|
|
55
|
-
result: DecodeAssetPayReqResult,
|
|
56
|
-
) => void,
|
|
97
|
+
cbk?: (err: LightningError | null, result?: DecodeAssetPayReqResult) => void,
|
|
57
98
|
) => Promise<DecodeAssetPayReqResult>;
|
|
@@ -1,78 +1,64 @@
|
|
|
1
1
|
const asyncAuto = require('async/auto');
|
|
2
2
|
const {returnResult} = require('asyncjs-util');
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const bufferAsHex = buffer => !!buffer ? buffer.toString('hex') : undefined;
|
|
5
|
+
const hexAsBuffer = hex => !!hex ? Buffer.from(hex, 'hex') : undefined;
|
|
6
6
|
|
|
7
7
|
/** Decode an asset payment request
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
Requires `offchain:read` permission
|
|
10
10
|
|
|
11
|
+
Either `asset_id` or `group_key` is required (mutually exclusive)
|
|
12
|
+
|
|
11
13
|
{
|
|
12
|
-
asset_id: <Asset ID Hex String>
|
|
13
|
-
|
|
14
|
+
[asset_id]: <Asset ID Hex String>
|
|
15
|
+
[group_key]: <Group Key Hex String>
|
|
14
16
|
pay_req_string: <BOLT 11 Payment Request String>
|
|
17
|
+
[price_oracle_metadata]: <Price Oracle Metadata JSON String>
|
|
15
18
|
tpr: <Authenticated TPR API Object>
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
@returns via cbk or Promise
|
|
19
22
|
{
|
|
20
|
-
asset_amount: <Invoice Amount in Asset Units
|
|
21
|
-
asset_group: {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
asset_amount: <Invoice Amount in Asset Units String>
|
|
24
|
+
[asset_group]: {
|
|
25
|
+
raw_group_key: <Raw Group Key Hex String>
|
|
26
|
+
tweaked_group_key: <Tweaked Group Key Hex String>
|
|
27
|
+
[asset_witness]: <Asset Witness Hex String>
|
|
28
|
+
[tapscript_root]: <Tapscript Root Hex String>
|
|
24
29
|
}
|
|
25
|
-
decimal_display: {
|
|
26
|
-
|
|
27
|
-
type: <Asset Type String>
|
|
28
|
-
units: <Asset Unit Label String>
|
|
30
|
+
[decimal_display]: {
|
|
31
|
+
decimal_display: <Decimal Display Number>
|
|
29
32
|
}
|
|
30
|
-
genesis_info: {
|
|
31
|
-
|
|
33
|
+
[genesis_info]: {
|
|
34
|
+
genesis_point: <Genesis Point String>
|
|
35
|
+
name: <Asset Name String>
|
|
32
36
|
meta_hash: <Meta Hash Hex String>
|
|
37
|
+
asset_id: <Asset ID Hex String>
|
|
38
|
+
asset_type: <Asset Type String>
|
|
39
|
+
output_index: <Output Index Number>
|
|
33
40
|
}
|
|
34
|
-
pay_req:
|
|
35
|
-
chain_address: <Fallback Chain Address String>
|
|
36
|
-
[cltv_delta]: <Final CLTV Delta Number>
|
|
37
|
-
created_at: <Payment Request Created At ISO 8601 Date String>
|
|
38
|
-
description: <Payment Description String>
|
|
39
|
-
description_hash: <Payment Longer Description Hash Hex String>
|
|
40
|
-
destination: <Public Key Hex String>
|
|
41
|
-
expires_at: <ISO 8601 Date String>
|
|
42
|
-
features: [{
|
|
43
|
-
bit: <BOLT 09 Feature Bit Number>
|
|
44
|
-
is_known: <Feature is Known Bool>
|
|
45
|
-
is_required: <Feature Support is Required To Pay Bool>
|
|
46
|
-
type: <Feature Type String>
|
|
47
|
-
}]
|
|
48
|
-
id: <Payment Hash Hex String>
|
|
49
|
-
is_expired: <Invoice is Expired Bool>
|
|
50
|
-
mtokens: <Requested Millitokens String>
|
|
51
|
-
[payment]: <Payment Identifier Hex Encoded String>
|
|
52
|
-
routes: [[{
|
|
53
|
-
[base_fee_mtokens]: <Base Routing Fee In Millitokens String>
|
|
54
|
-
[channel]: <Standard Format Channel Id String>
|
|
55
|
-
[cltv_delta]: <CLTV Blocks Delta Number>
|
|
56
|
-
[fee_rate]: <Fee Rate In Millitokens Per Million Number>
|
|
57
|
-
public_key: <Forward Edge Public Key Hex String>
|
|
58
|
-
}]]
|
|
59
|
-
safe_tokens: <Requested Tokens Rounded Up Number>
|
|
60
|
-
tokens: <Requested Tokens Rounded Down Number>
|
|
61
|
-
}
|
|
41
|
+
pay_req: <LND PayReq Object>
|
|
62
42
|
}
|
|
63
43
|
*/
|
|
64
|
-
module.exports = (
|
|
44
|
+
module.exports = (args, cbk) => {
|
|
65
45
|
return new Promise((resolve, reject) => {
|
|
66
46
|
return asyncAuto({
|
|
67
47
|
// Check arguments
|
|
68
48
|
validate: cbk => {
|
|
69
|
-
if (!asset_id) {
|
|
70
|
-
return cbk([400, '
|
|
49
|
+
if (!args.asset_id && !args.group_key) {
|
|
50
|
+
return cbk([400, 'ExpectedAssetIdOrGroupKeyToDecodeAssetPayReq']);
|
|
71
51
|
}
|
|
72
|
-
|
|
52
|
+
|
|
53
|
+
if (!!args.asset_id && !!args.group_key) {
|
|
54
|
+
return cbk([400, 'ExpectedEitherAssetIdOrGroupKeyNotBoth']);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (!args.pay_req_string) {
|
|
73
58
|
return cbk([400, 'ExpectedPaymentRequestStringToDecodeAssetPayReq']);
|
|
74
59
|
}
|
|
75
|
-
|
|
60
|
+
|
|
61
|
+
if (!args.tpr) {
|
|
76
62
|
return cbk([400, 'ExpectedTprToDecodeAssetPayReq']);
|
|
77
63
|
}
|
|
78
64
|
|
|
@@ -80,12 +66,14 @@ module.exports = ({asset_id, pay_req_string, tpr}, cbk) => {
|
|
|
80
66
|
},
|
|
81
67
|
|
|
82
68
|
// Decode asset payment request
|
|
83
|
-
decode: ['validate', ({}, cbk) => {
|
|
84
|
-
return tpr.taproot_asset_channels.decodeAssetPayReq({
|
|
85
|
-
asset_id: hexAsBuffer(asset_id),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
69
|
+
decode: ['validate', ({}, cbk) => {
|
|
70
|
+
return args.tpr.taproot_asset_channels.decodeAssetPayReq({
|
|
71
|
+
asset_id: hexAsBuffer(args.asset_id),
|
|
72
|
+
group_key: hexAsBuffer(args.group_key),
|
|
73
|
+
pay_req_string: args.pay_req_string,
|
|
74
|
+
price_oracle_metadata: args.price_oracle_metadata || undefined,
|
|
75
|
+
},
|
|
76
|
+
(err, res) => {
|
|
89
77
|
if (!!err) {
|
|
90
78
|
return cbk([503, 'UnexpectedDecodeAssetPayReqError', {err}]);
|
|
91
79
|
}
|
|
@@ -94,26 +82,31 @@ module.exports = ({asset_id, pay_req_string, tpr}, cbk) => {
|
|
|
94
82
|
return cbk([503, 'ExpectedResponseFromDecodeAssetPayReq']);
|
|
95
83
|
}
|
|
96
84
|
|
|
97
|
-
// Format the response
|
|
98
85
|
const response = {
|
|
99
86
|
asset_amount: res.asset_amount,
|
|
100
|
-
decimal_display: res.decimal_display,
|
|
87
|
+
decimal_display: res.decimal_display || undefined,
|
|
101
88
|
pay_req: res.pay_req,
|
|
102
89
|
};
|
|
103
90
|
|
|
104
|
-
// Add asset group if
|
|
91
|
+
// Add asset group if present
|
|
105
92
|
if (!!res.asset_group) {
|
|
106
93
|
response.asset_group = {
|
|
107
|
-
|
|
108
|
-
|
|
94
|
+
raw_group_key: bufferAsHex(res.asset_group.raw_group_key),
|
|
95
|
+
tweaked_group_key: bufferAsHex(res.asset_group.tweaked_group_key),
|
|
96
|
+
asset_witness: bufferAsHex(res.asset_group.asset_witness),
|
|
97
|
+
tapscript_root: bufferAsHex(res.asset_group.tapscript_root),
|
|
109
98
|
};
|
|
110
99
|
}
|
|
111
100
|
|
|
112
|
-
// Add genesis info if
|
|
101
|
+
// Add genesis info if present
|
|
113
102
|
if (!!res.genesis_info) {
|
|
114
103
|
response.genesis_info = {
|
|
115
|
-
|
|
104
|
+
genesis_point: res.genesis_info.genesis_point,
|
|
105
|
+
name: res.genesis_info.name,
|
|
116
106
|
meta_hash: bufferAsHex(res.genesis_info.meta_hash),
|
|
107
|
+
asset_id: bufferAsHex(res.genesis_info.asset_id),
|
|
108
|
+
asset_type: res.genesis_info.asset_type,
|
|
109
|
+
output_index: res.genesis_info.output_index,
|
|
117
110
|
};
|
|
118
111
|
}
|
|
119
112
|
|
|
@@ -69,6 +69,10 @@ export type GetPendingChannelsResult = {
|
|
|
69
69
|
transaction_weight?: number;
|
|
70
70
|
/** Channel Commitment Transaction Type */
|
|
71
71
|
type?: string;
|
|
72
|
+
/** Funding Seen At Best Block Height */
|
|
73
|
+
opening_funding_height?: number;
|
|
74
|
+
/** Open Activation Waiting Blocks Count */
|
|
75
|
+
opening_waiting_blocks?: number;
|
|
72
76
|
}[];
|
|
73
77
|
};
|
|
74
78
|
|
|
@@ -79,6 +83,18 @@ export type GetPendingChannelsResult = {
|
|
|
79
83
|
channel may be opening, closing, or active.
|
|
80
84
|
*
|
|
81
85
|
* Requires `offchain:read` permission
|
|
86
|
+
*
|
|
87
|
+
* `is_private` is not supported in LND 0.14.5 or before
|
|
88
|
+
*
|
|
89
|
+
* `description` is not supported in LND 0.16.4 or before
|
|
90
|
+
*
|
|
91
|
+
* `blocks_until_expiry` is not supported in LND 0.16.4 or before
|
|
92
|
+
*
|
|
93
|
+
* `close_transaction` is not supported in LND 0.17.5 or before
|
|
94
|
+
*
|
|
95
|
+
* `opening_funding_height` is not supported in LND 0.19.3 or before
|
|
96
|
+
*
|
|
97
|
+
* `opening_waiting_blocks` is not supported in LND 0.19.3 or before
|
|
82
98
|
*/
|
|
83
99
|
export const getPendingChannels: AuthenticatedLightningMethod<
|
|
84
100
|
{lnd: AuthenticatedLnd},
|
|
@@ -25,6 +25,10 @@ const type = 'default';
|
|
|
25
25
|
|
|
26
26
|
`close_transaction` is not supported in LND 0.17.5 or before
|
|
27
27
|
|
|
28
|
+
`opening_funding_height` is not supported in LND 0.19.3 or before
|
|
29
|
+
|
|
30
|
+
`opening_waiting_blocks` is not supported in LND 0.19.3 or before
|
|
31
|
+
|
|
28
32
|
{
|
|
29
33
|
lnd: <Authenticated LND API Object>
|
|
30
34
|
}
|
|
@@ -45,6 +49,8 @@ const type = 'default';
|
|
|
45
49
|
is_timelocked: <Channel Local Funds Constrained by Timelock Script Bool>
|
|
46
50
|
local_balance: <Channel Local Tokens Balance Number>
|
|
47
51
|
local_reserve: <Channel Local Reserved Tokens Number>
|
|
52
|
+
[opening_funding_height]: <Funding Seen At Best Block Height Number>
|
|
53
|
+
[opening_waiting_blocks]: <Open Activation Waiting Blocks Count Number>
|
|
48
54
|
partner_public_key: <Channel Peer Public Key String>
|
|
49
55
|
[pending_balance]: <Tokens Pending Recovery Number>
|
|
50
56
|
[pending_payments]: [{
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {AuthenticatedLnd} from '../../lnd_grpc';
|
|
2
|
+
import {
|
|
3
|
+
AuthenticatedLightningArgs,
|
|
4
|
+
AuthenticatedLightningMethod
|
|
5
|
+
} from '../../typescript';
|
|
6
|
+
|
|
7
|
+
export type GetRoutingFeeEstimateRequest = AuthenticatedLightningArgs<{
|
|
8
|
+
lnd: AuthenticatedLnd;
|
|
9
|
+
/** BOLT 11 Encoded Payment Request */
|
|
10
|
+
request: string;
|
|
11
|
+
/** Optional Timeout in Milliseconds */
|
|
12
|
+
timeout?: number;
|
|
13
|
+
}>;
|
|
14
|
+
|
|
15
|
+
export type GetRoutingFeeEstimateResponse = {
|
|
16
|
+
/** (Minimum Routing Fee Millitokens) */
|
|
17
|
+
fee_mtokens: string;
|
|
18
|
+
/** Timeout (Time Lock Delay) */
|
|
19
|
+
timeout: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Estimate routing fees based on an invoice.
|
|
24
|
+
*
|
|
25
|
+
* Requires `offchain:read` permission
|
|
26
|
+
*
|
|
27
|
+
* This method is not supported before LND 0.18.4
|
|
28
|
+
*/
|
|
29
|
+
export const getRoutingFeeEstimate: AuthenticatedLightningMethod<
|
|
30
|
+
GetRoutingFeeEstimateRequest,
|
|
31
|
+
GetRoutingFeeEstimateResponse
|
|
32
|
+
>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const asyncAuto = require('async/auto');
|
|
2
|
+
const {returnResult} = require('asyncjs-util');
|
|
3
|
+
|
|
4
|
+
const {isLnd} = require('./../../lnd_requests');
|
|
5
|
+
|
|
6
|
+
const defaultTimeoutSeconds = 60;
|
|
7
|
+
const method = 'estimateRouteFee';
|
|
8
|
+
const msAsSecs = ms => Math.round(ms / 1e3);
|
|
9
|
+
const type = 'router';
|
|
10
|
+
|
|
11
|
+
/** Estimate routing fees and timeout required to pay a payment request
|
|
12
|
+
|
|
13
|
+
Requires `offchain:read` permission
|
|
14
|
+
|
|
15
|
+
This method is not supported on LND 0.18.3 and below
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
lnd: <Authenticated LND API Object>
|
|
19
|
+
request: <BOLT 11 Payment Request String>
|
|
20
|
+
[timeout]: <Maximum Route Pathfinding Time in Milliseconds Number>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@returns via cbk or Promise
|
|
24
|
+
{
|
|
25
|
+
fee_mtokens: <Estimated Minimum Required Route Fee Millitokens String>
|
|
26
|
+
timeout: <Estimated Minimum Time Lock Block Height Delay Number>
|
|
27
|
+
}
|
|
28
|
+
*/
|
|
29
|
+
module.exports = ({lnd, request, timeout}, cbk) => {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
return asyncAuto({
|
|
32
|
+
// Check arguments
|
|
33
|
+
validate: cbk => {
|
|
34
|
+
if (!isLnd({lnd, method, type})) {
|
|
35
|
+
return cbk([400, 'ExpectedAuthenticatedLndToGetRoutingFeeEstimate']);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!request) {
|
|
39
|
+
return cbk([400, 'ExpectedPaymentRequestToGetRoutingFeeEstimate']);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return cbk();
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
// Request a probe of the request to determine a needed fee and delay
|
|
46
|
+
getEstimate: ['validate', ({}, cbk) => {
|
|
47
|
+
return lnd[type][method]({
|
|
48
|
+
payment_request: request,
|
|
49
|
+
timeout: msAsSecs(timeout) || defaultTimeoutSeconds,
|
|
50
|
+
},
|
|
51
|
+
(err, res) => {
|
|
52
|
+
if (!!err) {
|
|
53
|
+
return cbk([503, 'UnexpectedGetRoutingFeeEstimateError', {err}]);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (!res) {
|
|
57
|
+
return cbk([503, 'ExpectedGetRoutingFeeEstimateResponse']);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!res.routing_fee_msat) {
|
|
61
|
+
return cbk([503, 'ExpectedFeeInGetRoutingFeeEstimateResponse']);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!res.time_lock_delay) {
|
|
65
|
+
return cbk([503, 'ExpectedTimeoutInGetRouteFeeEstimateResponse']);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Exit early with error when the estimate response has failure code
|
|
69
|
+
if (res.failure_reason !== 'FAILURE_REASON_NONE') {
|
|
70
|
+
return cbk([
|
|
71
|
+
404,
|
|
72
|
+
'RouteToDestinationNotFound',
|
|
73
|
+
{failure: res.failure_reason},
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return cbk(null, {
|
|
78
|
+
fee_mtokens: res.routing_fee_msat,
|
|
79
|
+
timeout: Number(res.time_lock_delay),
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}],
|
|
83
|
+
},
|
|
84
|
+
returnResult({reject, resolve, of: 'getEstimate'}, cbk));
|
|
85
|
+
});
|
|
86
|
+
};
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
30
|
-
export * from
|
|
31
|
-
export * from
|
|
32
|
-
export * from
|
|
33
|
-
export * from
|
|
34
|
-
export * from
|
|
35
|
-
export * from
|
|
36
|
-
export * from
|
|
37
|
-
export * from
|
|
38
|
-
export * from
|
|
39
|
-
export * from
|
|
40
|
-
export * from
|
|
41
|
-
export * from
|
|
42
|
-
export * from
|
|
43
|
-
export * from
|
|
44
|
-
export * from
|
|
45
|
-
export * from
|
|
46
|
-
export * from
|
|
47
|
-
export * from
|
|
48
|
-
export * from
|
|
49
|
-
export * from
|
|
50
|
-
export * from
|
|
51
|
-
export * from
|
|
52
|
-
export * from
|
|
53
|
-
export * from
|
|
54
|
-
export * from
|
|
55
|
-
export * from
|
|
56
|
-
export * from
|
|
57
|
-
export * from
|
|
58
|
-
export * from
|
|
59
|
-
export * from
|
|
60
|
-
export * from
|
|
1
|
+
export * from './connect_watchtower';
|
|
2
|
+
export * from './decode_payment_request';
|
|
3
|
+
export * from './delete_failed_pay_attempts';
|
|
4
|
+
export * from './delete_failed_payments';
|
|
5
|
+
export * from './delete_forwarding_reputations';
|
|
6
|
+
export * from './delete_payment';
|
|
7
|
+
export * from './delete_payments';
|
|
8
|
+
export * from './delete_pending_channel';
|
|
9
|
+
export * from './disable_channel';
|
|
10
|
+
export * from './disconnect_watchtower';
|
|
11
|
+
export * from './enable_channel';
|
|
12
|
+
export * from './get_backup';
|
|
13
|
+
export * from './get_backups';
|
|
14
|
+
export * from './get_channel_balance';
|
|
15
|
+
export * from './get_channels';
|
|
16
|
+
export * from './get_closed_channels';
|
|
17
|
+
export * from './get_connected_watchtowers';
|
|
18
|
+
export * from './get_ephemeral_channel_ids';
|
|
19
|
+
export * from './get_failed_payments';
|
|
20
|
+
export * from './get_fee_rates';
|
|
21
|
+
export * from './get_forwarding_confidence';
|
|
22
|
+
export * from './get_forwarding_reputations';
|
|
23
|
+
export * from './get_forwards';
|
|
24
|
+
export * from './get_pathfinding_settings';
|
|
25
|
+
export * from './get_payment';
|
|
26
|
+
export * from './get_payments';
|
|
27
|
+
export * from './get_pending_channels';
|
|
28
|
+
export * from './get_pending_payments';
|
|
29
|
+
export * from './get_route_through_hops';
|
|
30
|
+
export * from './get_routing_fee_estimate';
|
|
31
|
+
export * from './get_settlement_status';
|
|
32
|
+
export * from './is_destination_payable';
|
|
33
|
+
export * from './pay_via_payment_details';
|
|
34
|
+
export * from './pay_via_payment_request';
|
|
35
|
+
export * from './pay_via_routes';
|
|
36
|
+
export * from './pay';
|
|
37
|
+
export * from './probe_for_route';
|
|
38
|
+
export * from './recover_funds_from_channel';
|
|
39
|
+
export * from './recover_funds_from_channels';
|
|
40
|
+
export * from './send_message_to_peer';
|
|
41
|
+
export * from './subscribe_to_backups';
|
|
42
|
+
export * from './subscribe_to_channels';
|
|
43
|
+
export * from './subscribe_to_forward_requests';
|
|
44
|
+
export * from './subscribe_to_forwards';
|
|
45
|
+
export * from './subscribe_to_open_requests';
|
|
46
|
+
export * from './subscribe_to_past_payment';
|
|
47
|
+
export * from './subscribe_to_past_payments';
|
|
48
|
+
export * from './subscribe_to_pay_via_details';
|
|
49
|
+
export * from './subscribe_to_pay_via_request';
|
|
50
|
+
export * from './subscribe_to_pay_via_routes';
|
|
51
|
+
export * from './subscribe_to_payments';
|
|
52
|
+
export * from './subscribe_to_peer_messages';
|
|
53
|
+
export * from './subscribe_to_probe_for_route';
|
|
54
|
+
export * from './update_connected_watchtower';
|
|
55
|
+
export * from './update_pathfinding_settings';
|
|
56
|
+
export * from './update_routing_fees';
|
|
57
|
+
export * from './verify_backup';
|
|
58
|
+
export * from './verify_backups';
|
|
59
|
+
export * from './decode_asset_pay_req';
|
|
60
|
+
export * from './pay_taproot_invoice';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const connectWatchtower = require('./connect_watchtower');
|
|
2
|
-
const decodeAssetPayReq = require('./decode_asset_pay_req');
|
|
3
2
|
const decodePaymentRequest = require('./decode_payment_request');
|
|
4
3
|
const deleteFailedPayAttempts = require('./delete_failed_pay_attempts');
|
|
5
4
|
const deleteFailedPayments = require('./delete_failed_payments');
|
|
@@ -28,10 +27,10 @@ const getPayments = require('./get_payments');
|
|
|
28
27
|
const getPendingChannels = require('./get_pending_channels');
|
|
29
28
|
const getPendingPayments = require('./get_pending_payments');
|
|
30
29
|
const getRouteThroughHops = require('./get_route_through_hops');
|
|
30
|
+
const getRoutingFeeEstimate = require('./get_routing_fee_estimate');
|
|
31
31
|
const getSettlementStatus = require('./get_settlement_status');
|
|
32
32
|
const isDestinationPayable = require('./is_destination_payable');
|
|
33
33
|
const pay = require('./pay');
|
|
34
|
-
const payTaprootInvoice = require('./pay_taproot_invoice');
|
|
35
34
|
const payViaPaymentDetails = require('./pay_via_payment_details');
|
|
36
35
|
const payViaPaymentRequest = require('./pay_via_payment_request');
|
|
37
36
|
const payViaRoutes = require('./pay_via_routes');
|
|
@@ -57,10 +56,11 @@ const updatePathfindingSettings = require('./update_pathfinding_settings');
|
|
|
57
56
|
const updateRoutingFees = require('./update_routing_fees');
|
|
58
57
|
const verifyBackup = require('./verify_backup');
|
|
59
58
|
const verifyBackups = require('./verify_backups');
|
|
59
|
+
const decodeAssetPayReq = require('./decode_asset_pay_req');
|
|
60
|
+
const payTaprootInvoice = require('./pay_taproot_invoice');
|
|
60
61
|
|
|
61
62
|
module.exports = {
|
|
62
63
|
connectWatchtower,
|
|
63
|
-
decodeAssetPayReq,
|
|
64
64
|
decodePaymentRequest,
|
|
65
65
|
deleteFailedPayAttempts,
|
|
66
66
|
deleteFailedPayments,
|
|
@@ -89,10 +89,10 @@ module.exports = {
|
|
|
89
89
|
getPendingChannels,
|
|
90
90
|
getPendingPayments,
|
|
91
91
|
getRouteThroughHops,
|
|
92
|
+
getRoutingFeeEstimate,
|
|
92
93
|
getSettlementStatus,
|
|
93
94
|
isDestinationPayable,
|
|
94
95
|
pay,
|
|
95
|
-
payTaprootInvoice,
|
|
96
96
|
payViaPaymentDetails,
|
|
97
97
|
payViaPaymentRequest,
|
|
98
98
|
payViaRoutes,
|
|
@@ -118,4 +118,6 @@ module.exports = {
|
|
|
118
118
|
updateRoutingFees,
|
|
119
119
|
verifyBackup,
|
|
120
120
|
verifyBackups,
|
|
121
|
+
decodeAssetPayReq,
|
|
122
|
+
payTaprootInvoice,
|
|
121
123
|
};
|
|
@@ -46,10 +46,14 @@ export type PayViaRoutesArgs = AuthenticatedLightningArgs<{
|
|
|
46
46
|
}[];
|
|
47
47
|
/** Total Millitokens To Pay */
|
|
48
48
|
mtokens: string;
|
|
49
|
+
/** Payment Identifier Hex */
|
|
50
|
+
payment?: string;
|
|
49
51
|
/** Expiration Block Height */
|
|
50
52
|
timeout: number;
|
|
51
53
|
/** Total Tokens To Pay */
|
|
52
54
|
tokens: number;
|
|
55
|
+
/** Total Millitokens */
|
|
56
|
+
total_mtokens?: string;
|
|
53
57
|
}[];
|
|
54
58
|
}>;
|
|
55
59
|
|