@curvefi/api 2.68.37 → 2.68.39

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.
@@ -114,12 +114,9 @@ export class StatsPool {
114
114
  poolType = poolType.replace(/-v2$/, '');
115
115
  }
116
116
  const poolsData = (yield _getPoolsFromApi.call(curve, network, poolType, curve.isLiteChain)).poolData;
117
- try {
118
- const totalLiquidity = poolsData.filter((data) => data.address.toLowerCase() === this.pool.address.toLowerCase())[0].usdTotal;
119
- return String(totalLiquidity);
120
- }
121
- catch (err) {
122
- console.log(this.pool.id, err.message);
117
+ const poolEntry = poolsData.find((data) => data.address.toLowerCase() === this.pool.address.toLowerCase());
118
+ if (poolEntry) {
119
+ return String(poolEntry.usdTotal);
123
120
  }
124
121
  }
125
122
  const balances = yield this.underlyingBalances();
@@ -47,6 +47,7 @@ export function routeFinderWorker() {
47
47
  const _isVisitedCoin = (coinAddress, route) => route.route.find((r) => r.inputCoinAddress === coinAddress) !== undefined;
48
48
  const _findPool = (route, poolId) => route.route.find((r) => r.poolId === poolId);
49
49
  const findRoutes = ({ inputCoinAddress, outputCoinAddress, routerGraph, poolData, ybAssets }) => {
50
+ var _a;
50
51
  inputCoinAddress = inputCoinAddress.toLowerCase();
51
52
  outputCoinAddress = outputCoinAddress.toLowerCase();
52
53
  const isYBAsset = ybAssets.includes(inputCoinAddress) || ybAssets.includes(outputCoinAddress);
@@ -57,7 +58,7 @@ export function routeFinderWorker() {
57
58
  while (routes.length) {
58
59
  const route = routes.pop();
59
60
  const inCoin = route.route.length > 0 ? route.route[route.route.length - 1].outputCoinAddress : inputCoinAddress;
60
- Object.entries(routerGraph[inCoin]).forEach((leaf) => {
61
+ Object.entries((_a = routerGraph[inCoin]) !== null && _a !== void 0 ? _a : {}).forEach((leaf) => {
61
62
  const outCoin = leaf[0], steps = leaf[1];
62
63
  if (_isVisitedCoin(outCoin, route))
63
64
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.68.37",
3
+ "version": "2.68.39",
4
4
  "description": "JavaScript library for curve.finance",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",
@@ -25,26 +25,26 @@
25
25
  },
26
26
  "type": "module",
27
27
  "devDependencies": {
28
- "@babel/eslint-parser": "^7.28.5",
29
- "@eslint/eslintrc": "^3.3.1",
30
- "@eslint/js": "^9.38.0",
28
+ "@babel/eslint-parser": "^7.28.6",
29
+ "@eslint/eslintrc": "^3.3.4",
30
+ "@eslint/js": "^9.39.3",
31
31
  "@types/chai": "^5.2.3",
32
32
  "@types/memoizee": "^0.4.12",
33
33
  "@types/mocha": "^10.0.10",
34
- "@types/node": "^24.9.2",
35
- "@typescript-eslint/eslint-plugin": "^8.46.2",
36
- "@typescript-eslint/parser": "^8.46.2",
37
- "chai": "^5.3.3",
38
- "eslint": "^9.38.0",
39
- "globals": "^16.4.0",
40
- "mocha": "^11.7.4",
34
+ "@types/node": "^25.3.0",
35
+ "@typescript-eslint/eslint-plugin": "^8.56.1",
36
+ "@typescript-eslint/parser": "^8.56.1",
37
+ "chai": "^6.2.2",
38
+ "eslint": "^9.39.3",
39
+ "globals": "^17.3.0",
40
+ "mocha": "^11.7.5",
41
41
  "typescript": "^5.9.3",
42
- "vue-eslint-parser": "^10.2.0"
42
+ "vue-eslint-parser": "^10.4.0"
43
43
  },
44
44
  "dependencies": {
45
45
  "@curvefi/ethcall": "^6.0.16",
46
- "bignumber.js": "^9.3.1",
47
- "ethers": "^6.15.0",
46
+ "bignumber.js": "^10.0.2",
47
+ "ethers": "^6.16.0",
48
48
  "memoizee": "^0.4.17"
49
49
  }
50
50
  }