lightning 10.26.3 → 10.27.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.
- package/CHANGELOG.md +5 -0
- package/lnd_methods/offchain/get_pending_channels.d.ts +16 -0
- package/lnd_methods/offchain/get_pending_channels.js +6 -0
- package/lnd_responses/pending_as_pending_channels.js +8 -0
- package/package.json +4 -4
- package/test/lnd_responses/test_pending_as_pending_channels.js +34 -1
package/CHANGELOG.md
CHANGED
|
@@ -69,6 +69,10 @@ export type GetPendingChannelsResult = {
|
|
|
69
69
|
transaction_weight?: number;
|
|
70
70
|
/** Channel Commitment Transaction Type */
|
|
71
71
|
type?: string;
|
|
72
|
+
/** Funding Seen At Best Block Height */
|
|
73
|
+
opening_funding_height?: number;
|
|
74
|
+
/** Open Activation Waiting Blocks Count */
|
|
75
|
+
opening_waiting_blocks?: number;
|
|
72
76
|
}[];
|
|
73
77
|
};
|
|
74
78
|
|
|
@@ -79,6 +83,18 @@ export type GetPendingChannelsResult = {
|
|
|
79
83
|
channel may be opening, closing, or active.
|
|
80
84
|
*
|
|
81
85
|
* Requires `offchain:read` permission
|
|
86
|
+
*
|
|
87
|
+
* `is_private` is not supported in LND 0.14.5 or before
|
|
88
|
+
*
|
|
89
|
+
* `description` is not supported in LND 0.16.4 or before
|
|
90
|
+
*
|
|
91
|
+
* `blocks_until_expiry` is not supported in LND 0.16.4 or before
|
|
92
|
+
*
|
|
93
|
+
* `close_transaction` is not supported in LND 0.17.5 or before
|
|
94
|
+
*
|
|
95
|
+
* `opening_funding_height` is not supported in LND 0.19.3 or before
|
|
96
|
+
*
|
|
97
|
+
* `opening_waiting_blocks` is not supported in LND 0.19.3 or before
|
|
82
98
|
*/
|
|
83
99
|
export const getPendingChannels: AuthenticatedLightningMethod<
|
|
84
100
|
{lnd: AuthenticatedLnd},
|
|
@@ -25,6 +25,10 @@ const type = 'default';
|
|
|
25
25
|
|
|
26
26
|
`close_transaction` is not supported in LND 0.17.5 or before
|
|
27
27
|
|
|
28
|
+
`opening_funding_height` is not supported in LND 0.19.3 or before
|
|
29
|
+
|
|
30
|
+
`opening_waiting_blocks` is not supported in LND 0.19.3 or before
|
|
31
|
+
|
|
28
32
|
{
|
|
29
33
|
lnd: <Authenticated LND API Object>
|
|
30
34
|
}
|
|
@@ -45,6 +49,8 @@ const type = 'default';
|
|
|
45
49
|
is_timelocked: <Channel Local Funds Constrained by Timelock Script Bool>
|
|
46
50
|
local_balance: <Channel Local Tokens Balance Number>
|
|
47
51
|
local_reserve: <Channel Local Reserved Tokens Number>
|
|
52
|
+
[opening_funding_height]: <Funding Seen At Best Block Height Number>
|
|
53
|
+
[opening_waiting_blocks]: <Open Activation Waiting Blocks Count Number>
|
|
48
54
|
partner_public_key: <Channel Peer Public Key String>
|
|
49
55
|
[pending_balance]: <Tokens Pending Recovery Number>
|
|
50
56
|
[pending_payments]: [{
|
|
@@ -41,6 +41,8 @@ const outpointSeparator = ':';
|
|
|
41
41
|
capacity: <Channel Capacity Tokens Count String>
|
|
42
42
|
channel_point: <Channel Outpoint String>
|
|
43
43
|
commitment_type: <Type of Channel String>
|
|
44
|
+
confirmation_height: <Best Chain Block Height Funding Seen Number>
|
|
45
|
+
confirmations_until_active: <Blocks Remaining to Channel Active Number>
|
|
44
46
|
initiator: <Channel Creator Status String>
|
|
45
47
|
local_balance: <Local Balance Tokens String>
|
|
46
48
|
local_chan_reserve_sat: <Local Side Channel Reserve Tokens String>
|
|
@@ -97,6 +99,8 @@ const outpointSeparator = ':';
|
|
|
97
99
|
is_timelocked: <Channel Local Funds Constrained by Timelock Script Bool>
|
|
98
100
|
local_balance: <Channel Local Tokens Balance Number>
|
|
99
101
|
local_reserve: <Channel Local Reserved Tokens Number>
|
|
102
|
+
[opening_funding_height]: <Funding Seen At Best Block Height Number>
|
|
103
|
+
[opening_waiting_blocks]: <Open Activation Waiting Blocks Count Number>
|
|
100
104
|
partner_public_key: <Channel Peer Public Key String>
|
|
101
105
|
[pending_balance]: <Tokens Pending Recovery Number>
|
|
102
106
|
[pending_payments]: [{
|
|
@@ -247,6 +251,8 @@ module.exports = args => {
|
|
|
247
251
|
|
|
248
252
|
sum[pending.channel.channel_point] = {
|
|
249
253
|
funding_expiry: Number(pending.funding_expiry_blocks) || undefined,
|
|
254
|
+
open_blocks: Number(pending.confirmations_until_active) || undefined,
|
|
255
|
+
open_height: Number(pending.confirmation_height) || undefined,
|
|
250
256
|
transaction_fee: Number(pending.commit_fee),
|
|
251
257
|
transaction_weight: Number(pending.commit_weight),
|
|
252
258
|
};
|
|
@@ -311,6 +317,8 @@ module.exports = args => {
|
|
|
311
317
|
is_timelocked: forced.timelock_blocks !== undefined,
|
|
312
318
|
local_balance: Number(channel.local_balance),
|
|
313
319
|
local_reserve: Number(channel.local_chan_reserve_sat),
|
|
320
|
+
opening_funding_height: !chanOpen ? undefined : chanOpen.open_height,
|
|
321
|
+
opening_waiting_blocks: !chanOpen ? undefined : chanOpen.open_blocks,
|
|
314
322
|
partner_public_key: channel.remote_node_pub,
|
|
315
323
|
pending_balance: pendingTokens || undefined,
|
|
316
324
|
pending_payments: forced.pending_payments || undefined,
|
package/package.json
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"url": "https://github.com/alexbosworth/lightning/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@grpc/grpc-js": "1.
|
|
10
|
+
"@grpc/grpc-js": "1.14.0",
|
|
11
11
|
"@grpc/proto-loader": "0.8.0",
|
|
12
|
-
"@types/node": "24.
|
|
12
|
+
"@types/node": "24.5.2",
|
|
13
13
|
"@types/request": "2.48.13",
|
|
14
14
|
"@types/ws": "8.18.1",
|
|
15
15
|
"async": "3.2.6",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"invoices": "4.0.0",
|
|
23
23
|
"psbt": "4.0.0",
|
|
24
24
|
"tiny-secp256k1": "2.2.4",
|
|
25
|
-
"type-fest": "5.0.
|
|
25
|
+
"type-fest": "5.0.1"
|
|
26
26
|
},
|
|
27
27
|
"description": "Lightning Network client library",
|
|
28
28
|
"devDependencies": {
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"directory": "test/typescript"
|
|
54
54
|
},
|
|
55
55
|
"types": "index.d.ts",
|
|
56
|
-
"version": "10.
|
|
56
|
+
"version": "10.27.1"
|
|
57
57
|
}
|
|
@@ -57,7 +57,8 @@ const makePendingForceClosingChannel = overrides => {
|
|
|
57
57
|
const makePendingOpenChannel = overrides => {
|
|
58
58
|
const res = {
|
|
59
59
|
channel: makeChannel({}),
|
|
60
|
-
confirmation_height:
|
|
60
|
+
confirmation_height: 0,
|
|
61
|
+
confirmations_until_active: 0,
|
|
61
62
|
commit_fee: '1',
|
|
62
63
|
commit_weight: '1',
|
|
63
64
|
fee_per_kw: '1',
|
|
@@ -114,6 +115,8 @@ const makeExpectedPending = overrides => {
|
|
|
114
115
|
is_timelocked: true,
|
|
115
116
|
local_balance: 1,
|
|
116
117
|
local_reserve: 1,
|
|
118
|
+
opening_funding_height: undefined,
|
|
119
|
+
opening_waiting_blocks: undefined,
|
|
117
120
|
partner_public_key: Buffer.alloc(33).toString('hex'),
|
|
118
121
|
pending_balance: 1,
|
|
119
122
|
pending_payments: [{
|
|
@@ -438,6 +441,36 @@ const tests = [
|
|
|
438
441
|
],
|
|
439
442
|
}),
|
|
440
443
|
},
|
|
444
|
+
{
|
|
445
|
+
args: makeArgs({
|
|
446
|
+
pending_force_closing_channels: [],
|
|
447
|
+
pending_open_channels: [
|
|
448
|
+
makePendingOpenChannel({
|
|
449
|
+
confirmation_height: 1,
|
|
450
|
+
confirmations_until_active: 3,
|
|
451
|
+
}),
|
|
452
|
+
],
|
|
453
|
+
waiting_close_channels: [],
|
|
454
|
+
}),
|
|
455
|
+
description: 'Pending open channels are mapped',
|
|
456
|
+
expected: makeExpected({
|
|
457
|
+
pending_channels: [
|
|
458
|
+
makeExpectedPending({
|
|
459
|
+
close_transaction_id: undefined,
|
|
460
|
+
is_closing: false,
|
|
461
|
+
is_opening: true,
|
|
462
|
+
is_timelocked: false,
|
|
463
|
+
opening_funding_height: 1,
|
|
464
|
+
opening_waiting_blocks: 3,
|
|
465
|
+
pending_balance: undefined,
|
|
466
|
+
pending_payments: undefined,
|
|
467
|
+
recovered_tokens: undefined,
|
|
468
|
+
timelock_blocks: undefined,
|
|
469
|
+
timelock_expiration: undefined,
|
|
470
|
+
}),
|
|
471
|
+
],
|
|
472
|
+
}),
|
|
473
|
+
},
|
|
441
474
|
];
|
|
442
475
|
|
|
443
476
|
tests.forEach(({args, description, error, expected}) => {
|