@curvefi/api 2.67.2 → 2.67.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.
@@ -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.3",
4
4
  "description": "JavaScript library for curve.finance",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",