@icgio/icg-utils 1.7.13 → 1.7.14

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/coingecko.js +18 -13
  2. package/package.json +1 -1
package/lib/coingecko.js CHANGED
@@ -17,15 +17,14 @@ let coins_map = {}
17
17
  let get_coins_map = (cb) => {
18
18
  needle.get('https://api.coingecko.com/api/v3/coins/list', (err, res, body) => {
19
19
  if (body && Array.isArray(body)) {
20
- let list = body
21
- let map = {}
22
- for (let line of list) {
20
+ let result = {}
21
+ for (let line of body) {
23
22
  let cur = line.symbol.toUpperCase()
24
- _.set(map, [cur], line.id)
23
+ _.set(result, [cur], line.id)
25
24
  }
26
- map['ETH'] = 'ethereum'
27
- map['MTR'] = 'meter-stable'
28
- cb({ success: true, body })
25
+ result['ETH'] = 'ethereum'
26
+ result['MTR'] = 'meter-stable'
27
+ cb({ success: true, body: result })
29
28
  } else {
30
29
  cb({ success: false, body })
31
30
  }
@@ -189,12 +188,18 @@ let get_coingecko_rates = (cb, pair_or_pairs_or_cur_curs, type) => {
189
188
  }
190
189
  }
191
190
 
192
- // get_coingecko_rates((res) => {
193
- // console.log(res)
194
- // // }, ['BTCUSD', 'ETHUSD'])
195
- // // }, ['SWFTC', 'BTC', 'ETH'], 'curs')
196
- // // }, 'ETHUSDC', 'pair')
197
- // // }, 'BTC')
191
+ // get_coingecko_rates(
192
+ // (res) => {
193
+ // console.log(res)
194
+ // },
195
+ // // ['BTCUSD', 'ETHUSD'],
196
+ // // 'pairs'
197
+ // // )
198
+ // ['RED', 'PIAS', 'PRMX'],
199
+ // 'curs'
200
+ // )
201
+ // }, 'ETHUSDC', 'pair')
202
+ // }, 'BTC')
198
203
  // })
199
204
 
200
205
  // get_coins_map((res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-utils",
3
- "version": "1.7.13",
3
+ "version": "1.7.14",
4
4
  "description": "Utils package.",
5
5
  "main": "index.js",
6
6
  "directories": {