ln-service 53.9.4 → 53.12.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 +15 -0
- package/README.md +79 -10
- package/index.js +4 -0
- package/package.json +9 -9
- package/test/chainrpc-integration/test_subscribe_to_blocks.js +0 -1
- package/test/chainrpc-integration/test_subscribe_to_chain_address.js +0 -1
- package/test/integration/test_create_chain_address.js +9 -0
- package/test/integration/test_get_pending_force.js +1 -1
- package/test/peersrpc-integration/test_update_alias.js +31 -0
- package/test/peersrpc-integration/test_update_color.js +31 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Versions
|
|
2
2
|
|
|
3
|
+
## 53.12.0
|
|
4
|
+
|
|
5
|
+
- `updateAlias`: Add method to update the node graph announcement alias
|
|
6
|
+
- `updateColor`: Add method to update the node graph announcement color
|
|
7
|
+
|
|
8
|
+
## 53.11.0
|
|
9
|
+
|
|
10
|
+
- Use TLV for all hops when sending HTLCs along routes
|
|
11
|
+
- `signTransaction`: Add `spending` attribute for specifying external inputs
|
|
12
|
+
|
|
13
|
+
## 53.10.0
|
|
14
|
+
|
|
15
|
+
- `createChainAddress`: Add support for creating P2TR addresses
|
|
16
|
+
- `getUtxos`: Add support for showing P2TR address types
|
|
17
|
+
|
|
3
18
|
## 53.9.4
|
|
4
19
|
|
|
5
20
|
- `getPendingPayments`: Add method to get payments in flight
|
package/README.md
CHANGED
|
@@ -249,8 +249,10 @@ for `unlocker` methods.
|
|
|
249
249
|
- [unlockUtxo](#unlockutxo) - Release a locked UTXO so that it can be used
|
|
250
250
|
again
|
|
251
251
|
- [unlockWallet](#unlockwallet) - Unlock a locked lnd
|
|
252
|
+
- [updateAlias](#updatealias) - Update node graph identity alias
|
|
252
253
|
- [updateChainTransaction](#updatechaintransaction) - Update a chain
|
|
253
254
|
transaction
|
|
255
|
+
- [updateColor](#updatecolor) - Update node graph color value
|
|
254
256
|
- [updateConnectedWatchtower](#updateconnectedwatchtower) - Update watchtower
|
|
255
257
|
- [updatePathfindingSettings](#updatepathfindingsettings) - Update pathfinding
|
|
256
258
|
configuration
|
|
@@ -271,8 +273,8 @@ for `unlocker` methods.
|
|
|
271
273
|
- [lightning](https://npmjs.com/package/lightning) - methods with typescript
|
|
272
274
|
typing support
|
|
273
275
|
- [ln-accounting](https://npmjs.com/package/ln-accounting) - accounting records
|
|
274
|
-
- [ln-docker-daemons](https://github.com/alexbosworth/ln-docker-daemons)
|
|
275
|
-
|
|
276
|
+
- [ln-docker-daemons](https://github.com/alexbosworth/ln-docker-daemons) -
|
|
277
|
+
run regtest integration tests
|
|
276
278
|
- [ln-pathfinding](https://npmjs.com/package/ln-accounting) - pathfinding
|
|
277
279
|
utilities
|
|
278
280
|
- [ln-sync](https://www.npmjs.com/package/ln-sync) - metadata helper methods
|
|
@@ -514,12 +516,19 @@ Create a new receive address.
|
|
|
514
516
|
|
|
515
517
|
Requires `address:write` permission
|
|
516
518
|
|
|
519
|
+
LND 0.14.3 and below do not support p2tr addresses
|
|
520
|
+
|
|
517
521
|
{
|
|
518
|
-
[format]: <Receive Address Type String> // "np2wpkh" || "p2wpkh"
|
|
522
|
+
[format]: <Receive Address Type String> // "np2wpkh" || "p2tr" || "p2wpkh"
|
|
519
523
|
[is_unused]: <Get As-Yet Unused Address Bool>
|
|
520
524
|
lnd: <Authenticated LND API Object>
|
|
521
525
|
}
|
|
522
526
|
|
|
527
|
+
@returns via cbk or Promise
|
|
528
|
+
{
|
|
529
|
+
address: <Chain Address String>
|
|
530
|
+
}
|
|
531
|
+
|
|
523
532
|
Example:
|
|
524
533
|
|
|
525
534
|
```node
|
|
@@ -3530,7 +3539,7 @@ Requires `onchain:write` permission
|
|
|
3530
3539
|
|
|
3531
3540
|
Requires LND built with `walletrpc` tag
|
|
3532
3541
|
|
|
3533
|
-
This method is not supported in LND 0.14.
|
|
3542
|
+
This method is not supported in LND 0.14.1 and below
|
|
3534
3543
|
|
|
3535
3544
|
{
|
|
3536
3545
|
lnd: <Authenticated LND API Object>
|
|
@@ -4614,10 +4623,14 @@ const {transaction} = await signPsbt({lnd, psbt});
|
|
|
4614
4623
|
|
|
4615
4624
|
Sign transaction
|
|
4616
4625
|
|
|
4617
|
-
|
|
4626
|
+
`spending` is required for non-internal inputs for a Taproot signature
|
|
4627
|
+
|
|
4628
|
+
Requires LND built with `signrpc` build tag
|
|
4618
4629
|
|
|
4619
4630
|
Requires `signer:generate` permission
|
|
4620
4631
|
|
|
4632
|
+
`spending` is not supported in LND 0.14.3 and below
|
|
4633
|
+
|
|
4621
4634
|
{
|
|
4622
4635
|
inputs: [{
|
|
4623
4636
|
key_family: <Key Family Number>
|
|
@@ -4629,14 +4642,13 @@ Requires `signer:generate` permission
|
|
|
4629
4642
|
witness_script: <Witness Script Hex String>
|
|
4630
4643
|
}]
|
|
4631
4644
|
lnd: <Authenticated LND API Object>
|
|
4645
|
+
[spending]: [{
|
|
4646
|
+
output_script: <Non-Internal Spend Output Script Hex String>
|
|
4647
|
+
output_tokens: <Non-Internal Spend Output Tokens Number>
|
|
4648
|
+
}]
|
|
4632
4649
|
transaction: <Unsigned Transaction Hex String>
|
|
4633
4650
|
}
|
|
4634
4651
|
|
|
4635
|
-
@returns via cbk or Promise
|
|
4636
|
-
{
|
|
4637
|
-
signatures: [<Signature Hex String>]
|
|
4638
|
-
}
|
|
4639
|
-
|
|
4640
4652
|
Example:
|
|
4641
4653
|
|
|
4642
4654
|
```node
|
|
@@ -4783,10 +4795,15 @@ Subscribe to confirmations of a spend
|
|
|
4783
4795
|
|
|
4784
4796
|
A chain address or raw output script is required
|
|
4785
4797
|
|
|
4798
|
+
When specifying a P2TR output script, `transaction_id` and `transaction_vout`
|
|
4799
|
+
are required.
|
|
4800
|
+
|
|
4786
4801
|
Requires LND built with `chainrpc` build tag
|
|
4787
4802
|
|
|
4788
4803
|
Requires `onchain:read` permission
|
|
4789
4804
|
|
|
4805
|
+
Subscribing to P2TR outputs is not supported in LND 0.14.3 and below
|
|
4806
|
+
|
|
4790
4807
|
{
|
|
4791
4808
|
[bech32_address]: <Bech32 P2WPKH or P2WSH Address String>
|
|
4792
4809
|
lnd: <Authenticated LND API Object>
|
|
@@ -6556,6 +6573,32 @@ const {lnd} = unauthenticatedLndGrpc({});
|
|
|
6556
6573
|
await unlockWallet({lnd, password: 'walletSecretPassword'});
|
|
6557
6574
|
```
|
|
6558
6575
|
|
|
6576
|
+
### updateAlias
|
|
6577
|
+
|
|
6578
|
+
Update the node alias as advertised in the graph
|
|
6579
|
+
|
|
6580
|
+
Note: this method is not supported in LND versions 0.14.3 and below
|
|
6581
|
+
|
|
6582
|
+
Requires LND built with `peersrpc` build tag
|
|
6583
|
+
|
|
6584
|
+
Requires `peers:write` permissions
|
|
6585
|
+
|
|
6586
|
+
{
|
|
6587
|
+
alias: <Node Alias String>
|
|
6588
|
+
lnd: <Authenticated LND API Object>
|
|
6589
|
+
}
|
|
6590
|
+
|
|
6591
|
+
@returns via cbk or Promise
|
|
6592
|
+
|
|
6593
|
+
Example:
|
|
6594
|
+
|
|
6595
|
+
```node
|
|
6596
|
+
const {updateAlias} = require('ln-service');
|
|
6597
|
+
|
|
6598
|
+
// Set the node alias to "foo"
|
|
6599
|
+
await updateAlias({lnd, alias: 'foo'});
|
|
6600
|
+
```
|
|
6601
|
+
|
|
6559
6602
|
### updateChainTransaction
|
|
6560
6603
|
|
|
6561
6604
|
Update an on-chain transaction record metadata
|
|
@@ -6584,6 +6627,32 @@ const [{id}] = transactions;
|
|
|
6584
6627
|
await updateChainTransaction({id, lnd, description: 'First transaction'});
|
|
6585
6628
|
```
|
|
6586
6629
|
|
|
6630
|
+
### updateColor
|
|
6631
|
+
|
|
6632
|
+
Update the node color as advertised in the graph
|
|
6633
|
+
|
|
6634
|
+
Note: this method is not supported in LND versions 0.14.3 and below
|
|
6635
|
+
|
|
6636
|
+
Requires LND built with `peersrpc` build tag
|
|
6637
|
+
|
|
6638
|
+
Requires `peers:write` permissions
|
|
6639
|
+
|
|
6640
|
+
{
|
|
6641
|
+
color: <Node Color String>
|
|
6642
|
+
lnd: <Authenticated LND API Object>
|
|
6643
|
+
}
|
|
6644
|
+
|
|
6645
|
+
@returns via cbk or Promise
|
|
6646
|
+
|
|
6647
|
+
Example:
|
|
6648
|
+
|
|
6649
|
+
```node
|
|
6650
|
+
const {updateColor} = require('ln-service');
|
|
6651
|
+
|
|
6652
|
+
// Update the node color identity in the network graph
|
|
6653
|
+
await updateColor({lnd, color: '#123456'});
|
|
6654
|
+
```
|
|
6655
|
+
|
|
6587
6656
|
### updateConnectedWatchtower
|
|
6588
6657
|
|
|
6589
6658
|
Update a watchtower
|
package/index.js
CHANGED
|
@@ -129,7 +129,9 @@ const {subscribeToWalletStatus} = require('lightning');
|
|
|
129
129
|
const {unauthenticatedLndGrpc} = require('lightning');
|
|
130
130
|
const {unlockUtxo} = require('lightning');
|
|
131
131
|
const {unlockWallet} = require('lightning');
|
|
132
|
+
const {updateAlias} = require('lightning');
|
|
132
133
|
const {updateChainTransaction} = require('lightning');
|
|
134
|
+
const {updateColor} = require('lightning');
|
|
133
135
|
const {updateConnectedWatchtower} = require('lightning');
|
|
134
136
|
const {updatePathfindingSettings} = require('lightning');
|
|
135
137
|
const {updateRoutingFees} = require('lightning');
|
|
@@ -271,7 +273,9 @@ module.exports = {
|
|
|
271
273
|
unauthenticatedLndGrpc,
|
|
272
274
|
unlockUtxo,
|
|
273
275
|
unlockWallet,
|
|
276
|
+
updateAlias,
|
|
274
277
|
updateChainTransaction,
|
|
278
|
+
updateColor,
|
|
275
279
|
updateConnectedWatchtower,
|
|
276
280
|
updatePathfindingSettings,
|
|
277
281
|
updateRoutingFees,
|
package/package.json
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"url": "https://github.com/alexbosworth/ln-service/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"bolt07": "1.8.
|
|
10
|
+
"bolt07": "1.8.1",
|
|
11
11
|
"cors": "2.8.5",
|
|
12
12
|
"express": "4.17.3",
|
|
13
|
-
"invoices": "2.0.
|
|
14
|
-
"lightning": "5.
|
|
13
|
+
"invoices": "2.0.6",
|
|
14
|
+
"lightning": "5.11.0",
|
|
15
15
|
"macaroon": "3.0.4",
|
|
16
16
|
"morgan": "1.10.0",
|
|
17
17
|
"ws": "8.5.0"
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
"@alexbosworth/tap": "15.0.11",
|
|
22
22
|
"@alexbosworth/node-fetch": "2.6.2",
|
|
23
23
|
"async": "3.2.3",
|
|
24
|
-
"asyncjs-util": "1.2.
|
|
24
|
+
"asyncjs-util": "1.2.9",
|
|
25
25
|
"bip32": "3.0.1",
|
|
26
26
|
"bip66": "1.1.5",
|
|
27
27
|
"bitcoinjs-lib": "6.0.1",
|
|
28
28
|
"bn.js": "5.2.0",
|
|
29
29
|
"bs58check": "2.1.2",
|
|
30
30
|
"ecpair": "2.0.1",
|
|
31
|
-
"ln-docker-daemons": "2.2.
|
|
32
|
-
"p2tr": "1.3.
|
|
31
|
+
"ln-docker-daemons": "2.2.8",
|
|
32
|
+
"p2tr": "1.3.1",
|
|
33
33
|
"portfinder": "1.0.28",
|
|
34
|
-
"psbt": "2.0.
|
|
34
|
+
"psbt": "2.0.1",
|
|
35
35
|
"rimraf": "3.0.2",
|
|
36
36
|
"secp256k1": "4.0.3",
|
|
37
37
|
"tiny-secp256k1": "2.2.1",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"integration-test-0.13.0": "DOCKER_LND_VERSION=v0.13.0-beta npm run test",
|
|
68
68
|
"integration-test-0.12.1": "DOCKER_LND_VERSION=v0.12.1-beta npm run test",
|
|
69
69
|
"integration-test-0.12.0": "DOCKER_LND_VERSION=v0.12.0-beta npm run test",
|
|
70
|
-
"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/routerrpc-integration/*.js test/signerrpc-integration/*.js test/tower_clientrpc-integration/*.js test/tower_serverrpc-integration/*.js test/walletrpc-integration/*.js"
|
|
70
|
+
"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"
|
|
71
71
|
},
|
|
72
|
-
"version": "53.
|
|
72
|
+
"version": "53.12.0"
|
|
73
73
|
}
|
|
@@ -10,7 +10,6 @@ const {delay} = require('./../macros');
|
|
|
10
10
|
const {generateBlocks} = require('./../macros');
|
|
11
11
|
const {getHeight} = require('./../../');
|
|
12
12
|
const {getChainBalance} = require('./../../');
|
|
13
|
-
const {spawnLnd} = require('./../macros');
|
|
14
13
|
const {subscribeToBlocks} = require('./../../');
|
|
15
14
|
const {waitForTermination} = require('./../macros');
|
|
16
15
|
|
|
@@ -11,7 +11,6 @@ const {getChainTransactions} = require('./../../');
|
|
|
11
11
|
const {getHeight} = require('./../../');
|
|
12
12
|
const {mineTransaction} = require('./../macros');
|
|
13
13
|
const {sendToChainAddress} = require('./../../');
|
|
14
|
-
const {spawnLnd} = require('./../macros');
|
|
15
14
|
const {subscribeToChainAddress} = require('./../../');
|
|
16
15
|
const {waitForTermination} = require('./../macros');
|
|
17
16
|
|
|
@@ -7,6 +7,7 @@ const {createChainAddress} = require('./../../');
|
|
|
7
7
|
const formats = ['np2wpkh', 'p2wpkh'];
|
|
8
8
|
const p2shAddressVersion = 196;
|
|
9
9
|
const pkHashByteLength = 20;
|
|
10
|
+
const prefixForV1 = 'bcrt1p';
|
|
10
11
|
const regtestBech32AddressHrp = 'bcrt';
|
|
11
12
|
|
|
12
13
|
// Creating addresses should result in addresses
|
|
@@ -34,6 +35,14 @@ test(`Create address results in address creation`, async ({end, equal}) => {
|
|
|
34
35
|
equal(np2wpkh.address, unusedNp2wpkh.address, 'Nested is reused');
|
|
35
36
|
equal(p2wpkh.address, unusedP2wpkh.address, 'Native is reused');
|
|
36
37
|
|
|
38
|
+
try {
|
|
39
|
+
const {address} = await createChainAddress({lnd, format: 'p2tr'});
|
|
40
|
+
|
|
41
|
+
equal(address.startsWith(prefixForV1), true, 'A taproot address is made');
|
|
42
|
+
} catch (err) {
|
|
43
|
+
// LND 0.14.3 and below do not support TR addresses
|
|
44
|
+
}
|
|
45
|
+
|
|
37
46
|
await kill({});
|
|
38
47
|
|
|
39
48
|
return end();
|
|
@@ -178,7 +178,7 @@ test(`Get pending channels`, async ({end, equal}) => {
|
|
|
178
178
|
equal(forceClose.received, 0, 'No receive amount');
|
|
179
179
|
equal(forceClose.recovered_tokens, undefined, 'No recovered amount');
|
|
180
180
|
|
|
181
|
-
// LND 0.14.
|
|
181
|
+
// LND 0.14.3 and below do not support remote balance info
|
|
182
182
|
if (!!forceClose.remote_balance) {
|
|
183
183
|
equal(forceClose.remote_balance, giftTokens, 'Got gift remote balance');
|
|
184
184
|
} else {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const {spawnLightningCluster} = require('ln-docker-daemons');
|
|
2
|
+
const {test} = require('@alexbosworth/tap');
|
|
3
|
+
|
|
4
|
+
const {getWalletInfo} = require('./../../');
|
|
5
|
+
const {updateAlias} = require('./../../');
|
|
6
|
+
|
|
7
|
+
const alias = 'alias';
|
|
8
|
+
|
|
9
|
+
// Updating a node alias should result in an updated alias
|
|
10
|
+
test(`Update alias`, async ({end, strictSame}) => {
|
|
11
|
+
const {kill, nodes} = await spawnLightningCluster({});
|
|
12
|
+
|
|
13
|
+
const [{lnd}] = nodes;
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const {color} = await getWalletInfo({lnd});
|
|
17
|
+
|
|
18
|
+
await updateAlias({alias, lnd});
|
|
19
|
+
|
|
20
|
+
const updated = await getWalletInfo({lnd});
|
|
21
|
+
|
|
22
|
+
strictSame(updated.alias, alias, 'Alias was updated');
|
|
23
|
+
strictSame(updated.color, color, 'Color was not updated');
|
|
24
|
+
} catch (err) {
|
|
25
|
+
strictSame(err, [400, 'ExpectedPeersRpcLndBuildTagToUpdateAlias']);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
await kill({});
|
|
29
|
+
|
|
30
|
+
return end();
|
|
31
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const {spawnLightningCluster} = require('ln-docker-daemons');
|
|
2
|
+
const {test} = require('@alexbosworth/tap');
|
|
3
|
+
|
|
4
|
+
const {getWalletInfo} = require('./../../');
|
|
5
|
+
const {updateColor} = require('./../../');
|
|
6
|
+
|
|
7
|
+
const color = '#666666'
|
|
8
|
+
|
|
9
|
+
// Updating a node color should result in an updated color
|
|
10
|
+
test(`Update color`, async ({end, strictSame}) => {
|
|
11
|
+
const {kill, nodes} = await spawnLightningCluster({});
|
|
12
|
+
|
|
13
|
+
const [{lnd}] = nodes;
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const {alias} = await getWalletInfo({lnd});
|
|
17
|
+
|
|
18
|
+
await updateColor({color, lnd});
|
|
19
|
+
|
|
20
|
+
const updated = await getWalletInfo({lnd});
|
|
21
|
+
|
|
22
|
+
strictSame(updated.alias, alias, 'Alias was not updated');
|
|
23
|
+
strictSame(updated.color, color, 'Color was updated');
|
|
24
|
+
} catch (err) {
|
|
25
|
+
strictSame(err, [400, 'ExpectedPeersRpcLndBuildTagToUpdateColor']);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
await kill({});
|
|
29
|
+
|
|
30
|
+
return end();
|
|
31
|
+
});
|