lightning 4.14.4 → 5.1.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 (47) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +0 -4
  3. package/lnd_methods/address/create_chain_address.d.ts +1 -1
  4. package/lnd_methods/address/create_chain_address.js +7 -4
  5. package/lnd_methods/info/constants.json +3 -1
  6. package/lnd_methods/macaroon/verify_access.d.ts +1 -1
  7. package/lnd_methods/macaroon/verify_access.js +1 -1
  8. package/lnd_methods/offchain/get_channels.d.ts +0 -2
  9. package/lnd_methods/offchain/get_channels.js +0 -3
  10. package/lnd_methods/offchain/get_pending_channels.js +0 -1
  11. package/lnd_methods/offchain/get_route_through_hops.d.ts +2 -2
  12. package/lnd_methods/offchain/send_message_to_peer.d.ts +1 -1
  13. package/lnd_methods/offchain/send_message_to_peer.js +1 -1
  14. package/lnd_methods/offchain/subscribe_to_channels.d.ts +0 -2
  15. package/lnd_methods/offchain/subscribe_to_channels.js +0 -3
  16. package/lnd_methods/offchain/subscribe_to_pay.d.ts +157 -53
  17. package/lnd_methods/offchain/subscribe_to_pay_via_details.d.ts +23 -135
  18. package/lnd_methods/offchain/subscribe_to_pay_via_request.d.ts +21 -113
  19. package/lnd_methods/offchain/subscribe_to_pay_via_routes.d.ts +8 -6
  20. package/lnd_methods/offchain/update_connected_watchtower.d.ts +2 -2
  21. package/lnd_methods/offchain/update_routing_fees.d.ts +2 -2
  22. package/lnd_methods/onchain/close_channel.d.ts +8 -5
  23. package/lnd_methods/onchain/fund_pending_channels.js +13 -13
  24. package/lnd_methods/onchain/fund_psbt.d.ts +2 -2
  25. package/lnd_methods/onchain/open_channels.d.ts +2 -0
  26. package/lnd_methods/onchain/open_channels.js +16 -10
  27. package/lnd_methods/onchain/request_chain_fee_increase.d.ts +2 -2
  28. package/lnd_methods/onchain/script_from_chain_address.d.ts +3 -3
  29. package/lnd_methods/onchain/send_to_chain_address.d.ts +3 -3
  30. package/lnd_methods/onchain/send_to_chain_addresses.d.ts +2 -2
  31. package/lnd_methods/onchain/send_to_chain_output_scripts.d.ts +1 -1
  32. package/lnd_methods/onchain/send_to_chain_output_scripts.js +9 -2
  33. package/lnd_methods/onchain/set_autopilot.d.ts +5 -2
  34. package/lnd_methods/onchain/subscribe_to_chain_address.d.ts +2 -2
  35. package/lnd_methods/onchain/subscribe_to_chain_spend.d.ts +2 -2
  36. package/lnd_methods/unauthenticated/subscribe_to_wallet_status.js +0 -2
  37. package/lnd_responses/pending_as_pending_channels.js +0 -2
  38. package/lnd_responses/rpc_channel_as_channel.js +0 -6
  39. package/package.json +11 -10
  40. package/test/lnd_methods/address/test_create_chain_address.js +0 -5
  41. package/test/lnd_methods/offchain/test_get_channels.js +0 -7
  42. package/test/lnd_methods/offchain/test_subscribe_to_channels.js +0 -3
  43. package/test/lnd_responses/test_pending_as_pending_channels.js +0 -1
  44. package/test/lnd_responses/test_rpc_channel_as_channel.js +0 -7
  45. package/test/typescript/create_chain_address.test-d.ts +6 -1
  46. package/typescript/shared.d.ts +2 -2
  47. package/typescript/util.d.ts +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Versions
2
2
 
3
+ ## 5.1.1
4
+
5
+ - `openChannels`: Fix `cooperative_close_address` not being set on channels
6
+
7
+ ## 5.1.0
8
+
9
+ - Add support for LND 0.14.1
10
+ - `openChannels`: Add `is_avoiding_broadcast` to avoid all funding broadcast
11
+
12
+ ## 5.0.1
13
+
14
+ - `createChainAddress`: Fix type hints to reflect optionality of `format`
15
+
16
+ ## 5.0.0
17
+
18
+ - Removed support for determining the type of channel to support LND 0.14.0.
19
+
20
+ - `createChainAddress`: Make address format optional and add p2wpkh as default
21
+ - `sendToChainOutputScripts`: Fix specification of `fee_tokens_per_vbyte`
22
+
23
+ ### Breaking Changes
24
+
25
+ - `getChannels`, `getPendingChannels`, `subscribeToChannels`: Remove
26
+ attributes `is_anchor`, `is_static_remote_key`, `is_variable_remote_key`.
27
+
3
28
  ## 4.14.4
4
29
 
5
30
  - `getPayment`, `subscribeToPastPayment`: Add `pending` for pending payment details
package/README.md CHANGED
@@ -52,10 +52,6 @@ To access unauthenticated methods like the wallet unlocker, use
52
52
 
53
53
  ## Methods
54
54
 
55
- There are two libraries, [ln-service](https://github.com/alexbosworth/ln-service) and this library.
56
-
57
- Methods exported by this library support typescript, but ln-service includes additional metthods.
58
-
59
55
  - [addPeer](https://github.com/alexbosworth/ln-service#addpeer): Connect to a new peer
60
56
  - [authenticatedLndGrpc](https://github.com/alexbosworth/ln-service#authenticatedlndgrpc):
61
57
  Instantiate connection to authenticated lnd methods.
@@ -5,7 +5,7 @@ import {
5
5
 
6
6
  export type CreateChainAddressArgs = AuthenticatedLightningArgs<{
7
7
  /** Receive Address Type */
8
- format: 'np2wpkh' | 'p2wpkh';
8
+ format?: 'np2wpkh' | 'p2wpkh';
9
9
  /** Get As-Yet Unused Address */
10
10
  is_unused?: boolean;
11
11
  }>;
@@ -5,6 +5,7 @@ const addressFormats = require('./address_formats');
5
5
  const {isLnd} = require('./../../lnd_requests');
6
6
 
7
7
  const connectFailMessage = '14 UNAVAILABLE: Connect Failed';
8
+ const defaultAddressFormat = 'p2wpkh';
8
9
  const method = 'newAddress';
9
10
  const type = 'default';
10
11
 
@@ -13,7 +14,7 @@ const type = 'default';
13
14
  Requires `address:write` permission
14
15
 
15
16
  {
16
- format: <Receive Address Type String> // "np2wpkh" || "p2wpkh"
17
+ [format]: <Receive Address Type String> // "np2wpkh" || "p2wpkh"
17
18
  [is_unused]: <Get As-Yet Unused Address Bool>
18
19
  lnd: <Authenticated LND API Object>
19
20
  }
@@ -28,7 +29,7 @@ module.exports = (args, cbk) => {
28
29
  return asyncAuto({
29
30
  // Check arguments
30
31
  validate: cbk => {
31
- if (!args.format || addressFormats[args.format] === undefined) {
32
+ if (!!args.format && addressFormats[args.format] === undefined) {
32
33
  return cbk([400, 'ExpectedKnownAddressFormat']);
33
34
  }
34
35
 
@@ -41,11 +42,13 @@ module.exports = (args, cbk) => {
41
42
 
42
43
  // Type
43
44
  type: ['validate', ({}, cbk) => {
45
+ const format = args.format || defaultAddressFormat;
46
+
44
47
  if (!args.is_unused) {
45
- return cbk(null, addressFormats[args.format]);
48
+ return cbk(null, addressFormats[format]);
46
49
  }
47
50
 
48
- return cbk(null, addressFormats[`unused_${args.format}`]);
51
+ return cbk(null, addressFormats[`unused_${format}`]);
49
52
  }],
50
53
 
51
54
  // Get the address
@@ -24,6 +24,7 @@
24
24
  "4f567577db9d85b6f392f960b3aabddcad3cd02c": "0.13.3-beta",
25
25
  "52bb3f33707b81972c67937c7a89addcdf00991c": "0.10.1-beta",
26
26
  "596fd90ef310cd7abbf2251edaae9ba4d5f8a689": "0.13.1-beta",
27
+ "6042004edaaa5b3cad0a0808ff23dba4716f7178": "0.14.1-beta",
27
28
  "61c34683058f2cc8dc10f49392a0057440d831c4": "0.13.4-beta",
28
29
  "725ff104808f49f0a5247bfdb4b6b5da7f488d38": "0.13.0-beta",
29
30
  "7f34774529fa0964d47fc418d4d2965435cbfdc0": "0.11.1-beta",
@@ -31,7 +32,8 @@
31
32
  "86114c575c2dff9dff1e1bb4df961c64aea9fc1c": "0.10.4-beta",
32
33
  "d176d2d65fc06e6631c4dc9478592be8545a21de": "0.12.0-beta",
33
34
  "d233f61383f2f950aa06f5b09da5b0e78e784fae": "0.12.1-beta",
34
- "d62c575f8499a314eb27f12462d20500b6bda2c7": "0.10.3-beta"
35
+ "d62c575f8499a314eb27f12462d20500b6bda2c7": "0.10.3-beta",
36
+ "df0b82f0165f19bde8832bacd1e35544b0a2990d": "0.14.0-beta"
35
37
  },
36
38
  "weightedType": "weightedcomb",
37
39
  "wrongLnd": "12 UNIMPLEMENTED: unknown service autopilotrpc.Autopilot"
@@ -18,7 +18,7 @@ export type VerifyAccessResult = {
18
18
  /**
19
19
  * Verify an access token has a given set of permissions
20
20
  *
21
- * Note: this method is not supported in LND versions 0.13.3 and below
21
+ * Note: this method is not supported in LND versions 0.13.4 and below
22
22
  *
23
23
  * Requires `macaroon:read` permission
24
24
  */
@@ -14,7 +14,7 @@ const type = 'default';
14
14
 
15
15
  /** Verify an access token has a given set of permissions
16
16
 
17
- Note: this method is not supported in LND versions 0.13.3 and below
17
+ Note: this method is not supported in LND versions 0.13.4 and below
18
18
 
19
19
  Requires `macaroon:read` permission
20
20
 
@@ -40,8 +40,6 @@ export type GetChannelsResult = {
40
40
  is_partner_initiated: boolean;
41
41
  /** Channel Is Private */
42
42
  is_private: boolean;
43
- /** Remote Key Is Static */
44
- is_static_remote_key: boolean;
45
43
  /** Local Balance Tokens */
46
44
  local_balance: number;
47
45
  /** Local CSV Blocks Delay */
@@ -34,13 +34,10 @@ const type = 'default';
34
34
  [cooperative_close_delay_height]: <Deny Coop Close Until Height Number>
35
35
  id: <Standard Format Channel Id String>
36
36
  is_active: <Channel Active Bool>
37
- is_anchor: <Channel Supports Anchor Outputs Bool>
38
37
  is_closing: <Channel Is Closing Bool>
39
38
  is_opening: <Channel Is Opening Bool>
40
39
  is_partner_initiated: <Channel Partner Opened Channel Bool>
41
40
  is_private: <Channel Is Private Bool>
42
- is_static_remote_key: <Remote Key Is Static Bool>
43
- is_variable_remote_key: <Remote Key Is Variable Bool>
44
41
  local_balance: <Local Balance Tokens Number>
45
42
  [local_csv]: <Local CSV Blocks Delay Number>
46
43
  [local_dust]: <Remote Non-Enforceable Amount Tokens Number>
@@ -27,7 +27,6 @@ const type = 'default';
27
27
  pending_channels: [{
28
28
  [close_transaction_id]: <Channel Closing Transaction Id String>
29
29
  is_active: <Channel Is Active Bool>
30
- is_anchor: <Channel Is Anchor Channel Type Bool>
31
30
  is_closing: <Channel Is Closing Bool>
32
31
  is_opening: <Channel Is Opening Bool>
33
32
  is_partner_initiated: <Channel Partner Initiated Channel Bool>
@@ -2,9 +2,9 @@ import {
2
2
  AuthenticatedLightningArgs,
3
3
  AuthenticatedLightningMethod,
4
4
  } from '../../typescript';
5
- import {Xor} from '../../typescript/util';
5
+ import {MergeExclusive} from 'type-fest';
6
6
 
7
- type Tokens = Xor<
7
+ type Tokens = MergeExclusive<
8
8
  {
9
9
  /** Millitokens to Send */
10
10
  mtokens?: string;
@@ -21,7 +21,7 @@ export type SendMessageToPeerArgs =
21
21
  * If specified, message type is expected to be between 32768 and 65535
22
22
  * Message data should not be larger than 65533 bytes
23
23
  *
24
- * Note: this method is not supported in LND versions 0.13.3 and below
24
+ * Note: this method is not supported in LND versions 0.13.4 and below
25
25
  *
26
26
  * Requires `offchain:write` permission
27
27
  */
@@ -17,7 +17,7 @@ const type = 'default';
17
17
 
18
18
  Message data should not be larger than 65533 bytes
19
19
 
20
- Note: this method is not supported in LND versions 0.13.3 and below
20
+ Note: this method is not supported in LND versions 0.13.4 and below
21
21
 
22
22
  Requires `offchain:write` permission
23
23
 
@@ -89,8 +89,6 @@ export type SubscribeToChannelsChannelOpenedEvent = {
89
89
  is_partner_initiated: boolean;
90
90
  /** Channel Is Private */
91
91
  is_private: boolean;
92
- /** Remote Key Is Static */
93
- is_static_remote_key: boolean;
94
92
  /** Local Balance Tokens */
95
93
  local_balance: number;
96
94
  /** Local Initially Pushed Tokens */
@@ -83,13 +83,10 @@ const updateOpening = 'pending_open_channel';
83
83
  [cooperative_close_delay_height]: <Prevent Coop Close Until Height Number>
84
84
  id: <Standard Format Channel Id String>
85
85
  is_active: <Channel Active Bool>
86
- is_anchor: <Channel Supports Anchor Outputs Bool>
87
86
  is_closing: <Channel Is Closing Bool>
88
87
  is_opening: <Channel Is Opening Bool>
89
88
  is_partner_initiated: <Channel Partner Opened Channel Bool>
90
89
  is_private: <Channel Is Private Bool>
91
- is_static_remote_key: <Remote Key Is Static Bool>
92
- is_variable_remote_key: <Remote Key Is Variable Bool>
93
90
  local_balance: <Local Balance Tokens Number>
94
91
  local_given: <Local Initially Pushed Tokens Number>
95
92
  local_reserve: <Local Reserved Tokens Number>
@@ -2,75 +2,83 @@ import {
2
2
  AuthenticatedLightningArgs,
3
3
  AuthenticatedLightningSubscription,
4
4
  } from '../../typescript';
5
+ import {MergeExclusive} from 'type-fest';
5
6
 
6
- type SubscribeToPayWithDestination = {
7
+ export type SubscribeToPayWithDestinationArgs = {
7
8
  /** Destination Public Key String> */
8
9
  destination: string;
9
10
  /** Payment Request Hash Hex String> */
10
11
  id: string;
11
12
  /** Final CLTV Delta Number> */
12
13
  cltv_delta?: number;
13
- request?: never;
14
14
  };
15
15
 
16
- type SubscribeToPayWithRequest = {
16
+ export type SubscribeToPayWithRequestArgs = {
17
17
  /** BOLT 11 Payment Request String> */
18
18
  request: string;
19
- cltv_delta?: never;
19
+ };
20
+
21
+ export type SubscribeToPayWithDestinationOrRequestArgs = MergeExclusive<
22
+ SubscribeToPayWithDestinationArgs,
23
+ SubscribeToPayWithRequestArgs
24
+ >;
25
+
26
+ export type SubscribeToPayOptionsArgs = {
27
+ features?: {
28
+ /** Feature Bit Number> */
29
+ bit: number;
30
+ }[];
31
+ /** Pay Through Specific Final Hop Public Key Hex String> */
32
+ incoming_peer?: string;
33
+ /** Maximum Fee Tokens To Pay Number> */
34
+ max_fee?: number;
35
+ /** Maximum Fee Millitokens to Pay String> */
36
+ max_fee_mtokens?: string;
37
+ /** Maximum Millitokens For A Multi-Path Path */
38
+ max_path_mtokens?: string;
39
+ /** Maximum Simultaneous Paths Number> */
40
+ max_paths?: number;
41
+ /** Maximum Height of Payment Timeout Number> */
42
+ max_timeout_height?: number;
43
+ messages?: {
44
+ /** Message Type Number String> */
45
+ type: string;
46
+ /** Message Raw Value Hex Encoded String> */
47
+ value: string;
48
+ }[];
49
+ /** Millitokens to Pay String> */
50
+ mtokens?: string;
51
+ /** Pay Out of Outgoing Channel Id String> */
52
+ outgoing_channel?: string;
53
+ /** Pay Out of Outgoing Channel Ids String> */
54
+ outgoing_channels?: string[];
55
+ /** Time to Spend Finding a Route Milliseconds Number> */
56
+ pathfinding_timeout?: number;
57
+ /** Payment Identifier Hex String> */
58
+ payment?: string;
59
+ routes?: {
60
+ /** Base Routing Fee In Millitokens String> */
61
+ base_fee_mtokens?: string;
62
+ /** Standard Format Channel Id String> */
63
+ channel?: string;
64
+ /** CLTV Blocks Delta Number> */
65
+ cltv_delta?: number;
66
+ /** Fee Rate In Millitokens Per Million Number> */
67
+ fee_rate?: number;
68
+ /** Forward Edge Public Key Hex String> */
69
+ public_key: string;
70
+ }[][];
71
+ /** Tokens to Pay Number> */
72
+ tokens?: number;
20
73
  };
21
74
 
22
75
  export type SubscribeToPayArgs = AuthenticatedLightningArgs<
23
- (SubscribeToPayWithDestination | SubscribeToPayWithRequest) & {
24
- features?: {
25
- /** Feature Bit Number> */
26
- bit: number;
27
- }[];
28
- /** Pay Through Specific Final Hop Public Key Hex String> */
29
- incoming_peer?: string;
30
- /** Maximum Fee Tokens To Pay Number> */
31
- max_fee?: number;
32
- /** Maximum Fee Millitokens to Pay String> */
33
- max_fee_mtokens?: string;
34
- /** Maximum Millitokens For A Multi-Path Path */
35
- max_path_mtokens?: string;
36
- /** Maximum Simultaneous Paths Number> */
37
- max_paths?: number;
38
- /** Maximum Height of Payment Timeout Number> */
39
- max_timeout_height?: number;
40
- messages?: {
41
- /** Message Type Number String> */
42
- type: string;
43
- /** Message Raw Value Hex Encoded String> */
44
- value: string;
45
- }[];
46
- /** Millitokens to Pay String> */
47
- mtokens?: string;
48
- /** Pay Out of Outgoing Channel Id String> */
49
- outgoing_channel?: string;
50
- /** Pay Out of Outgoing Channel Ids String> */
51
- outgoing_channels?: string[];
52
- /** Time to Spend Finding a Route Milliseconds Number> */
53
- pathfinding_timeout?: number;
54
- /** Payment Identifier Hex String> */
55
- payment?: string;
56
- routes?: {
57
- /** Base Routing Fee In Millitokens String> */
58
- base_fee_mtokens?: string;
59
- /** Standard Format Channel Id String> */
60
- channel?: string;
61
- /** CLTV Blocks Delta Number> */
62
- cltv_delta?: number;
63
- /** Fee Rate In Millitokens Per Million Number> */
64
- fee_rate?: number;
65
- /** Forward Edge Public Key Hex String> */
66
- public_key: string;
67
- }[][];
68
- /** Tokens to Probe Number> */
69
- tokens?: number;
70
- }
76
+ SubscribeToPayWithDestinationOrRequestArgs & SubscribeToPayOptionsArgs
71
77
  >;
72
78
 
73
79
  export type SubscribeToPayConfirmedEvent = {
80
+ /** Payment Confirmed At ISO 8601 Date String */
81
+ confirmed_at: string;
74
82
  /** Total Fee Tokens Paid Rounded Down Number> */
75
83
  fee: number;
76
84
  /** Total Fee Millitokens Paid String> */
@@ -174,7 +182,103 @@ export type SubscribeToPayFailedEvent = {
174
182
  };
175
183
  };
176
184
 
177
- export type SubscribeToPayPayingEvent = {[key: string]: never};
185
+ export type SubscribeToPayPayingEvent = {
186
+ /** Payment Created At ISO 8601 Date String> */
187
+ created_at: string;
188
+ /** Payment Destination Hex String> */
189
+ destination: string;
190
+ /** Payment Hash Hex String> */
191
+ id: string;
192
+ /** Total Millitokens Pending String> */
193
+ mtokens: string;
194
+ paths: {
195
+ /** Total Fee Tokens Pending Number> */
196
+ fee: number;
197
+ /** Total Fee Millitokens Pending String> */
198
+ fee_mtokens: string;
199
+ hops: {
200
+ /** Standard Format Channel Id String> */
201
+ channel: string;
202
+ /** Channel Capacity Tokens Number> */
203
+ channel_capacity: number;
204
+ /** Fee Tokens Rounded Down Number> */
205
+ fee: number;
206
+ /** Fee Millitokens String> */
207
+ fee_mtokens: string;
208
+ /** Forward Tokens Number> */
209
+ forward: number;
210
+ /** Forward Millitokens String> */
211
+ forward_mtokens: string;
212
+ /** Public Key Hex String> */
213
+ public_key: string;
214
+ /** Timeout Block Height Number> */
215
+ timeout: number;
216
+ }[];
217
+ /** Total Millitokens Pending String> */
218
+ mtokens: string;
219
+ /** Total Fee Tokens Pending Rounded Up Number> */
220
+ safe_fee: number;
221
+ /** Total Tokens Pending, Rounded Up Number> */
222
+ safe_tokens: number;
223
+ /** Expiration Block Height Number> */
224
+ timeout: number;
225
+ }[];
226
+ /** BOLT 11 Encoded Payment Request String> */
227
+ request?: string;
228
+ /** Total Tokens Pending, Rounded Up Number> */
229
+ safe_tokens: number;
230
+ /** Expiration Block Height Number> */
231
+ timeout?: number;
232
+ /** Total Tokens Pending Rounded Down Number> */
233
+ tokens: number;
234
+ };
235
+
236
+ export type SubscribeToRoutingFailureEvent = {
237
+ /** Standard Format Channel Id String> */
238
+ channel?: string;
239
+ /** Failure Index Number> */
240
+ index: number;
241
+ /** Millitokens String> */
242
+ mtokens?: string;
243
+ /** Public Key Hex String> */
244
+ public_key?: string;
245
+ /** Failure Reason String> */
246
+ reason: string;
247
+ route: {
248
+ /** Total Route Fee Tokens To Pay Number> */
249
+ fee: number;
250
+ /** Total Route Fee Millitokens To Pay String> */
251
+ fee_mtokens: string;
252
+ hops: {
253
+ /** Standard Format Channel Id String> */
254
+ channel: string;
255
+ /** Channel Capacity Tokens Number> */
256
+ channel_capacity: number;
257
+ /** Fee Number> */
258
+ fee: number;
259
+ /** Fee Millitokens String> */
260
+ fee_mtokens: string;
261
+ /** Forward Tokens Number> */
262
+ forward: number;
263
+ /** Forward Millitokens String> */
264
+ forward_mtokens: string;
265
+ /** Public Key Hex String> */
266
+ public_key: string;
267
+ /** Timeout Block Height Number> */
268
+ timeout: number;
269
+ }[];
270
+ /** Total Route Millitokens String> */
271
+ mtokens: string;
272
+ /** Payment Identifier Hex String> */
273
+ payment?: string;
274
+ /** Expiration Block Height Number> */
275
+ timeout: number;
276
+ /** Total Route Tokens Number> */
277
+ tokens: number;
278
+ /** Total Millitokens String> */
279
+ total_mtokens?: string;
280
+ };
281
+ };
178
282
 
179
283
  /**
180
284
  * Initiate and subscribe to the outcome of a payment
@@ -1,146 +1,34 @@
1
+ import {SetOptional} from 'type-fest';
1
2
  import {
2
3
  AuthenticatedLightningArgs,
3
4
  AuthenticatedLightningSubscription,
4
5
  } from '../../typescript';
6
+ import {
7
+ SubscribeToPayConfirmedEvent,
8
+ SubscribeToPayFailedEvent,
9
+ SubscribeToPayOptionsArgs,
10
+ SubscribeToPayPayingEvent,
11
+ SubscribeToPayWithDestinationArgs,
12
+ SubscribeToRoutingFailureEvent,
13
+ } from './subscribe_to_pay';
14
+
15
+ export type SubscribeToPayViaDetailsArgs = AuthenticatedLightningArgs<
16
+ SetOptional<SubscribeToPayWithDestinationArgs, 'id'> &
17
+ SubscribeToPayOptionsArgs
18
+ >;
5
19
 
6
- export type SubscribeToPayViaDetailsArgs = AuthenticatedLightningArgs<{
7
- /** Final CLTV Delta */
8
- cltv_delta?: number;
9
- /** Destination Public Key */
10
- destination: string;
11
- features?: {
12
- /** Feature Bit */
13
- bit: number;
14
- }[];
15
- /** Payment Request Hash Hex */
16
- id?: string;
17
- /** Pay Through Specific Final Hop Public Key Hex */
18
- incoming_peer?: string;
19
- /** Maximum Fee Tokens To Pay */
20
- max_fee?: number;
21
- /** Maximum Fee Millitokens to Pay */
22
- max_fee_mtokens?: string;
23
- /** Maximum Millitokens For A Multi-Path Path */
24
- max_path_mtokens?: string;
25
- /** Maximum Simultaneous Paths */
26
- max_paths?: number;
27
- /** Maximum Height of Payment Timeout */
28
- max_timeout_height?: number;
29
- messages?: {
30
- /** Message Type number */
31
- type: string;
32
- /** Message Raw Value Hex Encoded */
33
- value: string;
34
- }[];
35
- /** Millitokens to Pay */
36
- mtokens?: string;
37
- /** Pay Out of Outgoing Channel Id */
38
- outgoing_channel?: string;
39
- /** Pay Out of Outgoing Channel Ids */
40
- outgoing_channels?: string[];
41
- /** Time to Spend Finding a Route Milliseconds */
42
- pathfinding_timeout?: number;
43
- /** Payment Identifier Hex String */
44
- payment?: string;
45
- routes?: [
46
- {
47
- /** Base Routing Fee In Millitokens */
48
- base_fee_mtokens?: string;
49
- /** Standard Format Channel Id */
50
- channel?: string;
51
- /** CLTV Blocks Delta */
52
- cltv_delta?: number;
53
- /** Fee Rate In Millitokens Per Million */
54
- fee_rate?: number;
55
- /** Forward Edge Public Key Hex */
56
- public_key: string;
57
- }[]
58
- ];
59
- /** Tokens to Pay */
60
- tokens?: number;
61
- }>;
20
+ export type SubscribeToPayViaDetailsConfirmedEvent =
21
+ SubscribeToPayConfirmedEvent;
62
22
 
63
- export type SubscribeToPayViaDetailsConfirmedEvent = {
64
- /** Confirmed at ISO-8601 Date */
65
- confirmed_at: string;
66
- /** Fee Tokens Paid */
67
- fee: number;
68
- /** Total Fee Millitokens Paid */
69
- fee_mtokens: string;
70
- hops: {
71
- /** Standard Format Channel Id */
72
- channel: string;
73
- /** Channel Capacity Tokens */
74
- channel_capacity: number;
75
- /** Fee Millitokens */
76
- fee_mtokens: string;
77
- /** Forward Millitokens */
78
- forward_mtokens: string;
79
- /** Public Key Hex */
80
- public_key: string;
81
- /** Timeout Block Height */
82
- timeout: number;
83
- }[];
84
- /** Payment Hash Hex */
85
- id?: string;
86
- /** Total Millitokens To Pay */
87
- mtokens: string;
88
- /** Payment Forwarding Fee Rounded Up Tokens */
89
- safe_fee: number;
90
- /** Payment Tokens Rounded Up */
91
- safe_tokens: number;
92
- /** Payment Preimage Hex */
93
- secret: string;
94
- /** Total Tokens Paid Rounded Down */
95
- tokens: number;
96
- };
23
+ export type SubscribeToPayViaDetailsFailedEvent = SubscribeToPayFailedEvent;
97
24
 
98
- export type SubscribeToPayViaDetailsFailedEvent = {
99
- /** Failed Due To Lack of Balance */
100
- is_insufficient_balance: boolean;
101
- /** Failed Due to Invalid Payment */
102
- is_invalid_payment: boolean;
103
- /** Failed Due to Pathfinding Timeout */
104
- is_pathfinding_timeout: boolean;
105
- /** Failed Due to Route Not Found */
106
- is_route_not_found: boolean;
107
- route?: {
108
- /** Route Total Fee Tokens Rounded Down */
109
- fee: number;
110
- /** Route Total Fee Millitokens */
111
- fee_mtokens: string;
112
- hops: {
113
- /** Standard Format Channel Id */
114
- channel: string;
115
- /** Channel Capacity Tokens */
116
- channel_capacity: number;
117
- /** Hop Forwarding Fee Rounded Down Tokens */
118
- fee: number;
119
- /** Hop Forwarding Fee Millitokens */
120
- fee_mtokens: string;
121
- /** Hop Forwarding Tokens Rounded Down */
122
- forward: number;
123
- /** Hop Forwarding Millitokens */
124
- forward_mtokens: string;
125
- /** Hop Sending To Public Key Hex */
126
- public_key: string;
127
- /** Hop CTLV Expiration Height */
128
- timeout: number;
129
- }[];
130
- /** Payment Sending Millitokens */
131
- mtokens: string;
132
- /** Payment Forwarding Fee Rounded Up Tokens */
133
- safe_fee: number;
134
- /** Payment Sending Tokens Rounded Up */
135
- safe_tokens: number;
136
- /** Payment CLTV Expiration Height */
137
- timeout: number;
138
- /** Payment Sending Tokens Rounded Down */
139
- tokens: number;
140
- };
141
- };
25
+ export type SubscribeToPayViaDetailsPayingEvent = Omit<
26
+ SubscribeToPayPayingEvent,
27
+ 'request'
28
+ >;
142
29
 
143
- export type SubscribeToPayViaDetailsPayingEvent = {[key: string]: never};
30
+ export type SubscribeToPayViaDetailsRoutingFailure =
31
+ SubscribeToRoutingFailureEvent;
144
32
 
145
33
  /**
146
34
  * Subscribe to the flight of a payment