@icgio/icg-utils 1.7.56 → 1.7.58
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 +16 -14
- package/package.json +1 -1
package/lib/crypto-rates.js
CHANGED
|
@@ -296,8 +296,8 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
296
296
|
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'FIRM')) {
|
|
297
297
|
let curs = _.without(pair_or_pairs_or_cur_curs, 'FIRM')
|
|
298
298
|
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=FIRM_USDT&depth=100').then((res) => {
|
|
299
|
-
const { asks, bids } = res.body
|
|
300
|
-
let rate = (parseFloat(asks[0]
|
|
299
|
+
const { asks, bids } = res.body.data
|
|
300
|
+
let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
|
|
301
301
|
result.FIRM = {
|
|
302
302
|
USD: rate,
|
|
303
303
|
USDT: rate,
|
|
@@ -381,18 +381,20 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
381
381
|
get_crypto_rates(cb, curs, type, source)
|
|
382
382
|
} catch (error) {}
|
|
383
383
|
})
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
}
|
|
384
|
+
}
|
|
385
|
+
// else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'ROACHCOIN')) {
|
|
386
|
+
// let curs = _.without(pair_or_pairs_or_cur_curs, 'ROACHCOIN')
|
|
387
|
+
// needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=ROACHCOIN_USDT&depth=100').then((res) => {
|
|
388
|
+
// const { asks, bids } = res.body.data
|
|
389
|
+
// let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
|
|
390
|
+
// result.ROACHCOIN = {
|
|
391
|
+
// USD: rate,
|
|
392
|
+
// USDT: rate,
|
|
393
|
+
// }
|
|
394
|
+
// get_crypto_rates(cb, curs, type, source)
|
|
395
|
+
// })
|
|
396
|
+
// }
|
|
397
|
+
else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'SDP')) {
|
|
396
398
|
let curs = _.without(pair_or_pairs_or_cur_curs, 'SDP')
|
|
397
399
|
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=SDP_USDT&depth=100').then((res) => {
|
|
398
400
|
const { asks, bids } = res.body.data
|