beignet 0.31.1 → 0.32.1
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/README.md +132 -100
- package/dist/cli/auth.js +96 -184
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/backup-destination.js +23 -0
- package/dist/cli/backup-destination.js.map +1 -1
- package/dist/cli/backup-mac.js +20 -24
- package/dist/cli/backup-mac.js.map +1 -1
- package/dist/cli/beignet-node.js +3492 -207
- package/dist/cli/beignet-node.js.map +1 -1
- package/dist/cli/cli.js +196 -2
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/config.js +136 -0
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/daemon-options.js +7 -0
- package/dist/cli/daemon-options.js.map +1 -1
- package/dist/cli/daemon-state-keys.js +15 -0
- package/dist/cli/daemon-state-keys.js.map +1 -0
- package/dist/cli/daemon.js +691 -59
- package/dist/cli/daemon.js.map +1 -1
- package/dist/cli/direct-funding.js +98 -4
- package/dist/cli/direct-funding.js.map +1 -1
- package/dist/cli/electrum-tls-config.js +44 -25
- package/dist/cli/electrum-tls-config.js.map +1 -1
- package/dist/cli/errors.js +237 -18
- package/dist/cli/errors.js.map +1 -1
- package/dist/cli/ffor-receive.js +34 -8
- package/dist/cli/ffor-receive.js.map +1 -1
- package/dist/cli/fs-utils.js +46 -24
- package/dist/cli/fs-utils.js.map +1 -1
- package/dist/cli/http-rate-limiter.js +41 -1
- package/dist/cli/http-rate-limiter.js.map +1 -1
- package/dist/cli/index.js +8 -33
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/instance-lock.js +70 -1
- package/dist/cli/instance-lock.js.map +1 -1
- package/dist/cli/node-storage-view.js +37 -0
- package/dist/cli/node-storage-view.js.map +1 -1
- package/dist/cli/offline-receive.js +58 -1
- package/dist/cli/offline-receive.js.map +1 -1
- package/dist/cli/onchain-sweep.js +15 -4
- package/dist/cli/onchain-sweep.js.map +1 -1
- package/dist/cli/openapi.js +44 -1
- package/dist/cli/openapi.js.map +1 -1
- package/dist/cli/payment-queue.js +219 -1
- package/dist/cli/payment-queue.js.map +1 -1
- package/dist/cli/process-faults.js +17 -0
- package/dist/cli/process-faults.js.map +1 -1
- package/dist/cli/restore.js +76 -24
- package/dist/cli/restore.js.map +1 -1
- package/dist/cli/routes.js +376 -0
- package/dist/cli/routes.js.map +1 -0
- package/dist/cli/types.js +4 -0
- package/dist/cli/types.js.map +1 -1
- package/dist/cli/wallet-storage.js +18 -0
- package/dist/cli/wallet-storage.js.map +1 -1
- package/dist/cli/webhooks.js +61 -1
- package/dist/cli/webhooks.js.map +1 -1
- package/dist/daemon.js +22 -0
- package/dist/daemon.js.map +1 -0
- package/dist/electrum/index.js +1120 -20
- package/dist/electrum/index.js.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/lightning/advisor/channel-suggestions.js +25 -1
- package/dist/lightning/advisor/channel-suggestions.js.map +1 -1
- package/dist/lightning/advisor/fee-advisor.js +27 -3
- package/dist/lightning/advisor/fee-advisor.js.map +1 -1
- package/dist/lightning/advisor/fee-tuner.js +18 -0
- package/dist/lightning/advisor/fee-tuner.js.map +1 -1
- package/dist/lightning/advisor/liquidity-advisor.js +41 -0
- package/dist/lightning/advisor/liquidity-advisor.js.map +1 -1
- package/dist/lightning/advisor/rebalance-planner.js +20 -0
- package/dist/lightning/advisor/rebalance-planner.js.map +1 -1
- package/dist/lightning/async-payments/held-forward-ledger.js +87 -5
- package/dist/lightning/async-payments/held-forward-ledger.js.map +1 -1
- package/dist/lightning/async-payments/index.js +23 -0
- package/dist/lightning/async-payments/index.js.map +1 -0
- package/dist/lightning/async-payments/manager.js +108 -5
- package/dist/lightning/async-payments/manager.js.map +1 -1
- package/dist/lightning/async-payments/receiver-grant.js +106 -15
- package/dist/lightning/async-payments/receiver-grant.js.map +1 -1
- package/dist/lightning/async-payments/release-capability.js +60 -15
- package/dist/lightning/async-payments/release-capability.js.map +1 -1
- package/dist/lightning/async-payments/service.js +128 -5
- package/dist/lightning/async-payments/service.js.map +1 -1
- package/dist/lightning/async-payments/types.js +39 -0
- package/dist/lightning/async-payments/types.js.map +1 -1
- package/dist/lightning/backup/scb.js +97 -0
- package/dist/lightning/backup/scb.js.map +1 -1
- package/dist/lightning/bootstrap/dns.js +49 -0
- package/dist/lightning/bootstrap/dns.js.map +1 -1
- package/dist/lightning/bootstrap/seeds.js +6 -0
- package/dist/lightning/bootstrap/seeds.js.map +1 -1
- package/dist/lightning/bootstrap/types.js +3 -0
- package/dist/lightning/bootstrap/types.js.map +1 -1
- package/dist/lightning/chain/broadcast-rejection.js +25 -0
- package/dist/lightning/chain/broadcast-rejection.js.map +1 -1
- package/dist/lightning/chain/chain-monitor.js +891 -19
- package/dist/lightning/chain/chain-monitor.js.map +1 -1
- package/dist/lightning/chain/chain-watcher.js +997 -18
- package/dist/lightning/chain/chain-watcher.js.map +1 -1
- package/dist/lightning/chain/closing.js +111 -5
- package/dist/lightning/chain/closing.js.map +1 -1
- package/dist/lightning/chain/electrum-backend.js +156 -3
- package/dist/lightning/chain/electrum-backend.js.map +1 -1
- package/dist/lightning/chain/output-resolver.js +676 -17
- package/dist/lightning/chain/output-resolver.js.map +1 -1
- package/dist/lightning/chain/sweep.js +150 -0
- package/dist/lightning/chain/sweep.js.map +1 -1
- package/dist/lightning/chain/types.js +20 -0
- package/dist/lightning/chain/types.js.map +1 -1
- package/dist/lightning/channel/announcements.js +264 -0
- package/dist/lightning/channel/announcements.js.map +1 -0
- package/dist/lightning/channel/channel-actions.js +112 -1
- package/dist/lightning/channel/channel-actions.js.map +1 -1
- package/dist/lightning/channel/channel-helpers.js +33 -0
- package/dist/lightning/channel/channel-helpers.js.map +1 -0
- package/dist/lightning/channel/channel-manager.js +3406 -156
- package/dist/lightning/channel/channel-manager.js.map +1 -1
- package/dist/lightning/channel/channel-state.js +48 -0
- package/dist/lightning/channel/channel-state.js.map +1 -1
- package/dist/lightning/channel/channel.js +9912 -1884
- package/dist/lightning/channel/channel.js.map +1 -1
- package/dist/lightning/channel/commitment-builder.js +529 -0
- package/dist/lightning/channel/commitment-builder.js.map +1 -1
- package/dist/lightning/channel/commitment-musig.js +37 -0
- package/dist/lightning/channel/commitment-musig.js.map +1 -1
- package/dist/lightning/channel/dual-funding.js +313 -0
- package/dist/lightning/channel/dual-funding.js.map +1 -1
- package/dist/lightning/channel/events.js +3 -0
- package/dist/lightning/channel/events.js.map +1 -0
- package/dist/lightning/channel/htlc-policy.js +929 -0
- package/dist/lightning/channel/htlc-policy.js.map +1 -0
- package/dist/lightning/channel/htlc-snapshots.js +45 -1
- package/dist/lightning/channel/htlc-snapshots.js.map +1 -1
- package/dist/lightning/channel/index.js +1 -0
- package/dist/lightning/channel/index.js.map +1 -1
- package/dist/lightning/channel/liquidity-ads.js +54 -8
- package/dist/lightning/channel/liquidity-ads.js.map +1 -1
- package/dist/lightning/channel/quiescence.js +62 -0
- package/dist/lightning/channel/quiescence.js.map +1 -1
- package/dist/lightning/channel/splice-tx.js +62 -0
- package/dist/lightning/channel/splice-tx.js.map +1 -1
- package/dist/lightning/channel/splice-weight.js +89 -0
- package/dist/lightning/channel/splice-weight.js.map +1 -1
- package/dist/lightning/channel/splice.js +118 -0
- package/dist/lightning/channel/splice.js.map +1 -1
- package/dist/lightning/channel/types.js +102 -0
- package/dist/lightning/channel/types.js.map +1 -1
- package/dist/lightning/channel/validation.js +153 -9
- package/dist/lightning/channel/validation.js.map +1 -1
- package/dist/lightning/channel/watchtower-cache.js +143 -0
- package/dist/lightning/channel/watchtower-cache.js.map +1 -0
- package/dist/lightning/channel/zero-conf.js +43 -0
- package/dist/lightning/channel/zero-conf.js.map +1 -1
- package/dist/lightning/crypto/chacha20poly1305.js +28 -20
- package/dist/lightning/crypto/chacha20poly1305.js.map +1 -1
- package/dist/lightning/crypto/ecdh.js +159 -17
- package/dist/lightning/crypto/ecdh.js.map +1 -1
- package/dist/lightning/crypto/hash.js +19 -0
- package/dist/lightning/crypto/hash.js.map +1 -0
- package/dist/lightning/crypto/hkdf.js +40 -12
- package/dist/lightning/crypto/hkdf.js.map +1 -1
- package/dist/lightning/crypto/index.js +4 -0
- package/dist/lightning/crypto/index.js.map +1 -1
- package/dist/lightning/crypto/message-signing.js +23 -9
- package/dist/lightning/crypto/message-signing.js.map +1 -1
- package/dist/lightning/crypto/musig.js +74 -11
- package/dist/lightning/crypto/musig.js.map +1 -1
- package/dist/lightning/crypto/provider.js +282 -0
- package/dist/lightning/crypto/provider.js.map +1 -0
- package/dist/lightning/crypto/xchacha20poly1305.js +30 -0
- package/dist/lightning/crypto/xchacha20poly1305.js.map +1 -1
- package/dist/lightning/direct-funding/envelope.js +119 -0
- package/dist/lightning/direct-funding/envelope.js.map +1 -1
- package/dist/lightning/direct-funding/frames.js +71 -6
- package/dist/lightning/direct-funding/frames.js.map +1 -1
- package/dist/lightning/direct-funding/messages.js +106 -21
- package/dist/lightning/direct-funding/messages.js.map +1 -1
- package/dist/lightning/direct-funding/receiver/engine.js +776 -2
- package/dist/lightning/direct-funding/receiver/engine.js.map +1 -1
- package/dist/lightning/direct-funding/receiver/sessions.js +50 -5
- package/dist/lightning/direct-funding/receiver/sessions.js.map +1 -1
- package/dist/lightning/direct-funding/receiver/types.js +85 -0
- package/dist/lightning/direct-funding/receiver/types.js.map +1 -1
- package/dist/lightning/direct-funding/receiver/verify.js +156 -0
- package/dist/lightning/direct-funding/receiver/verify.js.map +1 -1
- package/dist/lightning/direct-funding/requests.js +232 -10
- package/dist/lightning/direct-funding/requests.js.map +1 -1
- package/dist/lightning/direct-funding/sender/engine.js +447 -9
- package/dist/lightning/direct-funding/sender/engine.js.map +1 -1
- package/dist/lightning/direct-funding/sender/records.js +78 -0
- package/dist/lightning/direct-funding/sender/records.js.map +1 -1
- package/dist/lightning/direct-funding/sender/types.js +52 -0
- package/dist/lightning/direct-funding/sender/types.js.map +1 -1
- package/dist/lightning/direct-funding/sender/verify.js +75 -0
- package/dist/lightning/direct-funding/sender/verify.js.map +1 -1
- package/dist/lightning/direct-funding/transport/direct-peer.js +63 -1
- package/dist/lightning/direct-funding/transport/direct-peer.js.map +1 -1
- package/dist/lightning/direct-funding/transport/index.js +23 -0
- package/dist/lightning/direct-funding/transport/index.js.map +1 -1
- package/dist/lightning/direct-funding/transport/lane-table.js +42 -0
- package/dist/lightning/direct-funding/transport/lane-table.js.map +1 -1
- package/dist/lightning/direct-funding/transport/onion.js +98 -6
- package/dist/lightning/direct-funding/transport/onion.js.map +1 -1
- package/dist/lightning/direct-funding/transport/registry.js +108 -0
- package/dist/lightning/direct-funding/transport/registry.js.map +1 -1
- package/dist/lightning/direct-funding/transport/relay.js +81 -0
- package/dist/lightning/direct-funding/transport/relay.js.map +1 -1
- package/dist/lightning/direct-funding/transport/types.js +84 -0
- package/dist/lightning/direct-funding/transport/types.js.map +1 -1
- package/dist/lightning/direct-funding/types.js +101 -3
- package/dist/lightning/direct-funding/types.js.map +1 -1
- package/dist/lightning/features/flags.js +183 -1
- package/dist/lightning/features/flags.js.map +1 -1
- package/dist/lightning/ffor/amounts.js +37 -0
- package/dist/lightning/ffor/amounts.js.map +1 -1
- package/dist/lightning/ffor/index.js +35 -0
- package/dist/lightning/ffor/index.js.map +1 -0
- package/dist/lightning/ffor/issuer-ledger.js +16 -0
- package/dist/lightning/ffor/issuer-ledger.js.map +1 -1
- package/dist/lightning/ffor/issuer-messages.js +13 -9
- package/dist/lightning/ffor/issuer-messages.js.map +1 -1
- package/dist/lightning/ffor/issuer-paths.js +23 -5
- package/dist/lightning/ffor/issuer-paths.js.map +1 -1
- package/dist/lightning/ffor/issuer-service.js +33 -9
- package/dist/lightning/ffor/issuer-service.js.map +1 -1
- package/dist/lightning/ffor/messages.js +92 -10
- package/dist/lightning/ffor/messages.js.map +1 -1
- package/dist/lightning/ffor/sync-state.js +3 -9
- package/dist/lightning/ffor/sync-state.js.map +1 -1
- package/dist/lightning/ffor/transcript.js +20 -8
- package/dist/lightning/ffor/transcript.js.map +1 -1
- package/dist/lightning/ffor/types.js +37 -0
- package/dist/lightning/ffor/types.js.map +1 -1
- package/dist/lightning/ffor/voucher-archive.js +19 -7
- package/dist/lightning/ffor/voucher-archive.js.map +1 -1
- package/dist/lightning/ffor/voucher-chain.js +3 -0
- package/dist/lightning/ffor/voucher-chain.js.map +1 -1
- package/dist/lightning/ffor/voucher-index.js +2 -0
- package/dist/lightning/ffor/voucher-index.js.map +1 -1
- package/dist/lightning/ffor/voucher.js +24 -5
- package/dist/lightning/ffor/voucher.js.map +1 -1
- package/dist/lightning/ffor/witness-crypto.js +14 -5
- package/dist/lightning/ffor/witness-crypto.js.map +1 -1
- package/dist/lightning/ffor/witness-ledger.js +27 -0
- package/dist/lightning/ffor/witness-ledger.js.map +1 -1
- package/dist/lightning/ffor/witness-messages.js +52 -8
- package/dist/lightning/ffor/witness-messages.js.map +1 -1
- package/dist/lightning/ffor/witness-service.js +66 -11
- package/dist/lightning/ffor/witness-service.js.map +1 -1
- package/dist/lightning/ffor/witness-types.js +32 -0
- package/dist/lightning/ffor/witness-types.js.map +1 -1
- package/dist/lightning/gossip/gossip-queries.js +40 -5
- package/dist/lightning/gossip/gossip-queries.js.map +1 -1
- package/dist/lightning/gossip/gossip-sync.js +177 -0
- package/dist/lightning/gossip/gossip-sync.js.map +1 -1
- package/dist/lightning/gossip/graph-restore.js +49 -0
- package/dist/lightning/gossip/graph-restore.js.map +1 -1
- package/dist/lightning/gossip/messages.js +99 -3
- package/dist/lightning/gossip/messages.js.map +1 -1
- package/dist/lightning/gossip/mission-control.js +37 -1
- package/dist/lightning/gossip/mission-control.js.map +1 -1
- package/dist/lightning/gossip/network-graph.js +423 -0
- package/dist/lightning/gossip/network-graph.js.map +1 -1
- package/dist/lightning/gossip/pathfinding.js +262 -3
- package/dist/lightning/gossip/pathfinding.js.map +1 -1
- package/dist/lightning/gossip/pay-all.js +12 -1
- package/dist/lightning/gossip/pay-all.js.map +1 -1
- package/dist/lightning/gossip/rapid-sync.js +125 -0
- package/dist/lightning/gossip/rapid-sync.js.map +1 -1
- package/dist/lightning/gossip/scid-encoding.js +27 -2
- package/dist/lightning/gossip/scid-encoding.js.map +1 -1
- package/dist/lightning/gossip/types.js +49 -0
- package/dist/lightning/gossip/types.js.map +1 -1
- package/dist/lightning/gossip/validation.js +63 -6
- package/dist/lightning/gossip/validation.js.map +1 -1
- package/dist/lightning/index.js +8 -1
- package/dist/lightning/index.js.map +1 -1
- package/dist/lightning/interactive-tx/builder.js +82 -0
- package/dist/lightning/interactive-tx/builder.js.map +1 -1
- package/dist/lightning/interactive-tx/types.js +11 -0
- package/dist/lightning/interactive-tx/types.js.map +1 -1
- package/dist/lightning/interactive-tx/validation.js +85 -1
- package/dist/lightning/interactive-tx/validation.js.map +1 -1
- package/dist/lightning/invoice/amount.js +39 -1
- package/dist/lightning/invoice/amount.js.map +1 -1
- package/dist/lightning/invoice/decode.js +43 -0
- package/dist/lightning/invoice/decode.js.map +1 -1
- package/dist/lightning/invoice/encode.js +39 -0
- package/dist/lightning/invoice/encode.js.map +1 -1
- package/dist/lightning/invoice/signing.js +42 -5
- package/dist/lightning/invoice/signing.js.map +1 -1
- package/dist/lightning/invoice/types.js +23 -0
- package/dist/lightning/invoice/types.js.map +1 -1
- package/dist/lightning/invoice/words.js +30 -0
- package/dist/lightning/invoice/words.js.map +1 -1
- package/dist/lightning/keys/derivation.js +64 -13
- package/dist/lightning/keys/derivation.js.map +1 -1
- package/dist/lightning/keys/shachain.js +64 -12
- package/dist/lightning/keys/shachain.js.map +1 -1
- package/dist/lightning/keys/signer.js +96 -0
- package/dist/lightning/keys/signer.js.map +1 -1
- package/dist/lightning/keys/wallet-keys.js +74 -2
- package/dist/lightning/keys/wallet-keys.js.map +1 -1
- package/dist/lightning/l402/challenge.js +82 -0
- package/dist/lightning/l402/challenge.js.map +1 -1
- package/dist/lightning/l402/client.js +198 -37
- package/dist/lightning/l402/client.js.map +1 -1
- package/dist/lightning/l402/credentials.js +25 -0
- package/dist/lightning/l402/credentials.js.map +1 -1
- package/dist/lightning/l402/index.js +10 -0
- package/dist/lightning/l402/index.js.map +1 -1
- package/dist/lightning/l402/macaroon.js +56 -0
- package/dist/lightning/l402/macaroon.js.map +1 -1
- package/dist/lightning/liquidity/index.js +3 -1
- package/dist/lightning/liquidity/index.js.map +1 -1
- package/dist/lightning/liquidity/jit-receive.js +427 -31
- package/dist/lightning/liquidity/jit-receive.js.map +1 -1
- package/dist/lightning/message/channel-close.js +58 -2
- package/dist/lightning/message/channel-close.js.map +1 -1
- package/dist/lightning/message/channel-commitment.js +42 -2
- package/dist/lightning/message/channel-commitment.js.map +1 -1
- package/dist/lightning/message/channel-funding.js +51 -3
- package/dist/lightning/message/channel-funding.js.map +1 -1
- package/dist/lightning/message/channel-open.js +62 -0
- package/dist/lightning/message/channel-open.js.map +1 -1
- package/dist/lightning/message/channel-reestablish.js +38 -1
- package/dist/lightning/message/channel-reestablish.js.map +1 -1
- package/dist/lightning/message/channel-update.js +82 -6
- package/dist/lightning/message/channel-update.js.map +1 -1
- package/dist/lightning/message/codec.js +52 -0
- package/dist/lightning/message/codec.js.map +1 -1
- package/dist/lightning/message/custom.js +66 -0
- package/dist/lightning/message/custom.js.map +1 -1
- package/dist/lightning/message/dual-funding.js +79 -0
- package/dist/lightning/message/dual-funding.js.map +1 -1
- package/dist/lightning/message/error.js +65 -0
- package/dist/lightning/message/error.js.map +1 -1
- package/dist/lightning/message/init.js +36 -0
- package/dist/lightning/message/init.js.map +1 -1
- package/dist/lightning/message/interactive-tx.js +101 -2
- package/dist/lightning/message/interactive-tx.js.map +1 -1
- package/dist/lightning/message/peer-storage.js +13 -0
- package/dist/lightning/message/peer-storage.js.map +1 -1
- package/dist/lightning/message/ping.js +32 -0
- package/dist/lightning/message/ping.js.map +1 -1
- package/dist/lightning/message/splice-conflict.js +28 -0
- package/dist/lightning/message/splice-conflict.js.map +1 -1
- package/dist/lightning/message/splice.js +78 -2
- package/dist/lightning/message/splice.js.map +1 -1
- package/dist/lightning/message/stfu.js +8 -0
- package/dist/lightning/message/stfu.js.map +1 -1
- package/dist/lightning/message/tlv.js +46 -0
- package/dist/lightning/message/tlv.js.map +1 -1
- package/dist/lightning/message/types.js +36 -0
- package/dist/lightning/message/types.js.map +1 -1
- package/dist/lightning/node/config.js +192 -0
- package/dist/lightning/node/config.js.map +1 -0
- package/dist/lightning/node/events.js +3 -0
- package/dist/lightning/node/events.js.map +1 -0
- package/dist/lightning/node/funding-selection.js +82 -0
- package/dist/lightning/node/funding-selection.js.map +1 -1
- package/dist/lightning/node/index.js +4 -0
- package/dist/lightning/node/index.js.map +1 -1
- package/dist/lightning/node/lightning-node.js +9347 -559
- package/dist/lightning/node/lightning-node.js.map +1 -1
- package/dist/lightning/node/payment-types.js +19 -0
- package/dist/lightning/node/payment-types.js.map +1 -0
- package/dist/lightning/node/rate-limiter.js +21 -1
- package/dist/lightning/node/rate-limiter.js.map +1 -1
- package/dist/lightning/node/types.js +115 -18
- package/dist/lightning/node/types.js.map +1 -1
- package/dist/lightning/offer/bech32-nochecksum.js +26 -0
- package/dist/lightning/offer/bech32-nochecksum.js.map +1 -1
- package/dist/lightning/offer/decode.js +21 -0
- package/dist/lightning/offer/decode.js.map +1 -1
- package/dist/lightning/offer/encode.js +26 -0
- package/dist/lightning/offer/encode.js.map +1 -1
- package/dist/lightning/offer/merkle.js +42 -24
- package/dist/lightning/offer/merkle.js.map +1 -1
- package/dist/lightning/offer/offer-manager.js +384 -16
- package/dist/lightning/offer/offer-manager.js.map +1 -1
- package/dist/lightning/offer/schnorr.js +31 -1
- package/dist/lightning/offer/schnorr.js.map +1 -1
- package/dist/lightning/offer/tlv.js +145 -8
- package/dist/lightning/offer/tlv.js.map +1 -1
- package/dist/lightning/offer/types.js +9 -0
- package/dist/lightning/offer/types.js.map +1 -1
- package/dist/lightning/onion/blinded-path.js +112 -0
- package/dist/lightning/onion/blinded-path.js.map +1 -1
- package/dist/lightning/onion/blinding.js +61 -17
- package/dist/lightning/onion/blinding.js.map +1 -1
- package/dist/lightning/onion/construct.js +57 -12
- package/dist/lightning/onion/construct.js.map +1 -1
- package/dist/lightning/onion/failures.js +71 -13
- package/dist/lightning/onion/failures.js.map +1 -1
- package/dist/lightning/onion/hop-payload.js +70 -0
- package/dist/lightning/onion/hop-payload.js.map +1 -1
- package/dist/lightning/onion/process.js +44 -11
- package/dist/lightning/onion/process.js.map +1 -1
- package/dist/lightning/onion/sphinx-crypto.js +36 -16
- package/dist/lightning/onion/sphinx-crypto.js.map +1 -1
- package/dist/lightning/onion/types.js +27 -0
- package/dist/lightning/onion/types.js.map +1 -1
- package/dist/lightning/onion-message/codec.js +59 -0
- package/dist/lightning/onion-message/codec.js.map +1 -1
- package/dist/lightning/onion-message/construct.js +91 -10
- package/dist/lightning/onion-message/construct.js.map +1 -1
- package/dist/lightning/onion-message/manager.js +97 -5
- package/dist/lightning/onion-message/manager.js.map +1 -1
- package/dist/lightning/onion-message/process.js +59 -8
- package/dist/lightning/onion-message/process.js.map +1 -1
- package/dist/lightning/onion-message/types.js +17 -0
- package/dist/lightning/onion-message/types.js.map +1 -1
- package/dist/lightning/recovery/assembly.js +74 -0
- package/dist/lightning/recovery/assembly.js.map +1 -1
- package/dist/lightning/recovery/capsule.js +377 -22
- package/dist/lightning/recovery/capsule.js.map +1 -1
- package/dist/lightning/recovery/channel-status.js +57 -0
- package/dist/lightning/recovery/channel-status.js.map +1 -1
- package/dist/lightning/recovery/durability-barrier.js +188 -0
- package/dist/lightning/recovery/durability-barrier.js.map +1 -1
- package/dist/lightning/recovery/frame-codec.js +65 -2
- package/dist/lightning/recovery/frame-codec.js.map +1 -1
- package/dist/lightning/recovery/guardian-bolt8.js +117 -1
- package/dist/lightning/recovery/guardian-bolt8.js.map +1 -1
- package/dist/lightning/recovery/guardian-client.js +116 -0
- package/dist/lightning/recovery/guardian-client.js.map +1 -1
- package/dist/lightning/recovery/guardian-host.js +92 -1
- package/dist/lightning/recovery/guardian-host.js.map +1 -1
- package/dist/lightning/recovery/guardian-http.js +48 -0
- package/dist/lightning/recovery/guardian-http.js.map +1 -1
- package/dist/lightning/recovery/guardian-proto.js +34 -0
- package/dist/lightning/recovery/guardian-proto.js.map +1 -1
- package/dist/lightning/recovery/guardian-replication.js +441 -6
- package/dist/lightning/recovery/guardian-replication.js.map +1 -1
- package/dist/lightning/recovery/guardian-rotation.js +88 -0
- package/dist/lightning/recovery/guardian-rotation.js.map +1 -1
- package/dist/lightning/recovery/guardian-store.js +133 -5
- package/dist/lightning/recovery/guardian-store.js.map +1 -1
- package/dist/lightning/recovery/guardian-wire.js +99 -10
- package/dist/lightning/recovery/guardian-wire.js.map +1 -1
- package/dist/lightning/recovery/guardian.js +471 -6
- package/dist/lightning/recovery/guardian.js.map +1 -1
- package/dist/lightning/recovery/index.js +21 -1
- package/dist/lightning/recovery/index.js.map +1 -1
- package/dist/lightning/recovery/journal.js +865 -15
- package/dist/lightning/recovery/journal.js.map +1 -1
- package/dist/lightning/recovery/recovery-manager.js +105 -0
- package/dist/lightning/recovery/recovery-manager.js.map +1 -1
- package/dist/lightning/recovery/restore-driver.js +374 -5
- package/dist/lightning/recovery/restore-driver.js.map +1 -1
- package/dist/lightning/recovery/startup-gate.js +91 -0
- package/dist/lightning/recovery/startup-gate.js.map +1 -1
- package/dist/lightning/recovery/types.js +23 -0
- package/dist/lightning/recovery/types.js.map +1 -1
- package/dist/lightning/recovery/wire-safety.js +93 -0
- package/dist/lightning/recovery/wire-safety.js.map +1 -1
- package/dist/lightning/recovery/writer-lease.js +115 -2
- package/dist/lightning/recovery/writer-lease.js.map +1 -1
- package/dist/lightning/script/anchor.js +46 -0
- package/dist/lightning/script/anchor.js.map +1 -1
- package/dist/lightning/script/commitment-taproot.js +116 -15
- package/dist/lightning/script/commitment-taproot.js.map +1 -1
- package/dist/lightning/script/commitment.js +91 -9
- package/dist/lightning/script/commitment.js.map +1 -1
- package/dist/lightning/script/funding-taproot.js +26 -0
- package/dist/lightning/script/funding-taproot.js.map +1 -1
- package/dist/lightning/script/funding.js +25 -5
- package/dist/lightning/script/funding.js.map +1 -1
- package/dist/lightning/script/htlc-taproot.js +55 -0
- package/dist/lightning/script/htlc-taproot.js.map +1 -1
- package/dist/lightning/script/htlc.js +94 -9
- package/dist/lightning/script/htlc.js.map +1 -1
- package/dist/lightning/script/revocation.js +76 -6
- package/dist/lightning/script/revocation.js.map +1 -1
- package/dist/lightning/sqlite.js +14 -0
- package/dist/lightning/sqlite.js.map +1 -0
- package/dist/lightning/storage/capabilities.js +169 -0
- package/dist/lightning/storage/capabilities.js.map +1 -0
- package/dist/lightning/storage/conformance.js +1016 -0
- package/dist/lightning/storage/conformance.js.map +1 -0
- package/dist/lightning/storage/durable-ledger.js +90 -0
- package/dist/lightning/storage/durable-ledger.js.map +1 -1
- package/dist/lightning/storage/encryption.js +48 -16
- package/dist/lightning/storage/encryption.js.map +1 -1
- package/dist/lightning/storage/htlc-history.js +1 -0
- package/dist/lightning/storage/htlc-history.js.map +1 -1
- package/dist/lightning/storage/index.js +20 -1
- package/dist/lightning/storage/index.js.map +1 -1
- package/dist/lightning/storage/memory-storage.js +949 -0
- package/dist/lightning/storage/memory-storage.js.map +1 -0
- package/dist/lightning/storage/serialization.js +81 -2
- package/dist/lightning/storage/serialization.js.map +1 -1
- package/dist/lightning/storage/sqlite-binding.js +25 -0
- package/dist/lightning/storage/sqlite-binding.js.map +1 -0
- package/dist/lightning/storage/sqlite-storage.js +567 -415
- package/dist/lightning/storage/sqlite-storage.js.map +1 -1
- package/dist/lightning/storage/transaction.js +26 -0
- package/dist/lightning/storage/transaction.js.map +1 -1
- package/dist/lightning/storage/types.js +12 -0
- package/dist/lightning/storage/types.js.map +1 -1
- package/dist/lightning/swaps/chain-resolver.js +48 -0
- package/dist/lightning/swaps/chain-resolver.js.map +1 -1
- package/dist/lightning/swaps/client.js +32 -0
- package/dist/lightning/swaps/client.js.map +1 -1
- package/dist/lightning/swaps/engine-common.js +12 -0
- package/dist/lightning/swaps/engine-common.js.map +1 -1
- package/dist/lightning/swaps/exposure.js +17 -0
- package/dist/lightning/swaps/exposure.js.map +1 -1
- package/dist/lightning/swaps/htlc.js +4 -0
- package/dist/lightning/swaps/htlc.js.map +1 -1
- package/dist/lightning/swaps/keys.js +18 -11
- package/dist/lightning/swaps/keys.js.map +1 -1
- package/dist/lightning/swaps/ledger.js +131 -0
- package/dist/lightning/swaps/ledger.js.map +1 -1
- package/dist/lightning/swaps/messages.js +57 -3
- package/dist/lightning/swaps/messages.js.map +1 -1
- package/dist/lightning/swaps/policy.js +14 -0
- package/dist/lightning/swaps/policy.js.map +1 -1
- package/dist/lightning/swaps/reverse-engine.js +225 -11
- package/dist/lightning/swaps/reverse-engine.js.map +1 -1
- package/dist/lightning/swaps/submarine-engine.js +166 -12
- package/dist/lightning/swaps/submarine-engine.js.map +1 -1
- package/dist/lightning/swaps/transactions.js +16 -0
- package/dist/lightning/swaps/transactions.js.map +1 -1
- package/dist/lightning/swaps/validation.js +1 -0
- package/dist/lightning/swaps/validation.js.map +1 -1
- package/dist/lightning/transport/cipher.js +41 -0
- package/dist/lightning/transport/cipher.js.map +1 -1
- package/dist/lightning/transport/duplex-transport.js +16 -0
- package/dist/lightning/transport/duplex-transport.js.map +1 -1
- package/dist/lightning/transport/iroh-node.js +9 -1
- package/dist/lightning/transport/iroh-node.js.map +1 -1
- package/dist/lightning/transport/iroh.js +6 -0
- package/dist/lightning/transport/iroh.js.map +1 -1
- package/dist/lightning/transport/noise.js +133 -24
- package/dist/lightning/transport/noise.js.map +1 -1
- package/dist/lightning/transport/peer-manager.js +625 -25
- package/dist/lightning/transport/peer-manager.js.map +1 -1
- package/dist/lightning/transport/peer-uri.js +13 -0
- package/dist/lightning/transport/peer-uri.js.map +1 -1
- package/dist/lightning/transport/peer.js +280 -17
- package/dist/lightning/transport/peer.js.map +1 -1
- package/dist/lightning/transport/websocket-frame.js +32 -0
- package/dist/lightning/transport/websocket-frame.js.map +1 -1
- package/dist/lightning/transport/websocket-node-client.js +41 -14
- package/dist/lightning/transport/websocket-node-client.js.map +1 -1
- package/dist/lightning/transport/websocket-server.js +70 -3
- package/dist/lightning/transport/websocket-server.js.map +1 -1
- package/dist/lightning/transport/websocket.js +67 -0
- package/dist/lightning/transport/websocket.js.map +1 -1
- package/dist/lightning/transport/wire-capture.js +23 -4
- package/dist/lightning/transport/wire-capture.js.map +1 -1
- package/dist/lightning/validation/index.js +44 -0
- package/dist/lightning/validation/index.js.map +1 -1
- package/dist/lightning/wallet/wallet-funding-provider.js +320 -0
- package/dist/lightning/wallet/wallet-funding-provider.js.map +1 -1
- package/dist/lightning/watchtower/blob.js +50 -10
- package/dist/lightning/watchtower/blob.js.map +1 -1
- package/dist/lightning/watchtower/index.js +12 -0
- package/dist/lightning/watchtower/index.js.map +1 -1
- package/dist/lightning/watchtower/justice.js +74 -0
- package/dist/lightning/watchtower/justice.js.map +1 -1
- package/dist/lightning/watchtower/tower-connection.js +20 -27
- package/dist/lightning/watchtower/tower-connection.js.map +1 -1
- package/dist/lightning/watchtower/types.js +4 -0
- package/dist/lightning/watchtower/types.js.map +1 -1
- package/dist/lightning/watchtower/watchtower-client.js +89 -3
- package/dist/lightning/watchtower/watchtower-client.js.map +1 -1
- package/dist/lightning/watchtower/wtwire.js +34 -0
- package/dist/lightning/watchtower/wtwire.js.map +1 -1
- package/dist/logger.js +26 -0
- package/dist/logger.js.map +1 -1
- package/dist/network.js +67 -0
- package/dist/network.js.map +1 -0
- package/dist/node.js +47 -0
- package/dist/node.js.map +1 -0
- package/dist/shapes/electrum.js +10 -0
- package/dist/shapes/electrum.js.map +1 -1
- package/dist/shapes/wallet.js +2 -0
- package/dist/shapes/wallet.js.map +1 -1
- package/dist/transaction/index.js +486 -630
- package/dist/transaction/index.js.map +1 -1
- package/dist/transaction/pricing.js +815 -0
- package/dist/transaction/pricing.js.map +1 -0
- package/dist/types/cli/auth.d.ts +108 -1
- package/dist/types/cli/backup-destination.d.ts +15 -0
- package/dist/types/cli/backup-mac.d.ts +18 -0
- package/dist/types/cli/beignet-node.d.ts +2193 -83
- package/dist/types/cli/config.d.ts +17 -1
- package/dist/types/cli/daemon-options.d.ts +14 -2
- package/dist/types/cli/daemon-state-keys.d.ts +11 -0
- package/dist/types/cli/daemon.d.ts +98 -7
- package/dist/types/cli/direct-funding.d.ts +29 -2
- package/dist/types/cli/electrum-tls-config.d.ts +48 -1
- package/dist/types/cli/errors.d.ts +163 -4
- package/dist/types/cli/ffor-receive.d.ts +2 -0
- package/dist/types/cli/fs-utils.d.ts +44 -0
- package/dist/types/cli/http-rate-limiter.d.ts +45 -0
- package/dist/types/cli/index.d.ts +8 -11
- package/dist/types/cli/instance-lock.d.ts +47 -0
- package/dist/types/cli/iroh-config.d.ts +3 -0
- package/dist/types/cli/node-storage-view.d.ts +34 -2
- package/dist/types/cli/offline-receive.d.ts +58 -0
- package/dist/types/cli/onchain-sweep.d.ts +11 -3
- package/dist/types/cli/openapi.d.ts +7 -0
- package/dist/types/cli/payment-queue.d.ts +168 -1
- package/dist/types/cli/process-faults.d.ts +19 -1
- package/dist/types/cli/restore.d.ts +73 -1
- package/dist/types/cli/routes.d.ts +830 -0
- package/dist/types/cli/types.d.ts +775 -65
- package/dist/types/cli/wallet-storage.d.ts +18 -3
- package/dist/types/cli/webhooks.d.ts +45 -1
- package/dist/types/daemon.d.ts +10 -0
- package/dist/types/electrum/index.d.ts +424 -6
- package/dist/types/electrum.js +6 -1
- package/dist/types/electrum.js.map +1 -1
- package/dist/types/index.d.ts +7 -0
- package/dist/types/lightning/advisor/channel-suggestions.d.ts +18 -1
- package/dist/types/lightning/advisor/fee-advisor.d.ts +18 -0
- package/dist/types/lightning/advisor/fee-tuner.d.ts +21 -0
- package/dist/types/lightning/advisor/liquidity-advisor.d.ts +56 -1
- package/dist/types/lightning/advisor/rebalance-planner.d.ts +17 -1
- package/dist/types/lightning/async-payments/held-forward-ledger.d.ts +110 -1
- package/dist/types/lightning/async-payments/index.d.ts +6 -0
- package/dist/types/lightning/async-payments/manager.d.ts +111 -4
- package/dist/types/lightning/async-payments/receiver-grant.d.ts +104 -0
- package/dist/types/lightning/async-payments/release-capability.d.ts +58 -0
- package/dist/types/lightning/async-payments/service.d.ts +133 -4
- package/dist/types/lightning/async-payments/types.d.ts +107 -0
- package/dist/types/lightning/backup/scb.d.ts +88 -0
- package/dist/types/lightning/bootstrap/dns.d.ts +36 -1
- package/dist/types/lightning/bootstrap/seeds.d.ts +9 -1
- package/dist/types/lightning/bootstrap/types.d.ts +12 -0
- package/dist/types/lightning/chain/broadcast-rejection.d.ts +5 -0
- package/dist/types/lightning/chain/chain-monitor.d.ts +357 -2
- package/dist/types/lightning/chain/chain-watcher.d.ts +541 -2
- package/dist/types/lightning/chain/closing.d.ts +99 -0
- package/dist/types/lightning/chain/electrum-backend.d.ts +89 -3
- package/dist/types/lightning/chain/output-resolver.d.ts +108 -2
- package/dist/types/lightning/chain/sweep.d.ts +174 -0
- package/dist/types/lightning/chain/types.d.ts +199 -0
- package/dist/types/lightning/channel/announcements.d.ts +46 -0
- package/dist/types/lightning/channel/channel-actions.d.ts +361 -7
- package/dist/types/lightning/channel/channel-helpers.d.ts +12 -0
- package/dist/types/lightning/channel/channel-manager.d.ts +1719 -15
- package/dist/types/lightning/channel/channel-state.d.ts +944 -2
- package/dist/types/lightning/channel/channel.d.ts +3673 -50
- package/dist/types/lightning/channel/commitment-builder.d.ts +215 -3
- package/dist/types/lightning/channel/commitment-musig.d.ts +38 -1
- package/dist/types/lightning/channel/dual-funding.d.ts +318 -4
- package/dist/types/lightning/channel/events.d.ts +153 -0
- package/dist/types/lightning/channel/htlc-policy.d.ts +359 -0
- package/dist/types/lightning/channel/htlc-snapshots.d.ts +33 -2
- package/dist/types/lightning/channel/index.d.ts +1 -0
- package/dist/types/lightning/channel/liquidity-ads.d.ts +41 -1
- package/dist/types/lightning/channel/quiescence.d.ts +57 -0
- package/dist/types/lightning/channel/splice-tx.d.ts +69 -1
- package/dist/types/lightning/channel/splice-weight.d.ts +89 -0
- package/dist/types/lightning/channel/splice.d.ts +117 -2
- package/dist/types/lightning/channel/types.d.ts +283 -0
- package/dist/types/lightning/channel/validation.d.ts +89 -1
- package/dist/types/lightning/channel/watchtower-cache.d.ts +42 -0
- package/dist/types/lightning/channel/zero-conf.d.ts +43 -0
- package/dist/types/lightning/channel/zero-reserve.d.ts +6 -0
- package/dist/types/lightning/crypto/chacha20poly1305.d.ts +26 -2
- package/dist/types/lightning/crypto/ecdh.d.ts +93 -0
- package/dist/types/lightning/crypto/hash.d.ts +12 -0
- package/dist/types/lightning/crypto/hkdf.d.ts +43 -5
- package/dist/types/lightning/crypto/index.d.ts +2 -0
- package/dist/types/lightning/crypto/message-signing.d.ts +21 -0
- package/dist/types/lightning/crypto/musig.d.ts +66 -0
- package/dist/types/lightning/crypto/provider.d.ts +62 -0
- package/dist/types/lightning/crypto/xchacha20poly1305.d.ts +18 -0
- package/dist/types/lightning/direct-funding/envelope.d.ts +85 -1
- package/dist/types/lightning/direct-funding/frames.d.ts +78 -1
- package/dist/types/lightning/direct-funding/messages.d.ts +136 -0
- package/dist/types/lightning/direct-funding/receiver/engine.d.ts +446 -4
- package/dist/types/lightning/direct-funding/receiver/index.d.ts +1 -1
- package/dist/types/lightning/direct-funding/receiver/sessions.d.ts +83 -0
- package/dist/types/lightning/direct-funding/receiver/types.d.ts +256 -0
- package/dist/types/lightning/direct-funding/receiver/verify.d.ts +118 -2
- package/dist/types/lightning/direct-funding/requests.d.ts +174 -2
- package/dist/types/lightning/direct-funding/sender/engine.d.ts +227 -1
- package/dist/types/lightning/direct-funding/sender/records.d.ts +73 -1
- package/dist/types/lightning/direct-funding/sender/types.d.ts +216 -0
- package/dist/types/lightning/direct-funding/sender/verify.d.ts +47 -1
- package/dist/types/lightning/direct-funding/transport/direct-peer.d.ts +32 -2
- package/dist/types/lightning/direct-funding/transport/index.d.ts +26 -2
- package/dist/types/lightning/direct-funding/transport/lane-table.d.ts +36 -1
- package/dist/types/lightning/direct-funding/transport/onion.d.ts +80 -4
- package/dist/types/lightning/direct-funding/transport/registry.d.ts +80 -2
- package/dist/types/lightning/direct-funding/transport/relay.d.ts +49 -2
- package/dist/types/lightning/direct-funding/transport/types.d.ts +211 -1
- package/dist/types/lightning/direct-funding/types.d.ts +197 -2
- package/dist/types/lightning/features/flags.d.ts +167 -0
- package/dist/types/lightning/ffor/amounts.d.ts +48 -1
- package/dist/types/lightning/ffor/index.d.ts +18 -0
- package/dist/types/lightning/ffor/issuer-ledger.d.ts +15 -1
- package/dist/types/lightning/ffor/issuer-messages.d.ts +13 -0
- package/dist/types/lightning/ffor/issuer-paths.d.ts +24 -3
- package/dist/types/lightning/ffor/issuer-service.d.ts +40 -5
- package/dist/types/lightning/ffor/messages.d.ts +44 -2
- package/dist/types/lightning/ffor/sync-state.d.ts +2 -1
- package/dist/types/lightning/ffor/transcript.d.ts +20 -1
- package/dist/types/lightning/ffor/types.d.ts +229 -0
- package/dist/types/lightning/ffor/voucher-archive.d.ts +15 -1
- package/dist/types/lightning/ffor/voucher-chain.d.ts +3 -2
- package/dist/types/lightning/ffor/voucher-index.d.ts +2 -1
- package/dist/types/lightning/ffor/voucher.d.ts +25 -1
- package/dist/types/lightning/ffor/witness-crypto.d.ts +13 -0
- package/dist/types/lightning/ffor/witness-ledger.d.ts +39 -1
- package/dist/types/lightning/ffor/witness-messages.d.ts +35 -3
- package/dist/types/lightning/ffor/witness-service.d.ts +88 -2
- package/dist/types/lightning/ffor/witness-types.d.ts +44 -0
- package/dist/types/lightning/gossip/gossip-queries.d.ts +32 -1
- package/dist/types/lightning/gossip/gossip-sync.d.ts +121 -1
- package/dist/types/lightning/gossip/graph-restore.d.ts +60 -2
- package/dist/types/lightning/gossip/messages.d.ts +67 -1
- package/dist/types/lightning/gossip/mission-control.d.ts +32 -0
- package/dist/types/lightning/gossip/network-graph.d.ts +254 -1
- package/dist/types/lightning/gossip/pathfinding.d.ts +123 -5
- package/dist/types/lightning/gossip/pay-all.d.ts +13 -4
- package/dist/types/lightning/gossip/rapid-sync.d.ts +72 -1
- package/dist/types/lightning/gossip/scid-encoding.d.ts +21 -0
- package/dist/types/lightning/gossip/types.d.ts +81 -0
- package/dist/types/lightning/gossip/validation.d.ts +57 -1
- package/dist/types/lightning/index.d.ts +7 -0
- package/dist/types/lightning/interactive-tx/builder.d.ts +64 -1
- package/dist/types/lightning/interactive-tx/types.d.ts +38 -0
- package/dist/types/lightning/interactive-tx/validation.d.ts +95 -1
- package/dist/types/lightning/invoice/amount.d.ts +27 -0
- package/dist/types/lightning/invoice/decode.d.ts +20 -1
- package/dist/types/lightning/invoice/encode.d.ts +10 -1
- package/dist/types/lightning/invoice/signing.d.ts +35 -0
- package/dist/types/lightning/invoice/types.d.ts +30 -2
- package/dist/types/lightning/invoice/words.d.ts +28 -0
- package/dist/types/lightning/keys/derivation.d.ts +61 -0
- package/dist/types/lightning/keys/shachain.d.ts +48 -0
- package/dist/types/lightning/keys/signer.d.ts +149 -0
- package/dist/types/lightning/keys/wallet-keys.d.ts +87 -2
- package/dist/types/lightning/l402/challenge.d.ts +62 -0
- package/dist/types/lightning/l402/client.d.ts +138 -5
- package/dist/types/lightning/l402/credentials.d.ts +31 -0
- package/dist/types/lightning/l402/index.d.ts +10 -0
- package/dist/types/lightning/l402/macaroon.d.ts +40 -0
- package/dist/types/lightning/liquidity/index.d.ts +2 -2
- package/dist/types/lightning/liquidity/jit-receive.d.ts +442 -3
- package/dist/types/lightning/message/channel-close.d.ts +61 -0
- package/dist/types/lightning/message/channel-commitment.d.ts +46 -0
- package/dist/types/lightning/message/channel-funding.d.ts +57 -0
- package/dist/types/lightning/message/channel-open.d.ts +56 -0
- package/dist/types/lightning/message/channel-reestablish.d.ts +42 -1
- package/dist/types/lightning/message/channel-update.d.ts +79 -0
- package/dist/types/lightning/message/codec.d.ts +55 -0
- package/dist/types/lightning/message/custom.d.ts +60 -0
- package/dist/types/lightning/message/dual-funding.d.ts +74 -1
- package/dist/types/lightning/message/error.d.ts +65 -0
- package/dist/types/lightning/message/init.d.ts +28 -0
- package/dist/types/lightning/message/interactive-tx.d.ts +99 -0
- package/dist/types/lightning/message/peer-storage.d.ts +14 -0
- package/dist/types/lightning/message/ping.d.ts +31 -0
- package/dist/types/lightning/message/splice-conflict.d.ts +34 -0
- package/dist/types/lightning/message/splice.d.ts +91 -0
- package/dist/types/lightning/message/stfu.d.ts +9 -0
- package/dist/types/lightning/message/tlv.d.ts +46 -0
- package/dist/types/lightning/message/types.d.ts +16 -0
- package/dist/types/lightning/node/config.d.ts +115 -0
- package/dist/types/lightning/node/events.d.ts +333 -0
- package/dist/types/lightning/node/funding-selection.d.ts +68 -0
- package/dist/types/lightning/node/index.d.ts +3 -0
- package/dist/types/lightning/node/lightning-node.d.ts +4296 -95
- package/dist/types/lightning/node/payment-types.d.ts +78 -0
- package/dist/types/lightning/node/rate-limiter.d.ts +21 -0
- package/dist/types/lightning/node/types.d.ts +1191 -70
- package/dist/types/lightning/offer/bech32-nochecksum.d.ts +22 -0
- package/dist/types/lightning/offer/decode.d.ts +20 -1
- package/dist/types/lightning/offer/encode.d.ts +29 -2
- package/dist/types/lightning/offer/merkle.d.ts +35 -2
- package/dist/types/lightning/offer/offer-manager.d.ts +224 -4
- package/dist/types/lightning/offer/schnorr.d.ts +29 -0
- package/dist/types/lightning/offer/tlv.d.ts +86 -4
- package/dist/types/lightning/offer/types.d.ts +67 -1
- package/dist/types/lightning/onion/blinded-path.d.ts +121 -0
- package/dist/types/lightning/onion/blinding.d.ts +54 -0
- package/dist/types/lightning/onion/construct.d.ts +37 -1
- package/dist/types/lightning/onion/failures.d.ts +51 -1
- package/dist/types/lightning/onion/hop-payload.d.ts +33 -1
- package/dist/types/lightning/onion/process.d.ts +28 -1
- package/dist/types/lightning/onion/sphinx-crypto.d.ts +34 -1
- package/dist/types/lightning/onion/types.d.ts +44 -0
- package/dist/types/lightning/onion-message/codec.d.ts +49 -3
- package/dist/types/lightning/onion-message/construct.d.ts +46 -2
- package/dist/types/lightning/onion-message/manager.d.ts +94 -3
- package/dist/types/lightning/onion-message/process.d.ts +21 -1
- package/dist/types/lightning/onion-message/types.d.ts +61 -1
- package/dist/types/lightning/recovery/assembly.d.ts +166 -11
- package/dist/types/lightning/recovery/capsule.d.ts +243 -3
- package/dist/types/lightning/recovery/channel-status.d.ts +57 -0
- package/dist/types/lightning/recovery/durability-barrier.d.ts +210 -4
- package/dist/types/lightning/recovery/frame-codec.d.ts +35 -1
- package/dist/types/lightning/recovery/guardian-bolt8.d.ts +156 -6
- package/dist/types/lightning/recovery/guardian-client.d.ts +148 -3
- package/dist/types/lightning/recovery/guardian-host.d.ts +86 -3
- package/dist/types/lightning/recovery/guardian-http.d.ts +56 -2
- package/dist/types/lightning/recovery/guardian-proto.d.ts +21 -2
- package/dist/types/lightning/recovery/guardian-replication.d.ts +321 -6
- package/dist/types/lightning/recovery/guardian-rotation.d.ts +85 -8
- package/dist/types/lightning/recovery/guardian-store.d.ts +130 -0
- package/dist/types/lightning/recovery/guardian-wire.d.ts +102 -0
- package/dist/types/lightning/recovery/guardian.d.ts +335 -2
- package/dist/types/lightning/recovery/index.d.ts +23 -1
- package/dist/types/lightning/recovery/journal.d.ts +528 -2
- package/dist/types/lightning/recovery/recovery-manager.d.ts +67 -2
- package/dist/types/lightning/recovery/restore-driver.d.ts +233 -6
- package/dist/types/lightning/recovery/startup-gate.d.ts +96 -5
- package/dist/types/lightning/recovery/types.d.ts +256 -8
- package/dist/types/lightning/recovery/wire-safety.d.ts +93 -2
- package/dist/types/lightning/recovery/writer-lease.d.ts +124 -3
- package/dist/types/lightning/script/anchor.d.ts +45 -0
- package/dist/types/lightning/script/commitment-taproot.d.ts +110 -0
- package/dist/types/lightning/script/commitment.d.ts +96 -0
- package/dist/types/lightning/script/funding-taproot.d.ts +31 -0
- package/dist/types/lightning/script/funding.d.ts +26 -0
- package/dist/types/lightning/script/htlc-taproot.d.ts +47 -0
- package/dist/types/lightning/script/htlc.d.ts +82 -0
- package/dist/types/lightning/script/revocation.d.ts +66 -0
- package/dist/types/lightning/sqlite.d.ts +8 -0
- package/dist/types/lightning/storage/capabilities.d.ts +21 -0
- package/dist/types/lightning/storage/conformance.d.ts +38 -0
- package/dist/types/lightning/storage/durable-ledger.d.ts +112 -0
- package/dist/types/lightning/storage/encryption.d.ts +47 -6
- package/dist/types/lightning/storage/htlc-history.d.ts +4 -2
- package/dist/types/lightning/storage/index.d.ts +15 -1
- package/dist/types/lightning/storage/memory-storage.d.ts +291 -0
- package/dist/types/lightning/storage/serialization.d.ts +143 -8
- package/dist/types/lightning/storage/sqlite-binding.d.ts +10 -0
- package/dist/types/lightning/storage/sqlite-storage.d.ts +176 -7
- package/dist/types/lightning/storage/transaction.d.ts +27 -1
- package/dist/types/lightning/storage/types.d.ts +468 -82
- package/dist/types/lightning/swaps/chain-resolver.d.ts +50 -2
- package/dist/types/lightning/swaps/client.d.ts +56 -2
- package/dist/types/lightning/swaps/engine-common.d.ts +31 -3
- package/dist/types/lightning/swaps/exposure.d.ts +31 -1
- package/dist/types/lightning/swaps/htlc.d.ts +7 -0
- package/dist/types/lightning/swaps/keys.d.ts +17 -0
- package/dist/types/lightning/swaps/ledger.d.ts +155 -1
- package/dist/types/lightning/swaps/messages.d.ts +70 -2
- package/dist/types/lightning/swaps/policy.d.ts +22 -0
- package/dist/types/lightning/swaps/reverse-engine.d.ts +159 -5
- package/dist/types/lightning/swaps/submarine-engine.d.ts +150 -6
- package/dist/types/lightning/swaps/transactions.d.ts +20 -1
- package/dist/types/lightning/swaps/validation.d.ts +1 -0
- package/dist/types/lightning/transport/cipher.d.ts +40 -0
- package/dist/types/lightning/transport/duplex-transport.d.ts +56 -2
- package/dist/types/lightning/transport/iroh-node.d.ts +2 -1
- package/dist/types/lightning/transport/iroh.d.ts +12 -1
- package/dist/types/lightning/transport/noise.d.ts +70 -0
- package/dist/types/lightning/transport/peer-manager.d.ts +419 -6
- package/dist/types/lightning/transport/peer-uri.d.ts +15 -1
- package/dist/types/lightning/transport/peer.d.ts +140 -2
- package/dist/types/lightning/transport/websocket-frame.d.ts +31 -0
- package/dist/types/lightning/transport/websocket-node-client.d.ts +24 -1
- package/dist/types/lightning/transport/websocket-server.d.ts +67 -3
- package/dist/types/lightning/transport/websocket.d.ts +56 -1
- package/dist/types/lightning/transport/wire-capture.d.ts +18 -0
- package/dist/types/lightning/validation/index.d.ts +45 -0
- package/dist/types/lightning/wallet/wallet-funding-provider.d.ts +259 -2
- package/dist/types/lightning/watchtower/blob.d.ts +67 -0
- package/dist/types/lightning/watchtower/index.d.ts +6 -0
- package/dist/types/lightning/watchtower/justice.d.ts +52 -0
- package/dist/types/lightning/watchtower/tower-connection.d.ts +18 -2
- package/dist/types/lightning/watchtower/types.d.ts +41 -1
- package/dist/types/lightning/watchtower/watchtower-client.d.ts +48 -4
- package/dist/types/lightning/watchtower/wtwire.d.ts +37 -0
- package/dist/types/logger.d.ts +29 -0
- package/dist/types/network.d.ts +24 -0
- package/dist/types/node.d.ts +14 -0
- package/dist/types/shapes/electrum.d.ts +12 -1
- package/dist/types/shapes/wallet.d.ts +3 -2
- package/dist/types/transaction/index.d.ts +244 -14
- package/dist/types/transaction/pricing.d.ts +83 -0
- package/dist/types/types/electrum.d.ts +13 -5
- package/dist/types/types/transaction.d.ts +8 -5
- package/dist/types/types/wallet.d.ts +287 -26
- package/dist/types/utils/boost.d.ts +9 -3
- package/dist/types/utils/common.d.ts +33 -0
- package/dist/types/utils/conversion.d.ts +38 -2
- package/dist/types/utils/derivation-path.d.ts +29 -4
- package/dist/types/utils/derive-path-cached.d.ts +13 -1
- package/dist/types/utils/descriptors.d.ts +19 -0
- package/dist/types/utils/ecc-apis.d.ts +9 -1
- package/dist/types/utils/ecc.d.ts +15 -0
- package/dist/types/utils/electrum.d.ts +48 -6
- package/dist/types/utils/errors.d.ts +28 -0
- package/dist/types/utils/fees.d.ts +22 -0
- package/dist/types/utils/helpers.d.ts +97 -15
- package/dist/types/utils/identifiers.d.ts +33 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/multisig.d.ts +37 -5
- package/dist/types/utils/node-builtins.d.ts +9 -0
- package/dist/types/utils/node-version.d.ts +22 -0
- package/dist/types/utils/result.d.ts +52 -3
- package/dist/types/utils/tls-verification.d.ts +29 -1
- package/dist/types/utils/transaction.d.ts +65 -6
- package/dist/types/utils/typed-emitter.d.ts +33 -0
- package/dist/types/utils/wallet-memory-storage.d.ts +14 -0
- package/dist/types/utils/wallet-storage-encryption.d.ts +23 -2
- package/dist/types/utils/wallet.d.ts +89 -14
- package/dist/types/utils/watch-only.d.ts +26 -6
- package/dist/types/wallet/coin-control.d.ts +54 -0
- package/dist/types/wallet/constants.d.ts +37 -1
- package/dist/types/wallet/index.d.ts +1454 -51
- package/dist/types/wallet/live-data.d.ts +11 -0
- package/dist/types/wallet.js +21 -9
- package/dist/types/wallet.js.map +1 -1
- package/dist/utils/boost.js +10 -4
- package/dist/utils/boost.js.map +1 -1
- package/dist/utils/common.js +101 -0
- package/dist/utils/common.js.map +1 -0
- package/dist/utils/conversion.js +43 -1
- package/dist/utils/conversion.js.map +1 -1
- package/dist/utils/derivation-path.js +36 -5
- package/dist/utils/derivation-path.js.map +1 -1
- package/dist/utils/derive-path-cached.js +15 -0
- package/dist/utils/derive-path-cached.js.map +1 -1
- package/dist/utils/descriptors.js +20 -0
- package/dist/utils/descriptors.js.map +1 -1
- package/dist/utils/ecc-apis.js +13 -0
- package/dist/utils/ecc-apis.js.map +1 -1
- package/dist/utils/ecc.js +15 -0
- package/dist/utils/ecc.js.map +1 -1
- package/dist/utils/electrum.js +59 -19
- package/dist/utils/electrum.js.map +1 -1
- package/dist/utils/errors.js +35 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/fees.js +23 -0
- package/dist/utils/fees.js.map +1 -1
- package/dist/utils/helpers.js +103 -26
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/identifiers.js +37 -0
- package/dist/utils/identifiers.js.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/multisig.js +35 -3
- package/dist/utils/multisig.js.map +1 -1
- package/dist/utils/node-builtins.js +41 -0
- package/dist/utils/node-builtins.js.map +1 -0
- package/dist/utils/node-version.js +22 -0
- package/dist/utils/node-version.js.map +1 -1
- package/dist/utils/result.js +48 -4
- package/dist/utils/result.js.map +1 -1
- package/dist/utils/tls-verification.js +31 -0
- package/dist/utils/tls-verification.js.map +1 -1
- package/dist/utils/transaction.js +163 -7
- package/dist/utils/transaction.js.map +1 -1
- package/dist/utils/typed-emitter.js +55 -0
- package/dist/utils/typed-emitter.js.map +1 -0
- package/dist/utils/wallet-memory-storage.js +38 -0
- package/dist/utils/wallet-memory-storage.js.map +1 -0
- package/dist/utils/wallet-storage-encryption.js +37 -4
- package/dist/utils/wallet-storage-encryption.js.map +1 -1
- package/dist/utils/wallet.js +107 -64
- package/dist/utils/wallet.js.map +1 -1
- package/dist/utils/watch-only.js +31 -4
- package/dist/utils/watch-only.js.map +1 -1
- package/dist/wallet/coin-control.js +202 -0
- package/dist/wallet/coin-control.js.map +1 -0
- package/dist/wallet/constants.js +40 -3
- package/dist/wallet/constants.js.map +1 -1
- package/dist/wallet/index.js +2722 -406
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/live-data.js +22 -0
- package/dist/wallet/live-data.js.map +1 -0
- package/docs/AI_AGENT_GUIDE.md +12 -8
- package/docs/API-CONVENTIONS.md +91 -0
- package/docs/FFOR-RESERVED-RETIREMENT.md +1 -1
- package/docs/README.md +56 -0
- package/docs/RECOVERY-PROTOCOL.md +1 -1
- package/docs/RECOVERY-TRANSITION-MATRIX.md +11 -10
- package/docs/ROADMAP.md +3 -0
- package/docs/specs/CONCURRENT-RECEIVE.md +524 -0
- package/docs/specs/SOURCE.md +15 -0
- package/docs/specs/ffor-offline-receive.md +3321 -0
- package/package.json +61 -12
- package/docs/html/.nojekyll +0 -1
- package/docs/html/assets/highlight.css +0 -22
- package/docs/html/assets/main.js +0 -58
- package/docs/html/assets/search.js +0 -1
- package/docs/html/assets/style.css +0 -1367
- package/docs/html/classes/Electrum.html +0 -918
- package/docs/html/classes/Transaction.html +0 -819
- package/docs/html/classes/Wallet.html +0 -2475
- package/docs/html/enums/EAddressType.html +0 -268
- package/docs/html/enums/EAvailableNetworks.html +0 -289
- package/docs/html/enums/EBoostType.html +0 -254
- package/docs/html/enums/ECoinSelectPreference.html +0 -275
- package/docs/html/enums/EElectrumNetworks.html +0 -261
- package/docs/html/enums/EFeeId.html +0 -275
- package/docs/html/enums/EPaymentType.html +0 -254
- package/docs/html/enums/EProtocol.html +0 -254
- package/docs/html/enums/EScanningStrategy.html +0 -268
- package/docs/html/enums/EUnit.html +0 -261
- package/docs/html/functions/availableNetworks.html +0 -234
- package/docs/html/functions/constructByteCountParam.html +0 -244
- package/docs/html/functions/decodeOpReturnMessage.html +0 -236
- package/docs/html/functions/decodeRawTransaction.html +0 -244
- package/docs/html/functions/err.html +0 -248
- package/docs/html/functions/filterAddressesForGapLimit.html +0 -245
- package/docs/html/functions/filterAddressesObjForAddressesList.html +0 -241
- package/docs/html/functions/filterAddressesObjForGapLimit.html +0 -245
- package/docs/html/functions/filterAddressesObjForSingleIndex.html +0 -241
- package/docs/html/functions/filterAddressesObjForStartingIndex.html +0 -241
- package/docs/html/functions/formatKeyDerivationPath.html +0 -253
- package/docs/html/functions/formatPeerData.html +0 -241
- package/docs/html/functions/generateMnemonic.html +0 -257
- package/docs/html/functions/generateWalletId.html +0 -236
- package/docs/html/functions/getAddressFromKeyPair.html +0 -246
- package/docs/html/functions/getAddressFromScriptPubKey.html +0 -243
- package/docs/html/functions/getAddressIndexDiff.html +0 -244
- package/docs/html/functions/getAddressTypeFromPath.html +0 -240
- package/docs/html/functions/getAddressesFromPrivateKey.html +0 -246
- package/docs/html/functions/getByteCount.html +0 -242
- package/docs/html/functions/getDataFallback.html +0 -241
- package/docs/html/functions/getDefaultPort.html +0 -243
- package/docs/html/functions/getDefaultWalletData.html +0 -234
- package/docs/html/functions/getDefaultWalletDataKeys.html +0 -234
- package/docs/html/functions/getElectrumNetwork.html +0 -240
- package/docs/html/functions/getHighestUsedIndexFromTxHashes.html +0 -250
- package/docs/html/functions/getKeyDerivationPath.html +0 -245
- package/docs/html/functions/getKeyDerivationPathObject.html +0 -250
- package/docs/html/functions/getKeyDerivationPathString.html +0 -254
- package/docs/html/functions/getKeyValue.html +0 -240
- package/docs/html/functions/getPeers.html +0 -245
- package/docs/html/functions/getProtocolForPort.html +0 -243
- package/docs/html/functions/getScriptHash.html +0 -244
- package/docs/html/functions/getSeed.html +0 -243
- package/docs/html/functions/getSeedHash.html +0 -240
- package/docs/html/functions/getSha256.html +0 -240
- package/docs/html/functions/getStorageKeyValues.html +0 -243
- package/docs/html/functions/getTapRootAddressFromPublicKey.html +0 -244
- package/docs/html/functions/getTxFee.html +0 -244
- package/docs/html/functions/getWalletDataStorageKey.html +0 -240
- package/docs/html/functions/isP2trPrefix.html +0 -241
- package/docs/html/functions/isPositive.html +0 -236
- package/docs/html/functions/isValidBech32mEncodedString.html +0 -245
- package/docs/html/functions/objectKeys-1.html +0 -245
- package/docs/html/functions/objectsMatch.html +0 -244
- package/docs/html/functions/ok.html +0 -248
- package/docs/html/functions/parseOnChainPaymentRequest.html +0 -238
- package/docs/html/functions/reduceValue.html +0 -249
- package/docs/html/functions/removeDustOutputs.html +0 -240
- package/docs/html/functions/removeDustUtxos.html +0 -240
- package/docs/html/functions/setReplaceByFee.html +0 -244
- package/docs/html/functions/shuffleArray.html +0 -245
- package/docs/html/functions/sleep.html +0 -236
- package/docs/html/functions/splitAddresses.html +0 -243
- package/docs/html/functions/validateAddress.html +0 -250
- package/docs/html/functions/validateMnemonic.html +0 -240
- package/docs/html/functions/validateTransaction.html +0 -240
- package/docs/html/index.html +0 -428
- package/docs/html/interfaces/IAddInput.html +0 -265
- package/docs/html/interfaces/IAddress.html +0 -281
- package/docs/html/interfaces/IAddressData.html +0 -265
- package/docs/html/interfaces/IAddressType.html +0 -233
- package/docs/html/interfaces/IAddressTypeData.html +0 -286
- package/docs/html/interfaces/IAddressTypesIO.html +0 -280
- package/docs/html/interfaces/IAddresses.html +0 -233
- package/docs/html/interfaces/IBoostedTransaction.html +0 -272
- package/docs/html/interfaces/IBoostedTransactions.html +0 -233
- package/docs/html/interfaces/IBtInfo.html +0 -372
- package/docs/html/interfaces/ICanBoostResponse.html +0 -265
- package/docs/html/interfaces/ICoinSelectResponse.html +0 -265
- package/docs/html/interfaces/ICreateTransaction.html +0 -265
- package/docs/html/interfaces/ICustomGetAddress.html +0 -265
- package/docs/html/interfaces/ICustomGetScriptHash.html +0 -258
- package/docs/html/interfaces/IElectrumGetAddressBalanceRes.html +0 -269
- package/docs/html/interfaces/IFormattedPeerData.html +0 -279
- package/docs/html/interfaces/IFormattedTransaction.html +0 -384
- package/docs/html/interfaces/IFormattedTransactions.html +0 -233
- package/docs/html/interfaces/IGenerateAddresses.html +0 -293
- package/docs/html/interfaces/IGenerateAddressesResponse.html +0 -258
- package/docs/html/interfaces/IGetAddress.html +0 -265
- package/docs/html/interfaces/IGetAddressBalanceRes.html +0 -260
- package/docs/html/interfaces/IGetAddressByPath.html +0 -258
- package/docs/html/interfaces/IGetAddressHistoryResponse.html +0 -303
- package/docs/html/interfaces/IGetAddressResponse.html +0 -265
- package/docs/html/interfaces/IGetAddressScriptHashBalances.html +0 -279
- package/docs/html/interfaces/IGetAddressScriptHashesHistoryResponse.html +0 -279
- package/docs/html/interfaces/IGetAddressTxResponse.html +0 -279
- package/docs/html/interfaces/IGetAddressesFromKeyPair.html +0 -258
- package/docs/html/interfaces/IGetAddressesFromPrivateKey.html +0 -258
- package/docs/html/interfaces/IGetDerivationPath.html +0 -293
- package/docs/html/interfaces/IGetFeeEstimatesResponse.html +0 -272
- package/docs/html/interfaces/IGetHeaderResponse.html +0 -279
- package/docs/html/interfaces/IGetNextAvailableAddressResponse.html +0 -272
- package/docs/html/interfaces/IGetTransactions.html +0 -279
- package/docs/html/interfaces/IGetTransactionsFromInputs.html +0 -279
- package/docs/html/interfaces/IGetUtxosResponse.html +0 -258
- package/docs/html/interfaces/IHeader.html +0 -265
- package/docs/html/interfaces/IIndexes.html +0 -272
- package/docs/html/interfaces/IKeyDerivationPath.html +0 -281
- package/docs/html/interfaces/IKeyDerivationPathData.html +0 -258
- package/docs/html/interfaces/INewBlock.html +0 -258
- package/docs/html/interfaces/IOnchainFees.html +0 -279
- package/docs/html/interfaces/IOutput.html +0 -265
- package/docs/html/interfaces/IPeerData.html +0 -265
- package/docs/html/interfaces/IPrivateKeyInfo.html +0 -272
- package/docs/html/interfaces/IRbfData.html +0 -293
- package/docs/html/interfaces/ISend.html +0 -258
- package/docs/html/interfaces/ISendTransaction.html +0 -356
- package/docs/html/interfaces/ISendTx.html +0 -265
- package/docs/html/interfaces/ISetupTransaction.html +0 -279
- package/docs/html/interfaces/ISubscribeToAddress.html +0 -281
- package/docs/html/interfaces/ISubscribeToHeader.html +0 -279
- package/docs/html/interfaces/ISweepPrivateKey.html +0 -279
- package/docs/html/interfaces/ISweepPrivateKeyRes.html +0 -265
- package/docs/html/interfaces/ITargets.html +0 -272
- package/docs/html/interfaces/ITransaction.html +0 -298
- package/docs/html/interfaces/ITxHash.html +0 -251
- package/docs/html/interfaces/ITxHashes.html +0 -269
- package/docs/html/interfaces/IUtxo.html +0 -314
- package/docs/html/interfaces/IVin.html +0 -286
- package/docs/html/interfaces/IVout.html +0 -280
- package/docs/html/interfaces/IWallet.html +0 -437
- package/docs/html/interfaces/IWalletData.html +0 -370
- package/docs/html/types/ElectrumConnectionPubSub.html +0 -267
- package/docs/html/types/ElectrumConnectionSubscription.html +0 -238
- package/docs/html/types/InputData.html +0 -237
- package/docs/html/types/Net.html +0 -227
- package/docs/html/types/ObjectKeys.html +0 -232
- package/docs/html/types/Result.html +0 -235
- package/docs/html/types/TAddressIndexInfo.html +0 -238
- package/docs/html/types/TAddressLabel.html +0 -227
- package/docs/html/types/TAddressTxResponse.html +0 -247
- package/docs/html/types/TAddressType.html +0 -227
- package/docs/html/types/TAddressTypeContent.html +0 -232
- package/docs/html/types/TAddressTypes.html +0 -227
- package/docs/html/types/TAvailableNetworks.html +0 -227
- package/docs/html/types/TConnectToElectrumRes.html +0 -227
- package/docs/html/types/TDecodeRawTx.html +0 -248
- package/docs/html/types/TElectrumNetworks.html +0 -227
- package/docs/html/types/TGapLimitOptions.html +0 -238
- package/docs/html/types/TGetAddressHistory.html +0 -234
- package/docs/html/types/TGetByteCountInput.html +0 -227
- package/docs/html/types/TGetByteCountInputs.html +0 -227
- package/docs/html/types/TGetByteCountOutput.html +0 -227
- package/docs/html/types/TGetByteCountOutputs.html +0 -227
- package/docs/html/types/TGetData.html +0 -245
- package/docs/html/types/TGetTotalFeeObj.html +0 -238
- package/docs/html/types/TKeyDerivationAccount.html +0 -227
- package/docs/html/types/TKeyDerivationChange.html +0 -227
- package/docs/html/types/TKeyDerivationCoinType.html +0 -227
- package/docs/html/types/TKeyDerivationIndex.html +0 -227
- package/docs/html/types/TKeyDerivationPurpose.html +0 -227
- package/docs/html/types/TMessageDataMap.html +0 -244
- package/docs/html/types/TMessageKeys.html +0 -227
- package/docs/html/types/TOnMessage.html +0 -247
- package/docs/html/types/TProcessUnconfirmedTransactions.html +0 -236
- package/docs/html/types/TProtocol.html +0 -227
- package/docs/html/types/TServer.html +0 -238
- package/docs/html/types/TSetData.html +0 -247
- package/docs/html/types/TSetupTransactionResponse.html +0 -227
- package/docs/html/types/TStorage.html +0 -234
- package/docs/html/types/TSubscribedReceive.html +0 -227
- package/docs/html/types/TTransactionMessage.html +0 -232
- package/docs/html/types/TTxDetails.html +0 -258
- package/docs/html/types/TTxResponse.html +0 -240
- package/docs/html/types/TTxResult.html +0 -234
- package/docs/html/types/TUnspentAddressScriptHash.html +0 -238
- package/docs/html/types/TUnspentAddressScriptHashData.html +0 -232
- package/docs/html/types/TUnspentAddressScriptHashResponse.html +0 -240
- package/docs/html/types/TUnspentAddressScriptHashResult.html +0 -240
- package/docs/html/types/TWalletDataKeys.html +0 -227
- package/docs/html/types/Tls.html +0 -227
- package/docs/html/variables/defaultElectrumPorts.html +0 -227
- package/docs/html/variables/electrumConnection.html +0 -233
- package/docs/markdown/.nojekyll +0 -1
- package/docs/markdown/README.md +0 -2352
- package/docs/markdown/classes/Electrum.md +0 -798
- package/docs/markdown/classes/Transaction.md +0 -638
- package/docs/markdown/classes/Wallet.md +0 -2684
- package/docs/markdown/enums/EAddressType.md +0 -52
- package/docs/markdown/enums/EAvailableNetworks.md +0 -85
- package/docs/markdown/enums/EBoostType.md +0 -30
- package/docs/markdown/enums/ECoinSelectPreference.md +0 -63
- package/docs/markdown/enums/EElectrumNetworks.md +0 -41
- package/docs/markdown/enums/EFeeId.md +0 -63
- package/docs/markdown/enums/EPaymentType.md +0 -30
- package/docs/markdown/enums/EProtocol.md +0 -30
- package/docs/markdown/enums/EScanningStrategy.md +0 -52
- package/docs/markdown/enums/EUnit.md +0 -41
- package/docs/markdown/interfaces/IAddInput.md +0 -41
- package/docs/markdown/interfaces/IAddress.md +0 -69
- package/docs/markdown/interfaces/IAddressData.md +0 -41
- package/docs/markdown/interfaces/IAddressType.md +0 -7
- package/docs/markdown/interfaces/IAddressTypeData.md +0 -74
- package/docs/markdown/interfaces/IAddressTypesIO.md +0 -48
- package/docs/markdown/interfaces/IAddresses.md +0 -7
- package/docs/markdown/interfaces/IBoostedTransaction.md +0 -52
- package/docs/markdown/interfaces/IBoostedTransactions.md +0 -7
- package/docs/markdown/interfaces/IBtInfo.md +0 -102
- package/docs/markdown/interfaces/ICanBoostResponse.md +0 -41
- package/docs/markdown/interfaces/ICoinSelectResponse.md +0 -41
- package/docs/markdown/interfaces/ICreateTransaction.md +0 -41
- package/docs/markdown/interfaces/ICustomGetAddress.md +0 -41
- package/docs/markdown/interfaces/ICustomGetScriptHash.md +0 -30
- package/docs/markdown/interfaces/IElectrumGetAddressBalanceRes.md +0 -55
- package/docs/markdown/interfaces/IFormattedPeerData.md +0 -63
- package/docs/markdown/interfaces/IFormattedTransaction.md +0 -228
- package/docs/markdown/interfaces/IFormattedTransactions.md +0 -7
- package/docs/markdown/interfaces/IGenerateAddresses.md +0 -85
- package/docs/markdown/interfaces/IGenerateAddressesResponse.md +0 -30
- package/docs/markdown/interfaces/IGetAddress.md +0 -41
- package/docs/markdown/interfaces/IGetAddressBalanceRes.md +0 -36
- package/docs/markdown/interfaces/IGetAddressByPath.md +0 -30
- package/docs/markdown/interfaces/IGetAddressHistoryResponse.md +0 -121
- package/docs/markdown/interfaces/IGetAddressResponse.md +0 -41
- package/docs/markdown/interfaces/IGetAddressScriptHashBalances.md +0 -63
- package/docs/markdown/interfaces/IGetAddressScriptHashesHistoryResponse.md +0 -63
- package/docs/markdown/interfaces/IGetAddressTxResponse.md +0 -63
- package/docs/markdown/interfaces/IGetAddressesFromKeyPair.md +0 -30
- package/docs/markdown/interfaces/IGetAddressesFromPrivateKey.md +0 -30
- package/docs/markdown/interfaces/IGetDerivationPath.md +0 -100
- package/docs/markdown/interfaces/IGetFeeEstimatesResponse.md +0 -52
- package/docs/markdown/interfaces/IGetHeaderResponse.md +0 -63
- package/docs/markdown/interfaces/IGetNextAvailableAddressResponse.md +0 -52
- package/docs/markdown/interfaces/IGetTransactions.md +0 -63
- package/docs/markdown/interfaces/IGetTransactionsFromInputs.md +0 -63
- package/docs/markdown/interfaces/IGetUtxosResponse.md +0 -30
- package/docs/markdown/interfaces/IHeader.md +0 -41
- package/docs/markdown/interfaces/IIndexes.md +0 -52
- package/docs/markdown/interfaces/IKeyDerivationPath.md +0 -69
- package/docs/markdown/interfaces/IKeyDerivationPathData.md +0 -30
- package/docs/markdown/interfaces/INewBlock.md +0 -30
- package/docs/markdown/interfaces/IOnchainFees.md +0 -63
- package/docs/markdown/interfaces/IOutput.md +0 -41
- package/docs/markdown/interfaces/IPeerData.md +0 -41
- package/docs/markdown/interfaces/IPrivateKeyInfo.md +0 -52
- package/docs/markdown/interfaces/IRbfData.md +0 -85
- package/docs/markdown/interfaces/ISend.md +0 -30
- package/docs/markdown/interfaces/ISendTransaction.md +0 -184
- package/docs/markdown/interfaces/ISendTx.md +0 -41
- package/docs/markdown/interfaces/ISetupTransaction.md +0 -63
- package/docs/markdown/interfaces/ISubscribeToAddress.md +0 -60
- package/docs/markdown/interfaces/ISubscribeToHeader.md +0 -59
- package/docs/markdown/interfaces/ISweepPrivateKey.md +0 -63
- package/docs/markdown/interfaces/ISweepPrivateKeyRes.md +0 -41
- package/docs/markdown/interfaces/ITargets.md +0 -52
- package/docs/markdown/interfaces/ITransaction.md +0 -87
- package/docs/markdown/interfaces/ITxHash.md +0 -19
- package/docs/markdown/interfaces/ITxHashes.md +0 -55
- package/docs/markdown/interfaces/IUtxo.md +0 -118
- package/docs/markdown/interfaces/IVin.md +0 -70
- package/docs/markdown/interfaces/IVout.md +0 -52
- package/docs/markdown/interfaces/IWallet.md +0 -288
- package/docs/markdown/interfaces/IWalletData.md +0 -206
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ Tor, full-graph gossip, the low-level `LightningNode` variant and the non-intera
|
|
|
99
99
|
|
|
100
100
|
Node state lives in a SQLite DB under `~/.beignet/data/<hash-of-mnemonic>/` (the `--low-level` example uses `example/lightningData/node.db`).
|
|
101
101
|
|
|
102
|
-
Both examples run straight off the TypeScript sources
|
|
102
|
+
Both examples run through `ts-node`. The on-chain example runs straight off the TypeScript sources. The Lightning example imports only the public entry points (`beignet`, `beignet/cli`, `beignet/lightning`, `beignet/lightning/sqlite`), so `npm run example:lightning` builds `dist/` first, and the file runs unchanged in a project that installed `beignet` from npm.
|
|
103
103
|
|
|
104
104
|
**→ [example/REPL_TESTING.md](example/REPL_TESTING.md) is a copy-pasteable walkthrough** of the whole lifecycle in the REPL: funding, peers, channels, invoices, payments, keysend, offers, splicing, closing, backup.
|
|
105
105
|
|
|
@@ -108,7 +108,9 @@ Both examples run straight off the TypeScript sources through `ts-node`, so no b
|
|
|
108
108
|
| Import | Contains | Use when |
|
|
109
109
|
|--------|----------|----------|
|
|
110
110
|
| `beignet` | `Wallet`, `generateMnemonic`, types | You want the on-chain wallet |
|
|
111
|
-
| `beignet/
|
|
111
|
+
| `beignet/node` | `BeignetNode`, error helpers | **You want Lightning.** Sats-denominated, string IDs, structured errors. Runs on React Native |
|
|
112
|
+
| `beignet/daemon` | `startDaemon`, API keys, webhooks | You serve the HTTP API from your own Node process |
|
|
113
|
+
| `beignet/cli` | Both of the above | Existing imports; it loads the daemon too |
|
|
112
114
|
| `beignet/lightning` | Namespaced protocol modules (`node`, `channel`, `onion`, ...) | You need the raw BOLT layer: bigint msat, Buffer IDs, wire messages |
|
|
113
115
|
|
|
114
116
|
## On-chain wallet
|
|
@@ -132,23 +134,70 @@ await wallet.send({ address: 'bc1q...', amount: 50_000, satsPerByte: 2 });
|
|
|
132
134
|
await wallet.sendMany({ txs: [{ address: 'bc1q...', amount: 1000 }] });
|
|
133
135
|
await wallet.refreshWallet();
|
|
134
136
|
|
|
135
|
-
const utxos = wallet.listUtxos();
|
|
136
|
-
const history = await wallet.
|
|
137
|
+
const utxos = wallet.listUtxos(); // what the last refresh stored
|
|
138
|
+
const history = await wallet.fetchAddressHistory('bc1q...'); // asks Electrum
|
|
139
|
+
|
|
140
|
+
// Build and sign without broadcasting, then broadcast separately
|
|
141
|
+
const signed = await wallet.createSignedTransaction({ address: 'bc1q...', amount: 50_000 });
|
|
142
|
+
if (signed.isOk()) await wallet.broadcastTransaction(signed.value.txHex);
|
|
137
143
|
```
|
|
138
144
|
|
|
139
|
-
|
|
145
|
+
A method's verb says where its answer comes from: `get*` and `list*` read what the wallet holds, `fetch*` asks Electrum, and `refresh*` asks Electrum and stores the answer. [docs/API-CONVENTIONS.md](docs/API-CONVENTIONS.md) lists the older names, which still work and go in the next major release.
|
|
146
|
+
|
|
147
|
+
Most fallible calls return a `Result<T>`: check `isErr()` before reading `.value`. The error is a `CodedError`: branch on `error.code`, never on the message, which can be reworded. The code is an `EWalletErrorCode` (`UNSPECIFIED` when the failure has no code of its own), or the code of an error passed through unchanged, such as `WATCH_ONLY_CANNOT_SIGN` or a `BoostError`'s. `error.cause` holds the failure it wraps, when there is one.
|
|
148
|
+
|
|
149
|
+
A few calls do not return a `Result`, so check them differently:
|
|
150
|
+
|
|
151
|
+
- `getAddress()` resolves to `''` when it cannot derive an address.
|
|
152
|
+
- `fetchFeeEstimates()` never errs. When its sources fail it returns the previous estimates or built-in defaults (fixed values on regtest).
|
|
153
|
+
- `updateAddressType()` throws on a type the wallet cannot use, and `resetAddressIndexes()` resolves to nothing.
|
|
154
|
+
|
|
155
|
+
Balances, UTXO values and send amounts are satoshis, and fee rates are sat/vB: every `satsPerByte` option and field is sat/vB despite its name. Stored transactions (`wallet.transactions`) carry their amounts in satoshis as `valueSats`, `feeSats`, `totalInputSats`, `matchedInputSats`, `totalOutputSats` and `matchedOutputSats`. Their older BTC twins (`value`, `fee`, `totalInputValue` and the rest) are deprecated and go in the next major release. `btcToSats`, `satsToMsat` and `msatToSatsFloor` convert between units.
|
|
156
|
+
|
|
157
|
+
Options worth knowing on `Wallet.create`: `network` (`Network.bitcoin` | `testnet` | `regtest` | `signet`), `addressType` (`EAddressType.p2wpkh` default, `p2sh` for P2SH-wrapped segwit, `p2pkh`, `p2tr`), `passphrase`, `account`, `storage`, `logger`, `onMessage`, `coinSelectPreference`, `feeEstimationSource`, `gapLimitOptions`, `remainOffline`.
|
|
140
158
|
|
|
141
|
-
|
|
159
|
+
`remainOffline: true` makes a wallet that never opens a connection: no Electrum server, and no fee lookup over HTTP. Calls that need a server fail, and a refresh stops after deriving the first addresses.
|
|
160
|
+
|
|
161
|
+
`wallet.data` is a frozen copy of the wallet's data, taken when it is read. Change data with `wallet.updateData({ utxos, balance })`, which replaces those fields and saves them in order with the wallet's own writes. Each read of `wallet.data` copies the whole history, so code reading one field often should use `wallet.balance`, `wallet.utxos` or `wallet.transactions`.
|
|
162
|
+
|
|
163
|
+
<details>
|
|
164
|
+
<summary><b>Fees, sweeping, boosting, coin control, events and shutdown</b></summary>
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import { EBoostType } from 'beignet';
|
|
168
|
+
|
|
169
|
+
const fees = await wallet.fetchFeeEstimates(); // { fast, normal, slow, minimum, timestamp }, sat/vB
|
|
170
|
+
await wallet.sendMax({ address: 'bc1q...', satsPerByte: fees.normal }); // sweeps every unfrozen coin
|
|
171
|
+
|
|
172
|
+
// Fee bumping an unconfirmed transaction
|
|
173
|
+
wallet.canBoost(txid); // { canBoost, rbf, cpfp }
|
|
174
|
+
wallet.getBoostableTransactions(); // { rbf: [...], cpfp: [...] }
|
|
175
|
+
await wallet.boost({ txid, type: EBoostType.rbf, satsPerByte: 20 }); // or EBoostType.cpfp
|
|
176
|
+
|
|
177
|
+
// Coin control: a frozen coin is left out of every coin selection
|
|
178
|
+
await wallet.freezeUtxo({ txid, vout: 0 });
|
|
179
|
+
await wallet.unfreezeUtxo({ txid, vout: 0 });
|
|
180
|
+
wallet.listUtxos(); // every coin, frozen ones included
|
|
181
|
+
wallet.listFrozenUtxos();
|
|
182
|
+
wallet.getBalanceBreakdown(); // { total, spendable, frozen }
|
|
183
|
+
|
|
184
|
+
// Waits (up to refreshTimeout) for an in-flight refresh and queued storage writes
|
|
185
|
+
await wallet.stop();
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
`onMessage(key, data)` on `Wallet.create` receives wallet events. The keys are `newBlock`, `transactionReceived`, `transactionSent`, `transactionConfirmed` (each with `{ transaction }`), `reorg` (the affected UTXOs), `rbf` (the replaced txids), `connectedToElectrum` (`true` or `false`) and `storageWriteFailed` (a write storage refused). `disableMessages: true` silences them, and `disableMessagesOnCreate: true` holds them until the first refresh ends, so stored history does not replay as news.
|
|
189
|
+
|
|
190
|
+
</details>
|
|
142
191
|
|
|
143
192
|
<details>
|
|
144
193
|
<summary><b>Custom Electrum servers, failover, fee sources, BIP21</b></summary>
|
|
145
194
|
|
|
146
195
|
```typescript
|
|
147
|
-
import {
|
|
196
|
+
import { EProtocol, Network, Wallet } from 'beignet';
|
|
148
197
|
|
|
149
198
|
const res = await Wallet.create({
|
|
150
199
|
mnemonic,
|
|
151
|
-
network:
|
|
200
|
+
network: Network.bitcoin,
|
|
152
201
|
feeEstimationSource: 'electrum', // 'electrum' | 'http' | 'auto' (default)
|
|
153
202
|
electrumOptions: {
|
|
154
203
|
net,
|
|
@@ -172,12 +221,12 @@ const res = await Wallet.create({
|
|
|
172
221
|
<details>
|
|
173
222
|
<summary><b>Watch-only wallets (account xpub)</b></summary>
|
|
174
223
|
|
|
175
|
-
Built from an account-level extended public key instead of a mnemonic. The key is assumed to sit at `m/purpose'/coin'/account'` (e.g. `m/84'/0'/0'`), so addresses derive as `xpub/0/i` and `xpub/1/i`. SLIP-132 version bytes are normalized: `zpub`/`vpub` implies p2wpkh, `ypub`/`upub` implies p2sh-p2wpkh, a plain `xpub`/`tpub` uses `addressType` (default p2wpkh). One account xpub yields exactly one address type, so a watch-only wallet monitors only that type.
|
|
224
|
+
Built from an account-level extended public key instead of a mnemonic. The key is assumed to sit at `m/purpose'/coin'/account'` (e.g. `m/84'/0'/0'`), so addresses derive as `xpub/0/i` and `xpub/1/i`. SLIP-132 version bytes are normalized: `zpub`/`vpub` implies p2wpkh, `ypub`/`upub` implies p2sh-p2wpkh (`EAddressType.p2sh`), a plain `xpub`/`tpub` uses `addressType` (default p2wpkh). One account xpub yields exactly one address type, so a watch-only wallet monitors only that type.
|
|
176
225
|
|
|
177
226
|
```typescript
|
|
178
227
|
const res = await Wallet.createWatchOnly({
|
|
179
228
|
xpub: 'zpub6r...',
|
|
180
|
-
network:
|
|
229
|
+
network: Network.bitcoin,
|
|
181
230
|
electrumOptions: { net, tls }
|
|
182
231
|
});
|
|
183
232
|
if (res.isErr()) return;
|
|
@@ -244,7 +293,7 @@ const a = await Wallet.createMultisig({
|
|
|
244
293
|
threshold: 2,
|
|
245
294
|
mnemonic: mnemonicA, // we are one cosigner; our xpub is added automatically
|
|
246
295
|
cosigners: [xpubB, xpubC],
|
|
247
|
-
network:
|
|
296
|
+
network: Network.bitcoin,
|
|
248
297
|
electrumOptions: { net, tls }
|
|
249
298
|
});
|
|
250
299
|
const b = await Wallet.createMultisig({ threshold: 2, mnemonic: mnemonicB, cosigners: [xpubA, xpubC], /* ... */ });
|
|
@@ -280,7 +329,9 @@ await coordinator.broadcastTransaction(finalized.value.txHex);
|
|
|
280
329
|
// 'Input 0 is below the multisig threshold: have 1 signature(s), need 2.'
|
|
281
330
|
|
|
282
331
|
// Interop: import into Bitcoin Core / Sparrow / Specter.
|
|
283
|
-
coordinator.exportDescriptors();
|
|
332
|
+
const exported = coordinator.exportDescriptors(); // Result<IExportDescriptorsResponse>
|
|
333
|
+
if (exported.isErr()) return;
|
|
334
|
+
exported.value.descriptors[0].external;
|
|
284
335
|
// wsh(sortedmulti(2,[fp/48h/0h/0h/2h]xpub.../0/*,[fp]xpub.../0/*,...))#checksum
|
|
285
336
|
```
|
|
286
337
|
|
|
@@ -289,13 +340,19 @@ coordinator.exportDescriptors();
|
|
|
289
340
|
</details>
|
|
290
341
|
|
|
291
342
|
<details>
|
|
292
|
-
<summary><b>
|
|
343
|
+
<summary><b>Storage, encryption and leveled logging</b></summary>
|
|
344
|
+
|
|
345
|
+
The wallet persists through the `storage` option, an `IWalletStorage`: `getData(key)`, `setData(key, value)` and the optional `setTransactionChanges` below. It holds one value per `IWalletData` field, under `<name>-<network>-<field>` (`<name>-<network>-acct<n>-<field>` for a non-zero account), and each value is plain JSON data. `createMemoryStorage()` implements all of it in memory: use it for tests and short-lived wallets, and start from it when writing a persistent store. Without `storage` the wallet keeps its data in memory and saves nothing.
|
|
293
346
|
|
|
294
|
-
|
|
347
|
+
Values are handed over as-is, so by default they are stored in plaintext. Persisted data is addresses, indexes, UTXOs, transactions, balance and fee estimates: no private keys and no mnemonic are ever written, so exposure is a privacy concern (full wallet history), not fund loss. The staged send (`transaction`) is written without signing keys, so a key pair handed to `sweepPrivateKey` or `addExternalInputs` never reaches storage, and `send`, `sendMany`, `sendMax`, `buildPsbt` and `sweepPrivateKey` reset the staged send when they return, so a restart never replays an earlier call's recipients.
|
|
295
348
|
|
|
296
349
|
`getData` must return `ok(undefined)` for a key it does not hold and `err` only when the read fails. `Wallet.create` returns an error on a failed read rather than start from defaults and save them over the data it could not read; pass `resetOnReadFailure: true` to start from defaults anyway.
|
|
297
350
|
|
|
298
|
-
|
|
351
|
+
`setData` must keep a copy of the value: the wallet goes on changing the object it handed over. Writes to one key arrive one at a time, in the order the wallet made them. A write that resolves `err`, or rejects, reaches `onMessage` as `storageWriteFailed`.
|
|
352
|
+
|
|
353
|
+
By default every change to the transaction history hands `setData` the whole history. A storage that also implements `setTransactionChanges(key, { set, deleted })` gets only the records that changed: new transactions, confirmations, reorgs, deletions and boosts. Its `getData` must then return the history with those changes applied. Replacing or clearing the history, and the one-time upgrade of old records on load, still go through `setData`. `createEncryptedStorage` does not pass `setTransactionChanges` through, so an encrypted storage keeps receiving the whole history.
|
|
354
|
+
|
|
355
|
+
Wrap any `IWalletStorage` with `createEncryptedStorage` to encrypt at rest with AES-256-GCM under an HKDF-derived key from the seed. Pre-existing plaintext values pass through unchanged and migrate lazily as they are rewritten.
|
|
299
356
|
|
|
300
357
|
```typescript
|
|
301
358
|
import * as bip39 from 'bip39';
|
|
@@ -326,10 +383,10 @@ Diagnostics flow through a small injectable `ILogger` (`debug`/`info`/`warn`/`er
|
|
|
326
383
|
> putting meaningful mainnet funds behind it: this is a self-custodial Lightning
|
|
327
384
|
> implementation, and channel funds are only as safe as the node watching them.
|
|
328
385
|
|
|
329
|
-
`BeignetNode` from `beignet/
|
|
386
|
+
`BeignetNode` from `beignet/node` is the recommended API: it wraps the protocol layer with satoshi amounts, string channel IDs and structured error codes. `beignet/cli` exports it too.
|
|
330
387
|
|
|
331
388
|
```typescript
|
|
332
|
-
import { BeignetNode, isRetryableError } from 'beignet/
|
|
389
|
+
import { BeignetNode, isRetryableError } from 'beignet/node';
|
|
333
390
|
|
|
334
391
|
// Creates the wallet, storage and funding provider for you
|
|
335
392
|
const node = await BeignetNode.create({
|
|
@@ -364,7 +421,7 @@ node.listInvoices();
|
|
|
364
421
|
await node.destroy();
|
|
365
422
|
```
|
|
366
423
|
|
|
367
|
-
|
|
424
|
+
`BeignetNode` is a typed emitter: `node.on('channel:ready', ({ channelId }) => ...)`. Every event, its payload and whether the daemon relays it over SSE is in the [generated events table](src/cli/README.md#events); every `BeignetNode.create` option is in the [options table](src/cli/README.md#factory).
|
|
368
425
|
|
|
369
426
|
Useful variants: `payInvoiceSafe` (never throws), `payInvoiceWithRetry({ maxRetries, backoffMs, maxFeeSats })`, `sendPaymentAsync` (returns the hash immediately), `connectAndOpenChannel`, `openChannelAndWait`, `sendKeysend`, `createOffer`/`payOffer`, `spliceIn`/`spliceOut`, `backup`, `gracefulShutdown`.
|
|
370
427
|
|
|
@@ -493,7 +550,7 @@ curl http://localhost:2112/ready # load-ba
|
|
|
493
550
|
- Full spec at `GET /openapi.json`.
|
|
494
551
|
- Authentication is on for every install `beignet init` creates (releases after 0.22.0): `init` mints a random `apiToken` and saves it in `config.json` (run `init` again on an older config to add one). Auth is off only for a config with neither `apiToken` nor `apiKeys` (named keys with `readonly`/`invoice`/`admin` scopes); `beignet start` warns on stderr in that case. `GET /health`, `/ready` and `/openapi.json` are auth-exempt; `/metrics` only with `metricsPublic`; everything else requires the bearer token. The daemon binds `127.0.0.1` by default.
|
|
495
552
|
- While auth is off, three browser guards keep a web page from driving the loopback daemon (issue #1005): a request body must be `Content-Type: application/json` (else `415 UNSUPPORTED_MEDIA_TYPE`), an `Origin` other than the configured `cors` origin or a `Sec-Fetch-Site: cross-site` request is refused (`403 CROSS_SITE_REQUEST_REFUSED`), and the `Host` header must be the loopback name the daemon is bound on (else `421 HOST_NOT_ALLOWED`, which also defeats DNS rebinding). They apply to every route but `OPTIONS`; plain clients (curl, the CLI, the SDKs) send none of those headers and are unaffected, and with a token configured the guards do not run at all.
|
|
496
|
-
- Embed it instead of shelling out: `import { startDaemon } from 'beignet/
|
|
553
|
+
- Embed it instead of shelling out: `import { startDaemon } from 'beignet/daemon'`.
|
|
497
554
|
|
|
498
555
|
### FFOR offline receive
|
|
499
556
|
|
|
@@ -513,8 +570,7 @@ node can run for others, each an explicit opt-in switched on with an exact
|
|
|
513
570
|
| `BEIGNET_FFOR_WITNESS` | Store a receiver-encrypted record of every delegated preimage this node relays before propagating the fulfil (a receipt witness). `BEIGNET_FFOR_WITNESS_MAX_MAILBOXES` and `BEIGNET_FFOR_WITNESS_MAX_BYTES` cap it. `GET /ffor/witness/status`. |
|
|
514
571
|
| `BEIGNET_FFOR_ISSUER` | Answer BOLT 12 invoice requests for offers a receiver delegated to this node, one fixed-amount slot per invoice. Needs the witness. `GET /ffor/issuer/status`. |
|
|
515
572
|
|
|
516
|
-
The SSE stream carries
|
|
517
|
-
`ffor:enforce` and the witness and issuer events.
|
|
573
|
+
The SSE stream carries every `ffor:*` event (see the [events table](src/cli/README.md#events)).
|
|
518
574
|
|
|
519
575
|
The experimental concurrent profile keeps ordinary payments available
|
|
520
576
|
within the channel's remaining capacity. `LightningNode.fforSync()` fetches paid
|
|
@@ -555,10 +611,8 @@ depth and been re-verified unspent immediately before the dispatch, binds
|
|
|
555
611
|
every HTLC of the payment to `refundHeight` minus its claim margins, judges
|
|
556
612
|
the payment by the node's own HTLC view (never by a wall clock or a failed
|
|
557
613
|
record while an HTLC is out), and persists its claim before broadcasting it.
|
|
558
|
-
The SSE stream carries `swap
|
|
559
|
-
|
|
560
|
-
`swap:paying`, `swap:preimage`, `swap:claim-broadcast`,
|
|
561
|
-
`swap:claim-confirmed` and `swap:payment-failed` for the submarine one.
|
|
614
|
+
The SSE stream carries every `swap:*` event of both directions (see the
|
|
615
|
+
[events table](src/cli/README.md#events)).
|
|
562
616
|
|
|
563
617
|
## Protocol layer (advanced)
|
|
564
618
|
|
|
@@ -600,14 +654,14 @@ node.on('node:error', (err) => console.error(`[${err.code}]`, err.message));
|
|
|
600
654
|
Without a `fundingProvider`, build the funding transaction yourself and call `node.createFunding(channel, fundingTxid, outputIndex, signature)` after `openChannel`.
|
|
601
655
|
|
|
602
656
|
```
|
|
603
|
-
LightningNode High-level API (EventEmitter)
|
|
657
|
+
LightningNode High-level API (typed EventEmitter)
|
|
604
658
|
├── ChannelManager Multiplexes messages to Channel instances
|
|
605
|
-
│
|
|
606
|
-
|
|
659
|
+
│ ├── Channel BOLT 2 state machine (returns ChannelAction[])
|
|
660
|
+
│ └── ChainMonitor BOLT 5 force-close detection + sweep
|
|
661
|
+
├── PeerManager TCP/WebSocket connections + Noise_XK encrypted transport
|
|
607
662
|
│ └── Peer Per-connection BOLT 8 handshake + message framing
|
|
608
663
|
├── NetworkGraph BOLT 7 gossip topology + Dijkstra pathfinding
|
|
609
|
-
├──
|
|
610
|
-
├── ChainMonitor BOLT 5 force-close detection + sweep
|
|
664
|
+
├── invoice (module) BOLT 11 encode/decode/sign functions
|
|
611
665
|
└── FundingProvider? Auto-builds + broadcasts funding txs (via Wallet)
|
|
612
666
|
```
|
|
613
667
|
|
|
@@ -615,64 +669,9 @@ LightningNode High-level API (EventEmitter)
|
|
|
615
669
|
|
|
616
670
|
**→ [src/lightning/README.md](src/lightning/README.md)** documents the protocol layer in detail: data flow, events reference, typed payment errors, channel lifecycle, zero-conf, anchors, dual funding, splicing, offers, onion messages, forwarding, chain monitoring.
|
|
617
671
|
|
|
618
|
-
|
|
619
|
-
<summary><b>BOLT coverage</b></summary>
|
|
620
|
-
|
|
621
|
-
| BOLT | Specification | Implemented |
|
|
622
|
-
|------|--------------|-------------|
|
|
623
|
-
| 1 | Base Protocol | Peer messaging, init, error, ping/pong, feature negotiation, peer storage |
|
|
624
|
-
| 2 | Channel Management | Full state machine: open, fund, normal operation, shutdown, close, reestablish; v2 dual-funded opens (interactive-tx), splicing, quiescence |
|
|
625
|
-
| 3 | Transactions | Commitment txs, HTLC scripts, funding scripts, anchor outputs, fee calculation; simple taproot channels (MuSig2 funding, Schnorr HTLC sigs) |
|
|
626
|
-
| 4 | Onion Routing | Sphinx encryption, TLV hop payloads, payment_secret, failure codes, route blinding, onion messages |
|
|
627
|
-
| 5 | On-Chain | Force-close detection, HTLC sweep, output resolution, chain monitoring, wallet-funded anchor fee bumping (commitment CPFP + zero-fee HTLC fee-attach) |
|
|
628
|
-
| 7 | Gossip | Channel/node announcements, network graph, Dijkstra routing, gossip sync, Rapid Gossip Sync |
|
|
629
|
-
| 8 | Transport | Noise_XK handshake, encrypted transport, key rotation |
|
|
630
|
-
| 9 | Features | DATA_LOSS_PROTECT, STATIC_REMOTE_KEY, PAYMENT_SECRET, TLV_ONION, BASIC_MPP, CHANNEL_TYPE, GOSSIP_QUERIES, ANCHORS_ZERO_FEE_HTLC_TX (default), ROUTE_BLINDING, ONION_MESSAGES, QUIESCE, SCID_ALIAS, ZERO_CONF, KEYSEND, OPTION_TAPROOT, OPTION_WILL_FUND |
|
|
631
|
-
| 10 | DNS Bootstrap | Seed resolution for discovering initial peers |
|
|
632
|
-
| 11 | Invoices | Encode, decode, sign, verify, amount formatting, hold invoices |
|
|
633
|
-
| 12 | Offers | Offer encode/decode, invoice_request/invoice over onion messages, receive-side settlement, async payment offers |
|
|
634
|
-
| bLIP-51 | Liquidity Ads | lease_rates/request_funds/will_fund negotiation, lease fee accounting, CLTV-locked lessor to_local, advisor lease quoting |
|
|
635
|
-
|
|
636
|
-
</details>
|
|
637
|
-
|
|
638
|
-
<details>
|
|
639
|
-
<summary><b>Module reference (<code>src/lightning/</code>)</b></summary>
|
|
640
|
-
|
|
641
|
-
| Module | Description |
|
|
642
|
-
|--------|-------------|
|
|
643
|
-
| `crypto/` | ChaCha20-Poly1305 AEAD, ECDH, HKDF, MuSig2 (BIP 327) for taproot channels |
|
|
644
|
-
| `message/` | Wire encode/decode for all channel, gossip and control messages |
|
|
645
|
-
| `features/` | Feature flag bitmap management (BOLT 9) |
|
|
646
|
-
| `transport/` | Noise_XK handshake, transport cipher, TCP/WebSocket peer connections, PeerManager |
|
|
647
|
-
| `keys/` | HD derivation, per-commitment secrets (shachain), signing, wallet keys |
|
|
648
|
-
| `script/` | Funding 2-of-2 multisig, commitment outputs, HTLC scripts, revocation, anchors, taproot scripts |
|
|
649
|
-
| `channel/` | Channel state machine, ChannelManager, commitment builder, actions, validation, liquidity ads |
|
|
650
|
-
| `chain/` | ChainMonitor, ChainWatcher, output resolver, closing tx, sweep tx, Electrum backend |
|
|
651
|
-
| `invoice/` | BOLT 11 encoding/decoding, bech32 words, signature verification |
|
|
652
|
-
| `gossip/` | NetworkGraph, Dijkstra pathfinding, gossip sync state machine, SCID encoding |
|
|
653
|
-
| `onion/` | Sphinx crypto, packet construction/processing, hop payloads, failures, blinded paths |
|
|
654
|
-
| `onion-message/` | Onion message construction/processing (carries BOLT 12 and async-payment messages) |
|
|
655
|
-
| `offer/` | BOLT 12 offers: encode/decode, OfferManager invoice_request/invoice flows |
|
|
656
|
-
| `async-payments/` | Hold invoices and AsyncPaymentManager (LSP held-forward, release_held_htlc, wake) |
|
|
657
|
-
| `ffor/` | FFOR Variant D offline receive: signed epoch lifecycle, voucher book, transcript hashes, delegated settlement arithmetic |
|
|
658
|
-
| `interactive-tx/` | Interactive transaction construction for v2 dual-funded opens and splicing |
|
|
659
|
-
| `watchtower/` | Altruist watchtower client: wtwire protocol, justice blobs, tower sessions |
|
|
660
|
-
| `backup/` | Static channel backup (SCB) export/import |
|
|
661
|
-
| `recovery/` | Safety transition layer: atomic persistence, the durable outbound-message outbox, the opt-in hash-chained recovery journal, and the peer_storage Recovery Capsule |
|
|
662
|
-
| `liquidity/` | JIT channel receive (LSP role): intercept SCIDs, held HTLCs, zero-conf open or splice, then forward; the opening fee is skimmed off the delivery for wallets that accept it, or charged to the sender through the invoice hint (hop mode) for wallets that cannot settle a short HTLC |
|
|
663
|
-
| `direct-funding/` | Third-party direct funding: the signed payment request envelope, sealed frames, protocol messages, outstanding-request store, the transport registry with its direct-peer, onion and blind-relay lanes, the receiver engine that turns a payer's offered UTXO into channel funding, and the payer engine that verifies and signs it |
|
|
664
|
-
| `swaps/` | Swaps: the P2WSH HTLC contract, claim/refund transactions, preimage extraction, admission policies, the durable swap ledger, the chain resolver, the wire protocol, and the swap provider engines (reverse: Lightning to on-chain; submarine: on-chain to Lightning) |
|
|
665
|
-
| `l402/` | L402 (Lightning HTTP 402) client: challenge parsing, macaroon reading, paid credentials |
|
|
666
|
-
| `node/` | LightningNode orchestrator, the main protocol-layer entry point |
|
|
667
|
-
| `wallet/` | WalletFundingProvider, adapts the on-chain Wallet for auto-funded opens |
|
|
668
|
-
| `bootstrap/` | DNS seed resolution for discovering initial peers |
|
|
669
|
-
| `advisor/` | Liquidity, fee and channel-suggestion advisors |
|
|
670
|
-
| `storage/` | SQLite persistence backend, channel state serialization |
|
|
671
|
-
| `validation/` | Input validation shared across modules |
|
|
672
|
-
|
|
673
|
-
`beignet/lightning` re-exports each of these as a namespace (`crypto`, `message`, `node`, ...). `async-payments` and `watchtower` are reachable via their source paths.
|
|
672
|
+
The protocol-layer README has the [BOLT coverage table](src/lightning/README.md#bolt-specification-coverage) and the [module reference](src/lightning/README.md#module-reference), one row per module of `src/lightning/` with its key exports. `beignet/lightning` re-exports each module as a namespace, camel-casing hyphenated names: `import { asyncPayments, ffor, watchtower } from 'beignet/lightning'`.
|
|
674
673
|
|
|
675
|
-
|
|
674
|
+
`SqliteStorage` and `GuardianStore` load from `beignet/lightning/sqlite`. They need `better-sqlite3`, an optional dependency that npm installs by default, and `beignet/lightning` loads without it.
|
|
676
675
|
|
|
677
676
|
## Tests
|
|
678
677
|
|
|
@@ -688,19 +687,21 @@ every TypeScript file.
|
|
|
688
687
|
|
|
689
688
|
```bash
|
|
690
689
|
npm run test:local # test:lightning + test:cli at once; no infrastructure needed
|
|
691
|
-
npm run test:
|
|
692
|
-
npm run test:
|
|
693
|
-
npm run test:
|
|
690
|
+
npm run coverage # test:local under c8, with a coverage summary of src
|
|
691
|
+
npm run test:lightning # 9500+ Lightning unit tests (parallel), no infrastructure needed
|
|
692
|
+
npm run test:cli # 2200+ CLI + daemon unit tests (parallel), no infrastructure needed
|
|
693
|
+
npm run test:conformance # 300+ official BOLT vector cases (subset of test:lightning)
|
|
694
694
|
npm run test:chaos # recovery kill matrices (parallel), split out of test:lightning
|
|
695
695
|
npm run test:sigkill # process-level SIGKILL chaos matrix (builds dist first)
|
|
696
|
+
npm run test:api # exported API vs tests/api-snapshot (npm run api:snapshot regenerates it)
|
|
696
697
|
npm run test:integration # daemon/Electrum integration (needs an Electrum server)
|
|
697
|
-
npm run test:interop #
|
|
698
|
+
npm run test:interop # 300+ cases vs LND/CLN/Eclair (needs Docker)
|
|
698
699
|
npm run test:interop:ffor # FFOR Variant D chain gates on regtest (needs only the bitcoind container)
|
|
699
700
|
npm run test:interop:ffor-concurrent # Concurrent receive process, durable boundary and current-chain qualification (bitcoind regtest)
|
|
700
701
|
npm run test:all # Lightning + CLI + interop (needs Docker + Electrum)
|
|
701
702
|
```
|
|
702
703
|
|
|
703
|
-
Counts are floors, not snapshots. Run the suites for exact numbers.
|
|
704
|
+
Counts are floors, not snapshots, and this is the only place they are kept. Run the suites for exact numbers (`npx mocha --dry-run` with a suite's arguments counts without running).
|
|
704
705
|
|
|
705
706
|
`test:local` is the fast inner loop. `test:lightning` and `test:cli` are
|
|
706
707
|
independent processes and neither saturates the machine alone, so running them at
|
|
@@ -716,6 +717,15 @@ three concurrently failed with `chaosWait timed out with the victim alive` while
|
|
|
716
717
|
the same suite passes 30/30 on its own. Run it separately. See
|
|
717
718
|
`scripts/run-suites.js` for the worker split and why more workers is not better.
|
|
718
719
|
|
|
720
|
+
`npm run coverage` prints a line, branch and function summary for `src`, and
|
|
721
|
+
writes per-file numbers to `coverage/coverage-summary.json` and per-line hits to
|
|
722
|
+
`coverage/lcov.info`. CI prints a summary per suite at the end of its
|
|
723
|
+
`test:lightning` and `test:cli` steps. The numbers are information, not a gate:
|
|
724
|
+
no threshold is set, and nothing fails on a percentage. A file the run never
|
|
725
|
+
loads counts as wholly uncovered. Two runs of the same tree can differ by a few
|
|
726
|
+
covered lines, because tests with random keys reach different branches. c8 also
|
|
727
|
+
counts a comment or type declaration as covered when the code around it ran.
|
|
728
|
+
|
|
719
729
|
The on-chain wallet suites live in `tests/*.test.ts` and connect to **live public
|
|
720
730
|
Electrum servers**, so they need network access and can fail on a server outage
|
|
721
731
|
rather than on your change. Each script runs `npm run build` first:
|
|
@@ -810,21 +820,43 @@ Recommended safeguards in production:
|
|
|
810
820
|
}
|
|
811
821
|
```
|
|
812
822
|
|
|
823
|
+
`BeignetNode` runs there from `beignet/node`, on storage passed in place of SQLite:
|
|
824
|
+
|
|
825
|
+
```typescript
|
|
826
|
+
import { BeignetNode } from 'beignet/node';
|
|
827
|
+
import { storage } from 'beignet/lightning';
|
|
828
|
+
|
|
829
|
+
const node = await BeignetNode.create({
|
|
830
|
+
network: 'mainnet',
|
|
831
|
+
mnemonic,
|
|
832
|
+
storage: new storage.MemoryStorage(), // or a backend over the app's database
|
|
833
|
+
});
|
|
834
|
+
```
|
|
835
|
+
|
|
836
|
+
Neither entry loads `fs`, `net`, `tls` or better-sqlite3 when imported. The node requires `net` and `tls` when it opens a connection, and `fs` only for a `dataDir`, which a node on `storage` does not need. Both entries still import `crypto`, `path`, `os`, `dns`, `http`, `https` and `zlib`, so the bundle needs a substitute for each.
|
|
837
|
+
|
|
838
|
+
The backend must implement the `walletData` capability: the node keeps its wallet state, spend ledger and sweep journal there. `MemoryStorage` loses everything when the app exits, so a wallet needs a backend over a persistent store; [src/lightning/README.md](src/lightning/README.md) describes the interface and its conformance suite. On such a node the payment queue lives in memory, and what copies or installs a SQLite file (`backupPath`, `backup()`, capsule restore) is refused.
|
|
839
|
+
|
|
840
|
+
Nothing in the `beignet` entry loads Node `crypto` until `createEncryptedStorage` is first called. It then needs HKDF-SHA256, random bytes and AES-256-GCM. An app that encrypts wallet storage either ships a `crypto` shim that covers those, or passes its own implementation (of the `ICryptoProvider` interface) to `setCryptoProvider` before the first call. Each primitive is checked against a known-answer vector before its first use, and one that fails throws an error naming it rather than returning wrong bytes. The check catches a missing or broken primitive, not a weak one: no test can tell predictable random bytes from secure ones, so a provider's `randomBytes` must come from the platform's secure generator.
|
|
841
|
+
|
|
813
842
|
## Documentation
|
|
814
843
|
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
| [docs/AI_AGENT_GUIDE.md](docs/AI_AGENT_GUIDE.md) | Deployment, monitoring, safety rails, HTTP daemon patterns |
|
|
819
|
-
| [src/lightning/README.md](src/lightning/README.md) | Protocol-layer reference and usage guide |
|
|
820
|
-
| [docs/ROADMAP.md](docs/ROADMAP.md) | Feature roadmap and progress |
|
|
821
|
-
| [docs/RECOVERY-PROTOCOL.md](docs/RECOVERY-PROTOCOL.md) | Proposed replicated state-continuity design |
|
|
822
|
-
| [API reference](docs/markdown/classes/Wallet.md) | Generated typedoc ([HTML](docs/html/classes/Wallet.html)) |
|
|
844
|
+
[docs/README.md](docs/README.md) indexes every guide, reference and design document in the repository.
|
|
845
|
+
|
|
846
|
+
The API reference for every entry point (`beignet`, `beignet/node`, `beignet/daemon`, `beignet/cli`, `beignet/lightning`, `beignet/lightning/sqlite`, `beignet/lightning/iroh-node`) is generated by typedoc and not kept in git. CI builds it on every run and uploads it as the `api-docs` artifact of the docs workflow; `npm run docs:html` (or `docs:markdown`) builds it locally into `api-docs/`.
|
|
823
847
|
|
|
824
848
|
## Support
|
|
825
849
|
|
|
826
850
|
Open an issue, or reach out on [Telegram](https://t.me/bitkitchat).
|
|
827
851
|
|
|
852
|
+
## Security
|
|
853
|
+
|
|
854
|
+
Report a vulnerability privately, as [SECURITY.md](SECURITY.md) describes, and not in a public issue.
|
|
855
|
+
|
|
856
|
+
## Contributing
|
|
857
|
+
|
|
858
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) covers setup, the checks CI runs, and the rules for pull requests.
|
|
859
|
+
|
|
828
860
|
## License
|
|
829
861
|
|
|
830
862
|
MIT
|