ln-service 53.10.0 → 53.13.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
@@ -1,5 +1,19 @@
1
1
  # Versions
2
2
 
3
+ ## 53.13.0
4
+
5
+ - `getWalletVersion`: Add support for LND 0.14.3-beta
6
+
7
+ ## 53.12.0
8
+
9
+ - `updateAlias`: Add method to update the node graph announcement alias
10
+ - `updateColor`: Add method to update the node graph announcement color
11
+
12
+ ## 53.11.0
13
+
14
+ - Use TLV for all hops when sending HTLCs along routes
15
+ - `signTransaction`: Add `spending` attribute for specifying external inputs
16
+
3
17
  ## 53.10.0
4
18
 
5
19
  - `createChainAddress`: Add support for creating P2TR addresses
package/README.md CHANGED
@@ -9,7 +9,7 @@ through npm.
9
9
 
10
10
  Supported LND versions:
11
11
 
12
- - v0.14.0-beta to v0.14.2-beta
12
+ - v0.14.0-beta to v0.14.3-beta
13
13
  - v0.13.0-beta to v0.13.4-beta
14
14
  - v0.12.0-beta to v0.12.1-beta
15
15
  - v0.11.0-beta to v0.11.1-beta
@@ -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
- - run regtest integration tests
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.3 and below
3542
+ This method is not supported in LND 0.14.1 and below
3541
3543
 
3542
3544
  {
3543
3545
  lnd: <Authenticated LND API Object>
@@ -4621,10 +4623,14 @@ const {transaction} = await signPsbt({lnd, psbt});
4621
4623
 
4622
4624
  Sign transaction
4623
4625
 
4624
- Requires LND built with `signerrpc` build tag
4626
+ `spending` is required for non-internal inputs for a Taproot signature
4627
+
4628
+ Requires LND built with `signrpc` build tag
4625
4629
 
4626
4630
  Requires `signer:generate` permission
4627
4631
 
4632
+ `spending` is not supported in LND 0.14.3 and below
4633
+
4628
4634
  {
4629
4635
  inputs: [{
4630
4636
  key_family: <Key Family Number>
@@ -4636,14 +4642,13 @@ Requires `signer:generate` permission
4636
4642
  witness_script: <Witness Script Hex String>
4637
4643
  }]
4638
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
+ }]
4639
4649
  transaction: <Unsigned Transaction Hex String>
4640
4650
  }
4641
4651
 
4642
- @returns via cbk or Promise
4643
- {
4644
- signatures: [<Signature Hex String>]
4645
- }
4646
-
4647
4652
  Example:
4648
4653
 
4649
4654
  ```node
@@ -4790,10 +4795,15 @@ Subscribe to confirmations of a spend
4790
4795
 
4791
4796
  A chain address or raw output script is required
4792
4797
 
4798
+ When specifying a P2TR output script, `transaction_id` and `transaction_vout`
4799
+ are required.
4800
+
4793
4801
  Requires LND built with `chainrpc` build tag
4794
4802
 
4795
4803
  Requires `onchain:read` permission
4796
4804
 
4805
+ Subscribing to P2TR outputs is not supported in LND 0.14.3 and below
4806
+
4797
4807
  {
4798
4808
  [bech32_address]: <Bech32 P2WPKH or P2WSH Address String>
4799
4809
  lnd: <Authenticated LND API Object>
@@ -6563,6 +6573,32 @@ const {lnd} = unauthenticatedLndGrpc({});
6563
6573
  await unlockWallet({lnd, password: 'walletSecretPassword'});
6564
6574
  ```
6565
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
+
6566
6602
  ### updateChainTransaction
6567
6603
 
6568
6604
  Update an on-chain transaction record metadata
@@ -6591,6 +6627,32 @@ const [{id}] = transactions;
6591
6627
  await updateChainTransaction({id, lnd, description: 'First transaction'});
6592
6628
  ```
6593
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
+
6594
6656
  ### updateConnectedWatchtower
6595
6657
 
6596
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.0",
10
+ "bolt07": "1.8.1",
11
11
  "cors": "2.8.5",
12
12
  "express": "4.17.3",
13
- "invoices": "2.0.4",
14
- "lightning": "5.9.0",
13
+ "invoices": "2.0.6",
14
+ "lightning": "5.12.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.8",
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.6",
32
- "p2tr": "1.3.0",
31
+ "ln-docker-daemons": "2.2.8",
32
+ "p2tr": "1.3.1",
33
33
  "portfinder": "1.0.28",
34
- "psbt": "2.0.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",
@@ -57,6 +57,7 @@
57
57
  },
58
58
  "scripts": {
59
59
  "integration-test-daily-lnd-build": "DOCKER_LND_VERSION=daily-testing-only npm run test",
60
+ "integration-test-0.14.3": "DOCKER_LND_VERSION=v0.14.3-beta npm run test",
60
61
  "integration-test-0.14.2": "DOCKER_LND_VERSION=v0.14.2-beta npm run test",
61
62
  "integration-test-0.14.1": "DOCKER_LND_VERSION=v0.14.1-beta npm run test",
62
63
  "integration-test-0.14.0": "DOCKER_LND_VERSION=v0.14.0-beta npm run test",
@@ -67,7 +68,7 @@
67
68
  "integration-test-0.13.0": "DOCKER_LND_VERSION=v0.13.0-beta npm run test",
68
69
  "integration-test-0.12.1": "DOCKER_LND_VERSION=v0.12.1-beta npm run test",
69
70
  "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"
71
+ "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
72
  },
72
- "version": "53.10.0"
73
+ "version": "53.13.0"
73
74
  }
@@ -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
+ });