@icgio/icg-utils 1.9.37 → 1.9.39

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.
@@ -240,6 +240,9 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
240
240
  }
241
241
  })
242
242
  } else if (exchange === 'coinstore') {
243
+ if (cur === 'SWAGG') {
244
+ cur = 'SWAGGERC20'
245
+ }
243
246
  let pair = cur.toLowerCase() + 'usdt'
244
247
  let url = `https://api.coinstore.com/api/v1/market/depth/${pair}`
245
248
  limiter.process(needle.get, url, (err, res, body) => {
package/lib/utils.js CHANGED
@@ -276,7 +276,8 @@ function level_position(input_array, level_target) {
276
276
  price = input_array[i][0]
277
277
  pos = i
278
278
  }
279
- return { price, avg_price: sum / vol ? sum / vol : price, vol, sum, pos }
279
+ const avg_price = sum / vol ? sum / vol : price
280
+ return { level: level_target, price, avg_price, vol, sum, pos }
280
281
  }
281
282
 
282
283
  function price_position(input_array, price) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-utils",
3
- "version": "1.9.37",
3
+ "version": "1.9.39",
4
4
  "description": "Utils package.",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -26,8 +26,6 @@
26
26
  "lodash": "^4.17.21",
27
27
  "mailgun-js": "^0.22.0",
28
28
  "needle": "^3.3.1",
29
- "websocket": "^1.0.35",
30
- "winston": "^2.4.5",
31
- "ws": "^8.18.3"
29
+ "winston": "^2.4.5"
32
30
  }
33
31
  }