@curvefi/api 2.67.5 → 2.67.7

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.
@@ -173,6 +173,11 @@ export function getTricryptoFactoryPoolData() {
173
173
  for (let i = 0; i < rawGaugeAddresses.length; i++) {
174
174
  gaugeAddresses.push(rawGaugeAddresses[i] !== this.constants.ZERO_ADDRESS ? rawGaugeAddresses[i] : rawOldGaugeAddresses[i]);
175
175
  }
176
+ swapAddresses.forEach((address, index) => {
177
+ var _a;
178
+ const isNativeCoinEnabled = this.chainId === 1 || implementationAddresses[index] === ((_a = this.constants.CRYPTO_FACTORY_CONSTANTS.tricryptoDeployImplementations) === null || _a === void 0 ? void 0 : _a.amm_native_transfers_enabled);
179
+ this.setContract(address, isNativeCoinEnabled ? tricryptoFactorySwapABI : tricryptoFactoryEthDisabledSwapABI);
180
+ });
176
181
  setCryptoFactoryGaugeContracts.call(this, gaugeAddresses);
177
182
  setCryptoFactoryCoinsContracts.call(this, coinAddresses);
178
183
  const existingCoinAddressNameDict = getExistingCoinAddressNameDict.call(this);
@@ -181,7 +186,6 @@ export function getTricryptoFactoryPoolData() {
181
186
  const nativeToken = this.constants.NATIVE_TOKEN;
182
187
  for (let i = 0; i < poolIds.length; i++) {
183
188
  const isETHEnabled = this.chainId === 1 || implementationAddresses[i] === ((_a = this.constants.CRYPTO_FACTORY_CONSTANTS.tricryptoDeployImplementations) === null || _a === void 0 ? void 0 : _a.amm_native_transfers_enabled);
184
- this.setContract(swapAddresses[i], isETHEnabled ? tricryptoFactorySwapABI : tricryptoFactoryEthDisabledSwapABI);
185
189
  const underlyingCoinAddresses = coinAddresses[i].map((addr) => {
186
190
  if (isETHEnabled) {
187
191
  return addr === nativeToken.wrappedAddress ? nativeToken.address : addr;
@@ -188,6 +188,7 @@ export declare class PoolTemplate extends CorePool {
188
188
  _getCoinIdx: (coin: string | number, useUnderlying?: boolean) => number;
189
189
  _getRates: () => Promise<bigint[]>;
190
190
  private _storedRatesBN;
191
+ getStoredRates(useUnderlying?: boolean): Promise<string[]>;
191
192
  _underlyingPrices: () => Promise<number[]>;
192
193
  _wrappedPrices: () => Promise<number[]>;
193
194
  private getGaugeStatus;
@@ -1864,6 +1864,17 @@ export class PoolTemplate extends CorePool {
1864
1864
  throw Error(`swapWrapped method doesn't exist for pool ${this.name} (id: ${this.name})`);
1865
1865
  });
1866
1866
  }
1867
+ getStoredRates() {
1868
+ return __awaiter(this, arguments, void 0, function* (useUnderlying = false) {
1869
+ try {
1870
+ const storedRatesBN = yield this._storedRatesBN(useUnderlying);
1871
+ return storedRatesBN.map(rate => rate.toString());
1872
+ }
1873
+ catch (error) {
1874
+ throw new Error(`Failed to get stored rates for pool ${this.name}`);
1875
+ }
1876
+ });
1877
+ }
1867
1878
  getGaugeStatus() {
1868
1879
  return __awaiter(this, void 0, void 0, function* () {
1869
1880
  const gaugeData = yield _getAllGaugesFormatted();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.67.5",
3
+ "version": "2.67.7",
4
4
  "description": "JavaScript library for curve.finance",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",