ln-service 59.2.5 → 59.3.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,14 @@
1
1
  # Versions
2
2
 
3
+ ## 59.3.0
4
+
5
+ - `parsePaymentRequest`: Add `signet` support
6
+
7
+ ## 59.2.6
8
+
9
+ - Add support for LND 0.21.2
10
+ - Add support for LND 0.20.3
11
+
3
12
  ## 59.2.5
4
13
 
5
14
  - Add support for LND 0.20.2
package/README.md CHANGED
@@ -9,8 +9,8 @@ through npm.
9
9
 
10
10
  Supported LND versions:
11
11
 
12
- - v0.21.0-beta to v0.21.1-beta
13
- - v0.20.0-beta to v0.20.2-beta
12
+ - v0.21.0-beta to v0.21.2-beta
13
+ - v0.20.0-beta to v0.20.3-beta
14
14
 
15
15
  For typescript-ready methods, check out https://github.com/alexbosworth/lightning#readme
16
16
 
package/package.json CHANGED
@@ -8,13 +8,13 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "bolt07": "1.9.5",
11
- "invoices": "6.0.5",
12
- "lightning": "12.2.4",
11
+ "invoices": "6.1.0",
12
+ "lightning": "12.2.5",
13
13
  "macaroon": "3.0.4"
14
14
  },
15
15
  "description": "Interaction helper for your Lightning Network daemon",
16
16
  "devDependencies": {
17
- "@alexbosworth/blockchain": "4.0.0",
17
+ "@alexbosworth/blockchain": "4.1.0",
18
18
  "@alexbosworth/node-fetch": "2.6.2",
19
19
  "async": "3.2.6",
20
20
  "asyncjs-util": "1.2.12",
@@ -51,12 +51,14 @@
51
51
  "url": "https://github.com/alexbosworth/ln-service.git"
52
52
  },
53
53
  "scripts": {
54
+ "integration-test-0.21.2": "DOCKER_LND_VERSION=v0.21.2-beta npm run test",
54
55
  "integration-test-0.21.1": "DOCKER_LND_VERSION=v0.21.1-beta npm run test",
55
56
  "integration-test-0.21.0": "DOCKER_LND_VERSION=v0.21.0-beta npm run test",
57
+ "integration-test-0.20.3": "DOCKER_LND_VERSION=v0.20.3-beta npm run test",
56
58
  "integration-test-0.20.2": "DOCKER_LND_VERSION=v0.20.2-beta npm run test",
57
59
  "integration-test-0.20.1": "DOCKER_LND_VERSION=v0.20.1-beta npm run test",
58
60
  "integration-test-0.20.0": "DOCKER_LND_VERSION=v0.20.0-beta npm run test",
59
61
  "test": "echo $DOCKER_LND_VERSION && node test/runner"
60
62
  },
61
- "version": "59.2.5"
63
+ "version": "59.3.0"
62
64
  }
@@ -10,6 +10,8 @@ const {extractTransaction} = require('psbt');
10
10
  const {finalizePsbt} = require('psbt');
11
11
  const {idForTransaction} = require('@alexbosworth/blockchain');
12
12
  const {networks} = require('bitcoinjs-lib');
13
+ const {p2msScript} = require('@alexbosworth/blockchain');
14
+ const {p2wshOutputScript} = require('@alexbosworth/blockchain');
13
15
  const {payments} = require('bitcoinjs-lib');
14
16
  const {script} = require('bitcoinjs-lib');
15
17
  const {spawnLightningCluster} = require('ln-docker-daemons');
@@ -31,6 +33,7 @@ const {proposeChannel} = require('./../../');
31
33
  const {signPsbt} = require('./../../');
32
34
  const {signTransaction} = require('./../../');
33
35
 
36
+ const bufferAsHex = buffer => buffer.toString('hex');
34
37
  const capacity = 1e6;
35
38
  const {ceil} = Math;
36
39
  const cooperativeCloseDelay = 2016;
@@ -42,7 +45,6 @@ const idForTx = transaction => idForTransaction({transaction}).id;
42
45
  const interval = 100;
43
46
  const keyIndex = 0;
44
47
  const network = 'regtest';
45
- const {p2ms} = payments;
46
48
  const {p2pkh} = payments;
47
49
  const {regtest} = networks;
48
50
  const reserveRatio = 0.01;
@@ -158,19 +160,19 @@ test(`Propose a channel with a coop delay`, async () => {
158
160
  ];
159
161
 
160
162
  // Make the channel 2:2 funding output from control and target keys
161
- const dualFundingChannelAddress = payments.p2wsh({
162
- redeem: p2ms({
163
- m: fundingMultiSigKeys.length,
164
- pubkeys: fundingMultiSigKeys.sort().map(n => Buffer.from(n, 'hex')),
165
- }),
163
+ const dualFundingChannelOutputScript = p2wshOutputScript({
164
+ hash: p2msScript({
165
+ keys: fundingMultiSigKeys.sort().map(n => Buffer.from(n, 'hex')),
166
+ required: fundingMultiSigKeys.length,
167
+ }).hash,
166
168
  });
167
169
 
168
- const pendingChannelId = dualFundingChannelAddress.hash;
170
+ const pendingChannelId = dualFundingChannelOutputScript.script.slice(2);
169
171
 
170
172
  // Create the basic PSBT that spends temporary funds to the 2:2 funding
171
173
  const dualFundPsbt = createPsbt({
172
174
  outputs: [{
173
- script: dualFundingChannelAddress.output.toString('hex'),
175
+ script: bufferAsHex(dualFundingChannelOutputScript.script),
174
176
  tokens: capacity,
175
177
  }],
176
178
  utxos: [
@@ -235,7 +237,7 @@ test(`Propose a channel with a coop delay`, async () => {
235
237
  inputs: [{
236
238
  key_family: temporaryFamily,
237
239
  key_index: controlDerivedKey.index,
238
- output_script: dualFundingChannelAddress.output.toString('hex'),
240
+ output_script: bufferAsHex(dualFundingChannelOutputScript.script),
239
241
  output_tokens: giveTokens + ceil(fundingFee / temporaryKeys.length),
240
242
  sighash: Transaction.SIGHASH_ALL,
241
243
  vin: controlVin,
@@ -267,7 +269,7 @@ test(`Propose a channel with a coop delay`, async () => {
267
269
  inputs: [{
268
270
  key_family: temporaryFamily,
269
271
  key_index: targetDerivedKey.index,
270
- output_script: dualFundingChannelAddress.output.toString('hex'),
272
+ output_script: bufferAsHex(dualFundingChannelOutputScript.script),
271
273
  output_tokens: giveTokens + ceil(fundingFee / temporaryKeys.length),
272
274
  sighash: Transaction.SIGHASH_ALL,
273
275
  vin: targetVin,