@curvefi/api 2.67.2 → 2.67.4

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.
@@ -87,11 +87,6 @@ function getPoolsData(factorySwapAddresses) {
87
87
  return [gaugeAddresses, gaugeOldAddresses, coinAddresses, implementationAddresses];
88
88
  });
89
89
  }
90
- function setCryptoFactorySwapContracts(factorySwapAddresses) {
91
- factorySwapAddresses.forEach((addr) => {
92
- this.setContract(addr, tricryptoFactorySwapABI);
93
- });
94
- }
95
90
  function setCryptoFactoryGaugeContracts(factoryGaugeAddresses) {
96
91
  factoryGaugeAddresses.filter((addr) => addr !== this.constants.ZERO_ADDRESS).forEach((addr) => {
97
92
  this.setContract(addr, this.chainId === 1 ? factoryGaugeABI : gaugeChildABI);
@@ -178,7 +173,6 @@ export function getTricryptoFactoryPoolData() {
178
173
  for (let i = 0; i < rawGaugeAddresses.length; i++) {
179
174
  gaugeAddresses.push(rawGaugeAddresses[i] !== this.constants.ZERO_ADDRESS ? rawGaugeAddresses[i] : rawOldGaugeAddresses[i]);
180
175
  }
181
- setCryptoFactorySwapContracts.call(this, swapAddresses);
182
176
  setCryptoFactoryGaugeContracts.call(this, gaugeAddresses);
183
177
  setCryptoFactoryCoinsContracts.call(this, coinAddresses);
184
178
  const existingCoinAddressNameDict = getExistingCoinAddressNameDict.call(this);
@@ -187,6 +181,7 @@ export function getTricryptoFactoryPoolData() {
187
181
  const nativeToken = this.constants.NATIVE_TOKEN;
188
182
  for (let i = 0; i < poolIds.length; i++) {
189
183
  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);
190
185
  const underlyingCoinAddresses = coinAddresses[i].map((addr) => {
191
186
  if (isETHEnabled) {
192
187
  return addr === nativeToken.wrappedAddress ? nativeToken.address : addr;
@@ -167,8 +167,8 @@ function _getUserClaimable(pools, address, useCache) {
167
167
  rewardInfoCalls.push(gaugeMulticallContract.claimable_tokens(address));
168
168
  }
169
169
  for (const token of rewardTokens[poolId]) {
170
- // Don't reset the reward ABI if the reward is the LP token itself, otherwise we lose LP contract functions
171
- const { multicallContract } = token === pool.address ? this.contracts[token] : _setContracts.call(this, token, ERC20Abi);
170
+ // Don't reset ABI if its already set, we might override an LP token ABI
171
+ const { multicallContract } = this.contracts[token] || _setContracts.call(this, token, ERC20Abi);
172
172
  rewardInfoCalls.push(multicallContract.symbol(), multicallContract.decimals());
173
173
  if ('claimable_reward(address,address)' in gaugeContract) {
174
174
  rewardInfoCalls.push(gaugeMulticallContract.claimable_reward(address, token));
@@ -255,8 +255,8 @@ function _getUserClaimableUseApi(pools, address, useCache) {
255
255
  rewardInfoCalls.push(gaugeMulticallContract.claimable_tokens(address));
256
256
  }
257
257
  for (const r of rewardTokens[poolId]) {
258
- // Don't reset the reward ABI if the reward is the LP token itself, otherwise we lose LP contract functions
259
- if (r.token !== pool.address) {
258
+ // Don't reset ABI if its already set, we might override an LP token ABI
259
+ if (!this.contracts[r.token]) {
260
260
  _setContracts.call(this, r.token, ERC20Abi);
261
261
  }
262
262
  if ('claimable_reward(address,address)' in gaugeContract) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.67.2",
3
+ "version": "2.67.4",
4
4
  "description": "JavaScript library for curve.finance",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",