@curvefi/api 2.49.0 → 2.49.1
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/README.md +7 -0
- package/lib/curve.js +7 -2
- package/lib/external-api.d.ts +2 -0
- package/lib/interfaces.d.ts +1 -0
- package/lib/pools/PoolTemplate.d.ts +1 -0
- package/lib/pools/PoolTemplate.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -383,6 +383,13 @@ import curve from "@curvefi/api";
|
|
|
383
383
|
// true
|
|
384
384
|
pool.isGaugeKilled;
|
|
385
385
|
// false
|
|
386
|
+
pool.gaugeStatus;
|
|
387
|
+
// null OR
|
|
388
|
+
//{
|
|
389
|
+
// rewardsNeedNudging: false,
|
|
390
|
+
// areCrvRewardsStuckInBridge: false,
|
|
391
|
+
//
|
|
392
|
+
// }
|
|
386
393
|
})()
|
|
387
394
|
````
|
|
388
395
|
|
package/lib/curve.js
CHANGED
|
@@ -104,21 +104,26 @@ import { lowerCasePoolDataAddresses, extractDecimals, extractGauges } from "./co
|
|
|
104
104
|
import { _getAllGauges, _getHiddenPools } from "./external-api.js";
|
|
105
105
|
import { L2Networks } from "./constants/L2Networks";
|
|
106
106
|
var _killGauges = function (poolsData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
-
var gaugeData, isKilled, poolId;
|
|
107
|
+
var gaugeData, isKilled, gaugeStatuses, poolId;
|
|
108
108
|
return __generator(this, function (_a) {
|
|
109
109
|
switch (_a.label) {
|
|
110
110
|
case 0: return [4 /*yield*/, _getAllGauges()];
|
|
111
111
|
case 1:
|
|
112
112
|
gaugeData = _a.sent();
|
|
113
113
|
isKilled = {};
|
|
114
|
+
gaugeStatuses = {};
|
|
114
115
|
Object.values(gaugeData).forEach(function (d) {
|
|
115
|
-
var _a;
|
|
116
|
+
var _a, _b;
|
|
116
117
|
isKilled[d.gauge.toLowerCase()] = (_a = d.is_killed) !== null && _a !== void 0 ? _a : false;
|
|
118
|
+
gaugeStatuses[d.gauge.toLowerCase()] = (_b = d.gaugeStatus) !== null && _b !== void 0 ? _b : null;
|
|
117
119
|
});
|
|
118
120
|
for (poolId in poolsData) {
|
|
119
121
|
if (isKilled[poolsData[poolId].gauge_address]) {
|
|
120
122
|
poolsData[poolId].is_gauge_killed = true;
|
|
121
123
|
}
|
|
124
|
+
if (gaugeStatuses[poolsData[poolId].gauge_address]) {
|
|
125
|
+
poolsData[poolId].gauge_status = gaugeStatuses[poolsData[poolId].gauge_address];
|
|
126
|
+
}
|
|
122
127
|
}
|
|
123
128
|
return [2 /*return*/];
|
|
124
129
|
}
|
package/lib/external-api.d.ts
CHANGED
|
@@ -38,9 +38,11 @@ export declare const _getFactoryAPYsAndVolumes: ((network: string) => Promise<{
|
|
|
38
38
|
export declare const _getAllGauges: (() => Promise<IDict<{
|
|
39
39
|
gauge: string;
|
|
40
40
|
is_killed?: boolean;
|
|
41
|
+
gaugeStatus?: Record<string, boolean> | null;
|
|
41
42
|
}>>) & memoize.Memoized<() => Promise<IDict<{
|
|
42
43
|
gauge: string;
|
|
43
44
|
is_killed?: boolean;
|
|
45
|
+
gaugeStatus?: Record<string, boolean> | null;
|
|
44
46
|
}>>>;
|
|
45
47
|
export declare const _getHiddenPools: (() => Promise<IDict<string[]>>) & memoize.Memoized<() => Promise<IDict<string[]>>>;
|
|
46
48
|
export declare const _generateBoostingProof: ((block: number, address: string) => Promise<{
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export declare class PoolTemplate {
|
|
|
32
32
|
useLending: boolean[];
|
|
33
33
|
inApi: boolean;
|
|
34
34
|
isGaugeKilled: boolean;
|
|
35
|
+
gaugeStatus: Record<string, boolean> | null;
|
|
35
36
|
estimateGas: {
|
|
36
37
|
depositApprove: (amounts: (number | string)[]) => Promise<number>;
|
|
37
38
|
deposit: (amounts: (number | string)[]) => Promise<number>;
|
|
@@ -66,7 +66,7 @@ var YEAR = 365 * DAY;
|
|
|
66
66
|
var PoolTemplate = /** @class */ (function () {
|
|
67
67
|
function PoolTemplate(id) {
|
|
68
68
|
var _this = this;
|
|
69
|
-
var _c, _d, _e;
|
|
69
|
+
var _c, _d, _e, _f;
|
|
70
70
|
this.statsParameters = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
71
71
|
var multicallContract, lpMulticallContract, calls, i, additionalCalls, _virtualPrice, _fee, _prices, _adminFee, _A, _lpTokenSupply, _gamma, e_1, _c, virtualPrice, fee, adminFee, A, lpTokenSupply, gamma, priceOracle, priceScale, prices, i, A_PRECISION, _d, _future_A, _initial_A, _future_A_time, _initial_A_time, _e, future_A, initial_A, future_A_time, initial_A_time;
|
|
72
72
|
var _f, _g, _h;
|
|
@@ -1117,6 +1117,7 @@ var PoolTemplate = /** @class */ (function () {
|
|
|
1117
1117
|
this.useLending = poolData.use_lending || poolData.underlying_coin_addresses.map(function () { return false; });
|
|
1118
1118
|
this.inApi = (_d = poolData.in_api) !== null && _d !== void 0 ? _d : false;
|
|
1119
1119
|
this.isGaugeKilled = (_e = poolData.is_gauge_killed) !== null && _e !== void 0 ? _e : false;
|
|
1120
|
+
this.gaugeStatus = (_f = poolData.gauge_status) !== null && _f !== void 0 ? _f : null;
|
|
1120
1121
|
this.estimateGas = {
|
|
1121
1122
|
depositApprove: this.depositApproveEstimateGas.bind(this),
|
|
1122
1123
|
deposit: this.depositEstimateGas.bind(this),
|