lightning 9.6.0 → 9.7.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 +9 -0
- package/grpc/protos/lightning.proto +7 -0
- package/lnd_methods/macaroon/subscribe_to_rpc_requests.js +1 -1
- package/lnd_methods/offchain/get_channels.js +1 -1
- package/lnd_methods/offchain/get_pending_channels.d.ts +4 -0
- package/lnd_methods/offchain/get_pending_channels.js +6 -0
- package/lnd_methods/offchain/is_destination_payable.js +4 -3
- package/lnd_methods/offchain/subscribe_to_channels.js +1 -1
- package/lnd_methods/onchain/open_channel.js +2 -2
- package/lnd_methods/onchain/open_channels.js +1 -1
- package/lnd_methods/onchain/propose_channel.js +1 -1
- package/lnd_responses/pending_as_pending_channels.js +6 -0
- package/package.json +3 -3
- package/test/lnd_responses/test_pending_as_pending_channels.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Versions
|
|
2
2
|
|
|
3
|
+
## 9.7.1
|
|
4
|
+
|
|
5
|
+
- `isDestinationPayable`: Correct behavior for passing variations of amounts
|
|
6
|
+
|
|
7
|
+
## 9.7.0
|
|
8
|
+
|
|
9
|
+
- `getPendingChannels`: Add `description` to return pending channel description
|
|
10
|
+
- `getPendingChannels`: Add `is_private` to show pending channel announcement
|
|
11
|
+
|
|
3
12
|
## 9.6.0
|
|
4
13
|
|
|
5
14
|
- `getPendingChannels`: Add `type` to return pending channel type
|
|
@@ -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.
|
|
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.
|
|
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 */
|
|
@@ -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>
|
|
@@ -3,6 +3,7 @@ const {returnResult} = require('asyncjs-util');
|
|
|
3
3
|
|
|
4
4
|
const subscribeToPayViaDetails = require('./subscribe_to_pay_via_details');
|
|
5
5
|
|
|
6
|
+
const defaultMillitokens = '1000';
|
|
6
7
|
const defaultTokens = 1;
|
|
7
8
|
|
|
8
9
|
/** Determine if a payment destination is actually payable by probing it
|
|
@@ -56,7 +57,7 @@ module.exports = (args, cbk) => {
|
|
|
56
57
|
|
|
57
58
|
// Attempt payment
|
|
58
59
|
probe: ['validate', ({}, cbk) => {
|
|
59
|
-
const
|
|
60
|
+
const isDefaultTokens = !args.tokens && !args.mtokens;
|
|
60
61
|
|
|
61
62
|
const sub = subscribeToPayViaDetails({
|
|
62
63
|
cltv_delta: args.cltv_delta,
|
|
@@ -66,11 +67,11 @@ module.exports = (args, cbk) => {
|
|
|
66
67
|
max_fee: args.max_fee,
|
|
67
68
|
max_fee_mtokens: args.max_fee_mtokens,
|
|
68
69
|
max_timeout_height: args.max_timeout_height,
|
|
69
|
-
mtokens: args.mtokens,
|
|
70
|
+
mtokens: isDefaultTokens ? defaultMillitokens : args.mtokens,
|
|
70
71
|
outgoing_channel: args.outgoing_channel,
|
|
71
72
|
pathfinding_timeout: args.pathfinding_timeout,
|
|
72
73
|
routes: args.routes,
|
|
73
|
-
tokens:
|
|
74
|
+
tokens: isDefaultTokens ? defaultTokens : args.tokens,
|
|
74
75
|
});
|
|
75
76
|
|
|
76
77
|
const finished = (err, res) => {
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
43
|
+
`description` is not supported on LND 0.16.4 and below
|
|
44
44
|
|
|
45
45
|
{
|
|
46
46
|
channels: [{
|
|
@@ -17,6 +17,7 @@ const outpointSeparator = ':';
|
|
|
17
17
|
initiator: <Channel Creator Status String>
|
|
18
18
|
local_balance: <Local Balance Tokens String>
|
|
19
19
|
local_chan_reserve_sat: <Local Side Channel Reserve Tokens String>
|
|
20
|
+
memo: <Channel Description String>
|
|
20
21
|
remote_balance: <Remote Balance Tokens String>
|
|
21
22
|
remote_chan_reserve_sat: <Remote Side Channel Reserve Tokens String>
|
|
22
23
|
remote_node_pub: <Remote Node Public Key Hex String>
|
|
@@ -42,6 +43,7 @@ const outpointSeparator = ':';
|
|
|
42
43
|
initiator: <Channel Creator Status String>
|
|
43
44
|
local_balance: <Local Balance Tokens String>
|
|
44
45
|
local_chan_reserve_sat: <Local Side Channel Reserve Tokens String>
|
|
46
|
+
memo: <Channel Description String>
|
|
45
47
|
remote_balance: <Remote Balance Tokens String>
|
|
46
48
|
remote_chan_reserve_sat: <Remote Side Channel Reserve Tokens String>
|
|
47
49
|
remote_node_pub: <Remote Node Public Key Hex String>
|
|
@@ -59,6 +61,7 @@ const outpointSeparator = ':';
|
|
|
59
61
|
initiator: <Channel Creator Status String>
|
|
60
62
|
local_balance: <Local Balance Tokens String>
|
|
61
63
|
local_chan_reserve_sat: <Local Side Channel Reserve Tokens String>
|
|
64
|
+
memo: <Channel Description String>
|
|
62
65
|
remote_balance: <Remote Balance Tokens String>
|
|
63
66
|
remote_chan_reserve_sat: <Remote Side Channel Reserve Tokens String>
|
|
64
67
|
remote_node_pub: <Remote Node Public Key Hex String>
|
|
@@ -83,6 +86,7 @@ const outpointSeparator = ':';
|
|
|
83
86
|
pending_channels: [{
|
|
84
87
|
capacity: <Channel Capacity Tokens Number>
|
|
85
88
|
[close_transaction_id]: <Channel Closing Transaction Id String>
|
|
89
|
+
[description]: <Channel Description String>
|
|
86
90
|
is_active: <Channel Is Active Bool>
|
|
87
91
|
is_closing: <Channel Is Closing Bool>
|
|
88
92
|
is_opening: <Channel Is Opening Bool>
|
|
@@ -291,10 +295,12 @@ module.exports = args => {
|
|
|
291
295
|
return {
|
|
292
296
|
capacity: Number(channel.capacity),
|
|
293
297
|
close_transaction_id: endTx || undefined,
|
|
298
|
+
description: channel.memo || undefined,
|
|
294
299
|
is_active: false,
|
|
295
300
|
is_closing: !chanOpen,
|
|
296
301
|
is_opening: !!chanOpen,
|
|
297
302
|
is_partner_initiated: channel.initiator === remoteInitiator,
|
|
303
|
+
is_private: channel.private || undefined,
|
|
298
304
|
is_timelocked: forced.timelock_blocks !== undefined,
|
|
299
305
|
local_balance: Number(channel.local_balance),
|
|
300
306
|
local_reserve: Number(channel.local_chan_reserve_sat),
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"url": "https://github.com/alexbosworth/lightning/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@grpc/grpc-js": "1.8.
|
|
10
|
+
"@grpc/grpc-js": "1.8.16",
|
|
11
11
|
"@grpc/proto-loader": "0.7.7",
|
|
12
12
|
"@types/express": "4.17.17",
|
|
13
13
|
"@types/node": "20.3.1",
|
|
@@ -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.
|
|
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.
|
|
62
|
+
"version": "9.7.1"
|
|
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,
|