@curvefi/api 2.52.2 → 2.52.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.
@@ -73,7 +73,7 @@ export var ALIASES_AVALANCHE = lowerCaseValues({
73
73
  "eywa_factory": '0x37F22A0B028f2152e6CAcef210e0C4d3b875f367',
74
74
  "crypto_factory": '0xF18056Bbd320E96A48e3Fbf8bC061322531aac99',
75
75
  "tricrypto_factory": '0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963',
76
- "stable_ng_factory": '0x0000000000000000000000000000000000000000',
76
+ "stable_ng_factory": '0x1764ee18e8B3ccA4787249Ceb249356192594585',
77
77
  "factory_admin": "",
78
78
  });
79
79
  export var ALIASES_ARBITRUM = lowerCaseValues({
@@ -147,6 +147,8 @@ export var implementationABIDictAvalanche = lowerCaseKeys({
147
147
  "0x7D86446dDb609eD0F5f8684AcF30380a356b2B4c": Plain4BalancesABI,
148
148
  "0x0eb0F1FaF5F509Ac53fA224477509EAD167cf410": Plain4ETHABI,
149
149
  "0xCE94D3E5b0D80565D7B713A687b39a3Dc81780BA": Plain4OptimizedABI,
150
+ "0xa7Ba18EeFcD9513230987eC2faB6711AF5AbD9c2": PlainStableSwapNGABI,
151
+ "0x7C2085419BE6a04f4ad88ea91bC9F5C6E6C463D8": MetaStableSwapNGABI,
150
152
  });
151
153
  export var implementationABIDictArbitrum = lowerCaseKeys({
152
154
  "0x09672362833d8f703D5395ef3252D4Bfa51c15ca": MetaUSDABI,
@@ -161,7 +161,7 @@ implementationIdx, emaTime, // seconds
161
161
  oracleAddresses, methodNames, estimateGas) {
162
162
  if (emaTime === void 0) { emaTime = 600; }
163
163
  return __awaiter(void 0, void 0, void 0, function () {
164
- var _oracleAddresses, _methodNames, _A, _fee, _coins, contractAddress, contract, methodIds, args, gas, gasLimit;
164
+ var _oracleAddresses, _methodNames, _A, _fee, _offpegFeeMultiplier, _coins, contractAddress, contract, methodIds, args, gas, gasLimit;
165
165
  var _a;
166
166
  return __generator(this, function (_b) {
167
167
  switch (_b.label) {
@@ -204,6 +204,7 @@ oracleAddresses, methodNames, estimateGas) {
204
204
  throw Error("emaTime must be > 0. Passed emaTime = ".concat(emaTime));
205
205
  _A = parseUnits(A, 0);
206
206
  _fee = parseUnits(fee, 8);
207
+ _offpegFeeMultiplier = parseUnits(offpegFeeMultiplier, 10);
207
208
  _coins = coins;
208
209
  contractAddress = curve.constants.ALIASES.stable_ng_factory;
209
210
  contract = curve.contracts[contractAddress].contract;
@@ -216,8 +217,7 @@ oracleAddresses, methodNames, estimateGas) {
216
217
  methodIds.push(ethers.id(item).substring(0, 10));
217
218
  }
218
219
  });
219
- args = [name, symbol, _coins, _A, _fee, offpegFeeMultiplier, emaTime, implementationIdx, assetTypes, methodIds, _oracleAddresses];
220
- console.log(args);
220
+ args = [name, symbol, _coins, _A, _fee, _offpegFeeMultiplier, emaTime, implementationIdx, assetTypes, methodIds, _oracleAddresses];
221
221
  return [4 /*yield*/, (_a = contract.deploy_plain_pool).estimateGas.apply(_a, __spreadArray(__spreadArray([], args, false), [curve.constantOptions], false))];
222
222
  case 1:
223
223
  gas = _b.sent();
@@ -375,7 +375,7 @@ implementationIdx, methodName, oracleAddress, estimateGas) {
375
375
  if (methodName === void 0) { methodName = "0x00000000"; }
376
376
  if (oracleAddress === void 0) { oracleAddress = curve.constants.ZERO_ADDRESS; }
377
377
  return __awaiter(void 0, void 0, void 0, function () {
378
- var _A, _fee, methodId, contract, gas, gasLimit;
378
+ var _A, _fee, _offpegFeeMultiplier, methodId, contract, gas, gasLimit;
379
379
  return __generator(this, function (_a) {
380
380
  switch (_a.label) {
381
381
  case 0:
@@ -391,9 +391,10 @@ implementationIdx, methodName, oracleAddress, estimateGas) {
391
391
  throw Error("Invalid implementationIdx. Must be one 0 or 1");
392
392
  _A = parseUnits(A, 0);
393
393
  _fee = parseUnits(fee, 8);
394
+ _offpegFeeMultiplier = parseUnits(offpegFeeMultiplier, 10);
394
395
  methodId = methodName === "0x00000000" ? "0x00000000" : ethers.id(methodName).substring(0, 10);
395
396
  contract = curve.contracts[curve.constants.ALIASES.stable_ng_factory].contract;
396
- return [4 /*yield*/, contract.deploy_metapool.estimateGas(basePool, name, symbol, coin, _A, _fee, offpegFeeMultiplier, emaTime, implementationIdx, assetType, methodId, oracleAddress, curve.constantOptions)];
397
+ return [4 /*yield*/, contract.deploy_metapool.estimateGas(basePool, name, symbol, coin, _A, _fee, _offpegFeeMultiplier, emaTime, implementationIdx, assetType, methodId, oracleAddress, curve.constantOptions)];
397
398
  case 1:
398
399
  gas = _a.sent();
399
400
  if (estimateGas)
@@ -1403,34 +1403,27 @@ var PoolTemplate = /** @class */ (function () {
1403
1403
  };
1404
1404
  PoolTemplate.prototype.depositBonus = function (amounts) {
1405
1405
  return __awaiter(this, void 0, void 0, function () {
1406
- var amountsBN, prices, _c, pricesBN, balancesBN, balancedAmounts, expectedBN, _d, balancedExpectedBN, _e;
1407
- return __generator(this, function (_f) {
1408
- switch (_f.label) {
1406
+ var amountsBN, prices, pricesBN, balancesBN, balancedAmounts, expectedBN, _c, balancedExpectedBN, _d;
1407
+ return __generator(this, function (_e) {
1408
+ switch (_e.label) {
1409
1409
  case 0:
1410
1410
  amountsBN = amounts.map(BN);
1411
- if (!(this.isCrypto || this.id === 'wsteth')) return [3 /*break*/, 2];
1412
1411
  return [4 /*yield*/, this._underlyingPrices()];
1413
1412
  case 1:
1414
- _c = _f.sent();
1415
- return [3 /*break*/, 3];
1416
- case 2:
1417
- _c = this.underlyingCoins.map(function () { return 1; });
1418
- _f.label = 3;
1419
- case 3:
1420
- prices = _c;
1413
+ prices = _e.sent();
1421
1414
  pricesBN = prices.map(BN);
1422
1415
  return [4 /*yield*/, this.stats.underlyingBalances()];
1423
- case 4:
1424
- balancesBN = (_f.sent()).map(BN);
1416
+ case 2:
1417
+ balancesBN = (_e.sent()).map(BN);
1425
1418
  balancedAmounts = this._balancedAmountsWithSameValue(amountsBN, pricesBN, balancesBN);
1426
- _d = BN;
1419
+ _c = BN;
1427
1420
  return [4 /*yield*/, this.depositExpected(amounts)];
1428
- case 5:
1429
- expectedBN = _d.apply(void 0, [_f.sent()]);
1430
- _e = BN;
1421
+ case 3:
1422
+ expectedBN = _c.apply(void 0, [_e.sent()]);
1423
+ _d = BN;
1431
1424
  return [4 /*yield*/, this.depositExpected(balancedAmounts)];
1432
- case 6:
1433
- balancedExpectedBN = _e.apply(void 0, [_f.sent()]);
1425
+ case 4:
1426
+ balancedExpectedBN = _d.apply(void 0, [_e.sent()]);
1434
1427
  return [2 /*return*/, String(expectedBN.minus(balancedExpectedBN).div(balancedExpectedBN).times(100))];
1435
1428
  }
1436
1429
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.52.2",
3
+ "version": "2.52.4",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",