@curvefi/api 2.28.0 → 2.28.1

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.
@@ -178,10 +178,13 @@ function getFactoryPoolsDataFromApi(isCrypto) {
178
178
  common_1.setFactoryZapContracts.call(this, isCrypto);
179
179
  FACTORY_POOLS_DATA = {};
180
180
  rawPoolList.forEach(function (pool) {
181
+ var nativeToken = _this.constants.NATIVE_TOKEN;
181
182
  var coinAddresses = pool.coins.map(function (c) { return c.address; });
183
+ if (_this.chainId === 137) {
184
+ coinAddresses = coinAddresses.map(function (a) { return a === "0x0000000000000000000000000000000000001010" ? nativeToken.wrappedAddress : a; });
185
+ }
182
186
  var coinNames = pool.coins.map(function (c) { return c.symbol; });
183
187
  var coinDecimals = pool.coins.map(function (c) { return Number(c.decimals); });
184
- var nativeToken = _this.constants.NATIVE_TOKEN;
185
188
  if (isCrypto) {
186
189
  var wrappedCoinNames = pool.coins.map(function (c) { return c.symbol === nativeToken.symbol ? nativeToken.wrappedSymbol : c.symbol; });
187
190
  var underlyingCoinNames = pool.coins.map(function (c) { return c.symbol === nativeToken.wrappedSymbol ? nativeToken.symbol : c.symbol; });
@@ -219,6 +219,7 @@ function getCryptoFactorySymbolsAndNames(factoryTokenAddresses) {
219
219
  function getCryptoFactoryCoinAddresses(factorySwapAddresses) {
220
220
  return __awaiter(this, void 0, void 0, function () {
221
221
  var factoryMulticallContract, calls, _i, factorySwapAddresses_3, addr;
222
+ var _this = this;
222
223
  return __generator(this, function (_a) {
223
224
  switch (_a.label) {
224
225
  case 0: return [4 /*yield*/, this.contracts[this.constants.ALIASES.crypto_factory].multicallContract];
@@ -230,7 +231,7 @@ function getCryptoFactoryCoinAddresses(factorySwapAddresses) {
230
231
  calls.push(factoryMulticallContract.get_coins(addr));
231
232
  }
232
233
  return [4 /*yield*/, this.multicallProvider.all(calls)];
233
- case 2: return [2 /*return*/, (_a.sent()).map(function (addresses) { return addresses.map(function (addr) { return addr.toLowerCase(); }); })];
234
+ case 2: return [2 /*return*/, (_a.sent()).map(function (addresses) { return addresses.map(function (addr) { return _this.chainId === 137 && addr === "0x0000000000000000000000000000000000001010" ? _this.constants.NATIVE_TOKEN.wrappedAddress : addr.toLowerCase(); }); })];
234
235
  }
235
236
  });
236
237
  });
@@ -244,6 +244,7 @@ function getFactoryReferenceAssets(factorySwapAddresses) {
244
244
  function getFactoryCoinAddresses(factorySwapAddresses) {
245
245
  return __awaiter(this, void 0, void 0, function () {
246
246
  var factoryMulticallContract, calls, _i, factorySwapAddresses_5, addr;
247
+ var _this = this;
247
248
  return __generator(this, function (_a) {
248
249
  switch (_a.label) {
249
250
  case 0: return [4 /*yield*/, this.contracts[this.constants.ALIASES.factory].multicallContract];
@@ -257,7 +258,7 @@ function getFactoryCoinAddresses(factorySwapAddresses) {
257
258
  return [4 /*yield*/, this.multicallProvider.all(calls)];
258
259
  case 2: return [2 /*return*/, (_a.sent()).map(function (addresses) { return addresses
259
260
  .filter(function (addr) { return addr !== ethers_1.ethers.constants.AddressZero; })
260
- .map(function (addr) { return addr.toLowerCase(); }); })];
261
+ .map(function (addr) { return _this.chainId === 137 && addr === "0x0000000000000000000000000000000000001010" ? _this.constants.NATIVE_TOKEN.address : addr.toLowerCase(); }); })];
261
262
  }
262
263
  });
263
264
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.28.0",
3
+ "version": "2.28.1",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",