@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.
- package/lib/crypto-rates.js +5 -5
- package/package.json +1 -1
package/lib/crypto-rates.js
CHANGED
|
@@ -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://
|
|
330
|
-
const { asks, bids } = res.body
|
|
331
|
-
let rate = (parseFloat(asks[0]
|
|
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]
|
|
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,
|