lightning 6.3.1 → 6.4.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 +9 -0
- package/lnd_messages/open_channel_request.js +10 -2
- package/lnd_methods/info/constants.json +1 -0
- package/lnd_methods/macaroon/subscribe_to_rpc_requests.js +2 -0
- package/lnd_methods/offchain/get_settlement_status.d.ts +1 -1
- package/lnd_methods/offchain/get_settlement_status.js +1 -1
- package/lnd_methods/offchain/subscribe_to_payments.d.ts +1 -1
- package/lnd_methods/offchain/subscribe_to_payments.js +1 -1
- package/lnd_methods/onchain/open_channel.d.ts +2 -2
- package/lnd_methods/onchain/open_channel.js +2 -2
- package/lnd_methods/onchain/open_channels.d.ts +2 -2
- package/lnd_methods/onchain/open_channels.js +2 -2
- package/package.json +4 -4
- package/test/lnd_messages/test_open_channel_request.js +2 -0
- package/test/lnd_methods/macaroon/test_handle_rpc_request_update.js +2 -0
- package/test/lnd_methods/macaroon/test_subscribe_to_rpc_requests.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Versions
|
|
2
2
|
|
|
3
|
+
## 6.4.0
|
|
4
|
+
|
|
5
|
+
- `subscribeToRpcRequests`: `open_channel_request` add support for
|
|
6
|
+
`fee_rate`, `base_fee_mtokens`
|
|
7
|
+
|
|
8
|
+
## 6.3.2
|
|
9
|
+
|
|
10
|
+
- `getWalletInfo`: Add support for LND 0.15.5
|
|
11
|
+
|
|
3
12
|
## 6.3.1
|
|
4
13
|
|
|
5
14
|
- `getSettlementStatus`: Add method to lookup received htlc settlement status
|
|
@@ -4,7 +4,9 @@ const minConfs = (isZero, confs) => isZero ? Number() : (confs || undefined);
|
|
|
4
4
|
/** Derive open channel details from an open channel request gRPC message
|
|
5
5
|
|
|
6
6
|
{
|
|
7
|
+
base_fee: <Set Channel Base Fee Millitokens String>
|
|
7
8
|
close_address: <Cooperative Close Address String>
|
|
9
|
+
fee_rate: <Set Channel Routing Fee Rate Millitoken Per Millitokens String>
|
|
8
10
|
local_funding_amount: <Channel Capacity Tokens String>
|
|
9
11
|
min_htlc_msat: <Minimum HTLC Millitokens String>
|
|
10
12
|
node_pubkey: <Node Public Key Buffer Object>
|
|
@@ -16,12 +18,16 @@ const minConfs = (isZero, confs) => isZero ? Number() : (confs || undefined);
|
|
|
16
18
|
sat_per_vbyte: <Tokens Per Virtual Byte String>
|
|
17
19
|
spend_unconfirmed: <Spend Unconfirmed UTXOs Bool>
|
|
18
20
|
target_conf: <Funding Transaction Confirmation Target Number>
|
|
21
|
+
use_base_fee: <Set Base Fee Bool>
|
|
22
|
+
use_fee_rate: <Set Fee Rate Bool>
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
@returns
|
|
22
26
|
{
|
|
27
|
+
[base_fee_mtokens]: <Routing Base Fee Millitokens Charged String>
|
|
23
28
|
[chain_fee_tokens_per_vbyte]: <Chain Fee Tokens Per VByte Number>
|
|
24
29
|
[cooperative_close_address]: <Restrict Cooperative Close To Address String>
|
|
30
|
+
[fee_rate]: <Routing Fee Rate In Millitokens Per Million Number>
|
|
25
31
|
[give_tokens]: <Tokens to Gift To Partner Number>
|
|
26
32
|
[is_private]: <Channel is Private Bool>
|
|
27
33
|
local_tokens: <Local Tokens Number>
|
|
@@ -32,14 +38,16 @@ const minConfs = (isZero, confs) => isZero ? Number() : (confs || undefined);
|
|
|
32
38
|
}
|
|
33
39
|
*/
|
|
34
40
|
module.exports = args => {
|
|
35
|
-
const
|
|
41
|
+
const chainFeeRate = Number(args.sat_per_vbyte) || Number(args.sat_per_byte);
|
|
36
42
|
const hasMinHtlc = args.min_htlc_msat !== Number().toString();
|
|
37
43
|
const publicKey = bufferAsHex(args.node_pubkey) || args.node_pubkey_string;
|
|
38
44
|
const utxoConfs = minConfs(args.spend_unconfirmed, args.min_confirmations);
|
|
39
45
|
|
|
40
46
|
return {
|
|
41
|
-
|
|
47
|
+
base_fee_mtokens: !!args.use_fee_rate ? args.base_fee : undefined,
|
|
48
|
+
chain_fee_tokens_per_vbyte: chainFeeRate || undefined,
|
|
42
49
|
cooperative_close_address: args.close_address || undefined,
|
|
50
|
+
fee_rate: !!args.use_fee_rate ? Number(args.fee_rate) : undefined,
|
|
43
51
|
give_tokens: Number(args.push_sat) || undefined,
|
|
44
52
|
is_private: args.private || undefined,
|
|
45
53
|
local_tokens: Number(args.local_funding_amount),
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"aff2ed3a6a118d664049835c325a5b69e977172f": "0.15.2-beta",
|
|
38
38
|
"b4e7131bdb47531ad2f00ce345ddcdb58935bba5": "0.15.3-beta",
|
|
39
39
|
"bd0c46b4fcb027af1915bd67a3da70e8ca5c6efe": "0.14.3-beta",
|
|
40
|
+
"c0a09209782b1c62c3393fcea0844e095c25046b": "0.15.5-beta",
|
|
40
41
|
"d176d2d65fc06e6631c4dc9478592be8545a21de": "0.12.0-beta",
|
|
41
42
|
"d233f61383f2f950aa06f5b09da5b0e78e784fae": "0.12.1-beta",
|
|
42
43
|
"d62c575f8499a314eb27f12462d20500b6bda2c7": "0.10.3-beta",
|
|
@@ -63,8 +63,10 @@ const type = 'default';
|
|
|
63
63
|
macaroon: <Base64 Encoded Macaroon String>
|
|
64
64
|
reject: ({message: <Rejection String>}, [cbk]) => {}
|
|
65
65
|
request: {
|
|
66
|
+
[base_fee_mtokens]: <Routing Base Fee Millitokens Charged String>
|
|
66
67
|
[chain_fee_tokens_per_vbyte]: <Chain Fee Tokens Per VByte Number>
|
|
67
68
|
[cooperative_close_address]: <Prefer Cooperative Close To Address String>
|
|
69
|
+
[fee_rate]: <Routing Fee Rate In Millitokens Per Million Number>
|
|
68
70
|
[give_tokens]: <Tokens to Gift To Partner Number>
|
|
69
71
|
[is_private]: <Channel is Private Bool>
|
|
70
72
|
local_tokens: <Local Tokens Number>
|
|
@@ -20,7 +20,7 @@ export type GetSettlementStatusResult = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Get the settlement status of a received HTLC
|
|
22
22
|
*
|
|
23
|
-
* Note: this method is not supported in LND versions 0.15.
|
|
23
|
+
* Note: this method is not supported in LND versions 0.15.5 and below
|
|
24
24
|
*
|
|
25
25
|
* Requires `offchain:read` permissions
|
|
26
26
|
*/
|
|
@@ -12,7 +12,7 @@ const type = 'default';
|
|
|
12
12
|
|
|
13
13
|
/** Get the settlement status of a received HTLC
|
|
14
14
|
|
|
15
|
-
Note: this method is not supported in LND versions 0.15.
|
|
15
|
+
Note: this method is not supported in LND versions 0.15.5 and below
|
|
16
16
|
|
|
17
17
|
Requires `offchain:read` permissions
|
|
18
18
|
|
|
@@ -17,6 +17,6 @@ export type SubscribeToPaymentsPaymentEvent =
|
|
|
17
17
|
*
|
|
18
18
|
* Requires `offchain:read` permission
|
|
19
19
|
*
|
|
20
|
-
* Note: Method not supported on LND 0.15.
|
|
20
|
+
* Note: Method not supported on LND 0.15.5 and below
|
|
21
21
|
*/
|
|
22
22
|
export const subscribeToPayments: AuthenticatedLightningSubscription<SubscribeToPaymentsArgs>;
|
|
@@ -50,8 +50,8 @@ export type OpenChannelResult = {
|
|
|
50
50
|
*
|
|
51
51
|
* External funding requires LND compiled with `walletrpc` build tag
|
|
52
52
|
*
|
|
53
|
-
* `base_fee_mtokens` is not supported on LND 0.15.
|
|
54
|
-
* `fee_rate` is not supported on LND 0.15.
|
|
53
|
+
* `base_fee_mtokens` is not supported on LND 0.15.5 and below
|
|
54
|
+
* `fee_rate` is not supported on LND 0.15.5 and below
|
|
55
55
|
*/
|
|
56
56
|
export const openChannel: AuthenticatedLightningMethod<
|
|
57
57
|
OpenChannelArgs,
|
|
@@ -20,8 +20,8 @@ const type = 'default';
|
|
|
20
20
|
|
|
21
21
|
External funding requires LND compiled with `walletrpc` build tag
|
|
22
22
|
|
|
23
|
-
`base_fee_mtokens` is not supported on LND 0.15.
|
|
24
|
-
`fee_rate` is not supported on LND 0.15.
|
|
23
|
+
`base_fee_mtokens` is not supported on LND 0.15.5 and below
|
|
24
|
+
`fee_rate` is not supported on LND 0.15.5 and below
|
|
25
25
|
|
|
26
26
|
{
|
|
27
27
|
[base_fee_mtokens]: <Routing Base Fee Millitokens Charged String>
|
|
@@ -56,8 +56,8 @@ channel that was not funded.
|
|
|
56
56
|
`--protocol.option-scid-alias` and `--protocol.zero-conf` set on both sides
|
|
57
57
|
as well as a channel open request listener to accept the trusted funding.
|
|
58
58
|
|
|
59
|
-
* `base_fee_mtokens` is not supported on LND 0.15.
|
|
60
|
-
* `fee_rate` is not supported on LND 0.15.
|
|
59
|
+
* `base_fee_mtokens` is not supported on LND 0.15.5 and below
|
|
60
|
+
* `fee_rate` is not supported on LND 0.15.5 and below
|
|
61
61
|
*/
|
|
62
62
|
export const openChannels: AuthenticatedLightningMethod<
|
|
63
63
|
OpenChannelsArgs,
|
|
@@ -37,8 +37,8 @@ const type = 'default';
|
|
|
37
37
|
`--protocol.option-scid-alias` and `--protocol.zero-conf` set on both sides
|
|
38
38
|
as well as a channel open request listener to accept the trusted funding.
|
|
39
39
|
|
|
40
|
-
`base_fee_mtokens` is not supported on LND 0.15.
|
|
41
|
-
`fee_rate` is not supported on LND 0.15.
|
|
40
|
+
`base_fee_mtokens` is not supported on LND 0.15.5 and below
|
|
41
|
+
`fee_rate` is not supported on LND 0.15.5 and below
|
|
42
42
|
|
|
43
43
|
{
|
|
44
44
|
channels: [{
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"@grpc/grpc-js": "1.7.3",
|
|
11
11
|
"@grpc/proto-loader": "0.7.3",
|
|
12
12
|
"@types/express": "4.17.14",
|
|
13
|
-
"@types/node": "18.11.
|
|
13
|
+
"@types/node": "18.11.11",
|
|
14
14
|
"@types/request": "2.48.8",
|
|
15
15
|
"@types/ws": "8.5.3",
|
|
16
16
|
"async": "3.2.4",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"invoices": "2.2.2",
|
|
27
27
|
"psbt": "2.7.1",
|
|
28
28
|
"tiny-secp256k1": "2.2.1",
|
|
29
|
-
"type-fest": "3.
|
|
29
|
+
"type-fest": "3.3.0"
|
|
30
30
|
},
|
|
31
31
|
"description": "Lightning Network client library",
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@alexbosworth/node-fetch": "2.6.2",
|
|
34
34
|
"@alexbosworth/tap": "15.0.11",
|
|
35
|
-
"tsd": "0.
|
|
35
|
+
"tsd": "0.25.0",
|
|
36
36
|
"typescript": "4.9.3",
|
|
37
37
|
"ws": "8.11.0"
|
|
38
38
|
},
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"directory": "test/typescript"
|
|
60
60
|
},
|
|
61
61
|
"types": "index.d.ts",
|
|
62
|
-
"version": "6.
|
|
62
|
+
"version": "6.4.0"
|
|
63
63
|
}
|
|
@@ -25,8 +25,10 @@ const makeArgs = overrides => {
|
|
|
25
25
|
|
|
26
26
|
const makeExpected = overrides => {
|
|
27
27
|
const args = {
|
|
28
|
+
base_fee_mtokens: undefined,
|
|
28
29
|
chain_fee_tokens_per_vbyte: 1,
|
|
29
30
|
cooperative_close_address: 'close_address',
|
|
31
|
+
fee_rate: undefined,
|
|
30
32
|
give_tokens: 1,
|
|
31
33
|
is_private: undefined,
|
|
32
34
|
local_tokens: 1,
|
|
@@ -99,8 +99,10 @@ const tests = [
|
|
|
99
99
|
id: 1,
|
|
100
100
|
macaroon: undefined,
|
|
101
101
|
request: {
|
|
102
|
+
base_fee_mtokens: undefined,
|
|
102
103
|
chain_fee_tokens_per_vbyte: 1,
|
|
103
104
|
cooperative_close_address: 'close_address',
|
|
105
|
+
fee_rate: undefined,
|
|
104
106
|
give_tokens: 1,
|
|
105
107
|
is_private: undefined,
|
|
106
108
|
local_tokens: 1,
|
|
@@ -191,8 +191,10 @@ const tests = [
|
|
|
191
191
|
macaroon: undefined,
|
|
192
192
|
reject: true,
|
|
193
193
|
request: {
|
|
194
|
+
base_fee_mtokens: undefined,
|
|
194
195
|
chain_fee_tokens_per_vbyte: 1,
|
|
195
196
|
cooperative_close_address: 'close_address',
|
|
197
|
+
fee_rate: undefined,
|
|
196
198
|
give_tokens: 1,
|
|
197
199
|
is_private: undefined,
|
|
198
200
|
local_tokens: 1,
|