@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.
@@ -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, err_1;
47
- return __generator(this, function (_a) {
48
- switch (_a.label) {
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
- _a.label = 1;
52
+ return [4 /*yield*/, axios_1.default.get(url, { validateStatus: function () { return true; } })];
52
53
  case 1:
53
- _a.trys.push([1, 3, , 4]);
54
- return [4 /*yield*/, axios_1.default.get(url)];
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];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "1.24.3",
3
+ "version": "1.24.4",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {