@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.
- package/lib/coingecko.js +18 -13
- 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
|
|
21
|
-
let
|
|
22
|
-
for (let line of list) {
|
|
20
|
+
let result = {}
|
|
21
|
+
for (let line of body) {
|
|
23
22
|
let cur = line.symbol.toUpperCase()
|
|
24
|
-
_.set(
|
|
23
|
+
_.set(result, [cur], line.id)
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
|
|
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(
|
|
193
|
-
//
|
|
194
|
-
//
|
|
195
|
-
//
|
|
196
|
-
// //
|
|
197
|
-
// //
|
|
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) => {
|