ln-service 56.13.0 → 56.14.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,9 @@
1
1
  # Versions
2
2
 
3
+ ## 56.14.0
4
+
5
+ - `openChannel`: Add `is_allowing_minimal_reserve` to allow no reserve on peer
6
+
3
7
  ## 56.13.0
4
8
 
5
9
  - `openChannels`: Add `is_simplified_taproot` to make a simplified taproot chan
package/README.md CHANGED
@@ -3758,6 +3758,8 @@ Requires `offchain:write`, `onchain:write`, `peers:write` permissions
3758
3758
  `base_fee_mtokens` is not supported on LND 0.15.5 and below
3759
3759
  `fee_rate` is not supported on LND 0.15.5 and below
3760
3760
 
3761
+ `is_allowing_minimal_reserve` is not supported on LND 0.15.0 and below
3762
+
3761
3763
  `is_max_funding` is not supported on LND 0.16.4 and below
3762
3764
 
3763
3765
  `description` is not supported on LND 0.16.4 and below
@@ -3778,6 +3780,7 @@ Requires `offchain:write`, `onchain:write`, `peers:write` permissions
3778
3780
  transaction_id: <Fund With Unspent Transaction Id Hex String>
3779
3781
  transaction_vout: <Fund With Unspent Transaction Output Index Number>
3780
3782
  }]
3783
+ [is_allowing_minimal_reserve]: <Allow Peer to Have Minimal Reserve Bool>
3781
3784
  [is_max_funding]: <Use Maximal Chain Funds For Local Funding Bool>
3782
3785
  [is_private]: <Channel is Private Bool> // Defaults to false
3783
3786
  [is_simplified_taproot]: <Channel is Simplified Taproot Type Bool>
package/package.json CHANGED
@@ -11,10 +11,10 @@
11
11
  "cors": "2.8.5",
12
12
  "express": "4.18.2",
13
13
  "invoices": "3.0.0",
14
- "lightning": "9.13.0",
14
+ "lightning": "9.14.0",
15
15
  "macaroon": "3.0.4",
16
16
  "morgan": "1.10.0",
17
- "ws": "8.13.0"
17
+ "ws": "8.14.2"
18
18
  },
19
19
  "description": "Interaction helper for your Lightning Network daemon",
20
20
  "devDependencies": {
@@ -24,7 +24,7 @@
24
24
  "asyncjs-util": "1.2.12",
25
25
  "bip32": "4.0.0",
26
26
  "bip66": "1.1.5",
27
- "bitcoinjs-lib": "6.1.3",
27
+ "bitcoinjs-lib": "6.1.5",
28
28
  "bn.js": "5.2.1",
29
29
  "bs58check": "3.0.1",
30
30
  "ecpair": "2.1.0",
@@ -32,10 +32,10 @@
32
32
  "p2tr": "2.0.0",
33
33
  "portfinder": "1.0.32",
34
34
  "psbt": "3.0.0",
35
- "rimraf": "5.0.1",
35
+ "rimraf": "5.0.5",
36
36
  "secp256k1": "5.0.0",
37
37
  "tiny-secp256k1": "2.2.3",
38
- "uuid": "9.0.0",
38
+ "uuid": "9.0.1",
39
39
  "varuint-bitcoin": "1.1.2"
40
40
  },
41
41
  "engines": {
@@ -69,5 +69,5 @@
69
69
  "integration-test-0.14.4": "DOCKER_LND_VERSION=v0.14.4-beta npm run test",
70
70
  "test": "echo $DOCKER_LND_VERSION && node test/runner"
71
71
  },
72
- "version": "56.13.0"
72
+ "version": "56.14.0"
73
73
  }
@@ -0,0 +1,92 @@
1
+ const {equal} = require('node:assert').strict;
2
+ const test = require('node:test');
3
+
4
+ const asyncRetry = require('async/retry');
5
+ const {spawnLightningCluster} = require('ln-docker-daemons');
6
+
7
+ const {addPeer} = require('./../../');
8
+ const {getChannels} = require('./../../');
9
+ const {getWalletInfo} = require('./../../');
10
+ const {openChannel} = require('./../../');
11
+ const {subscribeToOpenRequests} = require('./../../');
12
+
13
+ const channelCapacityTokens = 1e6;
14
+ const confirmationCount = 6;
15
+ const count = 100;
16
+ const dustLimit = 354;
17
+ const interval = 10;
18
+ const size = 2;
19
+ const times = 2000;
20
+
21
+ // Open a channel with a low channel reserve
22
+ test(`Open channel but allow a minimal channel reserve`, async () => {
23
+ const {kill, nodes} = await spawnLightningCluster({size});
24
+
25
+ const [control, target] = nodes;
26
+
27
+ const {id, lnd} = control;
28
+
29
+ await target.generate({count});
30
+
31
+ await addPeer({lnd, public_key: target.id, socket: target.socket});
32
+
33
+ await asyncRetry({interval, times}, async () => {
34
+ const wallet = await getWalletInfo({lnd: target.lnd});
35
+
36
+ if (!wallet.is_synced_to_chain) {
37
+ throw new Error('ExpectedWalletSyncedToChain');
38
+ }
39
+ });
40
+
41
+ const acceptSub = subscribeToOpenRequests({lnd});
42
+
43
+ acceptSub.on('channel_request', request => {
44
+ request.accept({
45
+ min_confirmations: 1,
46
+ remote_csv: 999,
47
+ remote_reserve: 354,
48
+ remote_max_htlcs: 20,
49
+ remote_max_pending_mtokens: '200000',
50
+ remote_min_htlc_mtokens: '2000',
51
+ });
52
+
53
+ return;
54
+ });
55
+
56
+ try {
57
+ await asyncRetry({interval, times}, async () => {
58
+ return await openChannel({
59
+ lnd: target.lnd,
60
+ is_private: true,
61
+ is_allowing_minimal_reserve: true,
62
+ local_tokens: channelCapacityTokens,
63
+ partner_public_key: control.id,
64
+ socket: control.socket,
65
+ });
66
+ });
67
+ } catch (err) {
68
+ equal(err, null, 'Expected no error when a channel is accepted');
69
+ }
70
+
71
+ acceptSub.removeAllListeners();
72
+
73
+ await target.generate({count: confirmationCount});
74
+
75
+ const channel = await asyncRetry({interval, times}, async () => {
76
+ const [channel] = (await getChannels({lnd})).channels;
77
+
78
+ await control.generate({});
79
+
80
+ if (!channel) {
81
+ throw new Error('ExpectedChannelCreation');
82
+ }
83
+
84
+ return channel;
85
+ });
86
+
87
+ equal(channel.remote_reserve, dustLimit, 'Got minimal reserve value');
88
+
89
+ await kill({});
90
+
91
+ return;
92
+ });