@icgio/icg-utils 1.7.54 → 1.7.55
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 +20 -8
- package/package.json +1 -1
package/lib/crypto-rates.js
CHANGED
|
@@ -270,6 +270,18 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
270
270
|
}
|
|
271
271
|
get_crypto_rates(cb, curs, type, source)
|
|
272
272
|
})
|
|
273
|
+
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'DFI')) {
|
|
274
|
+
let curs = _.without(pair_or_pairs_or_cur_curs, 'DFI')
|
|
275
|
+
needle('get', 'https://api.coinstore.com/api/v1/market/depth/dfiusdt').then((res) => {
|
|
276
|
+
const asks = res.body.data.a
|
|
277
|
+
const bids = res.body.data.b
|
|
278
|
+
let rate = (parseFloat(asks[0][0]) + parseFloat(bids[0][0])) / 2
|
|
279
|
+
result.DFI = {
|
|
280
|
+
USD: rate,
|
|
281
|
+
USDT: rate,
|
|
282
|
+
}
|
|
283
|
+
get_crypto_rates(cb, curs, type, source)
|
|
284
|
+
})
|
|
273
285
|
} else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'ENIX')) {
|
|
274
286
|
let curs = _.without(pair_or_pairs_or_cur_curs, 'ENIX')
|
|
275
287
|
needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=ENIX_USDT&depth=100').then((res) => {
|
|
@@ -399,14 +411,14 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
|
|
|
399
411
|
}
|
|
400
412
|
}
|
|
401
413
|
|
|
402
|
-
get_crypto_rates(
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
)
|
|
414
|
+
// get_crypto_rates(
|
|
415
|
+
// (res) => {
|
|
416
|
+
// console.log(res)
|
|
417
|
+
// },
|
|
418
|
+
// ['BTC', 'DFI', 'ETH', 'ENIX', 'FREN', 'DMC', 'IUS', 'MONE'],
|
|
419
|
+
// 'curs',
|
|
420
|
+
// 'coingecko'
|
|
421
|
+
// )
|
|
410
422
|
|
|
411
423
|
// dex_rate().then((res) => {
|
|
412
424
|
// console.log(res)
|