ln-service 53.1.2 → 53.2.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,6 +1,10 @@
1
1
  # Versions
2
2
 
3
- ## 53.1.1
3
+ ## 54.2.0
4
+
5
+ - `getPendingChannels`: Add support for channel `capacity`
6
+
7
+ ## 53.1.2
4
8
 
5
9
  - `openChannels`: Fix `cooperative_close_address` not being set on channels
6
10
 
package/README.md CHANGED
@@ -74,8 +74,8 @@ the LND directory. (~/.lnd or ~/Library/Application Support/Lnd)
74
74
 
75
75
  Be careful to avoid copying any newline characters in creds. To exclude them:
76
76
 
77
- base64 ~/.lnd/tls.cert | tr -d '\n'
78
- base64 ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon | tr -d '\n'
77
+ base64 -w0 ~/.lnd/tls.cert
78
+ base64 -w0 ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
79
79
 
80
80
  You can then use these to interact with your LND node directly:
81
81
 
@@ -2535,6 +2535,7 @@ Requires `offchain:read` permission
2535
2535
  @returns via cbk or Promise
2536
2536
  {
2537
2537
  pending_channels: [{
2538
+ capacity: <Channel Capacity Tokens Number>
2538
2539
  [close_transaction_id]: <Channel Closing Transaction Id String>
2539
2540
  is_active: <Channel Is Active Bool>
2540
2541
  is_closing: <Channel Is Closing Bool>
@@ -3205,11 +3206,11 @@ Requires `offchain:write`, `onchain:write`, `peers:write` permissions
3205
3206
  [give_tokens]: <Tokens to Gift To Partner Number> // Defaults to zero
3206
3207
  [is_private]: <Channel is Private Bool> // Defaults to false
3207
3208
  lnd: <Authenticated LND API Object>
3208
- local_tokens: <Local Tokens Number>
3209
+ local_tokens: <Total Channel Capacity Tokens Number>
3209
3210
  [min_confirmations]: <Spend UTXOs With Minimum Confirmations Number>
3210
3211
  [min_htlc_mtokens]: <Minimum HTLC Millitokens String>
3211
- partner_public_key: <Public Key Hex String>
3212
3212
  [partner_csv_delay]: <Peer Output CSV Delay Number>
3213
+ partner_public_key: <Public Key Hex String>
3213
3214
  [partner_socket]: <Peer Connection Host:Port String>
3214
3215
  }
3215
3216
 
@@ -3250,8 +3251,8 @@ after the funding step.
3250
3251
  [give_tokens]: <Tokens to Gift To Partner Number> // Defaults to zero
3251
3252
  [is_private]: <Channel is Private Bool> // Defaults to false
3252
3253
  [min_htlc_mtokens]: <Minimum HTLC Millitokens String>
3253
- partner_public_key: <Public Key Hex String>
3254
3254
  [partner_csv_delay]: <Peer Output CSV Delay Number>
3255
+ partner_public_key: <Public Key Hex String>
3255
3256
  [partner_socket]: <Peer Connection Host:Port String>
3256
3257
  }]
3257
3258
  [is_avoiding_broadcast]: <Avoid Broadcast of All Channels Bool>
@@ -6060,8 +6061,8 @@ This method is not supported in LND 0.13.4 and below
6060
6061
  local_tokens: <Local Tokens Number>
6061
6062
  [min_confirmations]: <Spend UTXOs With Minimum Confirmations Number>
6062
6063
  [min_htlc_mtokens]: <Minimum HTLC Millitokens String>
6063
- partner_public_key: <Public Key Hex String>
6064
6064
  [partner_csv_delay]: <Peer Output CSV Delay Number>
6065
+ partner_public_key: <Public Key Hex String>
6065
6066
  }
6066
6067
  uri: <RPC URI String>
6067
6068
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "cors": "2.8.5",
12
12
  "express": "4.17.1",
13
13
  "invoices": "2.0.2",
14
- "lightning": "5.1.1",
14
+ "lightning": "5.2.1",
15
15
  "macaroon": "3.0.4",
16
16
  "morgan": "1.10.0",
17
17
  "ws": "8.3.0"
@@ -35,7 +35,7 @@
35
35
  "varuint-bitcoin": "1.1.2"
36
36
  },
37
37
  "engines": {
38
- "node": ">=12"
38
+ "node": ">=12.20"
39
39
  },
40
40
  "keywords": [
41
41
  "bitcoin",
@@ -54,5 +54,5 @@
54
54
  "scripts": {
55
55
  "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"
56
56
  },
57
- "version": "53.1.2"
57
+ "version": "53.2.0"
58
58
  }
@@ -51,6 +51,7 @@ test(`Get pending channels`, async ({end, equal}) => {
51
51
  equal(channel.pending_balance, 980950, 'Waiting on balance');
52
52
  }
53
53
 
54
+ equal(channel.capacity, 1000000, 'Got channel capacity');
54
55
  equal(channel.close_transaction_id, undefined, 'No close tx id');
55
56
  equal(channel.is_active, false, 'Ended');
56
57
  equal(channel.is_closing, true, 'Closing');
@@ -68,6 +68,7 @@ test(`Get pending channels`, async ({end, equal}) => {
68
68
  equal(pendingOpen.transaction_weight, 724, 'Channel tx weight');
69
69
  }
70
70
 
71
+ equal(pendingOpen.capacity, 1000000, 'Got channel opening capacity');
71
72
  equal(pendingOpen.close_transaction_id, undefined, 'Not closing');
72
73
  equal(pendingOpen.is_active, false, 'Not active yet');
73
74
  equal(pendingOpen.is_closing, false, 'Not closing yet');
@@ -111,6 +112,7 @@ test(`Get pending channels`, async ({end, equal}) => {
111
112
  equal(waitClose.pending_balance, 980950, 'Waiting on balance');
112
113
  }
113
114
 
115
+ equal(waitClose.capacity, 1000000, 'Got channel closing capacity');
114
116
  equal(waitClose.close_transaction_id, undefined, 'Waiting for close tx');
115
117
  equal(waitClose.is_active, false, 'Not active yet');
116
118
  equal(waitClose.is_closing, true, 'Channel is closing');
@@ -166,6 +168,7 @@ test(`Get pending channels`, async ({end, equal}) => {
166
168
  equal(forceClose.pending_balance, 980950, 'Waiting on balance');
167
169
  }
168
170
 
171
+ equal(forceClose.capacity, 1000000, 'Got channel close capacity');
169
172
  equal(forceClose.close_transaction_id, channelClose.transaction_id, 'Txid');
170
173
  equal(forceClose.is_active, false, 'Not active anymore');
171
174
  equal(forceClose.is_closing, true, 'Channel is force closing');
@@ -359,6 +359,7 @@ test(`Propose a channel with a coop delay`, async ({end, equal, ok}) => {
359
359
  equal(incoming.transaction_weight, 724, 'Funding tx weight');
360
360
  }
361
361
 
362
+ equal(incoming.capacity, 1000000, 'Incoming capacity is defined');
362
363
  equal(incoming.close_transaction_id, undefined, 'Not a closing tx');
363
364
  equal(incoming.is_active, false, 'Not active yet');
364
365
  equal(incoming.is_closing, false, 'Channel is not closing');
@@ -1,5 +1,6 @@
1
1
  const {once} = require('events');
2
2
 
3
+ const asyncRetry = require('async/retry');
3
4
  const {spawnLightningCluster} = require('ln-docker-daemons');
4
5
  const {test} = require('@alexbosworth/tap');
5
6
 
@@ -9,7 +10,9 @@ const {removePeer} = require('./../../');
9
10
  const {subscribeToPeers} = require('./../../');
10
11
 
11
12
  const all = promise => Promise.all(promise);
13
+ const interval = 10;
12
14
  const size = 2;
15
+ const times = 1000;
13
16
 
14
17
  // Subscribing to peer events should trigger reception of peer status changes
15
18
  test(`Subscribe to peers`, async ({end, equal}) => {
@@ -21,7 +24,9 @@ test(`Subscribe to peers`, async ({end, equal}) => {
21
24
 
22
25
  sub.on('error', () => {});
23
26
 
24
- await addPeer({lnd, public_key: target.id, socket: target.socket});
27
+ await asyncRetry({interval, times}, async () => {
28
+ await addPeer({lnd, public_key: target.id, socket: target.socket});
29
+ });
25
30
 
26
31
  const disconnect = removePeer({lnd, public_key: target.id});
27
32
  const receiveDisconnect = once(sub, 'disconnected');
@@ -32,7 +37,9 @@ test(`Subscribe to peers`, async ({end, equal}) => {
32
37
 
33
38
  equal(disconnected.public_key, target.id, 'Got d/c event');
34
39
 
35
- const connect = addPeer({lnd, public_key: target.id, socket: target.socket});
40
+ const connect = asyncRetry({interval, times}, async () => {
41
+ return addPeer({lnd, public_key: target.id, socket: target.socket});
42
+ });
36
43
 
37
44
  const receiveConnectMessage = once(sub, 'connected');
38
45
 
@@ -103,7 +103,7 @@ test(`Pay with multiple paths`, async ({end, equal, rejects, strictSame}) => {
103
103
  total_mtokens: parsed.mtokens,
104
104
  });
105
105
 
106
- // Pay using routes. Multiple channels must be used too avoid tempChanFail
106
+ // Pay using routes. Multiple channels must be used to avoid tempChanFail
107
107
  try {
108
108
  const routes = [route1.route, route2.route];
109
109