@icgio/icg-utils 1.9.23 → 1.9.25

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.
@@ -367,12 +367,12 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
367
367
  }
368
368
  })
369
369
  } else if (exchange === 'mexc') {
370
- let pair = cur + '_USDT'
371
- let url = `https://www.mexc.com/open/api/v2/market/depth?symbol=${pair}&depth=100`
370
+ let pair = cur + 'USDT'
371
+ let url = `https://api.mexc.com/api/v3/depth?symbol=${pair}`
372
372
  limiter.process(needle.get, url, (err, res, body) => {
373
373
  try {
374
- const { asks, bids } = body.data
375
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
374
+ const { asks, bids } = body
375
+ let rate = (parseFloat(asks[0][0]) + parseFloat(bids[0][0])) / 2
376
376
  result[cur] = {
377
377
  USD: rate,
378
378
  USDT: rate,
@@ -419,7 +419,7 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
419
419
  })
420
420
  } else if (exchange === 'weex') {
421
421
  let pair = cur.toUpperCase() + 'USDT'
422
- let url = `https://contract-openapi.weex.com/api/spot/v1/market/depth?symbol=${pair}_spbl&type=step0`
422
+ let url = `https://api-spot.weex.com/api/v2/market/depth?symbol=${pair}_SPBL&type=step0&limit=200`
423
423
  limiter.process(needle.get, url, (err, res, body) => {
424
424
  try {
425
425
  const asks = body.data.asks
@@ -576,7 +576,7 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
576
576
  // console.log(res)
577
577
  // },
578
578
  // {
579
- // ETHF: 'htx',
579
+ // ETHF: 'mexc',
580
580
  // },
581
581
  // 'curs_dict'
582
582
  // )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-utils",
3
- "version": "1.9.23",
3
+ "version": "1.9.25",
4
4
  "description": "Utils package.",
5
5
  "main": "index.js",
6
6
  "directories": {