@mintbase-js/data
Advanced tools
Comparing version 0.6.0-fix-fetch-token-price-62ca0a4.0 to 0.6.0-fix-fetch-token-price-c335bd8.0
@@ -28,9 +28,8 @@ "use strict"; | ||
try { | ||
let res; | ||
try { | ||
res = yield fetchPrice(constants_1.COIN_GECKO_API, data => ({ price: data.near.usd })); | ||
} | ||
catch (err) { | ||
res = yield fetchPrice(constants_1.BINANCE_API, data => data); | ||
} | ||
const res = yield fetchPrice(constants_1.BINANCE_API, data => data) | ||
.catch((err) => __awaiter(void 0, void 0, void 0, function* () { | ||
console.log('First API call failed, trying second API', err); | ||
return yield fetchPrice(constants_1.COIN_GECKO_API, data => ({ price: data.near.usd })); | ||
})); | ||
console.log(res, 'res'); | ||
return (0, utils_1.parseData)(res.price); | ||
@@ -37,0 +36,0 @@ } |
{ | ||
"name": "@mintbase-js/data", | ||
"version": "0.6.0-fix-fetch-token-price-62ca0a4.0", | ||
"version": "0.6.0-fix-fetch-token-price-c335bd8.0", | ||
"description": "Query wrappers for Mintbase JS SDK", | ||
@@ -24,3 +24,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@mintbase-js/sdk": "^0.6.0-fix-fetch-token-price-62ca0a4.0", | ||
"@mintbase-js/sdk": "^0.6.0-fix-fetch-token-price-c335bd8.0", | ||
"cross-fetch": "^4.0.0", | ||
@@ -34,3 +34,3 @@ "graphql-request": "^5.2.0" | ||
}, | ||
"gitHead": "f9e93ca72a640b1683438645573cc668876787e6" | ||
"gitHead": "1feef89e84d36ee17f4cb20b3ebd45972907ee16" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
970610
12576