lightning 9.5.0 → 9.6.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,13 @@
1
1
  # Versions
2
2
 
3
+ ## 9.6.0
4
+
5
+ - `getPendingChannels`: Add `type` to return pending channel type
6
+
7
+ ## 9.5.1
8
+
9
+ - `getPendingChannels`: Fix returning closing transaction id for waiting close
10
+
3
11
  ## 9.5.0
4
12
 
5
13
  - `getWalletInfo`: Add support for LND 0.16.3
@@ -59,6 +59,8 @@ export type GetPendingChannelsResult = {
59
59
  transaction_vout: number;
60
60
  /** Funding Transaction Weight */
61
61
  transaction_weight?: number;
62
+ /** Channel Commitment Transaction Type */
63
+ type?: string;
62
64
  }[];
63
65
  };
64
66
 
@@ -53,6 +53,7 @@ const type = 'default';
53
53
  transaction_id: <Channel Funding Transaction Id String>
54
54
  transaction_vout: <Channel Funding Transaction Vout Number>
55
55
  [transaction_weight]: <Commit Transaction Weight Number>
56
+ [type]: <Channel Commitment Transaction Type String>
56
57
  }]
57
58
  }
58
59
  */
@@ -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 = ':';
@@ -109,6 +110,7 @@ const outpointSeparator = ':';
109
110
  transaction_id: <Channel Funding Transaction Id String>
110
111
  transaction_vout: <Channel Funding Transaction Vout Number>
111
112
  [transaction_weight]: <Commit Transaction Weight Number>
113
+ [type]: <Channel Commitment Transaction Type String>
112
114
  }]
113
115
  }
114
116
  */
@@ -263,6 +265,7 @@ module.exports = args => {
263
265
  }
264
266
 
265
267
  sum[pending.channel.channel_point] = {
268
+ close_transaction_id: pending.closing_txid,
266
269
  pending_balance: Number(pending.limbo_balance),
267
270
  };
268
271
 
@@ -282,7 +285,7 @@ module.exports = args => {
282
285
  const [txId, vout] = channel.channel_point.split(outpointSeparator);
283
286
  const wait = waitClosing[channel.channel_point] || {};
284
287
 
285
- const endTx = forced.close_transaction_id;
288
+ const endTx = forced.close_transaction_id || wait.close_transaction_id;
286
289
  const pendingTokens = wait.pending_balance || forced.pending_balance;
287
290
 
288
291
  return {
@@ -309,6 +312,7 @@ module.exports = args => {
309
312
  transaction_id: txId,
310
313
  transaction_vout: Number(vout),
311
314
  transaction_weight: !chanOpen ? null : chanOpen.transaction_weight,
315
+ type: channelTypes[channel.commitment_type],
312
316
  };
313
317
  });
314
318
 
package/package.json CHANGED
@@ -10,12 +10,12 @@
10
10
  "@grpc/grpc-js": "1.8.15",
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",
@@ -59,5 +59,5 @@
59
59
  "directory": "test/typescript"
60
60
  },
61
61
  "types": "index.d.ts",
62
- "version": "9.5.0"
62
+ "version": "9.6.0"
63
63
  }
@@ -128,6 +128,7 @@ const makeExpectedPending = overrides => {
128
128
  transaction_id: Buffer.alloc(32).toString('hex'),
129
129
  transaction_vout: 1,
130
130
  transaction_weight: 1,
131
+ type: 'original_with_static_to_remote',
131
132
  };
132
133
 
133
134
  Object.keys(overrides || {}).forEach(key => res[key] = overrides[key]);