@icgio/icg-utils 1.7.46 → 1.7.48
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 +22 -0
- package/package.json +1 -1
package/lib/crypto-rates.js
CHANGED
|
@@ -257,6 +257,17 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
257
257
|
}
|
|
258
258
|
get_crypto_rates(cb, curs, type, source)
|
|
259
259
|
})
|
|
260
|
+
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'CLOAK')) {
|
|
261
|
+
let curs = _.without(pair_or_pairs_or_cur_curs, 'CLOAK')
|
|
262
|
+
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=CLOAK_USDT&depth=100').then((res) => {
|
|
263
|
+
const { asks, bids } = res.body.data
|
|
264
|
+
let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
|
|
265
|
+
result.CLOAK = {
|
|
266
|
+
USD: rate,
|
|
267
|
+
USDT: rate,
|
|
268
|
+
}
|
|
269
|
+
get_crypto_rates(cb, curs, type, source)
|
|
270
|
+
})
|
|
260
271
|
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'DMC')) {
|
|
261
272
|
let curs = _.without(pair_or_pairs_or_cur_curs, 'DMC')
|
|
262
273
|
needle('get', 'https://api.gateio.ws/api/v4/spot/order_book?currency_pair=DMC_USDT').then((res) => {
|
|
@@ -301,6 +312,17 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
301
312
|
}
|
|
302
313
|
get_crypto_rates(cb, curs, type, source)
|
|
303
314
|
})
|
|
315
|
+
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'MEGODS')) {
|
|
316
|
+
let curs = _.without(pair_or_pairs_or_cur_curs, 'MEGODS')
|
|
317
|
+
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=MEGODS_USDT&depth=100').then((res) => {
|
|
318
|
+
const { asks, bids } = res.body.data
|
|
319
|
+
let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
|
|
320
|
+
result.MEGODS = {
|
|
321
|
+
USD: rate,
|
|
322
|
+
USDT: rate,
|
|
323
|
+
}
|
|
324
|
+
get_crypto_rates(cb, curs, type, source)
|
|
325
|
+
})
|
|
304
326
|
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'UCF')) {
|
|
305
327
|
let curs = _.without(pair_or_pairs_or_cur_curs, 'UCF')
|
|
306
328
|
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=UCF_USDT&depth=100').then((res) => {
|