lightning 4.14.3 → 5.1.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/README.md +0 -4
  3. package/index.js +4 -4
  4. package/lnd_methods/address/create_chain_address.d.ts +1 -1
  5. package/lnd_methods/address/create_chain_address.js +7 -4
  6. package/lnd_methods/info/constants.json +3 -1
  7. package/lnd_methods/macaroon/verify_access.d.ts +1 -1
  8. package/lnd_methods/macaroon/verify_access.js +1 -1
  9. package/lnd_methods/offchain/disconnect_watchtower.d.ts +0 -2
  10. package/lnd_methods/offchain/disconnect_watchtower.js +0 -1
  11. package/lnd_methods/offchain/get_channels.d.ts +0 -2
  12. package/lnd_methods/offchain/get_channels.js +0 -3
  13. package/lnd_methods/offchain/get_pending_channels.js +0 -1
  14. package/lnd_methods/offchain/get_route_through_hops.d.ts +2 -2
  15. package/lnd_methods/offchain/send_message_to_peer.d.ts +1 -1
  16. package/lnd_methods/offchain/send_message_to_peer.js +1 -1
  17. package/lnd_methods/offchain/subscribe_to_channels.d.ts +0 -2
  18. package/lnd_methods/offchain/subscribe_to_channels.js +0 -3
  19. package/lnd_methods/offchain/subscribe_to_past_payment.js +5 -0
  20. package/lnd_methods/offchain/subscribe_to_pay.d.ts +157 -53
  21. package/lnd_methods/offchain/subscribe_to_pay_via_details.d.ts +23 -135
  22. package/lnd_methods/offchain/subscribe_to_pay_via_request.d.ts +21 -113
  23. package/lnd_methods/offchain/subscribe_to_pay_via_routes.d.ts +8 -6
  24. package/lnd_methods/offchain/update_connected_watchtower.d.ts +2 -2
  25. package/lnd_methods/offchain/update_routing_fees.d.ts +2 -2
  26. package/lnd_methods/onchain/close_channel.d.ts +8 -5
  27. package/lnd_methods/onchain/fund_pending_channels.js +13 -13
  28. package/lnd_methods/onchain/fund_psbt.d.ts +2 -2
  29. package/lnd_methods/onchain/open_channels.d.ts +2 -0
  30. package/lnd_methods/onchain/open_channels.js +15 -10
  31. package/lnd_methods/onchain/request_chain_fee_increase.d.ts +2 -2
  32. package/lnd_methods/onchain/script_from_chain_address.d.ts +3 -3
  33. package/lnd_methods/onchain/send_to_chain_address.d.ts +3 -3
  34. package/lnd_methods/onchain/send_to_chain_addresses.d.ts +2 -2
  35. package/lnd_methods/onchain/send_to_chain_output_scripts.d.ts +1 -1
  36. package/lnd_methods/onchain/send_to_chain_output_scripts.js +9 -2
  37. package/lnd_methods/onchain/set_autopilot.d.ts +5 -2
  38. package/lnd_methods/onchain/subscribe_to_chain_address.d.ts +2 -2
  39. package/lnd_methods/onchain/subscribe_to_chain_spend.d.ts +2 -2
  40. package/lnd_methods/unauthenticated/subscribe_to_wallet_status.js +0 -2
  41. package/lnd_responses/pending_as_pending_channels.js +0 -2
  42. package/lnd_responses/rpc_channel_as_channel.js +0 -6
  43. package/package.json +10 -9
  44. package/test/lnd_methods/address/test_create_chain_address.js +0 -5
  45. package/test/lnd_methods/offchain/test_get_channels.js +0 -7
  46. package/test/lnd_methods/offchain/test_get_payment.js +2 -0
  47. package/test/lnd_methods/offchain/test_subscribe_to_channels.js +0 -3
  48. package/test/lnd_responses/test_pending_as_pending_channels.js +0 -1
  49. package/test/lnd_responses/test_rpc_channel_as_channel.js +0 -7
  50. package/test/typescript/create_chain_address.test-d.ts +6 -1
  51. package/test/typescript/disconnect_watchtower.test-d.ts +0 -6
  52. package/typescript/shared.d.ts +2 -2
  53. package/typescript/util.d.ts +0 -7
package/CHANGELOG.md CHANGED
@@ -1,6 +1,27 @@
1
1
  # Versions
2
2
 
3
- ## 4.14.3
3
+ ## 5.1.0
4
+
5
+ - Add support for LND 0.14.1
6
+ - `openChannels`: Add `is_avoiding_broadcast` to avoid all funding broadcast
7
+
8
+ ## 5.0.1
9
+
10
+ - `createChainAddress`: Fix type hints to reflect optionality of `format`
11
+
12
+ ## 5.0.0
13
+
14
+ - Removed support for determining the type of channel to support LND 0.14.0.
15
+
16
+ - `createChainAddress`: Make address format optional and add p2wpkh as default
17
+ - `sendToChainOutputScripts`: Fix specification of `fee_tokens_per_vbyte`
18
+
19
+ ### Breaking Changes
20
+
21
+ - `getChannels`, `getPendingChannels`, `subscribeToChannels`: Remove
22
+ attributes `is_anchor`, `is_static_remote_key`, `is_variable_remote_key`.
23
+
24
+ ## 4.14.4
4
25
 
5
26
  - `getPayment`, `subscribeToPastPayment`: Add `pending` for pending payment details
6
27
 
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.
package/index.js CHANGED
@@ -75,10 +75,10 @@ const {lndGateway} = require('./lnd_gateway');
75
75
  const {lockUtxo} = require('./lnd_methods');
76
76
  const {openChannel} = require('./lnd_methods');
77
77
  const {openChannels} = require('./lnd_methods');
78
+ const {pay} = require('./lnd_methods');
78
79
  const {payViaPaymentDetails} = require('./lnd_methods');
79
80
  const {payViaPaymentRequest} = require('./lnd_methods');
80
81
  const {payViaRoutes} = require('./lnd_methods');
81
- const {pay} = require('./lnd_methods');
82
82
  const {prepareForChannelProposal} = require('./lnd_methods');
83
83
  const {probeForRoute} = require('./lnd_methods');
84
84
  const {proposeChannel} = require('./lnd_methods');
@@ -123,8 +123,8 @@ const {subscribeToWalletStatus} = require('./lnd_methods');
123
123
  const {unauthenticatedLndGrpc} = require('./lnd_grpc');
124
124
  const {unlockUtxo} = require('./lnd_methods');
125
125
  const {unlockWallet} = require('./lnd_methods');
126
- const {updateConnectedWatchtower} = require('./lnd_methods');
127
126
  const {updateChainTransaction} = require('./lnd_methods');
127
+ const {updateConnectedWatchtower} = require('./lnd_methods');
128
128
  const {updatePathfindingSettings} = require('./lnd_methods');
129
129
  const {updateRoutingFees} = require('./lnd_methods');
130
130
  const {verifyAccess} = require('./lnd_methods');
@@ -211,10 +211,10 @@ module.exports = {
211
211
  lockUtxo,
212
212
  openChannel,
213
213
  openChannels,
214
+ pay,
214
215
  payViaPaymentDetails,
215
216
  payViaPaymentRequest,
216
217
  payViaRoutes,
217
- pay,
218
218
  prepareForChannelProposal,
219
219
  probeForRoute,
220
220
  proposeChannel,
@@ -259,8 +259,8 @@ module.exports = {
259
259
  unauthenticatedLndGrpc,
260
260
  unlockUtxo,
261
261
  unlockWallet,
262
- updateConnectedWatchtower,
263
262
  updateChainTransaction,
263
+ updateConnectedWatchtower,
264
264
  updatePathfindingSettings,
265
265
  updateRoutingFees,
266
266
  verifyAccess,
@@ -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
 
@@ -6,8 +6,6 @@ import {
6
6
  export type DisconnectWatchtowerArgs = AuthenticatedLightningArgs<{
7
7
  /** Watchtower Public Key Hex String */
8
8
  public_key: string;
9
- /** Retry Delay Milliseconds Number */
10
- retry_delay?: number;
11
9
  }>;
12
10
 
13
11
  /**
@@ -17,7 +17,6 @@ const unimplementedError = '12 UNIMPLEMENTED: unknown service wtclientrpc.Watcht
17
17
  {
18
18
  lnd: <Authenticated LND API Object>
19
19
  public_key: <Watchtower Public Key Hex String>
20
- [retry_delay]: <Retry Delay Milliseconds Number>
21
20
  }
22
21
 
23
22
  @returns via cbk or Promise
@@ -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>
@@ -8,10 +8,12 @@ const {confirmedFromPayment} = require('./../../lnd_responses');
8
8
  const {confirmedFromPaymentStatus} = require('./../../lnd_responses');
9
9
  const emitPayment = require('./emit_payment');
10
10
  const {failureFromPayment} = require('./../../lnd_responses');
11
+ const {handleRemoveListener} = require('./../../grpc');
11
12
  const {isLnd} = require('./../../lnd_requests');
12
13
  const {safeTokens} = require('./../../bolt00');
13
14
  const {states} = require('./payment_states');
14
15
 
16
+ const events = ['confirmed', 'failed', 'paying'];
15
17
  const hexToBuffer = hex => Buffer.from(hex, 'hex');
16
18
  const {isArray} = Array;
17
19
  const isHash = n => /^[0-9A-F]{64}$/i.test(n);
@@ -141,6 +143,9 @@ module.exports = args => {
141
143
 
142
144
  const sub = args.lnd[type][method]({payment_hash: hash});
143
145
 
146
+ // Terminate subscription when all listeners are removed
147
+ handleRemoveListener({emitter, events, subscription: sub});
148
+
144
149
  sub.on('data', data => emitPayment({data, emitter}));
145
150
  sub.on('end', () => emitter.emit('end'));
146
151
  sub.on('error', err => emitError(err));
@@ -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