@curvefi/api 1.24.3 → 1.24.4
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/external-api.js +7 -13
- package/lib/pools.js +2 -0
- package/package.json +1 -1
package/lib/external-api.js
CHANGED
|
@@ -43,22 +43,16 @@ exports._getPoolsFromApi = void 0;
|
|
|
43
43
|
var axios_1 = __importDefault(require("axios"));
|
|
44
44
|
var memoizee_1 = __importDefault(require("memoizee"));
|
|
45
45
|
exports._getPoolsFromApi = (0, memoizee_1.default)(function (network, poolType) { return __awaiter(void 0, void 0, void 0, function () {
|
|
46
|
-
var url, response
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
var url, response;
|
|
47
|
+
var _a;
|
|
48
|
+
return __generator(this, function (_b) {
|
|
49
|
+
switch (_b.label) {
|
|
49
50
|
case 0:
|
|
50
51
|
url = "https://api.curve.fi/api/getPools/".concat(network, "/").concat(poolType);
|
|
51
|
-
|
|
52
|
+
return [4 /*yield*/, axios_1.default.get(url, { validateStatus: function () { return true; } })];
|
|
52
53
|
case 1:
|
|
53
|
-
|
|
54
|
-
return [
|
|
55
|
-
case 2:
|
|
56
|
-
response = _a.sent();
|
|
57
|
-
return [2 /*return*/, response.data.data];
|
|
58
|
-
case 3:
|
|
59
|
-
err_1 = _a.sent();
|
|
60
|
-
return [2 /*return*/, { poolData: [], tvl: 0, tvlAll: 0 }];
|
|
61
|
-
case 4: return [2 /*return*/];
|
|
54
|
+
response = _b.sent();
|
|
55
|
+
return [2 /*return*/, (_a = response.data.data) !== null && _a !== void 0 ? _a : { poolData: [], tvl: 0, tvlAll: 0 }];
|
|
62
56
|
}
|
|
63
57
|
});
|
|
64
58
|
}); }, {
|
package/lib/pools.js
CHANGED
|
@@ -294,6 +294,8 @@ var Pool = /** @class */ (function () {
|
|
|
294
294
|
case 0: return [4 /*yield*/, this._getPoolStats()];
|
|
295
295
|
case 1:
|
|
296
296
|
volume = (_c.sent()).volume;
|
|
297
|
+
if (volume === 0)
|
|
298
|
+
return [2 /*return*/, "0"];
|
|
297
299
|
if (!(this.isCrypto || (curve_1.curve.chainId === 1 && this.isFactory))) return [3 /*break*/, 2];
|
|
298
300
|
_a = 1;
|
|
299
301
|
return [3 /*break*/, 4];
|