lightning 9.5.1 → 9.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Versions
2
2
 
3
+ ## 9.7.0
4
+
5
+ - `getPendingChannels`: Add `description` to return pending channel description
6
+ - `getPendingChannels`: Add `is_private` to show pending channel announcement
7
+
8
+ ## 9.6.0
9
+
10
+ - `getPendingChannels`: Add `type` to return pending channel type
11
+
3
12
  ## 9.5.1
4
13
 
5
14
  - `getPendingChannels`: Fix returning closing transaction id for waiting close
@@ -2552,6 +2552,13 @@ message PendingChannelsResponse {
2552
2552
 
2553
2553
  // Whether this channel is advertised to the network or not.
2554
2554
  bool private = 12;
2555
+
2556
+ /*
2557
+ An optional note-to-self to go along with the channel containing some
2558
+ useful information. This is only ever stored locally and in no way
2559
+ impacts the channel's operation.
2560
+ */
2561
+ string memo = 13;
2555
2562
  }
2556
2563
 
2557
2564
  message PendingOpenChannel {
@@ -24,7 +24,7 @@ const type = 'default';
24
24
 
25
25
  This method is not supported in LND 0.13.4 and below
26
26
 
27
- `description` is not supported on LND 0.16.3 and below
27
+ `description` is not supported on LND 0.16.4 and below
28
28
 
29
29
  {
30
30
  [id]: <RPC Middleware Interception Name String>
@@ -17,7 +17,7 @@ const type = 'default';
17
17
 
18
18
  `is_trusted_funding` is not supported on LND 0.15.0 and below
19
19
 
20
- `description` is not supported on LND 0.16.3 and below
20
+ `description` is not supported on LND 0.16.4 and below
21
21
 
22
22
  {
23
23
  [is_active]: <Limit Results To Only Active Channels Bool> // false
@@ -7,6 +7,8 @@ export type GetPendingChannelsResult = {
7
7
  capacity: number;
8
8
  /** Channel Closing Transaction Id */
9
9
  close_transaction_id?: string;
10
+ /** Channel Description */
11
+ description?: string;
10
12
  /** Channel Is Active */
11
13
  is_active: boolean;
12
14
  /** Channel Is Closing */
@@ -15,6 +17,8 @@ export type GetPendingChannelsResult = {
15
17
  is_opening: boolean;
16
18
  /** Channel Partner Initiated Channel */
17
19
  is_partner_initiated?: boolean;
20
+ /** Channel Is Not Announced */
21
+ is_private?: boolean;
18
22
  /** Channel Local Funds Constrained by Timelock */
19
23
  is_timelocked: boolean;
20
24
  /** Channel Local Tokens Balance */
@@ -59,6 +63,8 @@ export type GetPendingChannelsResult = {
59
63
  transaction_vout: number;
60
64
  /** Funding Transaction Weight */
61
65
  transaction_weight?: number;
66
+ /** Channel Commitment Transaction Type */
67
+ type?: string;
62
68
  }[];
63
69
  };
64
70
 
@@ -17,6 +17,10 @@ const type = 'default';
17
17
 
18
18
  Requires `offchain:read` permission
19
19
 
20
+ `is_private` is not supported in LND 0.14.5 or before
21
+
22
+ `description` is not supported in LND 0.16.4 or before
23
+
20
24
  {
21
25
  lnd: <Authenticated LND API Object>
22
26
  }
@@ -26,10 +30,12 @@ const type = 'default';
26
30
  pending_channels: [{
27
31
  capacity: <Channel Capacity Tokens Number>
28
32
  [close_transaction_id]: <Channel Closing Transaction Id String>
33
+ [description]: <Channel Description String>
29
34
  is_active: <Channel Is Active Bool>
30
35
  is_closing: <Channel Is Closing Bool>
31
36
  is_opening: <Channel Is Opening Bool>
32
37
  is_partner_initiated: <Channel Partner Initiated Channel Bool>
38
+ [is_private]: <Channel Is Private Bool>
33
39
  is_timelocked: <Channel Local Funds Constrained by Timelock Script Bool>
34
40
  local_balance: <Channel Local Tokens Balance Number>
35
41
  local_reserve: <Channel Local Reserved Tokens Number>
@@ -53,6 +59,7 @@ const type = 'default';
53
59
  transaction_id: <Channel Funding Transaction Id String>
54
60
  transaction_vout: <Channel Funding Transaction Vout Number>
55
61
  [transaction_weight]: <Commit Transaction Weight Number>
62
+ [type]: <Channel Commitment Transaction Type String>
56
63
  }]
57
64
  }
58
65
  */
@@ -31,7 +31,7 @@ const updateOpening = 'pending_open_channel';
31
31
 
32
32
  `is_trusted_funding`, `other_ids` are not supported on LND 0.15.0 and below
33
33
 
34
- `description` is not supported on LND 0.16.3 and below
34
+ `description` is not supported on LND 0.16.4 and below
35
35
 
36
36
  @throws
37
37
  <Error>
@@ -24,9 +24,9 @@ const type = 'default';
24
24
  `base_fee_mtokens` is not supported on LND 0.15.5 and below
25
25
  `fee_rate` is not supported on LND 0.15.5 and below
26
26
 
27
- `is_max_funding` is not supported on LND 0.16.3 and below
27
+ `is_max_funding` is not supported on LND 0.16.4 and below
28
28
 
29
- `description` is not supported on LND 0.16.3 and below
29
+ `description` is not supported on LND 0.16.4 and below
30
30
 
31
31
  {
32
32
  [base_fee_mtokens]: <Routing Base Fee Millitokens Charged String>
@@ -40,7 +40,7 @@ const type = 'default';
40
40
  `base_fee_mtokens` is not supported on LND 0.15.5 and below
41
41
  `fee_rate` is not supported on LND 0.15.5 and below
42
42
 
43
- `description` is not supported on LND 0.16.3 and below
43
+ `description` is not supported on LND 0.16.4 and below
44
44
 
45
45
  {
46
46
  channels: [{
@@ -19,7 +19,7 @@ const type = 'default';
19
19
 
20
20
  Requires LND compiled with `walletrpc` build tag
21
21
 
22
- `description` is not supported on LND 0.16.3 and below
22
+ `description` is not supported on LND 0.16.4 and below
23
23
 
24
24
  {
25
25
  capacity: <Channel Capacity Tokens Number>
@@ -1,4 +1,5 @@
1
- const anchorChannelType = 'ANCHORS';
1
+ const {channelTypes} = require('./constants');
2
+
2
3
  const {isArray} = Array;
3
4
  const remoteInitiator = 'INITIATOR_REMOTE';
4
5
  const outpointSeparator = ':';
@@ -16,6 +17,7 @@ const outpointSeparator = ':';
16
17
  initiator: <Channel Creator Status String>
17
18
  local_balance: <Local Balance Tokens String>
18
19
  local_chan_reserve_sat: <Local Side Channel Reserve Tokens String>
20
+ memo: <Channel Description String>
19
21
  remote_balance: <Remote Balance Tokens String>
20
22
  remote_chan_reserve_sat: <Remote Side Channel Reserve Tokens String>
21
23
  remote_node_pub: <Remote Node Public Key Hex String>
@@ -41,6 +43,7 @@ const outpointSeparator = ':';
41
43
  initiator: <Channel Creator Status String>
42
44
  local_balance: <Local Balance Tokens String>
43
45
  local_chan_reserve_sat: <Local Side Channel Reserve Tokens String>
46
+ memo: <Channel Description String>
44
47
  remote_balance: <Remote Balance Tokens String>
45
48
  remote_chan_reserve_sat: <Remote Side Channel Reserve Tokens String>
46
49
  remote_node_pub: <Remote Node Public Key Hex String>
@@ -58,6 +61,7 @@ const outpointSeparator = ':';
58
61
  initiator: <Channel Creator Status String>
59
62
  local_balance: <Local Balance Tokens String>
60
63
  local_chan_reserve_sat: <Local Side Channel Reserve Tokens String>
64
+ memo: <Channel Description String>
61
65
  remote_balance: <Remote Balance Tokens String>
62
66
  remote_chan_reserve_sat: <Remote Side Channel Reserve Tokens String>
63
67
  remote_node_pub: <Remote Node Public Key Hex String>
@@ -82,6 +86,7 @@ const outpointSeparator = ':';
82
86
  pending_channels: [{
83
87
  capacity: <Channel Capacity Tokens Number>
84
88
  [close_transaction_id]: <Channel Closing Transaction Id String>
89
+ [description]: <Channel Description String>
85
90
  is_active: <Channel Is Active Bool>
86
91
  is_closing: <Channel Is Closing Bool>
87
92
  is_opening: <Channel Is Opening Bool>
@@ -109,6 +114,7 @@ const outpointSeparator = ':';
109
114
  transaction_id: <Channel Funding Transaction Id String>
110
115
  transaction_vout: <Channel Funding Transaction Vout Number>
111
116
  [transaction_weight]: <Commit Transaction Weight Number>
117
+ [type]: <Channel Commitment Transaction Type String>
112
118
  }]
113
119
  }
114
120
  */
@@ -289,10 +295,12 @@ module.exports = args => {
289
295
  return {
290
296
  capacity: Number(channel.capacity),
291
297
  close_transaction_id: endTx || undefined,
298
+ description: channel.memo || undefined,
292
299
  is_active: false,
293
300
  is_closing: !chanOpen,
294
301
  is_opening: !!chanOpen,
295
302
  is_partner_initiated: channel.initiator === remoteInitiator,
303
+ is_private: channel.private || undefined,
296
304
  is_timelocked: forced.timelock_blocks !== undefined,
297
305
  local_balance: Number(channel.local_balance),
298
306
  local_reserve: Number(channel.local_chan_reserve_sat),
@@ -310,6 +318,7 @@ module.exports = args => {
310
318
  transaction_id: txId,
311
319
  transaction_vout: Number(vout),
312
320
  transaction_weight: !chanOpen ? null : chanOpen.transaction_weight,
321
+ type: channelTypes[channel.commitment_type],
313
322
  };
314
323
  });
315
324
 
package/package.json CHANGED
@@ -7,15 +7,15 @@
7
7
  "url": "https://github.com/alexbosworth/lightning/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@grpc/grpc-js": "1.8.15",
10
+ "@grpc/grpc-js": "1.8.16",
11
11
  "@grpc/proto-loader": "0.7.7",
12
12
  "@types/express": "4.17.17",
13
- "@types/node": "20.2.5",
13
+ "@types/node": "20.3.1",
14
14
  "@types/request": "2.48.8",
15
- "@types/ws": "8.5.4",
15
+ "@types/ws": "8.5.5",
16
16
  "async": "3.2.4",
17
17
  "asyncjs-util": "1.2.11",
18
- "bitcoinjs-lib": "6.1.2",
18
+ "bitcoinjs-lib": "6.1.3",
19
19
  "bn.js": "5.2.1",
20
20
  "body-parser": "1.20.2",
21
21
  "bolt07": "1.8.3",
@@ -26,7 +26,7 @@
26
26
  "invoices": "2.2.3",
27
27
  "psbt": "2.7.2",
28
28
  "tiny-secp256k1": "2.2.2",
29
- "type-fest": "3.11.1"
29
+ "type-fest": "3.12.0"
30
30
  },
31
31
  "description": "Lightning Network client library",
32
32
  "devDependencies": {
@@ -59,5 +59,5 @@
59
59
  "directory": "test/typescript"
60
60
  },
61
61
  "types": "index.d.ts",
62
- "version": "9.5.1"
62
+ "version": "9.7.0"
63
63
  }
@@ -101,10 +101,12 @@ const makeExpectedPending = overrides => {
101
101
  const res = {
102
102
  capacity: 1,
103
103
  close_transaction_id: Buffer.alloc(32).toString('hex'),
104
+ description: undefined,
104
105
  is_active: false,
105
106
  is_closing: true,
106
107
  is_opening: false,
107
108
  is_partner_initiated: true,
109
+ is_private: undefined,
108
110
  is_timelocked: true,
109
111
  local_balance: 1,
110
112
  local_reserve: 1,
@@ -128,6 +130,7 @@ const makeExpectedPending = overrides => {
128
130
  transaction_id: Buffer.alloc(32).toString('hex'),
129
131
  transaction_vout: 1,
130
132
  transaction_weight: 1,
133
+ type: 'original_with_static_to_remote',
131
134
  };
132
135
 
133
136
  Object.keys(overrides || {}).forEach(key => res[key] = overrides[key]);