lightning 5.1.1 → 5.2.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,9 @@
1
1
  # Versions
2
2
 
3
+ ## 5.2.0
4
+
5
+ - `getPendingChannels`: Add support for channel `capacity`
6
+
3
7
  ## 5.1.1
4
8
 
5
9
  - `openChannels`: Fix `cooperative_close_address` not being set on channels
@@ -25,6 +25,7 @@ const type = 'default';
25
25
  @returns via cbk or Promise
26
26
  {
27
27
  pending_channels: [{
28
+ capacity: <Channel Capacity Tokens Number>
28
29
  [close_transaction_id]: <Channel Closing Transaction Id String>
29
30
  is_active: <Channel Is Active Bool>
30
31
  is_closing: <Channel Is Closing Bool>
@@ -68,6 +69,7 @@ module.exports = ({lnd}, cbk) => {
68
69
  return cbk();
69
70
  },
70
71
 
72
+ // Get pending channels
71
73
  getPending: ['validate', ({}, cbk) => {
72
74
  return lnd[type][method]({}, (err, res) => {
73
75
  if (!!err) {
@@ -26,11 +26,11 @@ const type = 'default';
26
26
  [give_tokens]: <Tokens to Gift To Partner Number> // Defaults to zero
27
27
  [is_private]: <Channel is Private Bool> // Defaults to false
28
28
  lnd: <Authenticated LND API Object>
29
- local_tokens: <Local Tokens Number>
29
+ local_tokens: <Total Channel Capacity Tokens Number>
30
30
  [min_confirmations]: <Spend UTXOs With Minimum Confirmations Number>
31
31
  [min_htlc_mtokens]: <Minimum HTLC Millitokens String>
32
- partner_public_key: <Public Key Hex String>
33
32
  [partner_csv_delay]: <Peer Output CSV Delay Number>
33
+ partner_public_key: <Public Key Hex String>
34
34
  [partner_socket]: <Peer Connection Host:Port String>
35
35
  }
36
36
 
@@ -39,8 +39,8 @@ const type = 'default';
39
39
  [give_tokens]: <Tokens to Gift To Partner Number> // Defaults to zero
40
40
  [is_private]: <Channel is Private Bool> // Defaults to false
41
41
  [min_htlc_mtokens]: <Minimum HTLC Millitokens String>
42
- partner_public_key: <Public Key Hex String>
43
42
  [partner_csv_delay]: <Peer Output CSV Delay Number>
43
+ partner_public_key: <Public Key Hex String>
44
44
  [partner_socket]: <Peer Connection Host:Port String>
45
45
  }]
46
46
  [is_avoiding_broadcast]: <Avoid Broadcast of All Channels Bool>
@@ -80,6 +80,7 @@ const outpointSeparator = ':';
80
80
  @returns
81
81
  {
82
82
  pending_channels: [{
83
+ capacity: <Channel Capacity Tokens Number>
83
84
  [close_transaction_id]: <Channel Closing Transaction Id String>
84
85
  is_active: <Channel Is Active Bool>
85
86
  is_closing: <Channel Is Closing Bool>
@@ -285,6 +286,7 @@ module.exports = args => {
285
286
  const pendingTokens = wait.pending_balance || forced.pending_balance;
286
287
 
287
288
  return {
289
+ capacity: Number(channel.capacity),
288
290
  close_transaction_id: endTx || undefined,
289
291
  is_active: false,
290
292
  is_closing: !chanOpen,
package/package.json CHANGED
@@ -10,9 +10,9 @@
10
10
  "@grpc/grpc-js": "1.4.4",
11
11
  "@grpc/proto-loader": "0.6.7",
12
12
  "@types/express": "4.17.13",
13
- "@types/node": "16.11.11",
13
+ "@types/node": "16.11.12",
14
14
  "@types/request": "2.48.7",
15
- "@types/ws": "8.2.1",
15
+ "@types/ws": "8.2.2",
16
16
  "async": "3.2.2",
17
17
  "asyncjs-util": "1.2.7",
18
18
  "bitcoinjs-lib": "6.0.1",
@@ -57,5 +57,5 @@
57
57
  "directory": "test/typescript"
58
58
  },
59
59
  "types": "index.d.ts",
60
- "version": "5.1.1"
60
+ "version": "5.2.0"
61
61
  }
@@ -99,6 +99,7 @@ const makeArgs = overrides => {
99
99
 
100
100
  const makeExpectedPending = overrides => {
101
101
  const res = {
102
+ capacity: 1,
102
103
  close_transaction_id: Buffer.alloc(32).toString('hex'),
103
104
  is_active: false,
104
105
  is_closing: true,