@pioneer-platform/markets 8.3.6 → 8.3.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/index.js +7 -7
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -161,7 +161,7 @@ var update_cache = function () {
|
|
|
161
161
|
return [4 /*yield*/, redis.setex(key, 3600, JSON.stringify(entry))];
|
|
162
162
|
case 2:
|
|
163
163
|
result_2 = _b.sent();
|
|
164
|
-
log.
|
|
164
|
+
log.debug(tag, "saved: " + key + " result: ", result_2);
|
|
165
165
|
_b.label = 3;
|
|
166
166
|
case 3:
|
|
167
167
|
j++;
|
|
@@ -190,12 +190,12 @@ var update_cache = function () {
|
|
|
190
190
|
case 7:
|
|
191
191
|
if (!(page <= totalPages)) return [3 /*break*/, 15];
|
|
192
192
|
url_1 = "".concat(URL_COINGECKO, "coins/markets?vs_currency=usd&order=market_cap_desc&per_page=").concat(limit, "&page=").concat(page, "&sparkline=false");
|
|
193
|
-
log.
|
|
193
|
+
log.debug(tag, "Fetching URL: ", url_1);
|
|
194
194
|
return [4 /*yield*/, axios.get(url_1)];
|
|
195
195
|
case 8:
|
|
196
196
|
result_1 = _a.sent();
|
|
197
197
|
allCoinsArray_2 = result_1.data;
|
|
198
|
-
log.
|
|
198
|
+
log.debug(tag, "Fetched ".concat(allCoinsArray_2.length, " coins for page ").concat(page));
|
|
199
199
|
_loop_2 = function (coin) {
|
|
200
200
|
var matchingAssets, _c, matchingAssets_1, matchingAsset, key;
|
|
201
201
|
return __generator(this, function (_d) {
|
|
@@ -211,7 +211,7 @@ var update_cache = function () {
|
|
|
211
211
|
return [4 /*yield*/, redis.setex(key, 3600, JSON.stringify(coin))];
|
|
212
212
|
case 2:
|
|
213
213
|
_d.sent();
|
|
214
|
-
log.
|
|
214
|
+
log.debug(tag, "Saved ".concat(coin.symbol, " under ").concat(key));
|
|
215
215
|
_d.label = 3;
|
|
216
216
|
case 3:
|
|
217
217
|
_c++;
|
|
@@ -234,7 +234,7 @@ var update_cache = function () {
|
|
|
234
234
|
return [3 /*break*/, 9];
|
|
235
235
|
case 12:
|
|
236
236
|
if (!(page < totalPages)) return [3 /*break*/, 14];
|
|
237
|
-
log.
|
|
237
|
+
log.debug(tag, "Waiting 10 seconds before next query...");
|
|
238
238
|
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 30000); })];
|
|
239
239
|
case 13:
|
|
240
240
|
_a.sent();
|
|
@@ -332,8 +332,8 @@ var build_balances = function (marketInfoCoinCap, marketInfoCoinGecko, pubkeys)
|
|
|
332
332
|
else {
|
|
333
333
|
coincap = marketInfoCoinCap[entry.ticker];
|
|
334
334
|
coingecko = marketInfoCoinGecko[entry.ticker];
|
|
335
|
-
// log.
|
|
336
|
-
// log.
|
|
335
|
+
// log.debug("coincap: ",coincap)
|
|
336
|
+
// log.debug("coingecko: ",coingecko)
|
|
337
337
|
if (!coincap && !coingecko) {
|
|
338
338
|
console.error("unknown token! ", entry.symbol);
|
|
339
339
|
unknownTokens.push(entry);
|