@icgio/icg-utils 1.9.43 → 1.9.45

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/README.md CHANGED
@@ -52,7 +52,7 @@ const limiter = new RateLimiter({
52
52
  max_concurrent: 5,
53
53
  interval_concurrent: 1000,
54
54
  abandon_tx: false,
55
- only_same_args: false
55
+ only_same_args: false,
56
56
  })
57
57
 
58
58
  // Process function with rate limiting
@@ -74,14 +74,10 @@ const position = utils.sum_position(orderbook, target_sum)
74
74
  const combined = utils.combine_orderbooks(orderbooks_dict, depth)
75
75
 
76
76
  // Find arbitrage opportunities
77
- const opportunities = utils.arb_opportunities_from_combined_orderbook(
78
- combined_orderbook,
79
- profit_percentage,
80
- amount_cap
81
- )
77
+ const opportunities = utils.arb_opportunities_from_combined_orderbook(combined_orderbook, profit_percentage, amount_cap)
82
78
 
83
79
  // Parse trading pair
84
- const [base, quote] = utils.parse_pair('BTCUSDT') // ['BTC', 'USDT']
80
+ const [base, quote] = utils.parse_pair('BTCUSDT') // ['BTC', 'USDT']
85
81
  ```
86
82
 
87
83
  ### Observable
@@ -152,35 +148,35 @@ icg-utils/
152
148
 
153
149
  ### Orderbook Processing
154
150
 
155
- | Function | Description |
156
- |----------|-------------|
157
- | `vol_position` | Find position in orderbook by volume |
158
- | `sum_position` | Find position in orderbook by quote sum |
159
- | `price_position` | Find position in orderbook by price |
160
- | `level_position` | Find position by orderbook level |
161
- | `combine_orderbooks` | Merge orderbooks from multiple exchanges |
162
- | `arb_opportunities_from_combined_orderbook` | Find arbitrage opportunities |
151
+ | Function | Description |
152
+ | ------------------------------------------- | ---------------------------------------- |
153
+ | `vol_position` | Find position in orderbook by volume |
154
+ | `sum_position` | Find position in orderbook by quote sum |
155
+ | `price_position` | Find position in orderbook by price |
156
+ | `level_position` | Find position by orderbook level |
157
+ | `combine_orderbooks` | Merge orderbooks from multiple exchanges |
158
+ | `arb_opportunities_from_combined_orderbook` | Find arbitrage opportunities |
163
159
 
164
160
  ### General Utilities
165
161
 
166
- | Function | Description |
167
- |----------|-------------|
168
- | `parse_pair` | Parse trading pair into base/quote |
169
- | `reverse_pair` | Reverse a trading pair |
170
- | `round` | Round number to precision |
171
- | `ordered_dict` | Sorted dictionary for orderbooks |
162
+ | Function | Description |
163
+ | -------------------- | ------------------------------------ |
164
+ | `parse_pair` | Parse trading pair into base/quote |
165
+ | `reverse_pair` | Reverse a trading pair |
166
+ | `round` | Round number to precision |
167
+ | `ordered_dict` | Sorted dictionary for orderbooks |
172
168
  | `number_with_commas` | Format numbers with comma separators |
173
169
 
174
170
  ## Dependencies
175
171
 
176
- | Package | Purpose |
177
- |---------|---------|
178
- | `@influxdata/influxdb-client` | InfluxDB v2 client |
172
+ | Package | Purpose |
173
+ | ---------------------------------- | ------------------------ |
174
+ | `@influxdata/influxdb-client` | InfluxDB v2 client |
179
175
  | `@influxdata/influxdb-client-apis` | InfluxDB management APIs |
180
- | `lodash` | Utility library |
181
- | `needle` | HTTP client |
182
- | `winston` | Logging framework |
183
- | `csv-parse` | CSV parsing |
176
+ | `lodash` | Utility library |
177
+ | `needle` | HTTP client |
178
+ | `winston` | Logging framework |
179
+ | `csv-parse` | CSV parsing |
184
180
 
185
181
  ## Code Style
186
182
 
package/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  module.exports = {
2
- coinmarketcap: require('./lib/crypto-rates.js'),
3
- coingecko: require('./lib/crypto-rates.js'),
2
+ crypto_rates: require('./lib/crypto-rates.js'),
4
3
  forex_rate: require('./lib/forex-rate.js'),
5
4
  influx: require('./lib/influxdb.js'),
6
5
  ip: require('./lib/ip.js'),
@@ -9,5 +8,4 @@ module.exports = {
9
8
  ohlcv: require('./lib/ohlcv'),
10
9
  rate_limiter: require('./lib/rate-limiter.js'),
11
10
  utils: require('./lib/utils.js'),
12
- constants: {},
13
11
  }
@@ -2,13 +2,8 @@ const _ = require('lodash')
2
2
 
3
3
  const needle = require('needle')
4
4
 
5
- let coins_map_raw_coingecko = require('../constants/coins-map-coingecko.js')
6
- let coins_map_raw_coinmarketcap = require('../constants/coins-map-coinmarketcap.js')
7
- let coins_map = {}
8
-
9
- const sort_keys = require('./utils.js').sort_keys
10
-
11
5
  const Limiter = require('./rate-limiter.js')
6
+ const { dex_rate, token_dict } = require('./dex-rate.js')
12
7
 
13
8
  let limiter = new Limiter({
14
9
  max_concurrent: 1,
@@ -17,107 +12,50 @@ let limiter = new Limiter({
17
12
 
18
13
  const options = {}
19
14
 
20
- let process_coins_map_coingecko = (res) => {
21
- res['AXL'] = 'axelar'
22
- res['ETH'] = 'ethereum'
23
- res['MTR'] = 'meter-stable'
24
- res['WAXL'] = 'axelar'
25
- return res
26
- }
27
-
28
- let process_coins_map_coinmarketcap = (res) => {
29
- return res
30
- }
31
-
32
- let get_coins_map_coingecko = (cb) => {
33
- limiter.process(needle.get, 'https://api.coingecko.com/api/v3/coins/list', (err, res, body) => {
34
- if (body && Array.isArray(body)) {
35
- let res = {}
36
- for (let line of body) {
37
- let cur = line.symbol.toUpperCase()
38
- _.set(res, [cur], line.id)
39
- }
40
- cb({ success: true, body: process_coins_map_coingecko(res) })
41
- } else {
42
- cb({ success: false, body })
43
- }
44
- })
45
- }
46
-
47
- let get_coins_map_coinmarketcap = (cb) => {
48
- limiter.process(needle.get, 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/map?CMC_PRO_API_KEY=47a30ef1-a773-4da0-8ac5-69bce757fdfa', (err, res, body) => {
49
- if (body && body.data && Array.isArray(body.data)) {
50
- let res = {}
51
- for (let line of body.data) {
52
- let cur = line.symbol.toUpperCase()
53
- _.set(res, [cur], line.name)
54
- }
55
- res = sort_keys(res)
56
- cb({ success: true, body: process_coins_map_coinmarketcap(res) })
57
- } else {
58
- cb({ success: false, body })
59
- }
60
- })
61
- }
62
-
63
15
  let result = {}
64
- let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko') => {
16
+ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type) => {
65
17
  function get_crypto_rates_base(cb, pair_or_pairs_or_cur_curs, type) {
66
18
  if (type === 'cur') {
67
- let cur = pair_or_pairs_or_cur_curs,
68
- cur_id = coins_map[cur]
69
- limiter.process(needle.get, `https://api.coingecko.com/api/v3/simple/price?ids=${cur_id}&vs_currencies=usd`, (err, res, body) => {
19
+ let cur = pair_or_pairs_or_cur_curs
20
+ // Fetch all tickers and find by symbol
21
+ limiter.process(needle.get, 'https://api.coinpaprika.com/v1/tickers', (err, res, body) => {
70
22
  if (err) {
71
23
  console.error(cur, err)
72
- } else if (!body[cur_id]) {
73
- console.error('coingecko cur_id incorrect:', cur, cur_id, 'usd', err)
74
- }
75
- cb(body[cur_id]['usd'])
76
- })
77
- } else if (type === 'curs' && source === 'coingecko') {
78
- let curs = pair_or_pairs_or_cur_curs
79
- let cur_id_list = curs.map((cur) => coins_map[cur])
80
- let cur_id_map = _.fromPairs(
81
- curs.map((cur) => {
82
- return [coins_map[cur], cur]
83
- }),
84
- )
85
- let url = `https://api.coingecko.com/api/v3/simple/price?ids=${String(_.keys(cur_id_map))}&vs_currencies=usd`
86
- limiter.process(needle.get, url, (err, res, body) => {
87
- if (err) {
88
- console.error(err)
24
+ cb(null)
89
25
  return
90
26
  }
91
- for (let cur_id in body) {
92
- let temp = body[cur_id]
93
- temp.USD = temp.usd
94
- temp.USDT = temp.usd
95
- delete temp['usd']
96
- result[cur_id_map[cur_id]] = body[cur_id]
27
+ if (body && Array.isArray(body)) {
28
+ for (let ticker of body) {
29
+ if (ticker.symbol.toUpperCase() === cur.toUpperCase()) {
30
+ cb(ticker.quotes.USD.price)
31
+ return
32
+ }
33
+ }
97
34
  }
98
- cb(result)
35
+ console.error('coinpaprika cur not found:', cur)
36
+ cb(null)
99
37
  })
100
- } else if (type === 'curs' && source === 'coinmarketcap') {
38
+ } else if (type === 'curs') {
101
39
  let curs = pair_or_pairs_or_cur_curs
102
- let cur_slug_list = curs.map((cur) => coins_map[cur])
103
- let url = `https://pro-api.coinmarketcap.com/v2/cryptocurrency/quotes/latest?symbol=${String(curs)}&CMC_PRO_API_KEY=47a30ef1-a773-4da0-8ac5-69bce757fdfa`
40
+ let curs_upper = curs.map((c) => c.toUpperCase())
41
+ // Fetch all tickers and filter by symbol
42
+ let url = `https://api.coinpaprika.com/v1/tickers`
104
43
  limiter.process(needle.get, url, (err, res, body) => {
105
44
  if (err) {
106
45
  console.error(err)
107
46
  return
108
47
  }
109
- for (let cur in body.data) {
110
- let rates = body.data[cur]
111
- let temp = {}
112
- for (let rate of rates) {
113
- if (rate.name === coins_map[cur]) {
114
- temp = {
115
- USD: rate.quote.USD.price,
116
- USDT: rate.quote.USD.price,
48
+ if (body && Array.isArray(body)) {
49
+ for (let ticker of body) {
50
+ let symbol = ticker.symbol.toUpperCase()
51
+ if (curs_upper.includes(symbol)) {
52
+ let price = ticker.quotes.USD.price
53
+ result[symbol] = {
54
+ USD: price,
55
+ USDT: price,
117
56
  }
118
57
  }
119
58
  }
120
- result[cur] = temp
121
59
  }
122
60
  cb(result)
123
61
  })
@@ -267,26 +205,6 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
267
205
  console.error(pair, error)
268
206
  }
269
207
  })
270
- } else if (exchange === 'coingecko') {
271
- let pair = cur.toLowerCase() + 'usdt'
272
- let url = `https://api.coinex.com/v1/market/depth?market=${pair}&limit=20&merge=0`
273
- limiter.process(needle.get, url, (err, res, body) => {
274
- try {
275
- const asks = body.data.asks
276
- const bids = body.data.bids
277
- let rate = (parseFloat(asks[0][0]) + parseFloat(bids[0][0])) / 2
278
- result[cur] = {
279
- USD: rate,
280
- USDT: rate,
281
- }
282
- let result_length = _.keys(result).length
283
- if (result_length === length) {
284
- cb(result)
285
- }
286
- } catch (error) {
287
- console.error(pair, error)
288
- }
289
- })
290
208
  } else if (exchange === 'coinstore') {
291
209
  if (cur === 'SWAGG') {
292
210
  cur = 'SWAGGERC20'
@@ -549,136 +467,101 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
549
467
  console.error(pair, error)
550
468
  }
551
469
  })
470
+ } else if (exchange === 'dex') {
471
+ if (!token_dict[cur]) {
472
+ console.error('dex token not in token_dict:', cur)
473
+ let result_length = _.keys(result).length
474
+ if (result_length === length) {
475
+ cb(result)
476
+ }
477
+ } else {
478
+ dex_rate(cur, (rate_result) => {
479
+ let rate = rate_result[cur]
480
+ result[cur] = {
481
+ USD: rate,
482
+ USDT: rate,
483
+ }
484
+ let result_length = _.keys(result).length
485
+ if (result_length === length) {
486
+ cb(result)
487
+ }
488
+ })
489
+ }
552
490
  }
553
491
  }
554
492
  } else {
555
- let quote_cur = 'USD',
556
- page = 1,
557
- per_page_nums = 250
558
- let get_coingecko_rate_page = (page, cb) => {
559
- let url = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=' + quote_cur.toLowerCase() + '&per_page=' + per_page_nums + '&page=' + page
493
+ // Coinpaprika returns all tickers in one call (no pagination needed)
494
+ let get_coinpaprika_rates = (cb) => {
495
+ let url = 'https://api.coinpaprika.com/v1/tickers'
560
496
  limiter.process(needle.get, url, options, (err, res, body) => {
561
- console.log('fetching coingecko rate: body length', _.get(body, 'length', body))
562
- if (body && body.length > 0) {
497
+ console.log('fetching coinpaprika rate: body length', _.get(body, 'length', body))
498
+ if (body && Array.isArray(body) && body.length > 0) {
563
499
  for (let coin of body) {
564
500
  let symbol = coin.symbol
565
- if (!symbol || !coin.current_price) {
501
+ if (!symbol || !coin.quotes || !coin.quotes.USD || !coin.quotes.USD.price) {
566
502
  continue
567
503
  }
568
504
  symbol = symbol.toUpperCase()
569
- if (symbol === 'BAT' && coin.id !== 'basic-attention-token') {
505
+ if (symbol === 'BAT' && coin.id !== 'bat-basic-attention-token') {
570
506
  continue
571
- } else if (symbol === 'SBTC' && coin.id !== 'super-bitcoin') {
507
+ } else if (symbol === 'SBTC' && coin.id !== 'sbtc-super-bitcoin') {
572
508
  continue
573
509
  }
574
510
  result[symbol] = {
575
- USD: parseFloat(coin.current_price),
576
- USDT: parseFloat(coin.current_price),
577
- '24h_change': parseFloat(coin.price_change_percentage_24h),
578
- '24h_volume_usd': parseFloat(coin.total_volume),
579
- rank: parseInt(coin.market_cap_rank) || 10000,
580
- market_cap: parseInt(coin.market_cap),
511
+ USD: parseFloat(coin.quotes.USD.price),
512
+ USDT: parseFloat(coin.quotes.USD.price),
513
+ '24h_change': parseFloat(coin.quotes.USD.percent_change_24h),
514
+ '24h_volume_usd': parseFloat(coin.quotes.USD.volume_24h),
515
+ rank: parseInt(coin.rank) || 10000,
516
+ market_cap: parseInt(coin.quotes.USD.market_cap),
581
517
  update_time: new Date(coin.last_updated),
582
518
  }
583
519
  }
584
- // Continue pagination if BTC/ETH not found yet
585
- if (!result.BTC || !result.ETH) {
586
- if (body.length < per_page_nums) {
587
- // Last page and still no BTC/ETH - return what we have
588
- console.warn('BTC or ETH not found in CoinGecko pagination, returning partial results')
589
- for (let cur in result) {
590
- if (result.BTC) result[cur].BTC = result[cur].USD / result.BTC.USD
591
- if (result.ETH) result[cur].ETH = result[cur].USD / result.ETH.USD
592
- }
593
- cb(result)
594
- } else {
595
- // Continue to next page
596
- page++
597
- console.log('fetching coingecko rate: page', page, 'good (searching for BTC/ETH)')
598
- get_coingecko_rate_page(page, cb)
599
- }
600
- } else {
601
- // BTC and ETH found, calculate BTC/ETH rates for all currencies
520
+ // Calculate BTC/ETH rates for all currencies
521
+ if (result.BTC && result.ETH) {
602
522
  for (let cur in result) {
603
523
  result[cur].BTC = result[cur].USD / result.BTC.USD
604
524
  result[cur].ETH = result[cur].USD / result.ETH.USD
605
525
  }
606
- if (body.length < per_page_nums) {
607
- cb(result)
608
- } else {
609
- page++
610
- console.log('fetching coingecko rate: page', page, 'good')
611
- get_coingecko_rate_page(page, cb)
526
+ cb(result)
527
+ } else {
528
+ console.warn('BTC or ETH not found in Coinpaprika response, returning partial results')
529
+ for (let cur in result) {
530
+ if (result.BTC) result[cur].BTC = result[cur].USD / result.BTC.USD
531
+ if (result.ETH) result[cur].ETH = result[cur].USD / result.ETH.USD
612
532
  }
533
+ cb(result)
613
534
  }
614
535
  } else {
615
536
  // Handle error or empty response
616
- if (err || (body && body.status && body.status.error_code === 429)) {
617
- // Rate limit error - wait longer before retrying
618
- console.error('CoinGecko rate limit error (429), waiting 60s before retry')
537
+ if (err) {
538
+ console.error('Coinpaprika error:', err)
619
539
  setTimeout(() => {
620
- console.log('fetching coingecko rate: page', page, 'retry after rate limit')
621
- get_coingecko_rate_page(page, cb)
540
+ console.log('fetching coinpaprika rate: retry after error')
541
+ get_coinpaprika_rates(cb)
542
+ }, 60000)
543
+ } else if (body && body.error) {
544
+ // API error response
545
+ console.error('Coinpaprika API error:', body.error)
546
+ setTimeout(() => {
547
+ console.log('fetching coinpaprika rate: retry after API error')
548
+ get_coinpaprika_rates(cb)
622
549
  }, 60000)
623
- } else if (body && body.length === 0) {
624
- // Empty response - might be last page or error
625
- if (Object.keys(result).length > 0) {
626
- // Return what we have
627
- for (let cur in result) {
628
- if (result.BTC) result[cur].BTC = result[cur].USD / result.BTC.USD
629
- if (result.ETH) result[cur].ETH = result[cur].USD / result.ETH.USD
630
- }
631
- cb(result)
632
- } else {
633
- // No results at all - retry after delay
634
- console.log('fetching coingecko rate: page', page, 'empty response, retrying')
635
- setTimeout(() => {
636
- get_coingecko_rate_page(page, cb)
637
- }, 60000)
638
- }
639
550
  } else {
640
551
  // Unknown error - retry
641
- console.error('fetching coingecko rate: page', page, 'error', err || body)
552
+ console.error('fetching coinpaprika rate: error', err || body)
642
553
  setTimeout(() => {
643
- get_coingecko_rate_page(page, cb)
554
+ get_coinpaprika_rates(cb)
644
555
  }, 60000)
645
556
  }
646
557
  }
647
558
  })
648
559
  }
649
- console.log('fetching coingecko rate: page', page, 'first')
650
- get_coingecko_rate_page(page, cb)
560
+ console.log('fetching coinpaprika rate: starting')
561
+ get_coinpaprika_rates(cb)
651
562
  }
652
563
  }
653
- coins_map = source === 'coingecko' ? process_coins_map_coingecko(coins_map_raw_coingecko) : process_coins_map_coinmarketcap(coins_map_raw_coinmarketcap)
654
564
  get_crypto_rates_base(cb, pair_or_pairs_or_cur_curs, type)
655
565
  }
656
566
 
657
- // get_crypto_rates(
658
- // (res) => {
659
- // console.log(res)
660
- // },
661
- // {
662
- // ETHF: 'mexc',
663
- // },
664
- // 'curs_dict'
665
- // )
666
-
667
- // get_crypto_rates(
668
- // (res) => {
669
- // console.log(res)
670
- // },
671
- // ['AVAV'],
672
- // 'curs',
673
- // 'coinmarketcap'
674
- // )
675
-
676
- // get_coins_map_coingecko((res) => {
677
- // console.log(res.body)
678
- // })
679
-
680
- // get_coins_map_coinmarketcap((res) => {
681
- // console.log(res.body)
682
- // })
683
-
684
567
  module.exports = get_crypto_rates
package/lib/dex-rate.js CHANGED
@@ -3,31 +3,97 @@ const _ = require('lodash')
3
3
  const needle = require('needle')
4
4
 
5
5
  const token_dict = {
6
+ // BSC tokens (using token_price API)
6
7
  FREN: {
7
8
  address: '0xe6a768464b042a6d029394db1fdef360cb60bbeb',
8
9
  network: 'bsc',
10
+ type: 'token',
9
11
  },
10
12
  RWX: {
11
13
  address: '0xb0a1c87b890fe171371f81a59f7ed4636e82595d',
12
14
  network: 'bsc',
15
+ type: 'token',
13
16
  },
14
- USDT: {
15
- address: '0x55d398326f99059fF775485246999027B3197955',
16
- network: 'bsc',
17
+ // Pool-based tokens (using pools API)
18
+ ARMY: {
19
+ pool: '41524D5900000000000000000000000000000000.rGG3wQ4kUzd7Jnmk1n5NWPZjjut62kCBfC_XRP',
20
+ network: 'xrpl',
21
+ type: 'pool',
22
+ },
23
+ CCDOG: {
24
+ pool: '0x9ea8d5d68a4b6bd5cc5ed6b505f920ce6db9e93a',
25
+ network: 'eth',
26
+ type: 'pool',
27
+ },
28
+ JYAI: {
29
+ pool: '0x2623edc6008d057786a6bf9dd34185dcddebbf2f',
30
+ network: 'eth',
31
+ type: 'pool',
32
+ },
33
+ LBAI: {
34
+ pool: '0x65a33e74e18c99388f4989c296ab8e860219ee76',
35
+ network: 'eth',
36
+ type: 'pool',
37
+ },
38
+ MINDFAK: {
39
+ pool: '0x40c03fb952df5f4ec72414efb0b378d70cded263',
40
+ network: 'eth',
41
+ type: 'pool',
42
+ },
43
+ SHRAP: {
44
+ pool: '0x58f0caa7a5a3a92e33a348c282b4e415b84d863a',
45
+ network: 'avax',
46
+ type: 'pool',
17
47
  },
18
48
  }
19
49
 
20
50
  let dex_rate = function (cur, cb) {
21
- const { address, network } = token_dict[cur]
22
- const url = `https://api.geckoterminal.com/api/v2/simple/networks/${network}/token_price/${address}`
23
- needle.get(url, (res, error, body) => {
24
- if (body && body.data && body.data.id) {
25
- let rate = parseFloat(body.data.attributes.token_prices[address])
26
- cb({
27
- [cur]: rate,
28
- })
29
- }
30
- })
51
+ const token = token_dict[cur]
52
+ if (!token) {
53
+ console.error('dex_rate: token not found in token_dict:', cur)
54
+ cb(null)
55
+ return
56
+ }
57
+
58
+ if (token.type === 'pool') {
59
+ // Pool-based API
60
+ const url = `https://api.geckoterminal.com/api/v2/networks/${token.network}/pools/${token.pool}`
61
+ needle.get(url, (err, res, body) => {
62
+ try {
63
+ if (body && body.data && body.data.attributes) {
64
+ let rate = parseFloat(body.data.attributes.base_token_price_usd)
65
+ cb({
66
+ [cur]: rate,
67
+ })
68
+ } else {
69
+ console.error('dex_rate pool error:', cur, body)
70
+ cb(null)
71
+ }
72
+ } catch (error) {
73
+ console.error('dex_rate pool error:', cur, error)
74
+ cb(null)
75
+ }
76
+ })
77
+ } else {
78
+ // Token price API
79
+ const url = `https://api.geckoterminal.com/api/v2/simple/networks/${token.network}/token_price/${token.address}`
80
+ needle.get(url, (err, res, body) => {
81
+ try {
82
+ if (body && body.data && body.data.id) {
83
+ let rate = parseFloat(body.data.attributes.token_prices[token.address])
84
+ cb({
85
+ [cur]: rate,
86
+ })
87
+ } else {
88
+ console.error('dex_rate token error:', cur, body)
89
+ cb(null)
90
+ }
91
+ } catch (error) {
92
+ console.error('dex_rate token error:', cur, error)
93
+ cb(null)
94
+ }
95
+ })
96
+ }
31
97
  }
32
98
 
33
- module.exports = dex_rate
99
+ module.exports = { dex_rate, token_dict }