@curvefi/api 2.56.2 → 2.56.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.
@@ -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
  };
@@ -190,10 +197,10 @@ export function getFactoryPoolsDataFromApi(factoryType) {
190
197
  else if (factoryType === 'factory-tricrypto') {
191
198
  var isETHEnabled = pool.implementationAddress === tricryptoDeployImplementations[curve.chainId].amm_native_transfers_enabled;
192
199
  if (isETHEnabled) {
193
- return c.symbol;
200
+ return c.symbol === nativeToken.wrappedSymbol ? nativeToken.symbol : c.symbol;
194
201
  }
195
202
  else {
196
- return c.symbol === nativeToken.wrappedSymbol ? nativeToken.symbol : c.symbol;
203
+ return c.symbol;
197
204
  }
198
205
  }
199
206
  else {
@@ -207,10 +214,10 @@ export function getFactoryPoolsDataFromApi(factoryType) {
207
214
  else if (factoryType === 'factory-tricrypto') {
208
215
  var isETHEnabled = pool.implementationAddress === tricryptoDeployImplementations[curve.chainId].amm_native_transfers_enabled;
209
216
  if (isETHEnabled) {
210
- return addr;
217
+ return addr === nativeToken.wrappedAddress ? nativeToken.address : addr;
211
218
  }
212
219
  else {
213
- return addr === nativeToken.wrappedAddress ? nativeToken.address : addr;
220
+ return addr;
214
221
  }
215
222
  }
216
223
  else {
@@ -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.2",
3
+ "version": "2.56.4",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",