ln-service 53.22.0 → 54.0.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 +10 -0
- package/README.md +5 -1
- package/package.json +8 -8
- package/test/integration/test_get_closed_channels.js +10 -0
- package/test/{extra-integration → integration}/test_revoke_access.js +8 -24
- package/test/invoicesrpc-integration/test_cancel_invoice.js +30 -27
- package/test/routerrpc-integration/test_subscribe_to_forwards.js +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Versions
|
|
2
2
|
|
|
3
|
+
## 54.0.0
|
|
4
|
+
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- Versions of Node.js before 14 are no longer supported
|
|
8
|
+
|
|
9
|
+
## 53.23.0
|
|
10
|
+
|
|
11
|
+
- `getChainFeeEstimate`: Add support for specifying min `utxo_confirmations`
|
|
12
|
+
|
|
3
13
|
## 53.22.0
|
|
4
14
|
|
|
5
15
|
- `parsePaymentRequest`: Add support for parsing payment request metadata
|
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ If you're going to use extended gRPC APIs, make sure to add the APIs to make
|
|
|
48
48
|
tags.
|
|
49
49
|
|
|
50
50
|
```sh
|
|
51
|
-
make && make install tags="autopilotrpc chainrpc invoicesrpc routerrpc signrpc walletrpc watchtowerrpc wtclientrpc"
|
|
51
|
+
make && make install tags="autopilotrpc chainrpc invoicesrpc peersrpc routerrpc signrpc walletrpc watchtowerrpc wtclientrpc"
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
## Using gRPC
|
|
@@ -1437,6 +1437,8 @@ Get a chain fee estimate for a prospective chain send
|
|
|
1437
1437
|
|
|
1438
1438
|
Requires `onchain:read` permission
|
|
1439
1439
|
|
|
1440
|
+
Specifying 0 for `utxo_confirmations` is not supported in LND 0.13.0 or below
|
|
1441
|
+
|
|
1440
1442
|
{
|
|
1441
1443
|
lnd: <Authenticated LND API Object>
|
|
1442
1444
|
send_to: [{
|
|
@@ -5545,6 +5547,7 @@ LND 0.15.0 and below do not support `is_trusted_funding`
|
|
|
5545
5547
|
{
|
|
5546
5548
|
accept: <Accept Request Function> ({
|
|
5547
5549
|
[cooperative_close_address]: <Restrict Coop Close To Address String>
|
|
5550
|
+
[is_trusted_funding]: <Accept Funding as Trusted Bool>
|
|
5548
5551
|
[min_confirmations]: <Required Confirmations Before Channel Open Number>
|
|
5549
5552
|
[remote_csv]: <Peer Unilateral Balance Output CSV Delay Number>
|
|
5550
5553
|
[remote_reserve]: <Minimum Tokens Peer Must Keep On Their Side Number>
|
|
@@ -5558,6 +5561,7 @@ LND 0.15.0 and below do not support `is_trusted_funding`
|
|
|
5558
5561
|
csv_delay: <CSV Delay Blocks Number>
|
|
5559
5562
|
id: <Request Id Hex String>
|
|
5560
5563
|
is_private: <Incoming Channel Is Private Bool>
|
|
5564
|
+
is_trusted_funding: <Request Immediate Trusted Funding Bool>
|
|
5561
5565
|
local_balance: <Channel Local Tokens Balance Number>
|
|
5562
5566
|
local_reserve: <Channel Local Reserve Tokens Number>
|
|
5563
5567
|
max_pending_mtokens: <Maximum Millitokens Pending In Channel String>
|
package/package.json
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"cors": "2.8.5",
|
|
12
12
|
"express": "4.18.1",
|
|
13
13
|
"invoices": "2.2.0",
|
|
14
|
-
"lightning": "
|
|
14
|
+
"lightning": "6.0.0",
|
|
15
15
|
"macaroon": "3.0.4",
|
|
16
16
|
"morgan": "1.10.0",
|
|
17
|
-
"ws": "8.
|
|
17
|
+
"ws": "8.9.0"
|
|
18
18
|
},
|
|
19
19
|
"description": "Interaction helper for your Lightning Network daemon",
|
|
20
20
|
"devDependencies": {
|
|
@@ -22,24 +22,24 @@
|
|
|
22
22
|
"@alexbosworth/node-fetch": "2.6.2",
|
|
23
23
|
"async": "3.2.4",
|
|
24
24
|
"asyncjs-util": "1.2.10",
|
|
25
|
-
"bip32": "3.0
|
|
25
|
+
"bip32": "3.1.0",
|
|
26
26
|
"bip66": "1.1.5",
|
|
27
27
|
"bitcoinjs-lib": "6.0.2",
|
|
28
28
|
"bn.js": "5.2.1",
|
|
29
29
|
"bs58check": "2.1.2",
|
|
30
30
|
"ecpair": "2.0.1",
|
|
31
|
-
"ln-docker-daemons": "
|
|
32
|
-
"p2tr": "1.3.
|
|
31
|
+
"ln-docker-daemons": "3.0.0",
|
|
32
|
+
"p2tr": "1.3.2",
|
|
33
33
|
"portfinder": "1.0.32",
|
|
34
34
|
"psbt": "2.7.1",
|
|
35
35
|
"rimraf": "3.0.2",
|
|
36
36
|
"secp256k1": "4.0.3",
|
|
37
37
|
"tiny-secp256k1": "2.2.1",
|
|
38
|
-
"uuid": "
|
|
38
|
+
"uuid": "9.0.0",
|
|
39
39
|
"varuint-bitcoin": "1.1.2"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
42
|
-
"node": ">=
|
|
42
|
+
"node": ">=14"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
45
|
"bitcoin",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"integration-test-0.12.0": "DOCKER_LND_VERSION=v0.12.0-beta npm run test",
|
|
72
72
|
"test": "echo $DOCKER_LND_VERSION && tap -j 2 --branches=1 --functions=1 --lines=1 --statements=1 -t 200 test/autopilotrpc-integration/*.js test/chainrpc-integration/*.js test/integration/*.js test/invoicesrpc-integration/*.js test/peersrpc-integration/*.js test/routerrpc-integration/*.js test/signerrpc-integration/*.js test/tower_clientrpc-integration/*.js test/tower_serverrpc-integration/*.js test/walletrpc-integration/*.js"
|
|
73
73
|
},
|
|
74
|
-
"version": "
|
|
74
|
+
"version": "54.0.0"
|
|
75
75
|
}
|
|
@@ -10,6 +10,7 @@ const {delay} = require('./../macros');
|
|
|
10
10
|
const {payViaPaymentRequest} = require('./../../');
|
|
11
11
|
const {getChainTransactions} = require('./../../');
|
|
12
12
|
const {getClosedChannels} = require('./../../');
|
|
13
|
+
const {getLockedUtxos} = require('./../../');
|
|
13
14
|
const {getPendingChannels} = require('./../../');
|
|
14
15
|
const {getSweepTransactions} = require('./../../');
|
|
15
16
|
const {getUtxos} = require('./../../');
|
|
@@ -36,6 +37,15 @@ test(`Get closed channels`, async ({end, equal}) => {
|
|
|
36
37
|
|
|
37
38
|
const {generate, lnd} = control;
|
|
38
39
|
|
|
40
|
+
try {
|
|
41
|
+
await getLockedUtxos({lnd});
|
|
42
|
+
} catch (err) {
|
|
43
|
+
// Skip test on LND 0.12 due to sweep timing
|
|
44
|
+
await kill({});
|
|
45
|
+
|
|
46
|
+
return end();
|
|
47
|
+
}
|
|
48
|
+
|
|
39
49
|
const channelOpen = await setupChannel({
|
|
40
50
|
generate,
|
|
41
51
|
lnd,
|
|
@@ -1,32 +1,26 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {spawnLightningCluster} = require('ln-docker-daemons');
|
|
2
2
|
const {test} = require('@alexbosworth/tap');
|
|
3
3
|
|
|
4
|
-
const {authenticatedLndGrpc} = require('./../../');
|
|
5
4
|
const {createChainAddress} = require('./../../');
|
|
6
5
|
const {grantAccess} = require('./../../');
|
|
7
6
|
const {revokeAccess} = require('./../../');
|
|
8
|
-
const {spawnLnd} = require('./../macros');
|
|
9
|
-
const {waitForTermination} = require('./../macros');
|
|
10
7
|
|
|
8
|
+
const err = [503, 'UnexpectedErrorCreatingAddress'];
|
|
11
9
|
const format = 'np2wpkh';
|
|
12
10
|
const id = '1';
|
|
13
|
-
const
|
|
14
|
-
const pkHashByteLength = 20;
|
|
15
|
-
const regtestBech32AddressHrp = 'bcrt';
|
|
11
|
+
const permissions = ['address:read'];
|
|
16
12
|
|
|
17
13
|
// Revoking access should result in access denied
|
|
18
14
|
test(`Revoke access credentials`, async ({end, equal, rejects}) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const {lnd, kill} = spawned;
|
|
15
|
+
const [{lnd, kill, rpc}] = (await spawnLightningCluster({})).nodes;
|
|
22
16
|
|
|
23
17
|
await grantAccess({lnd, is_ok_to_create_chain_addresses: true});
|
|
24
18
|
|
|
25
19
|
const makeChainAddresses = await grantAccess({
|
|
26
20
|
id,
|
|
27
21
|
lnd,
|
|
22
|
+
permissions,
|
|
28
23
|
is_ok_to_create_chain_addresses: true,
|
|
29
|
-
permissions: ['address:read'],
|
|
30
24
|
});
|
|
31
25
|
|
|
32
26
|
try {
|
|
@@ -36,27 +30,17 @@ test(`Revoke access credentials`, async ({end, equal, rejects}) => {
|
|
|
36
30
|
|
|
37
31
|
// Avoid this test on LND 0.11.0 and below
|
|
38
32
|
if (type === 'RevokeAccessMethodNotSupported') {
|
|
39
|
-
kill();
|
|
40
|
-
|
|
41
|
-
await waitForTermination({lnd});
|
|
33
|
+
await kill({});
|
|
42
34
|
|
|
43
35
|
return end();
|
|
44
36
|
}
|
|
45
37
|
}
|
|
46
38
|
|
|
47
|
-
const macLnd =
|
|
48
|
-
cert: spawned.lnd_cert,
|
|
49
|
-
macaroon: makeChainAddresses.macaroon,
|
|
50
|
-
socket: spawned.lnd_socket,
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
const err = [503, 'UnexpectedErrorCreatingAddress'];
|
|
39
|
+
const macLnd = rpc({macaroon: makeChainAddresses.macaroon});
|
|
54
40
|
|
|
55
41
|
await rejects(createChainAddress({format, lnd: macLnd.lnd}), err, 'Fails');
|
|
56
42
|
|
|
57
|
-
kill();
|
|
58
|
-
|
|
59
|
-
await waitForTermination({lnd});
|
|
43
|
+
await kill({});
|
|
60
44
|
|
|
61
45
|
return end();
|
|
62
46
|
});
|
|
@@ -2,16 +2,15 @@ const {createHash} = require('crypto');
|
|
|
2
2
|
const {randomBytes} = require('crypto');
|
|
3
3
|
|
|
4
4
|
const asyncRetry = require('async/retry');
|
|
5
|
+
const {setupChannel} = require('ln-docker-daemons');
|
|
5
6
|
const {spawnLightningCluster} = require('ln-docker-daemons');
|
|
6
7
|
const {test} = require('@alexbosworth/tap');
|
|
7
8
|
|
|
8
9
|
const {cancelHodlInvoice} = require('./../../');
|
|
9
10
|
const {createHodlInvoice} = require('./../../');
|
|
10
|
-
const {delay} = require('./../macros');
|
|
11
11
|
const {getInvoice} = require('./../../');
|
|
12
12
|
const {getInvoices} = require('./../../');
|
|
13
13
|
const {pay} = require('./../../');
|
|
14
|
-
const {setupChannel} = require('./../macros');
|
|
15
14
|
const {subscribeToInvoice} = require('./../../');
|
|
16
15
|
|
|
17
16
|
const size = 2;
|
|
@@ -24,43 +23,47 @@ test(`Cancel back a hodl invoice`, async ({end, equal}) => {
|
|
|
24
23
|
|
|
25
24
|
const [{generate, lnd}, target] = nodes;
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
try {
|
|
27
|
+
await setupChannel({generate, lnd, to: target});
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
const id = createHash('sha256').update(randomBytes(32)).digest('hex');
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
const invoice = await createHodlInvoice({id, tokens, lnd: target.lnd});
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
const sub = subscribeToInvoice({id, lnd: target.lnd});
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
sub.on('invoice_updated', async updated => {
|
|
36
|
+
if (!updated.is_held) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
const [created] = (await getInvoices({lnd: target.lnd})).invoices;
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
const invoice = await getInvoice({id, lnd: target.lnd});
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
equal(created.is_confirmed, false, 'invoices shows not yet settled');
|
|
45
|
+
equal(created.is_held, true, 'invoices shows HTLC locked in place');
|
|
46
|
+
equal(invoice.is_confirmed, false, 'HTLC has not yet been settled');
|
|
47
|
+
equal(invoice.is_held, true, 'HTLC is locked in place');
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
await cancelHodlInvoice({id, lnd: target.lnd});
|
|
50
|
+
});
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
let cancelErr = [];
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
try {
|
|
55
|
+
await pay({lnd, request: invoice.request});
|
|
56
|
+
} catch (err) {
|
|
57
|
+
cancelErr = err;
|
|
58
|
+
}
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
const [code, message] = cancelErr;
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
equal(code, 503, 'Canceled back HODL HTLC results in 404');
|
|
63
|
+
equal(message, 'PaymentRejectedByDestination', 'Got back 404 error');
|
|
64
|
+
} catch (err) {
|
|
65
|
+
equal(err, null, 'Expected no error');
|
|
66
|
+
}
|
|
64
67
|
|
|
65
68
|
await kill({});
|
|
66
69
|
|
|
@@ -9,6 +9,7 @@ const {createInvoice} = require('./../../');
|
|
|
9
9
|
const {delay} = require('./../macros');
|
|
10
10
|
const {getChannels} = require('./../../');
|
|
11
11
|
const {getHeight} = require('./../../');
|
|
12
|
+
const {getLockedUtxos} = require('./../../');
|
|
12
13
|
const {getWalletInfo} = require('./../../');
|
|
13
14
|
const {payViaPaymentRequest} = require('./../../');
|
|
14
15
|
const {setupChannel} = require('./../macros');
|
|
@@ -26,6 +27,15 @@ test('Subscribe to forwards', async ({end, equal, rejects, strictSame}) => {
|
|
|
26
27
|
|
|
27
28
|
const [{generate, lnd}, target, remote] = nodes;
|
|
28
29
|
|
|
30
|
+
try {
|
|
31
|
+
await getLockedUtxos({lnd});
|
|
32
|
+
} catch (err) {
|
|
33
|
+
// Skip test on LND 0.12 due to timeout timing
|
|
34
|
+
await kill({});
|
|
35
|
+
|
|
36
|
+
return end();
|
|
37
|
+
}
|
|
38
|
+
|
|
29
39
|
try {
|
|
30
40
|
const {features} = await getWalletInfo({lnd});
|
|
31
41
|
const testSub = subscribeToForwards({lnd});
|