@icgio/icg-utils 1.7.48 → 1.7.49
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 +11 -0
- package/package.json +1 -1
package/lib/crypto-rates.js
CHANGED
|
@@ -323,6 +323,17 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
323
323
|
}
|
|
324
324
|
get_crypto_rates(cb, curs, type, source)
|
|
325
325
|
})
|
|
326
|
+
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'TIN')) {
|
|
327
|
+
let curs = _.without(pair_or_pairs_or_cur_curs, 'TIN')
|
|
328
|
+
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=TIN_USDT&depth=100').then((res) => {
|
|
329
|
+
const { asks, bids } = res.body.data
|
|
330
|
+
let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
|
|
331
|
+
result.TIN = {
|
|
332
|
+
USD: rate,
|
|
333
|
+
USDT: rate,
|
|
334
|
+
}
|
|
335
|
+
get_crypto_rates(cb, curs, type, source)
|
|
336
|
+
})
|
|
326
337
|
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'UCF')) {
|
|
327
338
|
let curs = _.without(pair_or_pairs_or_cur_curs, 'UCF')
|
|
328
339
|
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=UCF_USDT&depth=100').then((res) => {
|