beignet 0.2.0 → 0.4.0
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 +306 -1
- package/dist/cli/auth.js +238 -0
- package/dist/cli/auth.js.map +1 -0
- package/dist/cli/beignet-node.js +1034 -57
- package/dist/cli/beignet-node.js.map +1 -1
- package/dist/cli/cli.js +1257 -18
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/config.js +45 -1
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/daemon.js +398 -38
- package/dist/cli/daemon.js.map +1 -1
- package/dist/cli/errors.js +2 -0
- package/dist/cli/errors.js.map +1 -1
- package/dist/cli/index.js +6 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/openapi.js +1343 -89
- package/dist/cli/openapi.js.map +1 -1
- package/dist/cli/restore.js +89 -0
- package/dist/cli/restore.js.map +1 -0
- package/dist/cli/wallet-storage.js +34 -0
- package/dist/cli/wallet-storage.js.map +1 -0
- package/dist/electrum/index.js +107 -12
- package/dist/electrum/index.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lightning/advisor/fee-tuner.js +42 -0
- package/dist/lightning/advisor/fee-tuner.js.map +1 -0
- package/dist/lightning/advisor/index.js +9 -1
- package/dist/lightning/advisor/index.js.map +1 -1
- package/dist/lightning/advisor/rebalance-planner.js +55 -0
- package/dist/lightning/advisor/rebalance-planner.js.map +1 -0
- package/dist/lightning/backup/index.js +18 -0
- package/dist/lightning/backup/index.js.map +1 -0
- package/dist/lightning/backup/scb.js +42 -0
- package/dist/lightning/backup/scb.js.map +1 -0
- package/dist/lightning/chain/chain-monitor.js +27 -0
- package/dist/lightning/chain/chain-monitor.js.map +1 -1
- package/dist/lightning/chain/output-resolver.js +66 -15
- package/dist/lightning/chain/output-resolver.js.map +1 -1
- package/dist/lightning/chain/types.js +1 -0
- package/dist/lightning/chain/types.js.map +1 -1
- package/dist/lightning/channel/channel-manager.js +91 -24
- package/dist/lightning/channel/channel-manager.js.map +1 -1
- package/dist/lightning/channel/channel-state.js.map +1 -1
- package/dist/lightning/channel/channel.js +122 -4
- package/dist/lightning/channel/channel.js.map +1 -1
- package/dist/lightning/channel/commitment-builder.js +4 -7
- package/dist/lightning/channel/commitment-builder.js.map +1 -1
- package/dist/lightning/channel/dual-funding.js +6 -5
- package/dist/lightning/channel/dual-funding.js.map +1 -1
- package/dist/lightning/channel/splice-tx.js.map +1 -1
- package/dist/lightning/channel/types.js +3 -1
- package/dist/lightning/channel/types.js.map +1 -1
- package/dist/lightning/channel/validation.js +3 -3
- package/dist/lightning/channel/validation.js.map +1 -1
- package/dist/lightning/crypto/index.js +1 -0
- package/dist/lightning/crypto/index.js.map +1 -1
- package/dist/lightning/crypto/message-signing.js +116 -0
- package/dist/lightning/crypto/message-signing.js.map +1 -0
- package/dist/lightning/crypto/xchacha20poly1305.js +77 -0
- package/dist/lightning/crypto/xchacha20poly1305.js.map +1 -0
- package/dist/lightning/features/flags.js +1 -0
- package/dist/lightning/features/flags.js.map +1 -1
- package/dist/lightning/gossip/messages.js +37 -1
- package/dist/lightning/gossip/messages.js.map +1 -1
- package/dist/lightning/index.js +2 -1
- package/dist/lightning/index.js.map +1 -1
- package/dist/lightning/keys/signer.js +24 -3
- package/dist/lightning/keys/signer.js.map +1 -1
- package/dist/lightning/keys/wallet-keys.js +1 -0
- package/dist/lightning/keys/wallet-keys.js.map +1 -1
- package/dist/lightning/message/index.js +1 -0
- package/dist/lightning/message/index.js.map +1 -1
- package/dist/lightning/message/peer-storage.js +43 -0
- package/dist/lightning/message/peer-storage.js.map +1 -0
- package/dist/lightning/message/types.js +2 -0
- package/dist/lightning/message/types.js.map +1 -1
- package/dist/lightning/node/lightning-node.js +1593 -236
- package/dist/lightning/node/lightning-node.js.map +1 -1
- package/dist/lightning/node/types.js +18 -1
- package/dist/lightning/node/types.js.map +1 -1
- package/dist/lightning/offer/offer-manager.js +2 -5
- package/dist/lightning/offer/offer-manager.js.map +1 -1
- package/dist/lightning/offer/tlv.js +3 -1
- package/dist/lightning/offer/tlv.js.map +1 -1
- package/dist/lightning/storage/encryption.js +67 -0
- package/dist/lightning/storage/encryption.js.map +1 -0
- package/dist/lightning/storage/index.js +1 -0
- package/dist/lightning/storage/index.js.map +1 -1
- package/dist/lightning/storage/serialization.js +6 -2
- package/dist/lightning/storage/serialization.js.map +1 -1
- package/dist/lightning/storage/sqlite-storage.js +405 -33
- package/dist/lightning/storage/sqlite-storage.js.map +1 -1
- package/dist/lightning/watchtower/blob.js +221 -0
- package/dist/lightning/watchtower/blob.js.map +1 -0
- package/dist/lightning/watchtower/index.js +55 -0
- package/dist/lightning/watchtower/index.js.map +1 -0
- package/dist/lightning/watchtower/justice.js +272 -0
- package/dist/lightning/watchtower/justice.js.map +1 -0
- package/dist/lightning/watchtower/tower-connection.js +208 -0
- package/dist/lightning/watchtower/tower-connection.js.map +1 -0
- package/dist/lightning/watchtower/types.js +3 -0
- package/dist/lightning/watchtower/types.js.map +1 -0
- package/dist/lightning/watchtower/watchtower-client.js +472 -0
- package/dist/lightning/watchtower/watchtower-client.js.map +1 -0
- package/dist/lightning/watchtower/wtwire.js +201 -0
- package/dist/lightning/watchtower/wtwire.js.map +1 -0
- package/dist/logger.js +41 -0
- package/dist/logger.js.map +1 -0
- package/dist/shapes/electrum.js +32 -1
- package/dist/shapes/electrum.js.map +1 -1
- package/dist/shapes/wallet.js +11 -1
- package/dist/shapes/wallet.js.map +1 -1
- package/dist/transaction/index.js +163 -15
- package/dist/transaction/index.js.map +1 -1
- package/dist/types/cli/auth.d.ts +34 -0
- package/dist/types/cli/beignet-node.d.ts +148 -4
- package/dist/types/cli/daemon.d.ts +5 -0
- package/dist/types/cli/errors.d.ts +2 -0
- package/dist/types/cli/index.d.ts +1 -0
- package/dist/types/cli/restore.d.ts +10 -0
- package/dist/types/cli/types.d.ts +235 -1
- package/dist/types/cli/wallet-storage.d.ts +3 -0
- package/dist/types/electrum/index.d.ts +12 -0
- package/dist/types/electrum.js +1 -0
- package/dist/types/electrum.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/lightning/advisor/fee-tuner.d.ts +20 -0
- package/dist/types/lightning/advisor/index.d.ts +4 -0
- package/dist/types/lightning/advisor/rebalance-planner.d.ts +12 -0
- package/dist/types/lightning/backup/index.d.ts +1 -0
- package/dist/types/lightning/backup/scb.d.ts +24 -0
- package/dist/types/lightning/chain/chain-monitor.d.ts +1 -0
- package/dist/types/lightning/chain/types.d.ts +1 -0
- package/dist/types/lightning/channel/channel-manager.d.ts +11 -0
- package/dist/types/lightning/channel/channel-state.d.ts +2 -0
- package/dist/types/lightning/channel/channel.d.ts +11 -5
- package/dist/types/lightning/channel/commitment-builder.d.ts +7 -7
- package/dist/types/lightning/channel/dual-funding.d.ts +2 -1
- package/dist/types/lightning/channel/splice-tx.d.ts +2 -2
- package/dist/types/lightning/channel/types.d.ts +2 -0
- package/dist/types/lightning/channel/validation.d.ts +1 -1
- package/dist/types/lightning/crypto/index.d.ts +1 -0
- package/dist/types/lightning/crypto/message-signing.d.ts +9 -0
- package/dist/types/lightning/crypto/xchacha20poly1305.d.ts +3 -0
- package/dist/types/lightning/features/flags.d.ts +1 -0
- package/dist/types/lightning/gossip/messages.d.ts +4 -0
- package/dist/types/lightning/index.d.ts +1 -0
- package/dist/types/lightning/keys/signer.d.ts +18 -1
- package/dist/types/lightning/keys/wallet-keys.d.ts +2 -1
- package/dist/types/lightning/message/index.d.ts +1 -0
- package/dist/types/lightning/message/peer-storage.d.ts +9 -0
- package/dist/types/lightning/message/types.d.ts +2 -0
- package/dist/types/lightning/node/lightning-node.d.ts +120 -4
- package/dist/types/lightning/node/types.d.ts +66 -1
- package/dist/types/lightning/storage/encryption.d.ts +11 -0
- package/dist/types/lightning/storage/index.d.ts +1 -0
- package/dist/types/lightning/storage/serialization.d.ts +2 -0
- package/dist/types/lightning/storage/sqlite-storage.d.ts +43 -3
- package/dist/types/lightning/storage/types.d.ts +62 -0
- package/dist/types/lightning/watchtower/blob.d.ts +46 -0
- package/dist/types/lightning/watchtower/index.d.ts +9 -0
- package/dist/types/lightning/watchtower/justice.d.ts +30 -0
- package/dist/types/lightning/watchtower/tower-connection.d.ts +34 -0
- package/dist/types/lightning/watchtower/types.d.ts +46 -0
- package/dist/types/lightning/watchtower/watchtower-client.d.ts +68 -0
- package/dist/types/lightning/watchtower/wtwire.d.ts +90 -0
- package/dist/types/logger.d.ts +17 -0
- package/dist/types/shapes/electrum.d.ts +3 -1
- package/dist/types/transaction/index.d.ts +6 -0
- package/dist/types/transaction.js.map +1 -1
- package/dist/types/types/electrum.d.ts +3 -2
- package/dist/types/types/transaction.d.ts +1 -1
- package/dist/types/types/wallet.d.ts +80 -4
- package/dist/types/utils/descriptors.d.ts +2 -0
- package/dist/types/utils/fees.d.ts +3 -0
- package/dist/types/utils/helpers.d.ts +3 -1
- package/dist/types/utils/index.d.ts +5 -0
- package/dist/types/utils/multisig.d.ts +29 -0
- package/dist/types/utils/transaction.d.ts +7 -0
- package/dist/types/utils/wallet-storage-encryption.d.ts +3 -0
- package/dist/types/utils/wallet.d.ts +1 -1
- package/dist/types/utils/watch-only.d.ts +12 -0
- package/dist/types/wallet/constants.d.ts +1 -0
- package/dist/types/wallet/index.d.ts +63 -4
- package/dist/types/wallet.js +3 -0
- package/dist/types/wallet.js.map +1 -1
- package/dist/utils/derivation-path.js +8 -7
- package/dist/utils/derivation-path.js.map +1 -1
- package/dist/utils/descriptors.js +56 -0
- package/dist/utils/descriptors.js.map +1 -0
- package/dist/utils/electrum.js +14 -4
- package/dist/utils/electrum.js.map +1 -1
- package/dist/utils/fees.js +19 -0
- package/dist/utils/fees.js.map +1 -0
- package/dist/utils/helpers.js +22 -5
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/multisig.js +90 -0
- package/dist/utils/multisig.js.map +1 -0
- package/dist/utils/transaction.js +30 -3
- package/dist/utils/transaction.js.map +1 -1
- package/dist/utils/wallet-storage-encryption.js +45 -0
- package/dist/utils/wallet-storage-encryption.js.map +1 -0
- package/dist/utils/wallet.js +3 -1
- package/dist/utils/wallet.js.map +1 -1
- package/dist/utils/watch-only.js +102 -0
- package/dist/utils/watch-only.js.map +1 -0
- package/dist/wallet/constants.js +2 -1
- package/dist/wallet/constants.js.map +1 -1
- package/dist/wallet/index.js +810 -51
- package/dist/wallet/index.js.map +1 -1
- package/docs/ROADMAP.md +365 -0
- package/package.json +1 -1
|
@@ -13,4 +13,8 @@ export declare function decodeNodeAddress(buf: Buffer, offset: number): {
|
|
|
13
13
|
address: INodeAddress;
|
|
14
14
|
bytesRead: number;
|
|
15
15
|
};
|
|
16
|
+
export declare function nodeAddressToHostPort(addr: INodeAddress): {
|
|
17
|
+
host: string;
|
|
18
|
+
port: number;
|
|
19
|
+
} | null;
|
|
16
20
|
export declare function parseAnnouncedAddress(input: string): INodeAddress;
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import * as bitcoin from 'bitcoinjs-lib';
|
|
3
3
|
import { type SessionKey } from '../crypto/musig';
|
|
4
|
-
export
|
|
4
|
+
export interface ISigner {
|
|
5
|
+
readonly fundingPubkey: Buffer;
|
|
6
|
+
readonly hasHtlcKeys: boolean;
|
|
7
|
+
signFundingDigest(digest: Buffer): Buffer;
|
|
8
|
+
signCommitmentTx(tx: bitcoin.Transaction, fundingWitnessScript: Buffer, fundingAmount: number): Buffer;
|
|
9
|
+
signClosingTx(tx: bitcoin.Transaction, fundingWitnessScript: Buffer, fundingAmount: number): Buffer;
|
|
10
|
+
signCommitmentPartial(session: SessionKey, ourPublicNonce: Uint8Array): Buffer;
|
|
11
|
+
signHtlcTxForCommitment(tx: bitcoin.Transaction, htlcWitnessScript: Buffer, htlcAmount: number, perCommitmentPoint: Buffer, htlcBasepoint: Buffer, useAnchorSighash?: boolean): Buffer;
|
|
12
|
+
signTaprootHtlcForCommitment(sighash: Buffer, perCommitmentPoint: Buffer, htlcBasepoint: Buffer): Buffer;
|
|
13
|
+
verifyCommitmentSig(tx: bitcoin.Transaction, signature: Buffer, remoteFundingPubkey: Buffer, fundingWitnessScript: Buffer, fundingAmount: number): boolean;
|
|
14
|
+
}
|
|
15
|
+
export type SignerFactory = (channelKeyIndex: number) => ISigner;
|
|
16
|
+
export declare function verifyCommitmentSignature(tx: bitcoin.Transaction, signature: Buffer, remoteFundingPubkey: Buffer, fundingWitnessScript: Buffer, fundingAmount: number): boolean;
|
|
17
|
+
export declare class ChannelSigner implements ISigner {
|
|
5
18
|
private fundingPrivkey;
|
|
6
19
|
readonly fundingPubkey: Buffer;
|
|
7
20
|
private _htlcBasepointSecret;
|
|
8
21
|
constructor(fundingPrivkey: Buffer, htlcBasepointSecret?: Buffer);
|
|
9
22
|
get htlcBasepointSecret(): Buffer | undefined;
|
|
23
|
+
get hasHtlcKeys(): boolean;
|
|
24
|
+
private deriveHtlcPrivkey;
|
|
25
|
+
signHtlcTxForCommitment(tx: bitcoin.Transaction, htlcWitnessScript: Buffer, htlcAmount: number, perCommitmentPoint: Buffer, htlcBasepoint: Buffer, useAnchorSighash?: boolean): Buffer;
|
|
26
|
+
signTaprootHtlcForCommitment(sighash: Buffer, perCommitmentPoint: Buffer, htlcBasepoint: Buffer): Buffer;
|
|
10
27
|
signFundingDigest(digest: Buffer): Buffer;
|
|
11
28
|
signCommitmentPartial(session: SessionKey, ourPublicNonce: Uint8Array): Buffer;
|
|
12
29
|
signCommitmentTx(tx: bitcoin.Transaction, fundingWitnessScript: Buffer, fundingAmount: number): Buffer;
|
|
@@ -11,6 +11,7 @@ export * from './channel-commitment';
|
|
|
11
11
|
export * from './channel-close';
|
|
12
12
|
export * from './channel-reestablish';
|
|
13
13
|
export * from './stfu';
|
|
14
|
+
export * from './peer-storage';
|
|
14
15
|
export * from './interactive-tx';
|
|
15
16
|
export * from './dual-funding';
|
|
16
17
|
export * from './splice';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare const PEER_STORAGE_MAX_BYTES = 65531;
|
|
3
|
+
export interface IPeerStorageMessage {
|
|
4
|
+
blob: Buffer;
|
|
5
|
+
}
|
|
6
|
+
export declare function encodePeerStorageMessage(msg: IPeerStorageMessage): Buffer;
|
|
7
|
+
export declare function decodePeerStorageMessage(payload: Buffer): IPeerStorageMessage;
|
|
8
|
+
export declare function encodePeerStorageRetrievalMessage(msg: IPeerStorageMessage): Buffer;
|
|
9
|
+
export declare function decodePeerStorageRetrievalMessage(payload: Buffer): IPeerStorageMessage;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
|
+
import { ILogger } from '../../logger';
|
|
4
5
|
import { ChannelManager } from '../channel/channel-manager';
|
|
5
6
|
import { Channel } from '../channel/channel';
|
|
6
7
|
import { PeerManager, IPeerInfo } from '../transport/peer-manager';
|
|
7
8
|
import { NetworkGraph } from '../gossip/network-graph';
|
|
8
9
|
import { IRapidGossipResult } from '../gossip/rapid-sync';
|
|
9
|
-
import { INodeAddress } from '../gossip/types';
|
|
10
|
+
import { INodeAddress, IRoute } from '../gossip/types';
|
|
10
11
|
import { Network } from '../invoice/types';
|
|
11
|
-
import { INodeConfig, IPaymentInfo, ICreateInvoiceOptions, ICreateInvoiceResult, IChannelInfo, INodeInfo, ILightningBalance, IFundingProvider, IFeeEstimator, IInvoiceInfo, IChannelHealth, IStructuredLog, IPaymentProof, IPaymentEstimate, IKeysendOptions } from './types';
|
|
12
|
-
import { IStorageBackend } from '../storage/types';
|
|
12
|
+
import { INodeConfig, IPaymentInfo, ICreateInvoiceOptions, ICreateInvoiceResult, IChannelInfo, INodeInfo, ILightningBalance, IFundingProvider, IFeeEstimator, IInvoiceInfo, IChannelHealth, IStructuredLog, IPaymentProof, IPaymentEstimate, IKeysendOptions, IChannelPolicy, IChannelPolicyUpdate, IAutoRebalanceConfig, IAutoTuneFeesConfig, IRebalanceResult, IRebalanceExecutionSummary } from './types';
|
|
13
|
+
import { IStorageBackend, IForwardingEvent, IForwardingEventFilter, IForwardingSummary } from '../storage/types';
|
|
13
14
|
import { FeatureFlags } from '../features/flags';
|
|
14
15
|
import { ChainWatcher } from '../chain/chain-watcher';
|
|
16
|
+
import { WatchtowerClient } from '../watchtower';
|
|
17
|
+
import { IScbChannelEntry } from '../backup/scb';
|
|
15
18
|
import { IPeerAddress, IBootstrapConfig } from '../bootstrap';
|
|
16
19
|
import { OnionMessageManager } from '../onion-message/manager';
|
|
17
20
|
import { AsyncPaymentManager } from '../async-payments/manager';
|
|
@@ -21,6 +24,8 @@ import { IOffer, IBolt12Invoice } from '../offer/types';
|
|
|
21
24
|
import { ILiquiditySnapshot } from '../advisor/liquidity-advisor';
|
|
22
25
|
import { IFeeSnapshot } from '../advisor/fee-advisor';
|
|
23
26
|
import { IChannelSuggestion } from '../advisor/channel-suggestions';
|
|
27
|
+
import { IRebalancePlan } from '../advisor/rebalance-planner';
|
|
28
|
+
import { IFeeTuneAdjustment } from '../advisor/fee-tuner';
|
|
24
29
|
export declare class LightningNode extends EventEmitter {
|
|
25
30
|
private nodePrivkey;
|
|
26
31
|
private acceptableChainHashes;
|
|
@@ -45,6 +50,7 @@ export declare class LightningNode extends EventEmitter {
|
|
|
45
50
|
private forwardingCltvDelta;
|
|
46
51
|
private forwardingFeeBaseMsat;
|
|
47
52
|
private forwardingFeePropMillionths;
|
|
53
|
+
private channelPolicies;
|
|
48
54
|
private gossipSyncManagers;
|
|
49
55
|
private _ownNodeAnnouncement?;
|
|
50
56
|
private _ownChannelGossip;
|
|
@@ -58,6 +64,7 @@ export declare class LightningNode extends EventEmitter {
|
|
|
58
64
|
private fundingPubkey;
|
|
59
65
|
private fundingProvider;
|
|
60
66
|
private fundingPrivkey;
|
|
67
|
+
private signerFactory;
|
|
61
68
|
private sweepDestinationScript?;
|
|
62
69
|
private htlcBasepointSecret;
|
|
63
70
|
private delayedPaymentBasepointSecret;
|
|
@@ -69,6 +76,7 @@ export declare class LightningNode extends EventEmitter {
|
|
|
69
76
|
private receivedHtlcSharedSecrets;
|
|
70
77
|
private feeEstimator;
|
|
71
78
|
private missionControl;
|
|
79
|
+
private logger;
|
|
72
80
|
private maxPaymentRetries;
|
|
73
81
|
private maxTotalInFlightHtlcs;
|
|
74
82
|
private autoUpdateChannelFees;
|
|
@@ -95,6 +103,20 @@ export declare class LightningNode extends EventEmitter {
|
|
|
95
103
|
private liquidityAdvisor;
|
|
96
104
|
private feeAdvisor;
|
|
97
105
|
private channelSuggestions;
|
|
106
|
+
private autoRebalanceConfig;
|
|
107
|
+
private autoTuneFeesConfig;
|
|
108
|
+
private autoRebalanceTimer;
|
|
109
|
+
private autoTuneFeesTimer;
|
|
110
|
+
private rebalanceBudgetDay;
|
|
111
|
+
private rebalanceRunInFlight;
|
|
112
|
+
private peerStorageEnabled;
|
|
113
|
+
private largeChannels;
|
|
114
|
+
private socks5Proxy;
|
|
115
|
+
private watchtowerClient;
|
|
116
|
+
private peerStorageBlobs;
|
|
117
|
+
private peerStorageLastAccepted;
|
|
118
|
+
private ourPeerStorageBlob;
|
|
119
|
+
private retrievedPeerStorage;
|
|
98
120
|
constructor(config: INodeConfig);
|
|
99
121
|
private restoreFromStorage;
|
|
100
122
|
private persistChannel;
|
|
@@ -105,13 +127,50 @@ export declare class LightningNode extends EventEmitter {
|
|
|
105
127
|
private makeAnnouncementSigner;
|
|
106
128
|
private triggerPendingAnnouncementSigning;
|
|
107
129
|
private registerGossipHandlers;
|
|
130
|
+
private static readonly PEER_STORAGE_MIN_INTERVAL_MS;
|
|
131
|
+
private registerPeerStorageHandlers;
|
|
132
|
+
private handlePeerStorageMessage;
|
|
133
|
+
private handlePeerStorageRetrievalMessage;
|
|
134
|
+
private peerQualifiesForStorage;
|
|
135
|
+
private sendPeerStorageOnConnect;
|
|
136
|
+
private peerAdvertisesPeerStorage;
|
|
137
|
+
distributePeerStorage(blob: Buffer): number;
|
|
138
|
+
getRetrievedPeerStorage(): Array<{
|
|
139
|
+
peerPubkey: string;
|
|
140
|
+
blob: Buffer;
|
|
141
|
+
receivedAt: number;
|
|
142
|
+
}>;
|
|
108
143
|
private wirePeerManagerEvents;
|
|
109
144
|
private autoReconnectPeers;
|
|
110
145
|
private emitReady;
|
|
111
146
|
private handleAutoFunding;
|
|
112
147
|
getNodeId(): string;
|
|
148
|
+
signMessage(message: string): string;
|
|
149
|
+
verifyMessage(message: string, signature: string): {
|
|
150
|
+
valid: boolean;
|
|
151
|
+
pubkey: string | null;
|
|
152
|
+
knownNode: boolean;
|
|
153
|
+
};
|
|
113
154
|
getNodeInfo(): INodeInfo;
|
|
155
|
+
buildStaticChannelBackupData(): {
|
|
156
|
+
network: string;
|
|
157
|
+
channels: IScbChannelEntry[];
|
|
158
|
+
};
|
|
159
|
+
recoverFromStaticChannelBackup(entries: IScbChannelEntry[]): Promise<{
|
|
160
|
+
recovering: string[];
|
|
161
|
+
skipped: Array<{
|
|
162
|
+
channelId: string;
|
|
163
|
+
reason: string;
|
|
164
|
+
}>;
|
|
165
|
+
}>;
|
|
166
|
+
private contactRecoveryPeer;
|
|
114
167
|
getSweepDestinationScript(): Buffer;
|
|
168
|
+
private getBitcoinNetwork;
|
|
169
|
+
private initWatchtowerClient;
|
|
170
|
+
private backupRevokedStateToTowers;
|
|
171
|
+
addWatchtower(uri: string): void;
|
|
172
|
+
removeWatchtower(uri: string): void;
|
|
173
|
+
getWatchtowers(): ReturnType<WatchtowerClient['getHealth']>;
|
|
115
174
|
setSweepDestinationScript(destinationScript: Buffer): void;
|
|
116
175
|
recoverFallbackFunds(opts?: {
|
|
117
176
|
feeRatePerVbyte?: number;
|
|
@@ -125,7 +184,8 @@ export declare class LightningNode extends EventEmitter {
|
|
|
125
184
|
loadRapidGossipSnapshot(data: Buffer): IRapidGossipResult;
|
|
126
185
|
getChannelManager(): ChannelManager;
|
|
127
186
|
getPeerManager(): PeerManager | null;
|
|
128
|
-
connectPeer(pubkey: string, host
|
|
187
|
+
connectPeer(pubkey: string, host?: string, port?: number): Promise<void>;
|
|
188
|
+
private connectPeerById;
|
|
129
189
|
disconnectPeer(pubkey: string): void;
|
|
130
190
|
listPeers(): IPeerInfo[];
|
|
131
191
|
isNetworkingEnabled(): boolean;
|
|
@@ -136,6 +196,7 @@ export declare class LightningNode extends EventEmitter {
|
|
|
136
196
|
private wireChainWatcherEvents;
|
|
137
197
|
startChainWatcher(): Promise<void>;
|
|
138
198
|
restoreChainWatches(): Promise<void>;
|
|
199
|
+
private watchRecoveredFundingOutput;
|
|
139
200
|
bootstrapPeers(config?: IBootstrapConfig): Promise<IPeerAddress[]>;
|
|
140
201
|
connectToSeeds(maxPeers?: number, config?: IBootstrapConfig): Promise<string[]>;
|
|
141
202
|
addTrustedPeer(pubkeyHex: string): void;
|
|
@@ -166,6 +227,13 @@ export declare class LightningNode extends EventEmitter {
|
|
|
166
227
|
ok: boolean;
|
|
167
228
|
error?: string;
|
|
168
229
|
};
|
|
230
|
+
setChannelPolicy(channelId: Buffer | 'all', policy: IChannelPolicyUpdate): void;
|
|
231
|
+
getChannelPolicy(channelId: Buffer): IChannelPolicy | null;
|
|
232
|
+
private getForwardingPolicyForChannel;
|
|
233
|
+
private validateChannelPolicyFields;
|
|
234
|
+
private static serializeChannelPolicy;
|
|
235
|
+
private regenerateChannelUpdateForPolicy;
|
|
236
|
+
private buildDirectChannelUpdate;
|
|
169
237
|
forceCloseChannel(channelId: Buffer, destinationScript: Buffer): {
|
|
170
238
|
ok: boolean;
|
|
171
239
|
error?: string;
|
|
@@ -185,6 +253,23 @@ export declare class LightningNode extends EventEmitter {
|
|
|
185
253
|
getChannel(channelId: Buffer): IChannelInfo | undefined;
|
|
186
254
|
getChannelHealth(channelId: Buffer): IChannelHealth | null;
|
|
187
255
|
getLiquiditySnapshot(): ILiquiditySnapshot;
|
|
256
|
+
planRebalanceRecommendations(minImbalancePct?: number): IRebalancePlan[];
|
|
257
|
+
rebalanceChannel(options: {
|
|
258
|
+
fromChannelId: Buffer;
|
|
259
|
+
toChannelId: Buffer;
|
|
260
|
+
amountSats: bigint;
|
|
261
|
+
maxFeeSats: bigint;
|
|
262
|
+
timeoutMs?: number;
|
|
263
|
+
}): Promise<IRebalanceResult>;
|
|
264
|
+
private static readonly REBALANCE_BUDGET_KEY;
|
|
265
|
+
private static currentUtcDay;
|
|
266
|
+
private loadRebalanceSpentMsat;
|
|
267
|
+
private recordRebalanceSpend;
|
|
268
|
+
executeRebalanceRecommendations(options?: {
|
|
269
|
+
budgetSatsPerDay?: number;
|
|
270
|
+
minImbalancePct?: number;
|
|
271
|
+
}): Promise<IRebalanceExecutionSummary>;
|
|
272
|
+
runFeeTuneOnce(now?: number): IFeeTuneAdjustment[];
|
|
188
273
|
getFeeSnapshot(): IFeeSnapshot | null;
|
|
189
274
|
getChannelSuggestions(count?: number): IChannelSuggestion[];
|
|
190
275
|
private buildChannelInfo;
|
|
@@ -196,6 +281,7 @@ export declare class LightningNode extends EventEmitter {
|
|
|
196
281
|
private broadcastOwnGossip;
|
|
197
282
|
private startGossipRefresh;
|
|
198
283
|
private getPrivateChannelRoutingHints;
|
|
284
|
+
private buildRoutingHintForChannel;
|
|
199
285
|
private findBlindedIntroExtension;
|
|
200
286
|
private buildBlindedPaymentPaths;
|
|
201
287
|
private handleGossipMessage;
|
|
@@ -225,7 +311,23 @@ export declare class LightningNode extends EventEmitter {
|
|
|
225
311
|
private handleFinalHopHtlc;
|
|
226
312
|
private parkHeldHtlc;
|
|
227
313
|
settleHeldHtlc(paymentHash: Buffer, preimage?: Buffer): boolean;
|
|
314
|
+
private emitInvoiceSettled;
|
|
228
315
|
cancelHeldHtlc(paymentHash: Buffer, failureCode?: number): boolean;
|
|
316
|
+
private markHoldInvoiceCancelled;
|
|
317
|
+
cancelHoldInvoice(paymentHash: Buffer): {
|
|
318
|
+
htlcsFailed: number;
|
|
319
|
+
} | null;
|
|
320
|
+
listHoldInvoices(): Array<{
|
|
321
|
+
paymentHash: string;
|
|
322
|
+
bolt11: string;
|
|
323
|
+
amountMsat?: bigint;
|
|
324
|
+
description?: string;
|
|
325
|
+
expiry: number;
|
|
326
|
+
createdAt: number;
|
|
327
|
+
state: 'OPEN' | 'ACCEPTED' | 'SETTLED' | 'CANCELLED';
|
|
328
|
+
heldAmountMsat: bigint;
|
|
329
|
+
htlcCount: number;
|
|
330
|
+
}>;
|
|
229
331
|
private scanExpiringHeldHtlcs;
|
|
230
332
|
private persistHeldHtlcs;
|
|
231
333
|
listHeldHtlcs(): Array<{
|
|
@@ -245,10 +347,15 @@ export declare class LightningNode extends EventEmitter {
|
|
|
245
347
|
private handleForwardHtlc;
|
|
246
348
|
private handleOnChainPreimageLearned;
|
|
247
349
|
private handleHtlcFulfilled;
|
|
350
|
+
private recordForwardingEvent;
|
|
248
351
|
private handleHtlcFailed;
|
|
249
352
|
private isPermanentFailure;
|
|
250
353
|
getPayment(paymentHash: Buffer): IPaymentInfo | undefined;
|
|
251
354
|
listPayments(): IPaymentInfo[];
|
|
355
|
+
listForwards(filter?: IForwardingEventFilter): IForwardingEvent[];
|
|
356
|
+
getForwardingSummary(options?: {
|
|
357
|
+
since?: number;
|
|
358
|
+
}): IForwardingSummary;
|
|
252
359
|
getPaymentProof(paymentHash: Buffer): IPaymentProof | null;
|
|
253
360
|
setPaymentMetadata(paymentHash: Buffer, metadata: Record<string, string>): void;
|
|
254
361
|
estimateRouteFee(bolt11: string, amountSats?: number): {
|
|
@@ -262,11 +369,13 @@ export declare class LightningNode extends EventEmitter {
|
|
|
262
369
|
feeSats?: number;
|
|
263
370
|
hops?: number;
|
|
264
371
|
};
|
|
372
|
+
queryRoute(destination: Buffer, amountMsat: bigint, finalCltvExpiry?: number): IRoute | null;
|
|
265
373
|
handlePeerMessage(pubkey: string, type: number, payload: Buffer): void;
|
|
266
374
|
handleFundingSpent(channelId: Buffer, spendingTx: import('bitcoinjs-lib').Transaction, blockHeight: number, destinationScript: Buffer): void;
|
|
267
375
|
handleNewBlock(blockHeight: number): void;
|
|
268
376
|
getCurrentBlockHeight(): number;
|
|
269
377
|
private resolveForceCloseFeeRatePerVbyte;
|
|
378
|
+
private clampEstimatedFeeRate;
|
|
270
379
|
private static readonly INBOUND_HTLC_CLAIM_FORCE_CLOSE_BUFFER;
|
|
271
380
|
private scanExpiringHtlcs;
|
|
272
381
|
private scanForwardTimeouts;
|
|
@@ -284,15 +393,21 @@ export declare class LightningNode extends EventEmitter {
|
|
|
284
393
|
announcedAddresses?: INodeAddress[];
|
|
285
394
|
fundingProvider?: IFundingProvider;
|
|
286
395
|
feeEstimator?: IFeeEstimator;
|
|
396
|
+
logger?: ILogger;
|
|
287
397
|
socks5Proxy?: {
|
|
288
398
|
host: string;
|
|
289
399
|
port: number;
|
|
290
400
|
};
|
|
291
401
|
preferAnchors?: boolean;
|
|
402
|
+
largeChannels?: boolean;
|
|
292
403
|
chainBackend?: import('../chain/chain-watcher').IChainBackend;
|
|
293
404
|
autoReconnect?: boolean;
|
|
294
405
|
autoUpdateChannelFees?: boolean;
|
|
295
406
|
sweepDestinationScript?: Buffer;
|
|
407
|
+
peerStorageEnabled?: boolean;
|
|
408
|
+
autoRebalance?: IAutoRebalanceConfig;
|
|
409
|
+
autoTuneFees?: IAutoTuneFeesConfig;
|
|
410
|
+
watchtowers?: string[];
|
|
296
411
|
channelKeyDeriver?: (channelIndex: number) => import('../channel/channel-manager').IPerChannelKeys;
|
|
297
412
|
}): LightningNode;
|
|
298
413
|
static defaultFeatures(): FeatureFlags;
|
|
@@ -338,5 +453,6 @@ export declare class LightningNode extends EventEmitter {
|
|
|
338
453
|
limit?: number;
|
|
339
454
|
}): IStructuredLog[];
|
|
340
455
|
private cleanupHtlcSharedSecret;
|
|
456
|
+
private findLocalChannelByScid;
|
|
341
457
|
private findChannelForPeer;
|
|
342
458
|
}
|
|
@@ -6,7 +6,9 @@ import { IRoute, INodeAddress } from '../gossip/types';
|
|
|
6
6
|
import { FeatureFlags } from '../features/flags';
|
|
7
7
|
import { IStorageBackend, IInvoiceInfo } from '../storage/types';
|
|
8
8
|
import { IChainBackend } from '../chain/chain-watcher';
|
|
9
|
+
import { ILogger } from '../../logger';
|
|
9
10
|
import { IPerChannelKeys } from '../channel/channel-manager';
|
|
11
|
+
import { SignerFactory } from '../keys/signer';
|
|
10
12
|
export type { IInvoiceInfo };
|
|
11
13
|
export interface IResourceConfig {
|
|
12
14
|
maxCompletedPayments?: number;
|
|
@@ -16,6 +18,8 @@ export interface IResourceConfig {
|
|
|
16
18
|
export interface IFeeEstimator {
|
|
17
19
|
estimateFee(targetBlocks: number): Promise<number>;
|
|
18
20
|
}
|
|
21
|
+
export declare const MAX_FEE_RATE_SAT_PER_VBYTE = 5000;
|
|
22
|
+
export declare function clampFeeRateSatPerVbyte(satPerVbyte: number, onClamp?: (original: number, clamped: number) => void): number;
|
|
19
23
|
export interface IFundingProvider {
|
|
20
24
|
buildFundingTransaction(address: string, amountSats: bigint, satsPerByte?: number): Promise<{
|
|
21
25
|
txHex: string;
|
|
@@ -39,6 +43,7 @@ export interface INodeConfig {
|
|
|
39
43
|
channelBasepoints: IChannelBasepoints;
|
|
40
44
|
perCommitmentSeed: Buffer;
|
|
41
45
|
fundingPrivkey: Buffer;
|
|
46
|
+
signerFactory?: SignerFactory;
|
|
42
47
|
htlcBasepointSecret?: Buffer;
|
|
43
48
|
revocationBasepointSecret?: Buffer;
|
|
44
49
|
paymentBasepointSecret?: Buffer;
|
|
@@ -63,9 +68,13 @@ export interface INodeConfig {
|
|
|
63
68
|
host: string;
|
|
64
69
|
port: number;
|
|
65
70
|
};
|
|
71
|
+
watchtowers?: string[];
|
|
66
72
|
preferAnchors?: boolean;
|
|
73
|
+
largeChannels?: boolean;
|
|
67
74
|
preferTaproot?: boolean;
|
|
75
|
+
peerStorageEnabled?: boolean;
|
|
68
76
|
feeEstimator?: IFeeEstimator;
|
|
77
|
+
logger?: ILogger;
|
|
69
78
|
maxPaymentRetries?: number;
|
|
70
79
|
maxTotalInFlightHtlcs?: number;
|
|
71
80
|
nextChannelIndex?: number;
|
|
@@ -77,6 +86,42 @@ export interface INodeConfig {
|
|
|
77
86
|
reestablishTimeoutBlocks?: number;
|
|
78
87
|
autoUpdateChannelFees?: boolean;
|
|
79
88
|
sweepDestinationScript?: Buffer;
|
|
89
|
+
autoRebalance?: IAutoRebalanceConfig;
|
|
90
|
+
autoTuneFees?: IAutoTuneFeesConfig;
|
|
91
|
+
}
|
|
92
|
+
export interface IAutoRebalanceConfig {
|
|
93
|
+
enabled?: boolean;
|
|
94
|
+
budgetSatsPerDay?: number;
|
|
95
|
+
minImbalancePct?: number;
|
|
96
|
+
intervalMs?: number;
|
|
97
|
+
}
|
|
98
|
+
export interface IAutoTuneFeesConfig {
|
|
99
|
+
enabled?: boolean;
|
|
100
|
+
intervalMs?: number;
|
|
101
|
+
floorPpm?: number;
|
|
102
|
+
ceilPpm?: number;
|
|
103
|
+
}
|
|
104
|
+
export interface IRebalanceResult {
|
|
105
|
+
paymentHash: Buffer;
|
|
106
|
+
amountMsat: bigint;
|
|
107
|
+
feeMsat: bigint;
|
|
108
|
+
hops: number;
|
|
109
|
+
}
|
|
110
|
+
export interface IRebalanceAttempt {
|
|
111
|
+
fromChannelId: string;
|
|
112
|
+
toChannelId: string;
|
|
113
|
+
amountSats: bigint;
|
|
114
|
+
status: 'SUCCEEDED' | 'FAILED' | 'SKIPPED_BUDGET';
|
|
115
|
+
feeMsat?: bigint;
|
|
116
|
+
error?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface IRebalanceExecutionSummary {
|
|
119
|
+
attempts: IRebalanceAttempt[];
|
|
120
|
+
succeeded: number;
|
|
121
|
+
failed: number;
|
|
122
|
+
skippedBudget: number;
|
|
123
|
+
feeSpentMsat: bigint;
|
|
124
|
+
budgetRemainingMsat: bigint;
|
|
80
125
|
}
|
|
81
126
|
export declare enum PaymentStatus {
|
|
82
127
|
PENDING = "PENDING",
|
|
@@ -137,6 +182,26 @@ export interface IChannelInfo {
|
|
|
137
182
|
localReserveMsat?: bigint;
|
|
138
183
|
remoteReserveMsat?: bigint;
|
|
139
184
|
isPrivate?: boolean;
|
|
185
|
+
feeBaseMsat?: number;
|
|
186
|
+
feeProportionalMillionths?: number;
|
|
187
|
+
cltvExpiryDelta?: number;
|
|
188
|
+
htlcMinimumMsat?: bigint;
|
|
189
|
+
htlcMaximumMsat?: bigint;
|
|
190
|
+
}
|
|
191
|
+
export interface IChannelPolicyUpdate {
|
|
192
|
+
feeBaseMsat?: number;
|
|
193
|
+
feeProportionalMillionths?: number;
|
|
194
|
+
cltvExpiryDelta?: number;
|
|
195
|
+
htlcMinimumMsat?: bigint;
|
|
196
|
+
htlcMaximumMsat?: bigint;
|
|
197
|
+
}
|
|
198
|
+
export interface IChannelPolicy {
|
|
199
|
+
feeBaseMsat: number;
|
|
200
|
+
feeProportionalMillionths: number;
|
|
201
|
+
cltvExpiryDelta: number;
|
|
202
|
+
htlcMinimumMsat: bigint;
|
|
203
|
+
htlcMaximumMsat: bigint;
|
|
204
|
+
source: 'override' | 'default';
|
|
140
205
|
}
|
|
141
206
|
export interface INodeInfo {
|
|
142
207
|
nodeId: string;
|
|
@@ -225,7 +290,7 @@ export interface IChannelHealth {
|
|
|
225
290
|
warnings: string[];
|
|
226
291
|
}
|
|
227
292
|
export interface IStructuredLog {
|
|
228
|
-
category: 'payment' | 'channel' | 'htlc' | 'fee' | 'peer' | 'chain';
|
|
293
|
+
category: 'payment' | 'channel' | 'htlc' | 'fee' | 'peer' | 'chain' | 'watchtower';
|
|
229
294
|
action: string;
|
|
230
295
|
timestamp: number;
|
|
231
296
|
data: Record<string, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
export declare function hkdfKey(secret: Buffer, info: string): Buffer;
|
|
3
|
+
export declare function deriveStorageKey(secret: Buffer): Buffer;
|
|
4
|
+
export declare function encryptWithPrefix(key: Buffer, plaintext: string, prefix: string): string;
|
|
5
|
+
export declare function decryptWithPrefix(key: Buffer, value: string, prefix: string): string;
|
|
6
|
+
export declare function encryptValue(key: Buffer, plaintext: string): string;
|
|
7
|
+
export declare function decryptValue(key: Buffer, value: string): string;
|
|
8
|
+
export declare function isEncryptedValue(value: string): boolean;
|
|
9
|
+
export declare class StorageEncryptedError extends Error {
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
@@ -163,6 +163,8 @@ export interface ISerializedChannelState {
|
|
|
163
163
|
isLessor?: boolean;
|
|
164
164
|
leaseExpiry?: number;
|
|
165
165
|
lastCooperativeCloseTxHex?: string;
|
|
166
|
+
dataLossDetected?: boolean;
|
|
167
|
+
dlpRemotePerCommitmentPoint?: string | null;
|
|
166
168
|
}
|
|
167
169
|
export interface ISerializedSpliceInFlight {
|
|
168
170
|
spliceTxid: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { IStorageBackend, IInvoiceInfo } from './types';
|
|
2
|
+
import { IStorageBackend, IInvoiceInfo, IPersistedChannelPolicy, IForwardingEvent, IForwardingEventFilter, IForwardingSummary } from './types';
|
|
3
|
+
import { IWatchtowerSession, IWatchtowerUpdate } from '../watchtower/types';
|
|
3
4
|
import { IChannelState } from '../channel/channel-state';
|
|
4
5
|
import { IPaymentInfo } from '../node/types';
|
|
5
6
|
import { IChainMonitorState } from '../chain/chain-monitor';
|
|
@@ -7,15 +8,23 @@ import { IGraphChannel, IGraphNode } from '../gossip/types';
|
|
|
7
8
|
export declare class SqliteStorage implements IStorageBackend {
|
|
8
9
|
private db;
|
|
9
10
|
private onCorruptRow?;
|
|
10
|
-
|
|
11
|
+
private encryptionKey?;
|
|
12
|
+
constructor(dbPath: string, onCorruptRow?: (error: unknown) => void, opts?: {
|
|
13
|
+
encryptionKey?: Buffer;
|
|
14
|
+
});
|
|
11
15
|
private reportCorruptRow;
|
|
16
|
+
private _enc;
|
|
17
|
+
private _dec;
|
|
12
18
|
open(opts?: {
|
|
13
19
|
synchronous?: 'FULL' | 'NORMAL';
|
|
14
20
|
}): void;
|
|
15
21
|
checkpoint(): void;
|
|
16
22
|
close(): void;
|
|
17
23
|
backup(destPath: string): Promise<void>;
|
|
18
|
-
static readonly CURRENT_SCHEMA_VERSION =
|
|
24
|
+
static readonly CURRENT_SCHEMA_VERSION = 9;
|
|
25
|
+
forwardingEventsMaxRows: number;
|
|
26
|
+
private static readonly ENCRYPTED_COLUMNS;
|
|
27
|
+
private _encryptExistingData;
|
|
19
28
|
private _createTables;
|
|
20
29
|
saveChannel(id: string, state: IChannelState, peerPubkey: string): void;
|
|
21
30
|
loadChannel(id: string): {
|
|
@@ -92,6 +101,7 @@ export declare class SqliteStorage implements IStorageBackend {
|
|
|
92
101
|
}>;
|
|
93
102
|
deletePeerAddress(pubkey: string): void;
|
|
94
103
|
saveChannelKeyIndex(channelId: string, channelIndex: number): void;
|
|
104
|
+
private _decodeChannelIndex;
|
|
95
105
|
loadChannelKeyIndex(channelId: string): number | null;
|
|
96
106
|
loadNextChannelIndex(): number;
|
|
97
107
|
saveHtlcSharedSecret(key: string, secret: Buffer): void;
|
|
@@ -120,6 +130,36 @@ export declare class SqliteStorage implements IStorageBackend {
|
|
|
120
130
|
private _runMigrations;
|
|
121
131
|
saveMetadata(key: string, value: string): void;
|
|
122
132
|
loadMetadata(key: string): string | null;
|
|
133
|
+
saveWalletData(key: string, value: string): void;
|
|
134
|
+
loadWalletData(key: string): string | null;
|
|
135
|
+
saveChannelPolicy(channelId: string, policy: IPersistedChannelPolicy): void;
|
|
136
|
+
loadAllChannelPolicies(): Array<{
|
|
137
|
+
channelId: string;
|
|
138
|
+
policy: IPersistedChannelPolicy;
|
|
139
|
+
}>;
|
|
140
|
+
deleteChannelPolicy(channelId: string): void;
|
|
141
|
+
savePeerStorageBlob(peerPubkey: string, blob: Buffer, receivedAt: number): void;
|
|
142
|
+
loadPeerStorageBlob(peerPubkey: string): {
|
|
143
|
+
blob: Buffer;
|
|
144
|
+
receivedAt: number;
|
|
145
|
+
} | null;
|
|
146
|
+
deletePeerStorageBlob(peerPubkey: string): void;
|
|
147
|
+
saveWatchtowerSession(session: IWatchtowerSession, sessionKey: Buffer): void;
|
|
148
|
+
loadWatchtowerSessions(): Array<IWatchtowerSession & {
|
|
149
|
+
sessionKey: Buffer;
|
|
150
|
+
}>;
|
|
151
|
+
setWatchtowerSessionProgress(sessionId: string, seqNum: number, lastApplied: number): void;
|
|
152
|
+
deleteWatchtowerTower(towerUri: string): void;
|
|
153
|
+
addWatchtowerUpdate(update: IWatchtowerUpdate): number;
|
|
154
|
+
loadPendingWatchtowerUpdates(): Array<IWatchtowerUpdate & {
|
|
155
|
+
id: number;
|
|
156
|
+
}>;
|
|
157
|
+
markWatchtowerUpdateAcked(id: number, seqNum: number): void;
|
|
158
|
+
saveForwardingEvent(event: Omit<IForwardingEvent, 'id'>): void;
|
|
159
|
+
listForwardingEvents(filter?: IForwardingEventFilter): IForwardingEvent[];
|
|
160
|
+
getForwardingSummary(options?: {
|
|
161
|
+
since?: number;
|
|
162
|
+
}): IForwardingSummary;
|
|
123
163
|
transaction<T>(fn: () => T): T;
|
|
124
164
|
saveWebhook(id: string, url: string, events: string[], secretHash?: string, createdAt?: number): void;
|
|
125
165
|
deleteWebhook(id: string): void;
|