ln-service 53.13.0 → 53.15.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,21 @@
1
1
  # Versions
2
2
 
3
+ ## 53.15.0
4
+
5
+ - `getRouteToDestination`, `isDestinationPayable`, `pay`,
6
+ `payViaPaymentDetails`, `payViaPaymentRequest`, `probeForRoute`,
7
+ `subscribeToPayViaDetails`, `subscribeToPayViaRequest`,
8
+ `subscribeToProbeForRoute` - add support for pathfinding `confidence`
9
+
10
+ ## 53.14.1
11
+
12
+ - `signTransaction`: Fix multi-input signing for upcoming Taproot API changes
13
+
14
+ ## 53.14.0
15
+
16
+ - `addExternalSocket`: Add method to add a socket to graph announcements
17
+ - `removeExternalSocket`: Add method to remove sockets from graph announcements
18
+
3
19
  ## 53.13.0
4
20
 
5
21
  - `getWalletVersion`: Add support for LND 0.14.3-beta
package/README.md CHANGED
@@ -102,6 +102,7 @@ for `unlocker` methods.
102
102
 
103
103
  ## All Methods
104
104
 
105
+ - [addExternalSocket](#addexternalsocket) - Advertise a new p2p host:ip address
105
106
  - [addPeer](#addpeer) - Connect to a peer
106
107
  - [authenticatedLndGrpc](#authenticatedlndgrpc) - LND API Object
107
108
  - [broadcastChainTransaction](#broadcastchaintransaction) - Push a chain tx
@@ -201,6 +202,7 @@ for `unlocker` methods.
201
202
  - [proposeChannel](#proposechannel) - Offer a channel proposal to a peer
202
203
  - [recoverFundsFromChannel](#recoverfundsfromchannel) - Restore a channel
203
204
  - [recoverFundsFromChannels](#recoverfundsfromchannels) - Restore all channels
205
+ - [removeExternalSocket](#removeexternalsocket) - Remove a p2p host:ip announce
204
206
  - [removePeer](#removepeer) - Disconnect from a connected peer
205
207
  - [requestChainFeeIncrease](#requestchainfeeincrease) - Request a CPFP spend on
206
208
  a UTXO
@@ -281,6 +283,32 @@ for `unlocker` methods.
281
283
  - [probing](https://npmjs.com/package/probing) - payment probing utilities
282
284
  - [psbt](https://www.npmjs.com/package/psbt) - BIP 174 PSBT utilities
283
285
 
286
+ ### addExternalSocket
287
+
288
+ Add a new advertised p2p socket address
289
+
290
+ Note: this method is not supported in LND versions 0.14.3 and below
291
+
292
+ Requires LND built with `peersrpc` build tag
293
+
294
+ Requires `peers:write` permissions
295
+
296
+ {
297
+ lnd: <Authenticated LND API Object>
298
+ socket: <Add Socket Address String>
299
+ }
300
+
301
+ @returns via cbk or Promise
302
+
303
+ Example:
304
+
305
+ ```node
306
+ const {addExternalSocket} = require('ln-service');
307
+
308
+ // Add a new address to advertise on the graph via gossip
309
+ await addExternalSocket({lnd, socket: '192.168.0.1:9735'});
310
+ ```
311
+
284
312
  ### addPeer
285
313
 
286
314
  Add a peer if possible (not self, or already connected)
@@ -2903,8 +2931,11 @@ Call this iteratively after failed route attempts to get new routes
2903
2931
 
2904
2932
  Requires `info:read` permission
2905
2933
 
2934
+ Preferred `confidence` is not supported on LND 0.14.3 and below
2935
+
2906
2936
  {
2907
2937
  [cltv_delta]: <Final CLTV Delta Number>
2938
+ [confidence]: <Preferred Route Confidence Number Out of One Million Number>
2908
2939
  destination: <Final Send Destination Hex Encoded Public Key String>
2909
2940
  [features]: [{
2910
2941
  bit: <Feature Bit Number>
@@ -3303,8 +3334,11 @@ Determine if a payment destination is actually payable by probing it
3303
3334
 
3304
3335
  Requires `offchain:write` permission
3305
3336
 
3337
+ Preferred `confidence` is not supported on LND 0.14.3 and below
3338
+
3306
3339
  {
3307
3340
  [cltv_delta]: <Final CLTV Delta Number>
3341
+ [confidence]: <Preferred Route Confidence Number Out of One Million Number>
3308
3342
  destination: <Pay to Node with Public Key Hex String>
3309
3343
  [incoming_peer]: <Pay Through Specific Final Hop Public Key Hex String>
3310
3344
  lnd: <Authenticated LND API Object>
@@ -3584,7 +3618,10 @@ Requires `offchain:write` permission
3584
3618
 
3585
3619
  `max_path_mtokens` is not supported in LND 0.12.0 or below
3586
3620
 
3621
+ Preferred `confidence` is not supported on LND 0.14.3 and below
3622
+
3587
3623
  {
3624
+ [confidence]: <Preferred Route Confidence Number Out of One Million Number>
3588
3625
  [incoming_peer]: <Pay Through Specific Final Hop Public Key Hex String>
3589
3626
  lnd: <Authenticated LND API Object>
3590
3627
  [max_fee]: <Maximum Additional Fee Tokens To Pay Number>
@@ -3671,8 +3708,11 @@ Requires `offchain:write` permission
3671
3708
 
3672
3709
  `max_path_mtokens` is not supported in LND 0.12.0 or below
3673
3710
 
3711
+ Preferred `confidence` is not supported on LND 0.14.3 and below
3712
+
3674
3713
  {
3675
3714
  [cltv_delta]: <Final CLTV Delta Number>
3715
+ [confidence]: <Preferred Route Confidence Number Out of One Million Number>
3676
3716
  destination: <Destination Public Key String>
3677
3717
  [features]: [{
3678
3718
  bit: <Feature Bit Number>
@@ -3758,7 +3798,10 @@ Requires `offchain:write` permission
3758
3798
 
3759
3799
  `max_path_mtokens` is not supported in LND 0.12.0 or below
3760
3800
 
3801
+ Preferred `confidence` is not supported on LND 0.14.3 and below
3802
+
3761
3803
  {
3804
+ [confidence]: <Preferred Route Confidence Number Out of One Million Number>
3762
3805
  [incoming_peer]: <Pay Through Specific Final Hop Public Key Hex String>
3763
3806
  lnd: <Authenticated LND API Object>
3764
3807
  [max_fee]: <Maximum Fee Tokens To Pay Number>
@@ -3960,8 +4003,11 @@ If `total_mtokens` are specified, a `payment` nonce is required.
3960
4003
 
3961
4004
  Requires `offchain:write` permission
3962
4005
 
4006
+ Preferred `confidence` is not supported on LND 0.14.3 and below
4007
+
3963
4008
  {
3964
4009
  [cltv_delta]: <Final CLTV Delta Number>
4010
+ [confidence]: <Preferred Route Confidence Number Out of One Million Number>
3965
4011
  destination: <Destination Public Key Hex String>
3966
4012
  [features]: [{
3967
4013
  bit: <Feature Bit Number>
@@ -4139,6 +4185,32 @@ const {backup} = await getBackups({lnd});
4139
4185
  await recoverFundsFromChannels({backup, lnd});
4140
4186
  ```
4141
4187
 
4188
+ ### removeExternalSocket
4189
+
4190
+ Remove an existing advertised p2p socket address
4191
+
4192
+ Note: this method is not supported in LND versions 0.14.3 and below
4193
+
4194
+ Requires LND built with `peersrpc` build tag
4195
+
4196
+ Requires `peers:write` permissions
4197
+
4198
+ {
4199
+ lnd: <Authenticated LND API Object>
4200
+ socket: <Remove Socket Address String>
4201
+ }
4202
+
4203
+ @returns via cbk or Promise
4204
+
4205
+ Example:
4206
+
4207
+ ```node
4208
+ const {removeExternalSocket} = require('ln-service');
4209
+
4210
+ // Stop an address being advertised on the graph via gossip
4211
+ await removeExternalSocket({lnd, socket: '127.0.0.1:9735'});
4212
+ ```
4213
+
4142
4214
  ### removePeer
4143
4215
 
4144
4216
  Remove a peer if possible
@@ -5519,8 +5591,11 @@ Requires `offchain:write` permission
5519
5591
 
5520
5592
  `max_path_mtokens` is not supported in LND 0.12.0 or below
5521
5593
 
5594
+ Preferred `confidence` is not supported on LND 0.14.3 and below
5595
+
5522
5596
  {
5523
5597
  [cltv_delta]: <Final CLTV Delta Number>
5598
+ [confidence]: <Preferred Route Confidence Number Out of One Million Number>
5524
5599
  destination: <Destination Public Key String>
5525
5600
  [features]: [{
5526
5601
  bit: <Feature Bit Number>
@@ -5682,7 +5757,10 @@ Requires `offchain:write` permission
5682
5757
 
5683
5758
  `max_path_mtokens` is not supported in LND 0.12.0 or below
5684
5759
 
5760
+ Preferred `confidence` is not supported on LND 0.14.3 and below
5761
+
5685
5762
  {
5763
+ [confidence]: <Preferred Route Confidence Number Out of One Million Number>
5686
5764
  [incoming_peer]: <Pay Through Specific Final Hop Public Key Hex String>
5687
5765
  lnd: <Authenticated LND API Object>
5688
5766
  [max_fee]: <Maximum Fee Tokens To Pay Number>
@@ -6090,8 +6168,11 @@ Subscribe to a probe attempt
6090
6168
 
6091
6169
  Requires `offchain:write` permission
6092
6170
 
6171
+ Preferred `confidence` is not supported on LND 0.14.3 and below
6172
+
6093
6173
  {
6094
6174
  [cltv_delta]: <Final CLTV Delta Number>
6175
+ [confidence]: <Preferred Route Confidence Number Out of One Million Number>
6095
6176
  destination: <Destination Public Key Hex String>
6096
6177
  [features]: [{
6097
6178
  bit: <Feature Bit Number>
package/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ const {addExternalSocket} = require('lightning');
1
2
  const {addPeer} = require('lightning');
2
3
  const {authenticatedLndGrpc} = require('lightning');
3
4
  const {broadcastChainTransaction} = require('lightning');
@@ -88,6 +89,7 @@ const {probeForRoute} = require('lightning');
88
89
  const {proposeChannel} = require('lightning');
89
90
  const {recoverFundsFromChannel} = require('lightning');
90
91
  const {recoverFundsFromChannels} = require('lightning');
92
+ const {removeExternalSocket} = require('lightning');
91
93
  const {removePeer} = require('lightning');
92
94
  const {requestChainFeeIncrease} = require('lightning');
93
95
  const {restrictMacaroon} = require('./macaroons');
@@ -142,6 +144,7 @@ const {verifyBytesSignature} = require('lightning');
142
144
  const {verifyMessage} = require('lightning');
143
145
 
144
146
  module.exports = {
147
+ addExternalSocket,
145
148
  addPeer,
146
149
  authenticatedLndGrpc,
147
150
  broadcastChainTransaction,
@@ -232,6 +235,7 @@ module.exports = {
232
235
  proposeChannel,
233
236
  recoverFundsFromChannel,
234
237
  recoverFundsFromChannels,
238
+ removeExternalSocket,
235
239
  removePeer,
236
240
  requestChainFeeIncrease,
237
241
  restrictMacaroon,
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "cors": "2.8.5",
12
12
  "express": "4.17.3",
13
13
  "invoices": "2.0.6",
14
- "lightning": "5.12.0",
14
+ "lightning": "5.14.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.8",
31
+ "ln-docker-daemons": "2.2.9",
32
32
  "p2tr": "1.3.1",
33
33
  "portfinder": "1.0.28",
34
34
  "psbt": "2.0.1",
@@ -70,5 +70,5 @@
70
70
  "integration-test-0.12.0": "DOCKER_LND_VERSION=v0.12.0-beta npm run test",
71
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"
72
72
  },
73
- "version": "53.13.0"
73
+ "version": "53.15.0"
74
74
  }
@@ -0,0 +1,34 @@
1
+ const {spawnLightningCluster} = require('ln-docker-daemons');
2
+ const {test} = require('@alexbosworth/tap');
3
+
4
+ const {addExternalSocket} = require('./../../');
5
+ const {getWalletInfo} = require('./../../');
6
+
7
+ const socket = '192.168.0.1:12345';
8
+
9
+ // Adding a node socket should result in an updated advertised socket
10
+ test(`Add external socket`, async ({end, strictSame}) => {
11
+ const {kill, nodes} = await spawnLightningCluster({});
12
+
13
+ const [{id, lnd}] = nodes;
14
+
15
+ const additional = `${id}@${socket}`;
16
+
17
+ try {
18
+ const {uris} = await getWalletInfo({lnd});
19
+
20
+ const [existing] = uris;
21
+
22
+ await addExternalSocket({lnd, socket});
23
+
24
+ const updated = await getWalletInfo({lnd});
25
+
26
+ strictSame(updated.uris, [existing, additional], 'Added new socket');
27
+ } catch (err) {
28
+ strictSame(err, [400, 'ExpectedPeersRpcLndBuildTagToAddSocket']);
29
+ }
30
+
31
+ await kill({});
32
+
33
+ return end();
34
+ });
@@ -0,0 +1,32 @@
1
+ const {spawnLightningCluster} = require('ln-docker-daemons');
2
+ const {test} = require('@alexbosworth/tap');
3
+
4
+ const {getWalletInfo} = require('./../../');
5
+ const {removeExternalSocket} = require('./../../');
6
+
7
+ // Removign a node socket should result in a no longer advertised socket
8
+ test(`Add external socket`, async ({end, strictSame}) => {
9
+ const {kill, nodes} = await spawnLightningCluster({});
10
+
11
+ const [{id, lnd}] = nodes;
12
+
13
+ try {
14
+ const {uris} = await getWalletInfo({lnd});
15
+
16
+ const [uri] = uris;
17
+
18
+ const [, socket] = uri.split('@');
19
+
20
+ await removeExternalSocket({lnd, socket});
21
+
22
+ const updated = await getWalletInfo({lnd});
23
+
24
+ strictSame(updated.uris, [], 'External socket removed');
25
+ } catch (err) {
26
+ strictSame(err, [400, 'ExpectedPeersRpcLndBuildTagToRemoveSocket']);
27
+ }
28
+
29
+ await kill({});
30
+
31
+ return end();
32
+ });