@curvefi/api 1.12.0 → 1.13.0

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.
@@ -1521,4 +1521,27 @@ exports.POOLS_DATA_ETHEREUM = {
1521
1521
  '0xD533a949740bb3306d119CC777fa900bA034cd52',
1522
1522
  ],
1523
1523
  },
1524
+ cvxeth: {
1525
+ swap_abi: swap_json_37.default,
1526
+ N_COINS: 2,
1527
+ is_crypto: true,
1528
+ underlying_decimals: [18, 18],
1529
+ decimals: [18, 18],
1530
+ tethered: [false, false],
1531
+ use_lending: [false, false],
1532
+ is_plain: [true, true],
1533
+ swap_address: '0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4',
1534
+ token_address: '0x3A283D9c08E8b55966afb64C515f5143cf907611',
1535
+ gauge_address: '0x7E1444BA99dcdFfE8fBdb42C02F0005D14f13BE1',
1536
+ underlying_coins: ['ETH', 'CVX'],
1537
+ coins: ['WETH', 'CVX'],
1538
+ underlying_coin_addresses: [
1539
+ '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
1540
+ '0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b',
1541
+ ],
1542
+ coin_addresses: [
1543
+ '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
1544
+ '0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b',
1545
+ ],
1546
+ },
1524
1547
  };
@@ -90,7 +90,8 @@ exports.USD_COINS_ETHEREUM = {
90
90
  alusd: "0xbc6da0fe9ad5f3b0d58160288917aa56653660e9",
91
91
  mim: "0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3",
92
92
  '3crv': "0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490",
93
- crv: "0xD533a949740bb3306d119CC777fa900bA034cd52", // CRV
93
+ crv: "0xD533a949740bb3306d119CC777fa900bA034cd52",
94
+ cvx: "0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b", // CVX
94
95
  };
95
96
  // @ts-ignore
96
97
  exports.USD_COINS_LOWER_CASE_ETHEREUM = Object.fromEntries(Object.entries(exports.USD_COINS_ETHEREUM).map(function (entry) { return [entry[0], entry[1].toLowerCase()]; }));
@@ -158,7 +159,8 @@ exports.DECIMALS_ETHEREUM = {
158
159
  "0xbc6da0fe9ad5f3b0d58160288917aa56653660e9": 18,
159
160
  "0x99d8a9c45b2eca8864373a26d1459e3dff1e17f3": 18,
160
161
  "0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490": 18,
161
- "0xD533a949740bb3306d119CC777fa900bA034cd52": 18, // CRV
162
+ "0xD533a949740bb3306d119CC777fa900bA034cd52": 18,
163
+ "0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b": 18, // CVX
162
164
  };
163
165
  // @ts-ignore
164
166
  exports.DECIMALS_LOWER_CASE_ETHEREUM = Object.fromEntries(Object.entries(exports.DECIMALS_ETHEREUM).map(function (entry) { return [entry[0].toLowerCase(), entry[1]]; }));
package/lib/pools.js CHANGED
@@ -81,7 +81,7 @@ var Pool = /** @class */ (function () {
81
81
  _amounts = amounts.map(function (amount, i) {
82
82
  return ethers_1.ethers.utils.parseUnits(amount, _this.underlyingDecimals[i]);
83
83
  });
84
- if (!(['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 2];
84
+ if (!(['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 2];
85
85
  return [4 /*yield*/, this._calcLpTokenAmountWithUnderlying(_amounts, isDeposit)];
86
86
  case 1:
87
87
  _expected = _a.sent(); // Lending pools
@@ -161,7 +161,7 @@ var Pool = /** @class */ (function () {
161
161
  _poolUnderlyingBalances = this.name !== 'atricrypto3' ? __spreadArray(__spreadArray([], _poolUnderlyingBalance, true), _basePoolExpectedAmounts, true) : __spreadArray(__spreadArray([], _basePoolExpectedAmounts, true), _poolUnderlyingBalance, true);
162
162
  return [3 /*break*/, 6];
163
163
  case 3:
164
- if (!(['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
164
+ if (!(['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
165
165
  return [4 /*yield*/, this._getRates()];
166
166
  case 4:
167
167
  _rates_1 = _a.sent();
@@ -281,7 +281,7 @@ var Pool = /** @class */ (function () {
281
281
  return [4 /*yield*/, this._addLiquidityZap(_amounts, true)];
282
282
  case 3: return [2 /*return*/, _d.sent()];
283
283
  case 4:
284
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 6];
284
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 6];
285
285
  return [4 /*yield*/, this._addLiquidity(_amounts, true, true)];
286
286
  case 5: return [2 /*return*/, _d.sent()];
287
287
  case 6:
@@ -329,7 +329,7 @@ var Pool = /** @class */ (function () {
329
329
  return [4 /*yield*/, this._addLiquidityZap(_amounts)];
330
330
  case 2: return [2 /*return*/, _a.sent()];
331
331
  case 3:
332
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
332
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
333
333
  return [4 /*yield*/, this._addLiquidity(_amounts, true)];
334
334
  case 4: return [2 /*return*/, _a.sent()];
335
335
  case 5:
@@ -459,7 +459,7 @@ var Pool = /** @class */ (function () {
459
459
  _amounts = amounts.map(function (amount, i) {
460
460
  return ethers_1.ethers.utils.parseUnits(amount, _this.decimals[i]);
461
461
  });
462
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 4];
462
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 4];
463
463
  return [4 /*yield*/, this._addLiquidity(_amounts, false, true)];
464
464
  case 3: return [2 /*return*/, _d.sent()];
465
465
  case 4: return [4 /*yield*/, this._addLiquiditySwap(_amounts, true)];
@@ -487,7 +487,7 @@ var Pool = /** @class */ (function () {
487
487
  return [4 /*yield*/, curve_1.curve.updateFeeData()];
488
488
  case 1:
489
489
  _a.sent();
490
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
490
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
491
491
  return [4 /*yield*/, this._addLiquidity(_amounts, false)];
492
492
  case 2: return [2 /*return*/, _a.sent()];
493
493
  case 3: return [4 /*yield*/, this._addLiquiditySwap(_amounts)];
@@ -504,7 +504,7 @@ var Pool = /** @class */ (function () {
504
504
  switch (_a.label) {
505
505
  case 0:
506
506
  _lpTokenAmount = ethers_1.ethers.utils.parseUnits(lpTokenAmount);
507
- if (!(['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 2];
507
+ if (!(['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 2];
508
508
  return [4 /*yield*/, this._calcExpectedUnderlyingAmounts(_lpTokenAmount)];
509
509
  case 1:
510
510
  _expected = _a.sent(); // Lending pools
@@ -581,7 +581,7 @@ var Pool = /** @class */ (function () {
581
581
  return [4 /*yield*/, this._removeLiquidityZap(_lpTokenAmount, true)];
582
582
  case 4: return [2 /*return*/, _c.sent()];
583
583
  case 5:
584
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 7];
584
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 7];
585
585
  return [4 /*yield*/, this._removeLiquidity(_lpTokenAmount, true, true)];
586
586
  case 6: return [2 /*return*/, _c.sent()];
587
587
  case 7:
@@ -606,7 +606,7 @@ var Pool = /** @class */ (function () {
606
606
  return [4 /*yield*/, this._removeLiquidityZap(_lpTokenAmount)];
607
607
  case 2: return [2 /*return*/, _a.sent()];
608
608
  case 3:
609
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
609
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
610
610
  return [4 /*yield*/, this._removeLiquidity(_lpTokenAmount, true)];
611
611
  case 4: return [2 /*return*/, _a.sent()];
612
612
  case 5:
@@ -650,7 +650,7 @@ var Pool = /** @class */ (function () {
650
650
  if (Number(lpTokenBalance) < Number(lpTokenAmount)) {
651
651
  throw Error("Not enough LP tokens. Actual: ".concat(lpTokenBalance, ", required: ").concat(lpTokenAmount));
652
652
  }
653
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
653
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
654
654
  return [4 /*yield*/, this._removeLiquidity(_lpTokenAmount, false, true)];
655
655
  case 2: return [2 /*return*/, _a.sent()];
656
656
  case 3: return [4 /*yield*/, this._removeLiquiditySwap(_lpTokenAmount, true)];
@@ -670,7 +670,7 @@ var Pool = /** @class */ (function () {
670
670
  return [4 /*yield*/, curve_1.curve.updateFeeData()];
671
671
  case 1:
672
672
  _a.sent();
673
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
673
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
674
674
  return [4 /*yield*/, this._removeLiquidity(_lpTokenAmount, false)];
675
675
  case 2: return [2 /*return*/, _a.sent()];
676
676
  case 3: return [4 /*yield*/, this._removeLiquiditySwap(_lpTokenAmount)];
@@ -1047,7 +1047,7 @@ var Pool = /** @class */ (function () {
1047
1047
  return [4 /*yield*/, this._removeLiquidityOneCoinZap(_lpTokenAmount, i, true)];
1048
1048
  case 4: return [2 /*return*/, _c.sent()];
1049
1049
  case 5:
1050
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 7];
1050
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 7];
1051
1051
  return [4 /*yield*/, this._removeLiquidityOneCoin(_lpTokenAmount, i, true, true)];
1052
1052
  case 6: return [2 /*return*/, _c.sent()];
1053
1053
  case 7: return [4 /*yield*/, this._removeLiquidityOneCoinSwap(_lpTokenAmount, i, true)];
@@ -1071,7 +1071,7 @@ var Pool = /** @class */ (function () {
1071
1071
  return [4 /*yield*/, this._removeLiquidityOneCoinZap(_lpTokenAmount, i)];
1072
1072
  case 2: return [2 /*return*/, _a.sent()];
1073
1073
  case 3:
1074
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
1074
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
1075
1075
  return [4 /*yield*/, this._removeLiquidityOneCoin(_lpTokenAmount, i, true)];
1076
1076
  case 4: return [2 /*return*/, _a.sent()];
1077
1077
  case 5: return [4 /*yield*/, this._removeLiquidityOneCoinSwap(_lpTokenAmount, i)];
@@ -1143,7 +1143,7 @@ var Pool = /** @class */ (function () {
1143
1143
  throw Error("".concat(this.name, " pool doesn't have remove_liquidity_one_coin method for wrapped tokens"));
1144
1144
  }
1145
1145
  _lpTokenAmount = ethers_1.ethers.utils.parseUnits(lpTokenAmount);
1146
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
1146
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
1147
1147
  return [4 /*yield*/, this._removeLiquidityOneCoin(_lpTokenAmount, i, false, true)];
1148
1148
  case 2: return [2 /*return*/, _a.sent()];
1149
1149
  case 3: return [4 /*yield*/, this._removeLiquidityOneCoinSwap(_lpTokenAmount, i, true)];
@@ -1167,7 +1167,7 @@ var Pool = /** @class */ (function () {
1167
1167
  case 1:
1168
1168
  _a.sent();
1169
1169
  _lpTokenAmount = ethers_1.ethers.utils.parseUnits(lpTokenAmount);
1170
- if (!(['aave', 'saave', 'ib', 'crveth'].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
1170
+ if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth"].includes(this.name) || (curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
1171
1171
  return [4 /*yield*/, this._removeLiquidityOneCoin(_lpTokenAmount, i, false)];
1172
1172
  case 2: return [2 /*return*/, _a.sent()];
1173
1173
  case 3: return [4 /*yield*/, this._removeLiquidityOneCoinSwap(_lpTokenAmount, i)];
@@ -1946,7 +1946,7 @@ var Pool = /** @class */ (function () {
1946
1946
  switch (_a.label) {
1947
1947
  case 0:
1948
1948
  contract = curve_1.curve.contracts[this.swap].contract;
1949
- if (!["eurtusd", "crveth"].includes(this.name)) return [3 /*break*/, 2];
1949
+ if (!["eurtusd", "crveth", "cvxeth"].includes(this.name)) return [3 /*break*/, 2];
1950
1950
  return [4 /*yield*/, contract.calc_token_amount(_amounts, curve_1.curve.constantOptions)];
1951
1951
  case 1: return [2 /*return*/, _a.sent()];
1952
1952
  case 2: return [4 /*yield*/, contract.calc_token_amount(_amounts, isDeposit, curve_1.curve.constantOptions)];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "JavaScript library for curve.fi",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {