paid-services 4.0.2 → 4.0.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 4.0.2
3
+ ## Version 4.0.3
4
4
 
5
5
  - `manageTrades`: Fix connection to seller failing
6
6
 
@@ -134,11 +134,11 @@ module.exports = ({capacity, count, ecp, identity, lnd, rate}) => {
134
134
 
135
135
  // Group members have proposed channels to each other
136
136
  coordinator.events.once('funded', async () => {
137
- emitter.emit('proposed', {});
138
-
139
- const basePsbt = decodePsbt({ecp, psbt: coordinator.unsigned()});
137
+ emitter.emit('proposed', {unsigned: coordinator.unsigned()});
140
138
 
141
139
  try {
140
+ const basePsbt = decodePsbt({ecp, psbt: coordinator.unsigned()});
141
+
142
142
  // Sign the unsigned funding transaction
143
143
  const signed = await signAndFundGroupChannel({
144
144
  lnd,
@@ -167,21 +167,21 @@ module.exports = ({capacity, count, ecp, identity, lnd, rate}) => {
167
167
 
168
168
  // Group members have submitted their partial signatures
169
169
  coordinator.events.once('signed', async () => {
170
- emitter.emit('signed', {});
171
-
172
170
  // Collect all the partially signed PSBTs
173
171
  const psbts = coordinator.signed().map(n => n.signed);
174
172
 
175
- // Merge partial PSBTs into a single PSBT
176
- const combined = combinePsbts({ecp, psbts});
173
+ emitter.emit('signed', {psbts});
177
174
 
178
- // Finalize the PSBT to convert partial signatures to full final signatures
179
- const finalized = finalizePsbt({ecp, psbt: combined.psbt});
175
+ try {
176
+ // Merge partial PSBTs into a single PSBT
177
+ const combined = combinePsbts({ecp, psbts});
180
178
 
181
- // Pull out the raw transaction from the PSBT
182
- const {transaction} = extractTransaction({ecp, psbt: finalized.psbt});
179
+ // Finalize the PSBT to convert partial signatures to final signatures
180
+ const finalized = finalizePsbt({ecp, psbt: combined.psbt});
181
+
182
+ // Pull out the raw transaction from the PSBT
183
+ const {transaction} = extractTransaction({ecp, psbt: finalized.psbt});
183
184
 
184
- try {
185
185
  emitter.emit('broadcasting', ({transaction}));
186
186
 
187
187
  const {id} = await broadcastChainTransaction({lnd, transaction});
@@ -91,12 +91,12 @@ module.exports = ({ask, lnd, logger}, cbk) => {
91
91
  coordinate.events.once('connected', () => logger.info({peered: true}));
92
92
 
93
93
  // Members will propose pending channels to each other
94
- coordinate.events.once('proposed', () => {
95
- return logger.info({proposed: true});
94
+ coordinate.events.once('proposed', ({unsigned}) => {
95
+ return logger.info({proposed: unsigned});
96
96
  });
97
97
 
98
98
  // Once all pending channels are in place, signatures will be received
99
- coordinate.events.once('signed', () => logger.info({signed: true}));
99
+ coordinate.events.once('signed', signed => logger.info({signed}));
100
100
 
101
101
  // Finally the open channel tx will be broadcast
102
102
  coordinate.events.once('broadcasting', broadcast => {
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "ecpair": "2.1.0",
17
17
  "goldengate": "11.4.0",
18
18
  "invoices": "2.2.0",
19
- "ln-service": "54.2.3",
19
+ "ln-service": "54.2.5",
20
20
  "ln-sync": "4.0.4",
21
21
  "psbt": "2.7.1",
22
22
  "p2tr": "1.3.2",
@@ -25,7 +25,7 @@
25
25
  "description": "Lightning Paid Services library",
26
26
  "devDependencies": {
27
27
  "@alexbosworth/tap": "15.0.11",
28
- "ln-docker-daemons": "3.1.2",
28
+ "ln-docker-daemons": "3.1.4",
29
29
  "mock-lnd": "1.4.4",
30
30
  "secp256k1": "4.0.3"
31
31
  },
@@ -47,5 +47,5 @@
47
47
  "integration-tests": "tap -j 2 --branches=1 --functions=1 --lines=1 --statements=1 -t 180 test/integration/*.js",
48
48
  "test": "tap --branches=1 --functions=1 --lines=1 --statements=1 -t 60 test/actions/*.js test/balanced/*.js test/capacity/*.js test/client/*.js test/config/*.js test/p2p/*.js test/records/*.js test/respond/*.js test/server/*.js test/swaps/*.js test/services/*.js test/trades/*.js"
49
49
  },
50
- "version": "4.0.2"
50
+ "version": "4.0.3"
51
51
  }