@icgio/icg-utils 1.7.51 → 1.7.52
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
|
@@ -268,6 +268,17 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
268
268
|
}
|
|
269
269
|
get_crypto_rates(cb, curs, type, source)
|
|
270
270
|
})
|
|
271
|
+
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'DARK')) {
|
|
272
|
+
let curs = _.without(pair_or_pairs_or_cur_curs, 'DARK')
|
|
273
|
+
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=DARK_USDT&depth=100').then((res) => {
|
|
274
|
+
const { asks, bids } = res.body.data
|
|
275
|
+
let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
|
|
276
|
+
result.DARK = {
|
|
277
|
+
USD: rate,
|
|
278
|
+
USDT: rate,
|
|
279
|
+
}
|
|
280
|
+
get_crypto_rates(cb, curs, type, source)
|
|
281
|
+
})
|
|
271
282
|
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'DMC')) {
|
|
272
283
|
let curs = _.without(pair_or_pairs_or_cur_curs, 'DMC')
|
|
273
284
|
needle('get', 'https://api.gateio.ws/api/v4/spot/order_book?currency_pair=DMC_USDT').then((res) => {
|
|
@@ -334,6 +345,17 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
334
345
|
}
|
|
335
346
|
get_crypto_rates(cb, curs, type, source)
|
|
336
347
|
})
|
|
348
|
+
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'ROACHCOIN')) {
|
|
349
|
+
let curs = _.without(pair_or_pairs_or_cur_curs, 'ROACHCOIN')
|
|
350
|
+
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=ROACHCOIN_USDT&depth=100').then((res) => {
|
|
351
|
+
const { asks, bids } = res.body.data
|
|
352
|
+
let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
|
|
353
|
+
result.ROACHCOIN = {
|
|
354
|
+
USD: rate,
|
|
355
|
+
USDT: rate,
|
|
356
|
+
}
|
|
357
|
+
get_crypto_rates(cb, curs, type, source)
|
|
358
|
+
})
|
|
337
359
|
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'SDP')) {
|
|
338
360
|
let curs = _.without(pair_or_pairs_or_cur_curs, 'SDP')
|
|
339
361
|
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=SDP_USDT&depth=100').then((res) => {
|