ln-service 59.3.1 → 59.3.2

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,6 @@
1
1
  # Versions
2
2
 
3
- ## 59.3.1
3
+ ## 59.3.2
4
4
 
5
5
  - `parsePaymentRequest`: Add `signet` support
6
6
 
package/package.json CHANGED
@@ -9,12 +9,12 @@
9
9
  "dependencies": {
10
10
  "bolt07": "1.9.5",
11
11
  "invoices": "6.1.0",
12
- "lightning": "12.2.5",
12
+ "lightning": "12.2.6",
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.1.1",
17
+ "@alexbosworth/blockchain": "4.2.0",
18
18
  "@alexbosworth/node-fetch": "2.6.2",
19
19
  "async": "3.2.6",
20
20
  "asyncjs-util": "1.2.12",
@@ -30,7 +30,7 @@
30
30
  "psbt": "5.0.0",
31
31
  "rimraf": "6.1.3",
32
32
  "tiny-secp256k1": "2.2.4",
33
- "uuid": "14.0.1",
33
+ "uuid": "14.0.2",
34
34
  "varuint-bitcoin": "2.0.0"
35
35
  },
36
36
  "engines": {
@@ -60,5 +60,5 @@
60
60
  "integration-test-0.20.0": "DOCKER_LND_VERSION=v0.20.0-beta npm run test",
61
61
  "test": "echo $DOCKER_LND_VERSION && node test/runner"
62
62
  },
63
- "version": "59.3.1"
63
+ "version": "59.3.2"
64
64
  }
@@ -6,8 +6,10 @@ const asyncRetry = require('async/retry');
6
6
  const {createPsbt} = require('psbt');
7
7
  const {combinePsbts} = require('psbt');
8
8
  const {decodePsbt} = require('psbt');
9
+ const {encodeBech32Address} = require('@alexbosworth/blockchain');
9
10
  const {extractTransaction} = require('psbt');
10
11
  const {finalizePsbt} = require('psbt');
12
+ const {hashForP2wpkh} = require('@alexbosworth/blockchain');
11
13
  const {idForTransaction} = require('@alexbosworth/blockchain');
12
14
  const {networks} = require('bitcoinjs-lib');
13
15
  const {p2msScript} = require('@alexbosworth/blockchain');
@@ -46,7 +48,8 @@ const interval = 100;
46
48
  const keyIndex = 0;
47
49
  const network = 'regtest';
48
50
  const {p2pkh} = payments;
49
- const {regtest} = networks;
51
+ const p2wpkhHash = key => hashForP2wpkh({key: Buffer.from(key, 'hex')}).hash;
52
+ const prefix = 'bcrt';
50
53
  const reserveRatio = 0.01;
51
54
  const size = 2;
52
55
  const temporaryFamily = 805;
@@ -103,17 +106,36 @@ test(`Propose a channel with a coop delay`, async () => {
103
106
  lnd: target.lnd,
104
107
  });
105
108
 
109
+
106
110
  // Control should fund and sign a transaction going to the control temp key
107
- const controlDerivedAddress = payments.p2wpkh({
108
- network: regtest,
109
- pubkey: Buffer.from(controlDerivedKey.public_key, 'hex'),
110
- });
111
+ const controlDerivedAddress = {
112
+ hash: p2wpkhHash(controlDerivedKey.public_key),
113
+ };
114
+
115
+ {
116
+ const {address} = encodeBech32Address({
117
+ prefix,
118
+ program: controlDerivedAddress.hash,
119
+ version: 0,
120
+ });
121
+
122
+ controlDerivedAddress.address = address;
123
+ }
111
124
 
112
125
  // Target should fund and sign a transaction going to the target temp key
113
- const targetDerivedAddress = payments.p2wpkh({
114
- network: regtest,
115
- pubkey: Buffer.from(targetDerivedKey.public_key, 'hex'),
116
- });
126
+ const targetDerivedAddress = {
127
+ hash: p2wpkhHash(targetDerivedKey.public_key),
128
+ };
129
+
130
+ {
131
+ const {address} = encodeBech32Address({
132
+ prefix,
133
+ program: targetDerivedAddress.hash,
134
+ version: 0,
135
+ });
136
+
137
+ targetDerivedAddress.address = address;
138
+ }
117
139
 
118
140
  const temporaryKeys = [controlDerivedKey, targetDerivedKey];
119
141