@icgio/icg-utils 1.7.44 → 1.7.46
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 +33 -0
- package/package.json +1 -1
package/lib/crypto-rates.js
CHANGED
|
@@ -246,6 +246,17 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
246
246
|
}
|
|
247
247
|
get_crypto_rates(cb, curs, type, source)
|
|
248
248
|
})
|
|
249
|
+
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'BBDC')) {
|
|
250
|
+
let curs = _.without(pair_or_pairs_or_cur_curs, 'BBDC')
|
|
251
|
+
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=BBDC_USDT&depth=100').then((res) => {
|
|
252
|
+
const { asks, bids } = res.body.data
|
|
253
|
+
let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
|
|
254
|
+
result.BBDC = {
|
|
255
|
+
USD: rate,
|
|
256
|
+
USDT: rate,
|
|
257
|
+
}
|
|
258
|
+
get_crypto_rates(cb, curs, type, source)
|
|
259
|
+
})
|
|
249
260
|
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'DMC')) {
|
|
250
261
|
let curs = _.without(pair_or_pairs_or_cur_curs, 'DMC')
|
|
251
262
|
needle('get', 'https://api.gateio.ws/api/v4/spot/order_book?currency_pair=DMC_USDT').then((res) => {
|
|
@@ -279,6 +290,28 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
279
290
|
}
|
|
280
291
|
get_crypto_rates(cb, curs, type, source)
|
|
281
292
|
})
|
|
293
|
+
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'GLW')) {
|
|
294
|
+
let curs = _.without(pair_or_pairs_or_cur_curs, 'GLW')
|
|
295
|
+
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=GLW_USDT&depth=100').then((res) => {
|
|
296
|
+
const { asks, bids } = res.body.data
|
|
297
|
+
let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
|
|
298
|
+
result.GLW = {
|
|
299
|
+
USD: rate,
|
|
300
|
+
USDT: rate,
|
|
301
|
+
}
|
|
302
|
+
get_crypto_rates(cb, curs, type, source)
|
|
303
|
+
})
|
|
304
|
+
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'UCF')) {
|
|
305
|
+
let curs = _.without(pair_or_pairs_or_cur_curs, 'UCF')
|
|
306
|
+
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=UCF_USDT&depth=100').then((res) => {
|
|
307
|
+
const { asks, bids } = res.body.data
|
|
308
|
+
let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
|
|
309
|
+
result.UCF = {
|
|
310
|
+
USD: rate,
|
|
311
|
+
USDT: rate,
|
|
312
|
+
}
|
|
313
|
+
get_crypto_rates(cb, curs, type, source)
|
|
314
|
+
})
|
|
282
315
|
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'WPAY')) {
|
|
283
316
|
let curs = _.without(pair_or_pairs_or_cur_curs, 'WPAY')
|
|
284
317
|
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=WPAY_USDT&depth=100').then((res) => {
|