@icgio/icg-utils 1.7.55 → 1.7.57

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.
Files changed (2) hide show
  1. package/lib/crypto-rates.js +36 -12
  2. package/package.json +1 -1
@@ -293,6 +293,17 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
293
293
  }
294
294
  get_crypto_rates(cb, curs, type, source)
295
295
  })
296
+ } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'FIRM')) {
297
+ let curs = _.without(pair_or_pairs_or_cur_curs, 'FIRM')
298
+ needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=FIRM_USDT&depth=100').then((res) => {
299
+ const { asks, bids } = res.body
300
+ let rate = (parseFloat(asks[0][0]) + parseFloat(bids.reverse()[0][0])) / 2
301
+ result.FIRM = {
302
+ USD: rate,
303
+ USDT: rate,
304
+ }
305
+ get_crypto_rates(cb, curs, type, source)
306
+ })
296
307
  } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'FREN')) {
297
308
  let curs = _.without(pair_or_pairs_or_cur_curs, 'FREN')
298
309
  dex_rate().then((res) => {
@@ -324,6 +335,17 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
324
335
  }
325
336
  get_crypto_rates(cb, curs, type, source)
326
337
  })
338
+ } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'JD')) {
339
+ let curs = _.without(pair_or_pairs_or_cur_curs, 'JD')
340
+ needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=JD_USDT&depth=100').then((res) => {
341
+ const { asks, bids } = res.body
342
+ let rate = (parseFloat(asks[0][0]) + parseFloat(bids.reverse()[0][0])) / 2
343
+ result.JD = {
344
+ USD: rate,
345
+ USDT: rate,
346
+ }
347
+ get_crypto_rates(cb, curs, type, source)
348
+ })
327
349
  } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'KLC')) {
328
350
  let curs = _.without(pair_or_pairs_or_cur_curs, 'KLC')
329
351
  needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=KLC_USDT&depth=100').then((res) => {
@@ -359,18 +381,20 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
359
381
  get_crypto_rates(cb, curs, type, source)
360
382
  } catch (error) {}
361
383
  })
362
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'ROACHCOIN')) {
363
- let curs = _.without(pair_or_pairs_or_cur_curs, 'ROACHCOIN')
364
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=ROACHCOIN_USDT&depth=100').then((res) => {
365
- const { asks, bids } = res.body.data
366
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
367
- result.ROACHCOIN = {
368
- USD: rate,
369
- USDT: rate,
370
- }
371
- get_crypto_rates(cb, curs, type, source)
372
- })
373
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'SDP')) {
384
+ }
385
+ // else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'ROACHCOIN')) {
386
+ // let curs = _.without(pair_or_pairs_or_cur_curs, 'ROACHCOIN')
387
+ // needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=ROACHCOIN_USDT&depth=100').then((res) => {
388
+ // const { asks, bids } = res.body.data
389
+ // let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
390
+ // result.ROACHCOIN = {
391
+ // USD: rate,
392
+ // USDT: rate,
393
+ // }
394
+ // get_crypto_rates(cb, curs, type, source)
395
+ // })
396
+ // }
397
+ else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'SDP')) {
374
398
  let curs = _.without(pair_or_pairs_or_cur_curs, 'SDP')
375
399
  needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=SDP_USDT&depth=100').then((res) => {
376
400
  const { asks, bids } = res.body.data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-utils",
3
- "version": "1.7.55",
3
+ "version": "1.7.57",
4
4
  "description": "Utils package.",
5
5
  "main": "index.js",
6
6
  "directories": {