paid-services 3.14.1 → 3.14.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,5 +1,9 @@
1
1
  # Versions
2
2
 
3
+ ## Version 3.14.2
4
+
5
+ - `manageTrades`: Fix listing of trades that have fiat-pricing
6
+
3
7
  ## Version 3.14.1
4
8
 
5
9
  - `manageTrades`: Add support for dynamic fiat-priced trades
package/package.json CHANGED
@@ -43,5 +43,5 @@
43
43
  "integration-tests": "tap -j 2 --branches=1 --functions=1 --lines=1 --statements=1 -t 180 test/integration/*.js",
44
44
  "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/server/*.js test/services/*.js test/trades/*.js"
45
45
  },
46
- "version": "3.14.1"
46
+ "version": "3.14.2"
47
47
  }
@@ -200,11 +200,14 @@ module.exports = ({ask, lnd, logger, request, separator}, cbk) => {
200
200
  return cbk([404, 'NoTradesCurrentlyOpen']);
201
201
  }
202
202
 
203
+ const trades = getTrades.filter(n => !!n.secret && !!n.description);
204
+
203
205
  return ask({
204
- choices: getTrades.filter(n => !!n.secret).map(trade => ({
205
- name: `${tokensAsBigUnit(trade.tokens)} ${trade.description}`,
206
- value: trade.id,
207
- })),
206
+ choices: trades.map(({description, id, price, tokens}) => {
207
+ const charging = !!tokens ? tokensAsBigUnit(tokens) : price;
208
+
209
+ return {name: `${charging} ${description}`, value: id};
210
+ }),
208
211
  message: 'Trade?',
209
212
  name: 'manage',
210
213
  type: 'list',
@@ -258,6 +261,7 @@ module.exports = ({ask, lnd, logger, request, separator}, cbk) => {
258
261
  expires_at: trade.expires_at,
259
262
  id: trade.id,
260
263
  network: getNetwork.network,
264
+ price: trade.price,
261
265
  public_key: getIdentity.public_key,
262
266
  secret: trade.secret,
263
267
  tokens: trade.tokens,