ln-service 53.11.0 → 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
CHANGED
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
|
|
@@ -3537,7 +3539,7 @@ Requires `onchain:write` permission
|
|
|
3537
3539
|
|
|
3538
3540
|
Requires LND built with `walletrpc` tag
|
|
3539
3541
|
|
|
3540
|
-
This method is not supported in LND 0.14.
|
|
3542
|
+
This method is not supported in LND 0.14.1 and below
|
|
3541
3543
|
|
|
3542
3544
|
{
|
|
3543
3545
|
lnd: <Authenticated LND API Object>
|
|
@@ -6571,6 +6573,32 @@ const {lnd} = unauthenticatedLndGrpc({});
|
|
|
6571
6573
|
await unlockWallet({lnd, password: 'walletSecretPassword'});
|
|
6572
6574
|
```
|
|
6573
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
|
+
|
|
6574
6602
|
### updateChainTransaction
|
|
6575
6603
|
|
|
6576
6604
|
Update an on-chain transaction record metadata
|
|
@@ -6599,6 +6627,32 @@ const [{id}] = transactions;
|
|
|
6599
6627
|
await updateChainTransaction({id, lnd, description: 'First transaction'});
|
|
6600
6628
|
```
|
|
6601
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
|
+
|
|
6602
6656
|
### updateConnectedWatchtower
|
|
6603
6657
|
|
|
6604
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
|
@@ -10,8 +10,8 @@
|
|
|
10
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"
|
|
@@ -28,7 +28,7 @@
|
|
|
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.
|
|
31
|
+
"ln-docker-daemons": "2.2.8",
|
|
32
32
|
"p2tr": "1.3.1",
|
|
33
33
|
"portfinder": "1.0.28",
|
|
34
34
|
"psbt": "2.0.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
|
}
|
|
@@ -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
|
+
});
|