lightning 5.6.1 → 5.6.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
- ## 5.6.1
3
+ ## 5.6.2
4
4
 
5
5
  - `payViaRoutes`, `subscribeToPayViaRoutes`: Add support for relay messages
6
6
 
@@ -1,6 +1,7 @@
1
1
  const asyncAuto = require('async/auto');
2
2
  const {decodePsbt} = require('psbt');
3
3
  const {returnResult} = require('asyncjs-util');
4
+ const tinysecp = require('tiny-secp256k1');
4
5
  const {Transaction} = require('bitcoinjs-lib');
5
6
 
6
7
  const {isLnd} = require('./../../lnd_requests');
@@ -67,6 +68,9 @@ const txIdFromHash = hash => hash.reverse().toString('hex');
67
68
  module.exports = (args, cbk) => {
68
69
  return new Promise((resolve, reject) => {
69
70
  return asyncAuto({
71
+ // Import ECPair library
72
+ ecp: async () => (await import('ecpair')).ECPairFactory(tinysecp),
73
+
70
74
  // Check arguments
71
75
  validate: cbk => {
72
76
  if (!isLnd({method, type, lnd: args.lnd})) {
@@ -201,11 +205,11 @@ module.exports = (args, cbk) => {
201
205
  }],
202
206
 
203
207
  // Derive the raw transaction from the funded PSBT
204
- tx: ['fund', ({fund}, cbk) => {
208
+ tx: ['fund', ({ecp, fund}, cbk) => {
205
209
  const {psbt} = fund;
206
210
 
207
211
  try {
208
- const tx = fromHex(decodePsbt({psbt}).unsigned_transaction);
212
+ const tx = fromHex(decodePsbt({ecp, psbt}).unsigned_transaction);
209
213
 
210
214
  return cbk(null, tx);
211
215
  } catch (err) {
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "@grpc/grpc-js": "1.5.4",
11
11
  "@grpc/proto-loader": "0.6.9",
12
12
  "@types/express": "4.17.13",
13
- "@types/node": "17.0.14",
13
+ "@types/node": "17.0.15",
14
14
  "@types/request": "2.48.8",
15
15
  "@types/ws": "8.2.2",
16
16
  "async": "3.2.3",
@@ -21,9 +21,11 @@
21
21
  "bolt07": "1.8.0",
22
22
  "bolt09": "0.2.1",
23
23
  "cbor": "8.1.0",
24
+ "ecpair": "2.0.1",
24
25
  "express": "4.17.2",
25
26
  "invoices": "2.0.3",
26
- "psbt": "1.1.11",
27
+ "psbt": "2.0.0",
28
+ "tiny-secp256k1": "2.2.0",
27
29
  "type-fest": "2.11.1"
28
30
  },
29
31
  "description": "Lightning Network client library",
@@ -57,5 +59,5 @@
57
59
  "directory": "test/typescript"
58
60
  },
59
61
  "types": "index.d.ts",
60
- "version": "5.6.1"
62
+ "version": "5.6.2"
61
63
  }