@icgio/icg-utils 1.7.58 → 1.7.59

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.
@@ -326,9 +326,9 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
326
326
  })
327
327
  } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'IUS')) {
328
328
  let curs = _.without(pair_or_pairs_or_cur_curs, 'IUS')
329
- needle('get', 'https://api.coinsbit.io/api/v1/public/depth/result?market=IUS_USDT&limit=10').then((res) => {
330
- const { asks, bids } = res.body
331
- let rate = (parseFloat(asks[0][0]) + parseFloat(bids.reverse()[0][0])) / 2
329
+ needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=IUS_USDT&depth=100').then((res) => {
330
+ const { asks, bids } = res.body.data
331
+ let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
332
332
  result.IUS = {
333
333
  USD: rate,
334
334
  USDT: rate,
@@ -338,8 +338,8 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
338
338
  } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'JD')) {
339
339
  let curs = _.without(pair_or_pairs_or_cur_curs, 'JD')
340
340
  needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=JD_USDT&depth=100').then((res) => {
341
- const { asks, bids } = res.body
342
- let rate = (parseFloat(asks[0][0]) + parseFloat(bids.reverse()[0][0])) / 2
341
+ const { asks, bids } = res.body.data
342
+ let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
343
343
  result.JD = {
344
344
  USD: rate,
345
345
  USDT: rate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-utils",
3
- "version": "1.7.58",
3
+ "version": "1.7.59",
4
4
  "description": "Utils package.",
5
5
  "main": "index.js",
6
6
  "directories": {