paid-services 3.11.1 → 3.11.3

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
- ## Version 3.11.1
3
+ ## Version 3.11.3
4
4
 
5
5
  - `changeChannelCapacity`: Add `nodes` to allow moving channel to another node
6
6
 
@@ -7,6 +7,7 @@ const {fromHex} = Transaction;
7
7
  /** Generate a dummy PSBT to allow for setting up the channel funding
8
8
 
9
9
  {
10
+ ecp: <ECPair Object>
10
11
  [increase_transaction]: <Increase Funds Transaction Hex String>
11
12
  open_transaction: <Original Channel Funding Transaction Hex String>
12
13
  signature: <Hex Encoded Signature String>
@@ -49,6 +50,7 @@ module.exports = args => {
49
50
  }
50
51
 
51
52
  const {psbt} = transactionAsPsbt({
53
+ ecp: args.ecp,
52
54
  spending: spending.filter(n => !!n),
53
55
  transaction: replacement.toHex(),
54
56
  });
@@ -12,8 +12,8 @@ const {getPendingChannels} = require('ln-service');
12
12
  const {returnResult} = require('asyncjs-util');
13
13
  const {signTransaction} = require('ln-service');
14
14
  const {subscribeToBlocks} = require('ln-service');
15
+ const tinysecp = require('tiny-secp256k1');
15
16
  const {Transaction} = require('bitcoinjs-lib');
16
- const {transactionAsPsbt} = require('psbt');
17
17
 
18
18
  const finalizeCapacityReplacement = require('./finalize_capacity_replacement');
19
19
  const getCapacityReplacement = require('./get_capacity_replacement');
@@ -69,6 +69,9 @@ const unsignedTransactionType = '1';
69
69
  module.exports = (args, cbk) => {
70
70
  return new Promise((resolve, reject) => {
71
71
  return asyncAuto({
72
+ // Import ECPair library
73
+ ecp: async () => (await import('ecpair')).ECPairFactory(tinysecp),
74
+
72
75
  // Check arguments
73
76
  validate: cbk => {
74
77
  if (!args.bitcoinjs_network) {
@@ -173,13 +176,15 @@ module.exports = (args, cbk) => {
173
176
 
174
177
  // Derive the funding PSBT to use for funding
175
178
  funding: [
179
+ 'ecp',
176
180
  'getReplacement',
177
181
  'signAddFunds',
178
- ({getReplacement, signAddFunds}, cbk) =>
182
+ ({ecp, getReplacement, signAddFunds}, cbk) =>
179
183
  {
180
184
  const [addFundsSignature] = signAddFunds.signatures || [];
181
185
 
182
186
  const {psbt} = interimReplacementPsbt({
187
+ ecp,
183
188
  increase_public_key: args.increase_key,
184
189
  increase_signature: addFundsSignature,
185
190
  increase_transaction: args.increase_transaction,
package/package.json CHANGED
@@ -11,9 +11,11 @@
11
11
  "asyncjs-util": "1.2.8",
12
12
  "bolt01": "1.2.3",
13
13
  "bolt07": "1.8.0",
14
+ "ecpair": "2.0.1",
14
15
  "invoices": "2.0.4",
15
16
  "ln-service": "53.9.0",
16
- "ln-sync": "3.10.1"
17
+ "ln-sync": "3.10.1",
18
+ "tiny-secp256k1": "2.2.0"
17
19
  },
18
20
  "description": "Lightning Paid Services library",
19
21
  "devDependencies": {
@@ -40,5 +42,5 @@
40
42
  "integration-tests": "tap -j 2 --branches=1 --functions=1 --lines=1 --statements=1 -t 180 test/integration/*.js",
41
43
  "test": "tap --branches=1 --functions=1 --lines=1 --statements=1 -t 60 test/actions/*.js test/capacity/*.js test/client/*.js test/config/*.js test/p2p/*.js test/records/*.js test/respond/*.js test/server/*.js test/server/*.js test/services/*.js test/trades/*.js"
42
44
  },
43
- "version": "3.11.1"
45
+ "version": "3.11.3"
44
46
  }