@curvefi/api 2.34.0 → 2.34.2

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.
package/lib/curve.js CHANGED
@@ -390,7 +390,7 @@ var Curve = /** @class */ (function () {
390
390
  case 0:
391
391
  if (this.chainId === 1313161554)
392
392
  return [2 /*return*/, []];
393
- currentPoolIds = Object.keys(this.constants.FACTORY_POOLS_DATA);
393
+ currentPoolIds = Object.keys(this.constants.FACTORY_POOLS_DATA).filter(function (id) { return !id.includes('crvusd'); });
394
394
  lastPoolIdx = Number(currentPoolIds[currentPoolIds.length - 1].split("-")[2]);
395
395
  _a = lowerCasePoolDataAddresses;
396
396
  return [4 /*yield*/, getFactoryPoolData.call(this, lastPoolIdx + 1)];
@@ -314,11 +314,11 @@ export function getCryptoFactoryPoolData(fromIdx, swapAddress) {
314
314
  is_factory: true,
315
315
  base_pool: basePoolId,
316
316
  underlying_coins: __spreadArray([coinAddressNameDict[underlyingCoinAddresses[i][0]]], basePoolCoinNames, true),
317
- wrapped_coins: coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }),
317
+ wrapped_coins: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }), true),
318
318
  underlying_coin_addresses: __spreadArray([underlyingCoinAddresses[i][0]], basePoolCoinAddresses, true),
319
319
  wrapped_coin_addresses: coinAddresses[i],
320
320
  underlying_decimals: __spreadArray([coinAddressDecimalsDict[underlyingCoinAddresses[i][0]]], basePoolDecimals, true),
321
- wrapped_decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
321
+ wrapped_decimals: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }), true),
322
322
  swap_abi: cryptoFactorySwapABI,
323
323
  gauge_abi: this.chainId === 1 ? factoryGaugeABI : gaugeChildABI,
324
324
  deposit_abi: basePoolZap.ABI,
@@ -336,12 +336,12 @@ export function getCryptoFactoryPoolData(fromIdx, swapAddress) {
336
336
  is_crypto: true,
337
337
  is_plain: underlyingCoinAddresses[i].toString() === coinAddresses[i].toString(),
338
338
  is_factory: true,
339
- underlying_coins: underlyingCoinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }),
340
- wrapped_coins: coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }),
339
+ underlying_coins: __spreadArray([], underlyingCoinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }), true),
340
+ wrapped_coins: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }), true),
341
341
  underlying_coin_addresses: underlyingCoinAddresses[i],
342
342
  wrapped_coin_addresses: coinAddresses[i],
343
- underlying_decimals: underlyingCoinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
344
- wrapped_decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
343
+ underlying_decimals: __spreadArray([], underlyingCoinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }), true),
344
+ wrapped_decimals: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }), true),
345
345
  swap_abi: cryptoFactorySwapABI,
346
346
  gauge_abi: this.chainId === 1 ? factoryGaugeABI : gaugeChildABI,
347
347
  };
@@ -337,12 +337,12 @@ export function getFactoryPoolData(fromIdx, swapAddress, factoryAddress) {
337
337
  implementation_address: implementations[i],
338
338
  is_plain: true,
339
339
  is_factory: true,
340
- underlying_coins: coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }),
341
- wrapped_coins: coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }),
340
+ underlying_coins: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }), true),
341
+ wrapped_coins: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }), true),
342
342
  underlying_coin_addresses: coinAddresses[i],
343
343
  wrapped_coin_addresses: coinAddresses[i],
344
- underlying_decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
345
- wrapped_decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
344
+ underlying_decimals: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }), true),
345
+ wrapped_decimals: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }), true),
346
346
  swap_abi: swapABIs[i],
347
347
  gauge_abi: this_1.chainId === 1 ? factoryGaugeABI : gaugeChildABI,
348
348
  };
@@ -371,11 +371,11 @@ export function getFactoryPoolData(fromIdx, swapAddress, factoryAddress) {
371
371
  is_factory: true,
372
372
  base_pool: basePoolIds[i],
373
373
  underlying_coins: __spreadArray([coinAddressNameDict[coinAddresses[i][0]]], basePoolIdCoinsDict[basePoolIds[i]], true),
374
- wrapped_coins: coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }),
374
+ wrapped_coins: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressNameDict[addr]; }), true),
375
375
  underlying_coin_addresses: __spreadArray([coinAddresses[i][0]], basePoolIdCoinAddressesDict[basePoolIds[i]], true),
376
376
  wrapped_coin_addresses: coinAddresses[i],
377
377
  underlying_decimals: __spreadArray([coinAddressDecimalsDict[coinAddresses[i][0]]], basePoolIdDecimalsDict[basePoolIds[i]], true),
378
- wrapped_decimals: coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }),
378
+ wrapped_decimals: __spreadArray([], coinAddresses[i].map(function (addr) { return coinAddressDecimalsDict[addr]; }), true),
379
379
  swap_abi: swapABIs[i],
380
380
  gauge_abi: this_1.chainId === 1 ? factoryGaugeABI : gaugeChildABI,
381
381
  deposit_abi: basePoolZap.ABI,
@@ -1165,14 +1165,16 @@ var PoolTemplate = /** @class */ (function () {
1165
1165
  };
1166
1166
  PoolTemplate.prototype.statsWrappedBalances = function () {
1167
1167
  return __awaiter(this, void 0, void 0, function () {
1168
- var swapContract, contractCalls, _wrappedBalances;
1168
+ var contract, calls, i, _wrappedBalances;
1169
1169
  var _this = this;
1170
1170
  return __generator(this, function (_c) {
1171
1171
  switch (_c.label) {
1172
1172
  case 0:
1173
- swapContract = curve.contracts[this.address].multicallContract;
1174
- contractCalls = this.wrappedCoins.map(function (_, i) { return swapContract.balances(i); });
1175
- return [4 /*yield*/, curve.multicallProvider.all(contractCalls)];
1173
+ contract = curve.contracts[this.address].multicallContract;
1174
+ calls = [];
1175
+ for (i = 0; i < this.wrappedCoins.length; i++)
1176
+ calls.push(contract.balances(i));
1177
+ return [4 /*yield*/, curve.multicallProvider.all(calls)];
1176
1178
  case 1:
1177
1179
  _wrappedBalances = _c.sent();
1178
1180
  return [2 /*return*/, _wrappedBalances.map(function (_b, i) { return curve.formatUnits(_b, _this.wrappedDecimals[i]); })];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.34.0",
3
+ "version": "2.34.2",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",