@curvefi/api 2.68.3 → 2.68.5
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.
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { _getPoolsFromApi, _getCrvApyFromApi } from '../../cached.js';
|
|
11
11
|
import { _getUsdRate, BN, toBN, _getRewardsFromApi, getVolumeApiController, } from '../../utils.js';
|
|
12
|
+
import { rewardNetworks } from '../../constants/rewardNetworks.js';
|
|
12
13
|
import memoize from "memoizee";
|
|
13
14
|
export class StatsPool {
|
|
14
15
|
constructor(pool) {
|
|
@@ -165,12 +166,12 @@ export class StatsPool {
|
|
|
165
166
|
this.tokenApy = (...args_1) => __awaiter(this, [...args_1], void 0, function* (useApi = true) {
|
|
166
167
|
var _a;
|
|
167
168
|
const curve = this.pool.curve;
|
|
168
|
-
if (curve.isLiteChain && curve.chainId
|
|
169
|
+
if (curve.isLiteChain && !rewardNetworks.tokenApyLiteChainExceptions.includes(curve.chainId)) {
|
|
169
170
|
throw Error('tokenApy is not supported for the lite version');
|
|
170
171
|
}
|
|
171
172
|
if (this.pool.rewardsOnly())
|
|
172
173
|
throw Error(`${this.pool.name} has Rewards-Only Gauge. Use stats.rewardsApy instead`);
|
|
173
|
-
const isDisabledChain =
|
|
174
|
+
const isDisabledChain = rewardNetworks.tokenApyDisabledChains.includes(curve.chainId);
|
|
174
175
|
if (useApi && !isDisabledChain) {
|
|
175
176
|
const crvAPYs = yield _getCrvApyFromApi(curve.constants.NETWORK_NAME, curve.isLiteChain);
|
|
176
177
|
const poolCrvApy = (_a = crvAPYs[this.pool.gauge.address]) !== null && _a !== void 0 ? _a : [0, 0]; // new pools might be missing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@curvefi/api",
|
|
3
|
-
"version": "2.68.
|
|
3
|
+
"version": "2.68.5",
|
|
4
4
|
"description": "JavaScript library for curve.finance",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Macket",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"vue-eslint-parser": "^10.1.3"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@curvefi/ethcall": "^6.0.
|
|
45
|
+
"@curvefi/ethcall": "^6.0.16",
|
|
46
46
|
"bignumber.js": "^9.3.0",
|
|
47
47
|
"ethers": "^6.14.1",
|
|
48
48
|
"memoizee": "^0.4.17"
|