lightning 4.10.7 → 4.12.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +2 -0
  3. package/grpc/protos/lightning.proto +53 -0
  4. package/grpc/protos/signer.proto +6 -0
  5. package/grpc/protos/walletkit.proto +10 -0
  6. package/grpc/protos/walletunlocker.proto +66 -0
  7. package/index.js +4 -0
  8. package/lnd_methods/index.js +4 -0
  9. package/lnd_methods/macaroon/index.d.ts +1 -0
  10. package/lnd_methods/macaroon/methods.json +9 -0
  11. package/lnd_methods/macaroon/subscribe_to_rpc_requests.d.ts +143 -0
  12. package/lnd_methods/offchain/get_failed_payments.d.ts +136 -0
  13. package/lnd_methods/offchain/index.d.ts +1 -0
  14. package/lnd_methods/offchain/index.js +4 -0
  15. package/lnd_methods/offchain/probe_for_route.d.ts +4 -0
  16. package/lnd_methods/offchain/send_message_to_peer.js +75 -0
  17. package/lnd_methods/offchain/subscribe_to_pay_via_routes.js +22 -0
  18. package/lnd_methods/offchain/subscribe_to_peer_messages.js +63 -0
  19. package/lnd_methods/onchain/propose_channel.d.ts +1 -1
  20. package/lnd_methods/unauthenticated/get_wallet_status.d.ts +3 -1
  21. package/lnd_methods/unauthenticated/subscribe_to_wallet_status.d.ts +2 -0
  22. package/lnd_responses/index.js +2 -0
  23. package/lnd_responses/rpc_peer_message_as_message.js +44 -0
  24. package/package.json +6 -6
  25. package/test/lnd_methods/offchain/test_pay_via_routes.js +11 -9
  26. package/test/lnd_methods/offchain/test_send_message_to_peer.js +68 -0
  27. package/test/lnd_methods/offchain/test_subscribe_to_pay_via_routes.js +81 -34
  28. package/test/lnd_methods/offchain/test_subscribe_to_peer_messages.js +132 -0
  29. package/test/lnd_methods/offchain/test_subscribe_to_probe_for_route.js +3 -0
  30. package/test/lnd_responses/test_rpc_peer_message_as_message.js +67 -0
  31. package/test/protos/protos.json +5 -5
  32. package/test/typescript/get_failed_payments.test-d.ts +31 -0
  33. package/test/typescript/subscribe_to_rpc_requests.test-d.ts +46 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Versions
2
2
 
3
+ ## 4.12.1
4
+
5
+ - `probeForRoute`, `subscribeToProbeForRoute`, `subscribeToPayViaRoutes`,
6
+ `payViaRoutes`: When probing (no hash), delete the payment failure record after the probe
7
+
8
+ ## 4.11.1
9
+
10
+ - `getFailedPayments`: Add method to get past failed payments
11
+ - `subscribeToRpcRequests`: Add method to listen to and interact with RPC requests
12
+
3
13
  ## 4.10.7
4
14
 
5
15
  - `getPayment`: Expand type definitions to match result data
package/README.md CHANGED
@@ -131,6 +131,8 @@ Methods exported by this library support typescript, but ln-service includes add
131
131
  channels on the node.
132
132
  - [getConnectedWatchtowers](https://github.com/alexbosworth/ln-service#getconnectedwatchtowers):
133
133
  List watchtowers that were added
134
+ - [getFailedPayments](https://github.com/alexbosworth/ln-service#getfailedpayments): List out
135
+ past payments that failed.
134
136
  - [getFeeRates](https://github.com/alexbosworth/ln-service#getfeerates): List routing fee rates
135
137
  and routing policies of channels on the node.
136
138
  - [getForwardingConfidence](https://github.com/alexbosworth/ln-service#getforwardingconfidence):
@@ -557,6 +557,47 @@ service Lightning {
557
557
  */
558
558
  rpc RegisterRPCMiddleware (stream RPCMiddlewareResponse)
559
559
  returns (stream RPCMiddlewareRequest);
560
+
561
+ /* lncli: `sendcustom`
562
+ SendCustomMessage sends a custom peer message.
563
+ */
564
+ rpc SendCustomMessage (SendCustomMessageRequest)
565
+ returns (SendCustomMessageResponse);
566
+
567
+ /* lncli: `subscribecustom`
568
+ SubscribeCustomMessages subscribes to a stream of incoming custom peer
569
+ messages.
570
+ */
571
+ rpc SubscribeCustomMessages (SubscribeCustomMessagesRequest)
572
+ returns (stream CustomMessage);
573
+ }
574
+
575
+ message SubscribeCustomMessagesRequest {
576
+ }
577
+
578
+ message CustomMessage {
579
+ // Peer from which the message originates
580
+ bytes peer = 1;
581
+
582
+ // Message type. This value will be in the custom range (>= 32768).
583
+ uint32 type = 2;
584
+
585
+ // Raw message data
586
+ bytes data = 3;
587
+ }
588
+
589
+ message SendCustomMessageRequest {
590
+ // Peer to send the message to
591
+ bytes peer = 1;
592
+
593
+ // Message type. This value needs to be in the custom range (>= 32768).
594
+ uint32 type = 2;
595
+
596
+ // Raw message data.
597
+ bytes data = 3;
598
+ }
599
+
600
+ message SendCustomMessageResponse {
560
601
  }
561
602
 
562
603
  message Utxo {
@@ -834,6 +875,9 @@ message ChannelAcceptRequest {
834
875
  // A bit-field which the initiator uses to specify proposed channel
835
876
  // behavior.
836
877
  uint32 channel_flags = 13;
878
+
879
+ // The commitment type the initiator wishes to use for the proposed channel.
880
+ CommitmentType commitment_type = 14;
837
881
  }
838
882
 
839
883
  message ChannelAcceptResponse {
@@ -1188,6 +1232,15 @@ enum CommitmentType {
1188
1232
  been broadcast.
1189
1233
  */
1190
1234
  ANCHORS = 2;
1235
+
1236
+ /*
1237
+ A channel that uses a commitment type that builds upon the anchors
1238
+ commitment format, but in addition requires a CLTV clause to spend outputs
1239
+ paying to the channel initiator. This is intended for use on leased channels
1240
+ to guarantee that the channel initiator has no incentives to close a leased
1241
+ channel before its maturity date.
1242
+ */
1243
+ SCRIPT_ENFORCED_LEASE = 4;
1191
1244
  }
1192
1245
 
1193
1246
  message ChannelConstraints {
@@ -193,6 +193,12 @@ message SignMessageReq {
193
193
 
194
194
  // Double-SHA256 hash instead of just the default single round.
195
195
  bool double_hash = 3;
196
+
197
+ /*
198
+ Use the compact (pubkey recoverable) format instead of the raw lnwire
199
+ format.
200
+ */
201
+ bool compact_sig = 4;
196
202
  }
197
203
  message SignMessageResp {
198
204
  /*
@@ -286,6 +286,16 @@ message AddrRequest {
286
286
  default wallet account is used.
287
287
  */
288
288
  string account = 1;
289
+
290
+ /*
291
+ The type of address to derive.
292
+ */
293
+ AddressType type = 2;
294
+
295
+ /*
296
+ Whether a change address should be derived.
297
+ */
298
+ bool change = 3;
289
299
  }
290
300
  message AddrResponse {
291
301
  /*
@@ -176,6 +176,15 @@ message InitWalletRequest {
176
176
  mainnet).
177
177
  */
178
178
  uint64 extended_master_key_birthday_timestamp = 8;
179
+
180
+ /*
181
+ watch_only is the third option of initializing a wallet: by importing
182
+ account xpubs only and therefore creating a watch-only wallet that does not
183
+ contain any private keys. That means the wallet won't be able to sign for
184
+ any of the keys and _needs_ to be run with a remote signer that has the
185
+ corresponding private keys and can serve signing RPC requests.
186
+ */
187
+ WatchOnly watch_only = 9;
179
188
  }
180
189
  message InitWalletResponse {
181
190
  /*
@@ -188,6 +197,63 @@ message InitWalletResponse {
188
197
  bytes admin_macaroon = 1;
189
198
  }
190
199
 
200
+ message WatchOnly {
201
+ /*
202
+ The unix timestamp in seconds of when the master key was created. lnd will
203
+ only start scanning for funds in blocks that are after the birthday which
204
+ can speed up the process significantly. If the birthday is not known, this
205
+ should be left at its default value of 0 in which case lnd will start
206
+ scanning from the first SegWit block (481824 on mainnet).
207
+ */
208
+ uint64 master_key_birthday_timestamp = 1;
209
+
210
+ /*
211
+ The fingerprint of the root key (also known as the key with derivation path
212
+ m/) from which the account public keys were derived from. This may be
213
+ required by some hardware wallets for proper identification and signing. The
214
+ bytes must be in big-endian order.
215
+ */
216
+ bytes master_key_fingerprint = 2;
217
+
218
+ /*
219
+ The list of accounts to import. There _must_ be an account for all of lnd's
220
+ main key scopes: BIP49/BIP84 (m/49'/0'/0', m/84'/0'/0', note that the
221
+ coin type is always 0, even for testnet/regtest) and lnd's internal key
222
+ scope (m/1017'/<coin_type>'/<account>'), where account is the key family as
223
+ defined in `keychain/derivation.go` (currently indices 0 to 9).
224
+ */
225
+ repeated WatchOnlyAccount accounts = 3;
226
+ }
227
+
228
+ message WatchOnlyAccount {
229
+ /*
230
+ Purpose is the first number in the derivation path, must be either 49, 84
231
+ or 1017.
232
+ */
233
+ uint32 purpose = 1;
234
+
235
+ /*
236
+ Coin type is the second number in the derivation path, this is _always_ 0
237
+ for purposes 49 and 84. It only needs to be set to 1 for purpose 1017 on
238
+ testnet or regtest.
239
+ */
240
+ uint32 coin_type = 2;
241
+
242
+ /*
243
+ Account is the third number in the derivation path. For purposes 49 and 84
244
+ at least the default account (index 0) needs to be created but optional
245
+ additional accounts are allowed. For purpose 1017 there needs to be exactly
246
+ one account for each of the key families defined in `keychain/derivation.go`
247
+ (currently indices 0 to 9)
248
+ */
249
+ uint32 account = 3;
250
+
251
+ /*
252
+ The extended public key at depth 3 for the given account.
253
+ */
254
+ string xpub = 4;
255
+ }
256
+
191
257
  message UnlockWalletRequest {
192
258
  /*
193
259
  wallet_password should be the current valid passphrase for the daemon. This
package/index.js CHANGED
@@ -37,6 +37,7 @@ const {getChannelBalance} = require('./lnd_methods');
37
37
  const {getChannels} = require('./lnd_methods');
38
38
  const {getClosedChannels} = require('./lnd_methods');
39
39
  const {getConnectedWatchtowers} = require('./lnd_methods');
40
+ const {getFailedPayments} = require('./lnd_methods');
40
41
  const {getFeeRates} = require('./lnd_methods');
41
42
  const {getForwardingConfidence} = require('./lnd_methods');
42
43
  const {getForwardingReputations} = require('./lnd_methods');
@@ -114,6 +115,7 @@ const {subscribeToPayViaRequest} = require('./lnd_methods');
114
115
  const {subscribeToPayViaRoutes} = require('./lnd_methods');
115
116
  const {subscribeToPeers} = require('./lnd_methods');
116
117
  const {subscribeToProbeForRoute} = require('./lnd_methods');
118
+ const {subscribeToRpcRequests} = require('./lnd_methods');
117
119
  const {subscribeToTransactions} = require('./lnd_methods');
118
120
  const {subscribeToWalletStatus} = require('./lnd_methods');
119
121
  const {unauthenticatedLndGrpc} = require('./lnd_grpc');
@@ -169,6 +171,7 @@ module.exports = {
169
171
  getChannels,
170
172
  getClosedChannels,
171
173
  getConnectedWatchtowers,
174
+ getFailedPayments,
172
175
  getFeeRates,
173
176
  getForwardingConfidence,
174
177
  getForwardingReputations,
@@ -246,6 +249,7 @@ module.exports = {
246
249
  subscribeToPayViaRoutes,
247
250
  subscribeToPeers,
248
251
  subscribeToProbeForRoute,
252
+ subscribeToRpcRequests,
249
253
  subscribeToTransactions,
250
254
  subscribeToWalletStatus,
251
255
  unauthenticatedLndGrpc,
@@ -84,6 +84,7 @@ const {recoverFundsFromChannels} = require('./offchain');
84
84
  const {removePeer} = require('./peers');
85
85
  const {requestChainFeeIncrease} = require('./onchain');
86
86
  const {revokeAccess} = require('./macaroon');
87
+ const {sendMessageToPeer} = require('./offchain');
87
88
  const {sendToChainAddress} = require('./onchain');
88
89
  const {sendToChainAddresses} = require('./onchain');
89
90
  const {sendToChainOutputScripts} = require('./onchain');
@@ -110,6 +111,7 @@ const {subscribeToPastPayments} = require('./offchain');
110
111
  const {subscribeToPayViaDetails} = require('./offchain');
111
112
  const {subscribeToPayViaRequest} = require('./offchain');
112
113
  const {subscribeToPayViaRoutes} = require('./offchain');
114
+ const {subscribeToPeerMessages} = require('./offchain');
113
115
  const {subscribeToPeers} = require('./peers');
114
116
  const {subscribeToProbeForRoute} = require('./offchain');
115
117
  const {subscribeToRpcRequests} = require('./macaroon');
@@ -214,6 +216,7 @@ module.exports = {
214
216
  removePeer,
215
217
  requestChainFeeIncrease,
216
218
  revokeAccess,
219
+ sendMessageToPeer,
217
220
  sendToChainAddress,
218
221
  sendToChainAddresses,
219
222
  sendToChainOutputScripts,
@@ -240,6 +243,7 @@ module.exports = {
240
243
  subscribeToPayViaDetails,
241
244
  subscribeToPayViaRequest,
242
245
  subscribeToPayViaRoutes,
246
+ subscribeToPeerMessages,
243
247
  subscribeToPeers,
244
248
  subscribeToProbeForRoute,
245
249
  subscribeToRpcRequests,
@@ -1,4 +1,5 @@
1
1
  export * from './get_access_ids';
2
2
  export * from './grant_access';
3
3
  export * from './revoke_access';
4
+ export * from './subscribe_to_rpc_requests';
4
5
  export * from './verify_access';
@@ -334,6 +334,10 @@
334
334
  "method": "DeleteMacaroonId",
335
335
  "type": "default"
336
336
  },
337
+ "sendMessageToPeer": {
338
+ "method": "SendCustomMessage",
339
+ "type": "default"
340
+ },
337
341
  "sendToChainAddress": {
338
342
  "method": "SendCoins",
339
343
  "type": "default"
@@ -439,9 +443,14 @@
439
443
  "type": "router"
440
444
  },
441
445
  "subscribeToPayViaRoutes": {
446
+ "depends_on": ["deletePayment"],
442
447
  "method": "SendToRouteV2",
443
448
  "type": "router"
444
449
  },
450
+ "subscribeToPeerMessages": {
451
+ "method": "SubscribeCustomMessages",
452
+ "type": "default"
453
+ },
445
454
  "subscribeToPeers": {
446
455
  "method": "SubscribePeerEvents",
447
456
  "type": "default"
@@ -0,0 +1,143 @@
1
+ import {
2
+ AuthenticatedLightningArgs,
3
+ AuthenticatedLightningMethod,
4
+ LightningMethod,
5
+ } from '../../typescript';
6
+
7
+ export type SubscribeToRpcRequestsArgs = AuthenticatedLightningArgs<{
8
+ /** RPC Middleware Interception Name String */
9
+ id?: string;
10
+ /** Intercept Channel Closes Bool */
11
+ is_intercepting_close_channel_requests?: boolean;
12
+ /** Intercept Channel Opens Bool */
13
+ is_intercepting_open_channel_requests?: boolean;
14
+ /** Intercept Pay Via Route Bool */
15
+ is_intercepting_pay_via_routes_requests?: boolean;
16
+ }>;
17
+
18
+ export type SubscribeToRpcRequestsResult = {
19
+ /** RPC Request Subscription EventEmitter Object */
20
+ subscription: NodeJS.EventEmitter;
21
+ };
22
+
23
+ export type SubscribeToRpcRequestsCommonEvent = {
24
+ /** Request Id Number */
25
+ id: number;
26
+ /** Base64 Encoded Macaroon String */
27
+ macaroon?: string;
28
+ /** RPC URI String */
29
+ uri?: string;
30
+ };
31
+
32
+ export type SubscribeToRpcRequestsEvent<TRequest> =
33
+ Required<SubscribeToRpcRequestsCommonEvent> & {
34
+ accept: LightningMethod;
35
+ reject: LightningMethod<{
36
+ /** Rejection String */
37
+ message: string;
38
+ }>;
39
+ request: TRequest;
40
+ };
41
+
42
+ /** A channel close request was intercepted: by default it will be rejected */
43
+ export type SubscribeToRpcRequestsCloseChannelRequestEvent =
44
+ SubscribeToRpcRequestsEvent<{
45
+ /** Request Sending Local Channel Funds To Address String */
46
+ address?: string;
47
+ /** Is Force Close Bool */
48
+ is_force_close?: boolean;
49
+ /** Confirmation Target Number */
50
+ target_confirmations?: number;
51
+ /** Tokens Per Virtual Byte Number */
52
+ tokens_per_vbyte?: number;
53
+ /** Transaction Id Hex String */
54
+ transaction_id: string;
55
+ /** Transaction Output Index Number */
56
+ transaction_vout: number;
57
+ }>;
58
+
59
+ /** A channel open request was intercepted: by default it will be rejected */
60
+ export type SubscribeToRpcRequestsOpenChannelRequestEvent =
61
+ SubscribeToRpcRequestsEvent<{
62
+ /** Chain Fee Tokens Per VByte Number */
63
+ chain_fee_tokens_per_vbyte?: number;
64
+ /** Prefer Cooperative Close To Address String */
65
+ cooperative_close_address?: string;
66
+ /** Tokens to Gift To Partner Number */
67
+ give_tokens?: number;
68
+ /** Channel is Private Bool */
69
+ is_private?: boolean;
70
+ /** Local Tokens Number */
71
+ local_tokens: number;
72
+ /** Spend UTXOs With Minimum Confirmations Number */
73
+ min_confirmations?: number;
74
+ /** Minimum HTLC Millitokens String */
75
+ min_htlc_mtokens?: string;
76
+ /** Public Key Hex String */
77
+ partner_public_key: string;
78
+ /** Peer Output CSV Delay Number */
79
+ partner_csv_delay?: number;
80
+ }>;
81
+
82
+ /** A pay to route request was intercepted: by default it will be rejected */
83
+ export type SubscribeToRpcRequestsPayViaRouteRequestEvent =
84
+ SubscribeToRpcRequestsEvent<{
85
+ /** Payment Hash Hex String */
86
+ id: string;
87
+ route: {
88
+ /** Route Fee Tokens Number */
89
+ fee: number;
90
+ /** Route Fee Millitokens String */
91
+ fee_mtokens: string;
92
+ hops: {
93
+ /** Standard Format Channel Id String */
94
+ channel: string;
95
+ /** Channel Capacity Tokens Number */
96
+ channel_capacity: number;
97
+ /** Fee Tokens Number */
98
+ fee: number;
99
+ /** Fee Millitokens String */
100
+ fee_mtokens: string;
101
+ /** Forward Tokens Number */
102
+ forward: number;
103
+ /** Forward Millitokens String */
104
+ forward_mtokens: string;
105
+ /** Forward Edge Public Key Hex String */
106
+ public_key: string;
107
+ /** Timeout Block Height Number */
108
+ timeout?: number;
109
+ }[];
110
+ /** Total Fee-Inclusive Millitokens String */
111
+ mtokens: string;
112
+ /** Payment Identifier Hex String */
113
+ payment?: string;
114
+ /** Timeout Block Height Number */
115
+ timeout?: number;
116
+ /** Total Fee-Inclusive Tokens Number */
117
+ tokens: number;
118
+ /** Total Payment Millitokens String */
119
+ total_mtokens?: string;
120
+ };
121
+ }>;
122
+
123
+ export type SubscribeToRpcRequestsRequestEvent =
124
+ SubscribeToRpcRequestsCommonEvent;
125
+
126
+ export type SubscribeToRpcRequestsResponseEvent =
127
+ SubscribeToRpcRequestsCommonEvent;
128
+
129
+ /**
130
+ * Subscribe to RPC requests and their responses
131
+ *
132
+ * `accept` and `reject` methods can be used with cbk or Promise syntax
133
+ *
134
+ * Requires `macaroon:write` permission
135
+ *
136
+ * LND must be running with "RPC middleware" enabled: `rpcmiddleware.enable=1`
137
+ *
138
+ * This method is not supported in LND 0.13.3 and below
139
+ */
140
+ export const subscribeToRpcRequests: AuthenticatedLightningMethod<
141
+ SubscribeToRpcRequestsArgs,
142
+ SubscribeToRpcRequestsResult
143
+ >;
@@ -0,0 +1,136 @@
1
+ import {
2
+ AuthenticatedLightningArgs,
3
+ AuthenticatedLightningMethod,
4
+ PaginationArgs,
5
+ } from '../../typescript';
6
+
7
+ export type GetFailedPaymentsArgs = AuthenticatedLightningArgs<PaginationArgs>;
8
+
9
+ export type GetFailedPaymentsResult = {
10
+ payments: {
11
+ attempts: {
12
+ failure?: {
13
+ /** Error Type Code Number */
14
+ code: number;
15
+ details?: {
16
+ /** Standard Format Channel Id String */
17
+ channel?: string;
18
+ /** Error Associated Block Height Number */
19
+ height?: number;
20
+ /** Failed Hop Index Number */
21
+ index?: number;
22
+ /** Error Millitokens String */
23
+ mtokens?: string;
24
+ policy?: {
25
+ /** Base Fee Millitokens String */
26
+ base_fee_mtokens: string;
27
+ /** Locktime Delta Number */
28
+ cltv_delta: number;
29
+ /** Fees Charged in Millitokens Per Million Number */
30
+ fee_rate: number;
31
+ /** Channel is Disabled Bool */
32
+ is_disabled?: boolean;
33
+ /** Maximum HLTC Millitokens Value String */
34
+ max_htlc_mtokens: string;
35
+ /** Minimum HTLC Millitokens Value String */
36
+ min_htlc_mtokens: string;
37
+ /** Updated At ISO 8601 Date String */
38
+ updated_at: string;
39
+ };
40
+ /** Error CLTV Timeout Height Number */
41
+ timeout_height?: number;
42
+ update?: {
43
+ /** Chain Id Hex String */
44
+ chain: string;
45
+ /** Channel Flags Number */
46
+ channel_flags: number;
47
+ /** Extra Opaque Data Hex String */
48
+ extra_opaque_data: string;
49
+ /** Message Flags Number */
50
+ message_flags: number;
51
+ /** Channel Update Signature Hex String */
52
+ signature: string;
53
+ };
54
+ };
55
+ /** Error Message String */
56
+ message: string;
57
+ };
58
+ /** Payment Add Index Number */
59
+ index?: number;
60
+ /** Payment Confirmed At ISO 8601 Date String */
61
+ confirmed_at?: string;
62
+ /** Payment Attempt Succeeded Bool */
63
+ is_confirmed: boolean;
64
+ /** Payment Attempt Failed Bool */
65
+ is_failed: boolean;
66
+ /** Payment Attempt is Waiting For Resolution Bool */
67
+ is_pending: boolean;
68
+ route: {
69
+ /** Route Fee Tokens Number */
70
+ fee: number;
71
+ /** Route Fee Millitokens String */
72
+ fee_mtokens: string;
73
+ hops: {
74
+ /** Standard Format Channel Id String */
75
+ channel: string;
76
+ /** Channel Capacity Tokens Number */
77
+ channel_capacity: number;
78
+ /** Fee Number */
79
+ fee: number;
80
+ /** Fee Millitokens String */
81
+ fee_mtokens: string;
82
+ /** Forward Tokens Number */
83
+ forward: number;
84
+ /** Forward Millitokens String */
85
+ forward_mtokens: string;
86
+ /** Forward Edge Public Key Hex String */
87
+ public_key?: string;
88
+ /** Timeout Block Height Number */
89
+ timeout?: number;
90
+ }[];
91
+ /** Total Fee-Inclusive Millitokens String */
92
+ mtokens: string;
93
+ /** Payment Identifier Hex String */
94
+ payment?: string;
95
+ /** Timeout Block Height Number */
96
+ timeout: number;
97
+ /** Total Fee-Inclusive Tokens Number */
98
+ tokens: number;
99
+ /** Total Millitokens String */
100
+ total_mtokens?: string;
101
+ };
102
+ }[];
103
+ /** Payment at ISO-8601 Date String */
104
+ created_at: string;
105
+ /** Destination Node Public Key Hex String */
106
+ destination?: string;
107
+ /** Payment Preimage Hash String */
108
+ id: string;
109
+ /** Payment Add Index Number */
110
+ index?: number;
111
+ /** Payment is Confirmed Bool */
112
+ is_confirmed: boolean;
113
+ /** Transaction Is Outgoing Bool */
114
+ is_outgoing: boolean;
115
+ /** Millitokens Attempted to Pay to Destination String */
116
+ mtokens: string;
117
+ /** BOLT 11 Payment Request String */
118
+ request?: string;
119
+ /** Payment Tokens Attempted to Pay Rounded Up Number */
120
+ safe_tokens: number;
121
+ /** Rounded Down Tokens Attempted to Pay to Destination Number */
122
+ tokens: number;
123
+ }[];
124
+ /** Next Opaque Paging Token String */
125
+ next?: string;
126
+ };
127
+
128
+ /**
129
+ * Get failed payments made through channels.
130
+ *
131
+ * Requires `offchain:read` permission
132
+ */
133
+ export const getFailedPayments: AuthenticatedLightningMethod<
134
+ GetFailedPaymentsArgs,
135
+ GetFailedPaymentsResult
136
+ >;
@@ -14,6 +14,7 @@ export * from './get_channel_balance';
14
14
  export * from './get_channels';
15
15
  export * from './get_closed_channels';
16
16
  export * from './get_connected_watchtowers';
17
+ export * from './get_failed_payments';
17
18
  export * from './get_fee_rates';
18
19
  export * from './get_forwarding_confidence';
19
20
  export * from './get_forwarding_reputations';
@@ -32,6 +32,7 @@ const payViaRoutes = require('./pay_via_routes');
32
32
  const probeForRoute = require('./probe_for_route');
33
33
  const recoverFundsFromChannel = require('./recover_funds_from_channel');
34
34
  const recoverFundsFromChannels = require('./recover_funds_from_channels');
35
+ const sendMessageToPeer = require('./send_message_to_peer');
35
36
  const subscribeToBackups = require('./subscribe_to_backups');
36
37
  const subscribeToChannels = require('./subscribe_to_channels');
37
38
  const subscribeToForwardRequests = require('./subscribe_to_forward_requests');
@@ -42,6 +43,7 @@ const subscribeToPastPayments = require('./subscribe_to_past_payments');
42
43
  const subscribeToPayViaDetails = require('./subscribe_to_pay_via_details');
43
44
  const subscribeToPayViaRequest = require('./subscribe_to_pay_via_request');
44
45
  const subscribeToPayViaRoutes = require('./subscribe_to_pay_via_routes');
46
+ const subscribeToPeerMessages = require('./subscribe_to_peer_messages');
45
47
  const subscribeToProbeForRoute = require('./subscribe_to_probe_for_route');
46
48
  const updateConnectedWatchtower = require('./update_connected_watchtower');
47
49
  const updatePathfindingSettings = require('./update_pathfinding_settings');
@@ -84,6 +86,7 @@ module.exports = {
84
86
  probeForRoute,
85
87
  recoverFundsFromChannel,
86
88
  recoverFundsFromChannels,
89
+ sendMessageToPeer,
87
90
  subscribeToBackups,
88
91
  subscribeToChannels,
89
92
  subscribeToForwardRequests,
@@ -94,6 +97,7 @@ module.exports = {
94
97
  subscribeToPayViaDetails,
95
98
  subscribeToPayViaRequest,
96
99
  subscribeToPayViaRoutes,
100
+ subscribeToPeerMessages,
97
101
  subscribeToProbeForRoute,
98
102
  updateConnectedWatchtower,
99
103
  updatePathfindingSettings,
@@ -118,6 +118,10 @@ export type ProbeForRouteResult = {
118
118
  /**
119
119
  * Probe to find a successful route
120
120
  *
121
+ * When probing to a payment request, make sure to specify the fields encoded in the payment request such as `cltv_delta`.
122
+ *
123
+ * If `total_mtokens` are specified, a `payment` nonce is required.
124
+ *
121
125
  * Requires `offchain:write` permission
122
126
  */
123
127
  export const probeForRoute: AuthenticatedLightningMethod<