@curvefi/api 2.63.2 → 2.63.3

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/dao.js CHANGED
@@ -193,7 +193,7 @@ const _extractNetworkFromPoolUrl = (poolUrl) => {
193
193
  return poolUrl.split("/")[4];
194
194
  };
195
195
  export const getVotingGaugeList = () => __awaiter(void 0, void 0, void 0, function* () {
196
- var _a;
196
+ var _a, _b;
197
197
  if (curve.chainId !== 1)
198
198
  throw Error("Ethereum-only method");
199
199
  const gaugeData = Object.values(yield _getAllGauges());
@@ -202,21 +202,21 @@ export const getVotingGaugeList = () => __awaiter(void 0, void 0, void 0, functi
202
202
  if ((gaugeData[i].is_killed || gaugeData[i].hasNoCrv) && Number(gaugeData[i].gauge_controller.gauge_relative_weight) === 0)
203
203
  continue;
204
204
  res.push({
205
- poolUrl: gaugeData[i].poolUrls.swap[0],
206
- network: _extractNetworkFromPoolUrl(gaugeData[i].poolUrls.swap[0]),
205
+ poolUrl: ((_a = gaugeData[i].poolUrls) === null || _a === void 0 ? void 0 : _a.swap[0]) || '',
206
+ network: gaugeData[i].blockchainId,
207
207
  gaugeAddress: gaugeData[i].gauge,
208
- poolAddress: gaugeData[i].swap,
209
- lpTokenAddress: gaugeData[i].swap_token,
208
+ poolAddress: gaugeData[i].swap || '',
209
+ lpTokenAddress: gaugeData[i].swap_token || '',
210
210
  poolName: gaugeData[i].shortName,
211
211
  totalVeCrv: curve.formatUnits(gaugeData[i].gauge_controller.get_gauge_weight, 18),
212
212
  relativeWeight: curve.formatUnits(gaugeData[i].gauge_controller.gauge_relative_weight, 16),
213
- isKilled: (_a = gaugeData[i].is_killed) !== null && _a !== void 0 ? _a : false,
213
+ isKilled: (_b = gaugeData[i].is_killed) !== null && _b !== void 0 ? _b : false,
214
214
  });
215
215
  }
216
216
  return res;
217
217
  });
218
218
  export const userGaugeVotes = (address = "") => __awaiter(void 0, void 0, void 0, function* () {
219
- var _b;
219
+ var _c, _d;
220
220
  if (curve.chainId !== 1)
221
221
  throw Error("Ethereum-only method");
222
222
  address = _getAddress(address);
@@ -243,15 +243,15 @@ export const userGaugeVotes = (address = "") => __awaiter(void 0, void 0, void 0
243
243
  userFutureVeCrv: curve.formatUnits(veCrvBalance * votes[i][1] / BigInt(10000), 18),
244
244
  expired: dt === BigInt(0),
245
245
  gaugeData: {
246
- poolUrl: gaugeData[i].poolUrls.swap[0],
247
- network: _extractNetworkFromPoolUrl(gaugeData[i].poolUrls.swap[0]),
246
+ poolUrl: ((_c = gaugeData[i].poolUrls) === null || _c === void 0 ? void 0 : _c.swap[0]) || '',
247
+ network: gaugeData[i].blockchainId,
248
248
  gaugeAddress: gaugeData[i].gauge,
249
- poolAddress: gaugeData[i].swap,
250
- lpTokenAddress: gaugeData[i].swap_token,
249
+ poolAddress: gaugeData[i].swap || '',
250
+ lpTokenAddress: gaugeData[i].swap_token || '',
251
251
  poolName: gaugeData[i].shortName,
252
252
  totalVeCrv: curve.formatUnits(gaugeData[i].gauge_controller.get_gauge_weight, 18),
253
253
  relativeWeight: curve.formatUnits(gaugeData[i].gauge_controller.gauge_relative_weight, 16),
254
- isKilled: (_b = gaugeData[i].is_killed) !== null && _b !== void 0 ? _b : false,
254
+ isKilled: (_d = gaugeData[i].is_killed) !== null && _d !== void 0 ? _d : false,
255
255
  },
256
256
  });
257
257
  powerUsed += votes[i][1];
@@ -178,6 +178,7 @@ export interface IProfit {
178
178
  price: number;
179
179
  }
180
180
  export interface IGaugesDataFromApi {
181
+ blockchainId: string;
181
182
  gauge: string;
182
183
  swap: string;
183
184
  swap_token: string;
@@ -186,7 +187,7 @@ export interface IGaugesDataFromApi {
186
187
  gauge_relative_weight: string;
187
188
  get_gauge_weight: string;
188
189
  };
189
- poolUrls: {
190
+ poolUrls?: {
190
191
  swap: string[];
191
192
  };
192
193
  is_killed?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.63.2",
3
+ "version": "2.63.3",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",