@curvefi/api 2.56.3 → 2.56.5

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.
@@ -61,12 +61,13 @@ import ERC20ABI from "../constants/abis/ERC20.json" assert { type: 'json' };
61
61
  import cryptoFactorySwapABI from "../constants/abis/factory-crypto/factory-crypto-pool-2.json" assert { type: 'json' };
62
62
  import twocryptoFactorySwapABI from "../constants/abis/factory-twocrypto/factory-twocrypto-pool.json" assert { type: 'json' };
63
63
  import tricryptoFactorySwapABI from "../constants/abis/factory-tricrypto/factory-tricrypto-pool.json" assert { type: 'json' };
64
+ import tricryptoFactoryEthDisabledSwapABI from "../constants/abis/factory-tricrypto/factory-tricrypto-pool-eth-disabled.json" assert { type: 'json' };
64
65
  import { FACTORY_CONSTANTS } from "./constants.js";
65
66
  import { CRYPTO_FACTORY_CONSTANTS } from "./constants-crypto.js";
66
67
  import { getPoolIdByAddress, setFactoryZapContracts } from "./common.js";
67
68
  import { _getPoolsFromApi } from "../external-api.js";
68
69
  import { assetTypeNameHandler, getPoolName, isStableNgPool } from "../utils.js";
69
- import { tricryptoDeployImplementations } from "../constants/tricryptoDeployImplementations";
70
+ import { tricryptoDeployImplementations } from "../constants/tricryptoDeployImplementations.js";
70
71
  export var lowerCasePoolDataAddresses = function (poolsData) {
71
72
  var _a;
72
73
  for (var _i = 0, poolsData_1 = poolsData; _i < poolsData_1.length; _i++) {
@@ -104,7 +105,12 @@ function setFactorySwapContracts(rawPoolList, factoryType) {
104
105
  }
105
106
  else if (factoryType === "factory-tricrypto") {
106
107
  rawPoolList.forEach(function (pool) {
107
- _this.setContract(pool.address, tricryptoFactorySwapABI);
108
+ if (pool.implementationAddress === tricryptoDeployImplementations[curve.chainId].amm_native_transfers_disabled) {
109
+ _this.setContract(pool.address, tricryptoFactoryEthDisabledSwapABI);
110
+ }
111
+ else {
112
+ _this.setContract(pool.address, tricryptoFactorySwapABI);
113
+ }
108
114
  });
109
115
  }
110
116
  else {
@@ -139,11 +145,12 @@ function setFactoryCoinsContracts(rawPoolList) {
139
145
  }
140
146
  }
141
147
  }
142
- var getSwapAbiByFactoryType = function (factoryType) {
148
+ var getSwapAbiByFactoryType = function (factoryType, pool) {
149
+ var isETHDisabled = pool.implementationAddress === tricryptoDeployImplementations[curve.chainId].amm_native_transfers_disabled;
143
150
  var map = {
144
151
  "factory-crypto": cryptoFactorySwapABI,
145
152
  "factory-twocrypto": twocryptoFactorySwapABI,
146
- "facroty-tricrypto": tricryptoFactorySwapABI,
153
+ "facroty-tricrypto": isETHDisabled ? tricryptoFactoryEthDisabledSwapABI : tricryptoFactorySwapABI,
147
154
  };
148
155
  return map[factoryType];
149
156
  };
@@ -271,7 +278,7 @@ export function getFactoryPoolsDataFromApi(factoryType) {
271
278
  wrapped_coin_addresses: coinAddresses,
272
279
  underlying_decimals: coinDecimals,
273
280
  wrapped_decimals: coinDecimals,
274
- swap_abi: getSwapAbiByFactoryType(factoryType),
281
+ swap_abi: getSwapAbiByFactoryType(factoryType, pool),
275
282
  gauge_abi: _this.chainId === 1 ? factoryGaugeABI : gaugeChildABI,
276
283
  in_api: true,
277
284
  is_stable_ng: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.56.3",
3
+ "version": "2.56.5",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",
@@ -35,7 +35,7 @@
35
35
  "axios": "^0.21.1",
36
36
  "bignumber.js": "^9.0.1",
37
37
  "ethcall": "^6.0.2",
38
- "ethers": "^6.10.0",
38
+ "ethers": "^6.11.0",
39
39
  "memoizee": "^0.4.15"
40
40
  }
41
41
  }