@curvefi/api 1.18.0 → 1.19.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.
- package/README.md +44 -24
- package/lib/constants/abis/json/factory-crypto/factory-crypto-pool-2.json +1112 -0
- package/lib/constants/abis/json/factory-crypto.json +635 -0
- package/lib/constants/aliases.d.ts +2 -0
- package/lib/constants/aliases.js +2 -0
- package/lib/curve.d.ts +2 -0
- package/lib/curve.js +35 -7
- package/lib/factory-crypto.d.ts +32 -0
- package/lib/factory-crypto.js +377 -0
- package/lib/factory.js +3 -3
- package/lib/index.d.ts +3 -0
- package/lib/index.js +14 -0
- package/lib/interfaces.d.ts +1 -0
- package/lib/pools.d.ts +1 -0
- package/lib/pools.js +56 -19
- package/lib/utils.d.ts +1 -0
- package/lib/utils.js +3 -1
- package/package.json +1 -1
package/lib/pools.js
CHANGED
|
@@ -81,7 +81,9 @@ 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', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
84
|
+
if (!(['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
85
|
+
this.isCryptoFactory ||
|
|
86
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 2];
|
|
85
87
|
return [4 /*yield*/, this._calcLpTokenAmountWithUnderlying(_amounts, isDeposit)];
|
|
86
88
|
case 1:
|
|
87
89
|
_expected = _a.sent(); // Lending pools
|
|
@@ -192,7 +194,9 @@ var Pool = /** @class */ (function () {
|
|
|
192
194
|
_poolUnderlyingBalances = this.name !== 'atricrypto3' ? __spreadArray(__spreadArray([], _poolUnderlyingBalance, true), _basePoolExpectedAmounts, true) : __spreadArray(__spreadArray([], _basePoolExpectedAmounts, true), _poolUnderlyingBalance, true);
|
|
193
195
|
return [3 /*break*/, 6];
|
|
194
196
|
case 3:
|
|
195
|
-
if (!(['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
197
|
+
if (!(['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
198
|
+
this.isCryptoFactory ||
|
|
199
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
|
|
196
200
|
return [4 /*yield*/, this._getRates()];
|
|
197
201
|
case 4:
|
|
198
202
|
_rates_1 = _a.sent();
|
|
@@ -236,7 +240,7 @@ var Pool = /** @class */ (function () {
|
|
|
236
240
|
case 2:
|
|
237
241
|
prices = _c.sent();
|
|
238
242
|
totalLiquidity = balances.reduce(function (liquidity, b, i) { return liquidity + (Number(b) * prices[i]); }, 0);
|
|
239
|
-
return [2 /*return*/,
|
|
243
|
+
return [2 /*return*/, totalLiquidity.toFixed(8)];
|
|
240
244
|
}
|
|
241
245
|
});
|
|
242
246
|
}); };
|
|
@@ -312,6 +316,8 @@ var Pool = /** @class */ (function () {
|
|
|
312
316
|
return [4 /*yield*/, this.getTotalLiquidity()];
|
|
313
317
|
case 1:
|
|
314
318
|
totalLiquidityUSD = _c.sent();
|
|
319
|
+
if (Number(totalLiquidityUSD) === 0)
|
|
320
|
+
return [2 /*return*/, ["0", "0"]];
|
|
315
321
|
return [4 /*yield*/, curve_1.curve.multicallProvider.all([
|
|
316
322
|
gaugeContract.inflation_rate(),
|
|
317
323
|
gaugeControllerContract.gauge_relative_weight(this.gauge),
|
|
@@ -320,6 +326,8 @@ var Pool = /** @class */ (function () {
|
|
|
320
326
|
])];
|
|
321
327
|
case 2:
|
|
322
328
|
_a = (_c.sent()).map(function (value) { return (0, utils_1.toBN)(value); }), inflation = _a[0], weight = _a[1], workingSupply = _a[2], totalSupply = _a[3];
|
|
329
|
+
if (Number(workingSupply) === 0)
|
|
330
|
+
return [2 /*return*/, ["0", "0"]];
|
|
323
331
|
rate = inflation.times(weight).times(31536000).times(0.4).div(workingSupply).times(totalSupply).div(Number(totalLiquidityUSD));
|
|
324
332
|
return [4 /*yield*/, (0, utils_1._getUsdRate)(curve_1.ALIASES.crv)];
|
|
325
333
|
case 3:
|
|
@@ -478,7 +486,9 @@ var Pool = /** @class */ (function () {
|
|
|
478
486
|
return [4 /*yield*/, this._addLiquidityZap(_amounts, true)];
|
|
479
487
|
case 3: return [2 /*return*/, _d.sent()];
|
|
480
488
|
case 4:
|
|
481
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
489
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
490
|
+
this.isCryptoFactory ||
|
|
491
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 6];
|
|
482
492
|
return [4 /*yield*/, this._addLiquidity(_amounts, true, true)];
|
|
483
493
|
case 5: return [2 /*return*/, _d.sent()];
|
|
484
494
|
case 6:
|
|
@@ -534,7 +544,9 @@ var Pool = /** @class */ (function () {
|
|
|
534
544
|
return [4 /*yield*/, this._addLiquidityZap(_amounts)];
|
|
535
545
|
case 2: return [2 /*return*/, _a.sent()];
|
|
536
546
|
case 3:
|
|
537
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
547
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
548
|
+
this.isCryptoFactory ||
|
|
549
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
|
|
538
550
|
return [4 /*yield*/, this._addLiquidity(_amounts, true)];
|
|
539
551
|
case 4: return [2 /*return*/, _a.sent()];
|
|
540
552
|
case 5:
|
|
@@ -713,7 +725,9 @@ var Pool = /** @class */ (function () {
|
|
|
713
725
|
return ethers_1.ethers.utils.parseUnits(amount, decimals[i]);
|
|
714
726
|
});
|
|
715
727
|
contract = curve_1.curve.contracts[curve_1.ALIASES.deposit_and_stake].contract;
|
|
716
|
-
useUnderlying = isUnderlying && (['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
728
|
+
useUnderlying = isUnderlying && (['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
729
|
+
this.isCryptoFactory ||
|
|
730
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'));
|
|
717
731
|
if (!isUnderlying) return [3 /*break*/, 14];
|
|
718
732
|
_l = (_k = ethers_1.ethers.utils).parseUnits;
|
|
719
733
|
return [4 /*yield*/, this.depositAndStakeExpected(amounts)];
|
|
@@ -884,7 +898,9 @@ var Pool = /** @class */ (function () {
|
|
|
884
898
|
_amounts = amounts.map(function (amount, i) {
|
|
885
899
|
return ethers_1.ethers.utils.parseUnits(amount, _this.decimals[i]);
|
|
886
900
|
});
|
|
887
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
901
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
902
|
+
this.isCryptoFactory ||
|
|
903
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 4];
|
|
888
904
|
return [4 /*yield*/, this._addLiquidity(_amounts, false, true)];
|
|
889
905
|
case 3: return [2 /*return*/, _d.sent()];
|
|
890
906
|
case 4: return [4 /*yield*/, this._addLiquiditySwap(_amounts, true)];
|
|
@@ -912,7 +928,9 @@ var Pool = /** @class */ (function () {
|
|
|
912
928
|
return [4 /*yield*/, curve_1.curve.updateFeeData()];
|
|
913
929
|
case 1:
|
|
914
930
|
_a.sent();
|
|
915
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
931
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
932
|
+
this.isCryptoFactory ||
|
|
933
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
|
|
916
934
|
return [4 /*yield*/, this._addLiquidity(_amounts, false)];
|
|
917
935
|
case 2: return [2 /*return*/, _a.sent()];
|
|
918
936
|
case 3: return [4 /*yield*/, this._addLiquiditySwap(_amounts)];
|
|
@@ -1054,7 +1072,9 @@ var Pool = /** @class */ (function () {
|
|
|
1054
1072
|
switch (_a.label) {
|
|
1055
1073
|
case 0:
|
|
1056
1074
|
_lpTokenAmount = ethers_1.ethers.utils.parseUnits(lpTokenAmount);
|
|
1057
|
-
if (!(['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1075
|
+
if (!(['compound', 'usdt', 'y', 'busd', 'pax', 'aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1076
|
+
this.isCryptoFactory ||
|
|
1077
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 2];
|
|
1058
1078
|
return [4 /*yield*/, this._calcExpectedUnderlyingAmounts(_lpTokenAmount)];
|
|
1059
1079
|
case 1:
|
|
1060
1080
|
_expected = _a.sent(); // Lending pools
|
|
@@ -1131,7 +1151,9 @@ var Pool = /** @class */ (function () {
|
|
|
1131
1151
|
return [4 /*yield*/, this._removeLiquidityZap(_lpTokenAmount, true)];
|
|
1132
1152
|
case 4: return [2 /*return*/, _c.sent()];
|
|
1133
1153
|
case 5:
|
|
1134
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1154
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1155
|
+
this.isCryptoFactory ||
|
|
1156
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 7];
|
|
1135
1157
|
return [4 /*yield*/, this._removeLiquidity(_lpTokenAmount, true, true)];
|
|
1136
1158
|
case 6: return [2 /*return*/, _c.sent()];
|
|
1137
1159
|
case 7:
|
|
@@ -1156,7 +1178,9 @@ var Pool = /** @class */ (function () {
|
|
|
1156
1178
|
return [4 /*yield*/, this._removeLiquidityZap(_lpTokenAmount)];
|
|
1157
1179
|
case 2: return [2 /*return*/, _a.sent()];
|
|
1158
1180
|
case 3:
|
|
1159
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1181
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1182
|
+
this.isCryptoFactory ||
|
|
1183
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
|
|
1160
1184
|
return [4 /*yield*/, this._removeLiquidity(_lpTokenAmount, true)];
|
|
1161
1185
|
case 4: return [2 /*return*/, _a.sent()];
|
|
1162
1186
|
case 5:
|
|
@@ -1200,7 +1224,9 @@ var Pool = /** @class */ (function () {
|
|
|
1200
1224
|
if (Number(lpTokenBalance) < Number(lpTokenAmount)) {
|
|
1201
1225
|
throw Error("Not enough LP tokens. Actual: ".concat(lpTokenBalance, ", required: ").concat(lpTokenAmount));
|
|
1202
1226
|
}
|
|
1203
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1227
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1228
|
+
this.isCryptoFactory ||
|
|
1229
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
|
|
1204
1230
|
return [4 /*yield*/, this._removeLiquidity(_lpTokenAmount, false, true)];
|
|
1205
1231
|
case 2: return [2 /*return*/, _a.sent()];
|
|
1206
1232
|
case 3: return [4 /*yield*/, this._removeLiquiditySwap(_lpTokenAmount, true)];
|
|
@@ -1220,7 +1246,9 @@ var Pool = /** @class */ (function () {
|
|
|
1220
1246
|
return [4 /*yield*/, curve_1.curve.updateFeeData()];
|
|
1221
1247
|
case 1:
|
|
1222
1248
|
_a.sent();
|
|
1223
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1249
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1250
|
+
this.isCryptoFactory ||
|
|
1251
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
|
|
1224
1252
|
return [4 /*yield*/, this._removeLiquidity(_lpTokenAmount, false)];
|
|
1225
1253
|
case 2: return [2 /*return*/, _a.sent()];
|
|
1226
1254
|
case 3: return [4 /*yield*/, this._removeLiquiditySwap(_lpTokenAmount)];
|
|
@@ -1603,7 +1631,9 @@ var Pool = /** @class */ (function () {
|
|
|
1603
1631
|
return [4 /*yield*/, this._removeLiquidityOneCoinZap(_lpTokenAmount, i, true)];
|
|
1604
1632
|
case 4: return [2 /*return*/, _c.sent()];
|
|
1605
1633
|
case 5:
|
|
1606
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1634
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1635
|
+
this.isCryptoFactory ||
|
|
1636
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 7];
|
|
1607
1637
|
return [4 /*yield*/, this._removeLiquidityOneCoin(_lpTokenAmount, i, true, true)];
|
|
1608
1638
|
case 6: return [2 /*return*/, _c.sent()];
|
|
1609
1639
|
case 7: return [4 /*yield*/, this._removeLiquidityOneCoinSwap(_lpTokenAmount, i, true)];
|
|
@@ -1627,7 +1657,9 @@ var Pool = /** @class */ (function () {
|
|
|
1627
1657
|
return [4 /*yield*/, this._removeLiquidityOneCoinZap(_lpTokenAmount, i)];
|
|
1628
1658
|
case 2: return [2 /*return*/, _a.sent()];
|
|
1629
1659
|
case 3:
|
|
1630
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1660
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1661
|
+
this.isCryptoFactory ||
|
|
1662
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 5];
|
|
1631
1663
|
return [4 /*yield*/, this._removeLiquidityOneCoin(_lpTokenAmount, i, true)];
|
|
1632
1664
|
case 4: return [2 /*return*/, _a.sent()];
|
|
1633
1665
|
case 5: return [4 /*yield*/, this._removeLiquidityOneCoinSwap(_lpTokenAmount, i)];
|
|
@@ -1705,7 +1737,9 @@ var Pool = /** @class */ (function () {
|
|
|
1705
1737
|
throw Error("".concat(this.name, " pool doesn't have remove_liquidity_one_coin method for wrapped tokens"));
|
|
1706
1738
|
}
|
|
1707
1739
|
_lpTokenAmount = ethers_1.ethers.utils.parseUnits(lpTokenAmount);
|
|
1708
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1740
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1741
|
+
this.isCryptoFactory ||
|
|
1742
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
|
|
1709
1743
|
return [4 /*yield*/, this._removeLiquidityOneCoin(_lpTokenAmount, i, false, true)];
|
|
1710
1744
|
case 2: return [2 /*return*/, _a.sent()];
|
|
1711
1745
|
case 3: return [4 /*yield*/, this._removeLiquidityOneCoinSwap(_lpTokenAmount, i, true)];
|
|
@@ -1729,7 +1763,9 @@ var Pool = /** @class */ (function () {
|
|
|
1729
1763
|
case 1:
|
|
1730
1764
|
_a.sent();
|
|
1731
1765
|
_lpTokenAmount = ethers_1.ethers.utils.parseUnits(lpTokenAmount);
|
|
1732
|
-
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1766
|
+
if (!(['aave', 'saave', 'ib', 'crveth', "cvxeth", "spelleth", "teth"].includes(this.name) ||
|
|
1767
|
+
this.isCryptoFactory ||
|
|
1768
|
+
(curve_1.curve.chainId === 137 && this.name === 'ren'))) return [3 /*break*/, 3];
|
|
1733
1769
|
return [4 /*yield*/, this._removeLiquidityOneCoin(_lpTokenAmount, i, false)];
|
|
1734
1770
|
case 2: return [2 /*return*/, _a.sent()];
|
|
1735
1771
|
case 3: return [4 /*yield*/, this._removeLiquidityOneCoinSwap(_lpTokenAmount, i)];
|
|
@@ -2780,7 +2816,7 @@ var Pool = /** @class */ (function () {
|
|
|
2780
2816
|
switch (_a.label) {
|
|
2781
2817
|
case 0:
|
|
2782
2818
|
contract = curve_1.curve.contracts[this.swap].contract;
|
|
2783
|
-
if (!["eurtusd", "xautusd", "crveth", "cvxeth", "spelleth", "teth"].includes(this.name)) return [3 /*break*/, 2];
|
|
2819
|
+
if (!(["eurtusd", "xautusd", "crveth", "cvxeth", "spelleth", "teth"].includes(this.name) || this.isCryptoFactory)) return [3 /*break*/, 2];
|
|
2784
2820
|
return [4 /*yield*/, contract.calc_token_amount(_amounts, curve_1.curve.constantOptions)];
|
|
2785
2821
|
case 1: return [2 /*return*/, _a.sent()];
|
|
2786
2822
|
case 2: return [4 /*yield*/, contract.calc_token_amount(_amounts, isDeposit, curve_1.curve.constantOptions)];
|
|
@@ -3479,7 +3515,7 @@ var Pool = /** @class */ (function () {
|
|
|
3479
3515
|
}
|
|
3480
3516
|
});
|
|
3481
3517
|
}); };
|
|
3482
|
-
var poolData = __assign(__assign({}, curve_1.POOLS_DATA), (curve_1.curve.constants.FACTORY_POOLS_DATA || {}))[name];
|
|
3518
|
+
var poolData = __assign(__assign(__assign({}, curve_1.POOLS_DATA), (curve_1.curve.constants.FACTORY_POOLS_DATA || {})), (curve_1.curve.constants.CRYPTO_FACTORY_POOLS_DATA || {}))[name];
|
|
3483
3519
|
this.name = name;
|
|
3484
3520
|
this.referenceAsset = poolData.reference_asset;
|
|
3485
3521
|
this.swap = poolData.swap_address;
|
|
@@ -3500,6 +3536,7 @@ var Pool = /** @class */ (function () {
|
|
|
3500
3536
|
this.isFactory = poolData.is_factory || false;
|
|
3501
3537
|
this.isMetaFactory = poolData.is_meta_factory || false;
|
|
3502
3538
|
this.isPlainFactory = poolData.is_plain_factory || false;
|
|
3539
|
+
this.isCryptoFactory = poolData.is_crypto_factory || false;
|
|
3503
3540
|
this.basePool = poolData.base_pool || '';
|
|
3504
3541
|
this.rewardTokens = poolData.reward_tokens || [];
|
|
3505
3542
|
this.estimateGas = {
|
package/lib/utils.d.ts
CHANGED
|
@@ -29,4 +29,5 @@ export declare const _getFactoryStatsEthereum: ((statsUrl: string) => Promise<IS
|
|
|
29
29
|
export declare const _getFactoryStatsPolygon: ((statsUrl: string) => Promise<IStats>) & memoize.Memoized<(statsUrl: string) => Promise<IStats>>;
|
|
30
30
|
export declare const getPoolList: () => string[];
|
|
31
31
|
export declare const getFactoryPoolList: () => string[];
|
|
32
|
+
export declare const getCryptoFactoryPoolList: () => string[];
|
|
32
33
|
export declare const getUsdRate: (coin: string) => Promise<number>;
|
package/lib/utils.js
CHANGED
|
@@ -59,7 +59,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
59
59
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
60
60
|
};
|
|
61
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
exports.getUsdRate = exports.getFactoryPoolList = exports.getPoolList = exports._getFactoryStatsPolygon = exports._getFactoryStatsEthereum = exports._getStats = exports._getStatsUrl = exports._getFactoryStatsUrl = exports._getUsdRate = exports.getPoolNameBySwapAddress = exports.ensureAllowance = exports.ensureAllowanceEstimateGas = exports._ensureAllowance = exports.hasAllowance = exports.getAllowance = exports._getAllowance = exports.getBalances = exports._prepareAddresses = exports._getBalances = exports._getCoinDecimals = exports._getCoinAddresses = exports.getEthIndex = exports.isEth = exports.fromBN = exports.toStringFromBN = exports.toBN = exports.BN = exports.MAX_ALLOWANCE = void 0;
|
|
62
|
+
exports.getUsdRate = exports.getCryptoFactoryPoolList = exports.getFactoryPoolList = exports.getPoolList = exports._getFactoryStatsPolygon = exports._getFactoryStatsEthereum = exports._getStats = exports._getStatsUrl = exports._getFactoryStatsUrl = exports._getUsdRate = exports.getPoolNameBySwapAddress = exports.ensureAllowance = exports.ensureAllowanceEstimateGas = exports._ensureAllowance = exports.hasAllowance = exports.getAllowance = exports._getAllowance = exports.getBalances = exports._prepareAddresses = exports._getBalances = exports._getCoinDecimals = exports._getCoinAddresses = exports.getEthIndex = exports.isEth = exports.fromBN = exports.toStringFromBN = exports.toBN = exports.BN = exports.MAX_ALLOWANCE = void 0;
|
|
63
63
|
var axios_1 = __importDefault(require("axios"));
|
|
64
64
|
var memoizee_1 = __importDefault(require("memoizee"));
|
|
65
65
|
var ethers_1 = require("ethers");
|
|
@@ -532,6 +532,8 @@ var getPoolList = function () { return Object.keys(curve_1.POOLS_DATA); };
|
|
|
532
532
|
exports.getPoolList = getPoolList;
|
|
533
533
|
var getFactoryPoolList = function () { return Object.keys(curve_1.curve.constants.FACTORY_POOLS_DATA); };
|
|
534
534
|
exports.getFactoryPoolList = getFactoryPoolList;
|
|
535
|
+
var getCryptoFactoryPoolList = function () { return Object.keys(curve_1.curve.constants.CRYPTO_FACTORY_POOLS_DATA); };
|
|
536
|
+
exports.getCryptoFactoryPoolList = getCryptoFactoryPoolList;
|
|
535
537
|
var getUsdRate = function (coin) { return __awaiter(void 0, void 0, void 0, function () {
|
|
536
538
|
var coinAddress;
|
|
537
539
|
return __generator(this, function (_a) {
|