@icgio/icg-utils 1.7.5 → 1.7.7
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 +9 -9
- package/package.json +2 -2
package/lib/coingecko.js
CHANGED
|
@@ -108,7 +108,7 @@ let get_coingecko_rates = (cb, pair_or_pairs_or_cur_curs) => {
|
|
|
108
108
|
let get_coingecko_rate = (page, cb) => {
|
|
109
109
|
let url = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=' + quote_cur.toLowerCase() + '&per_page=' + per_page_nums + '&page=' + page
|
|
110
110
|
needle.get(url, options, (err, res, body) => {
|
|
111
|
-
console.log('fetching coingecko rate: body length', body
|
|
111
|
+
console.log('fetching coingecko rate: body length', _.get(body, 'length'))
|
|
112
112
|
if (body && body.length > 0) {
|
|
113
113
|
for (let coin of body) {
|
|
114
114
|
let symbol = coin.symbol
|
|
@@ -149,14 +149,14 @@ let get_coingecko_rates = (cb, pair_or_pairs_or_cur_curs) => {
|
|
|
149
149
|
setTimeout(() => {
|
|
150
150
|
console.log('fetching coingecko rate: page', page, 'good')
|
|
151
151
|
get_coingecko_rate(page, cb)
|
|
152
|
-
},
|
|
152
|
+
}, 3000)
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
} else {
|
|
156
156
|
setTimeout(() => {
|
|
157
|
-
console.log('fetching coingecko rate: page', page, '
|
|
157
|
+
console.log('fetching coingecko rate: page', page, 'timeout')
|
|
158
158
|
get_coingecko_rates(cb)
|
|
159
|
-
},
|
|
159
|
+
}, 60000)
|
|
160
160
|
}
|
|
161
161
|
})
|
|
162
162
|
}
|
|
@@ -166,11 +166,11 @@ let get_coingecko_rates = (cb, pair_or_pairs_or_cur_curs) => {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
// get_coingecko_rates((res) => {
|
|
169
|
-
//
|
|
170
|
-
// // }, ['BTCUSD', 'ETHUSD'])
|
|
171
|
-
// // }, ['BTC', 'ETH'])
|
|
172
|
-
// // }, 'BTCUSDT')
|
|
173
|
-
// // }, 'BTC')
|
|
169
|
+
// console.log(res)
|
|
170
|
+
// // // }, ['BTCUSD', 'ETHUSD'])
|
|
171
|
+
// // // }, ['BTC', 'ETH'])
|
|
172
|
+
// // // }, 'BTCUSDT')
|
|
173
|
+
// // // }, 'BTC')
|
|
174
174
|
// })
|
|
175
175
|
|
|
176
176
|
// https://api.coingecko.com/api/v3/coins/list
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icgio/icg-utils",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.7",
|
|
4
4
|
"description": "Utils package.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"directories": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"etherscan-api": "^8.1.5",
|
|
24
24
|
"external-ip": "^2.3.1",
|
|
25
25
|
"htmlparser2": "^3.10.1",
|
|
26
|
-
"influx": "^5.
|
|
26
|
+
"influx": "^5.9.3",
|
|
27
27
|
"lodash": "^4.17.21",
|
|
28
28
|
"mailgun-js": "^0.18.1",
|
|
29
29
|
"needle": "^2.6.0",
|