@curvefi/api 2.65.28 → 2.65.29
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/eslint.config.mjs +88 -0
- package/lib/boosting.js +13 -13
- package/lib/constants/coins/avalanche.js +4 -4
- package/lib/constants/coins/base.js +1 -1
- package/lib/constants/coins/celo.js +1 -1
- package/lib/constants/coins/ethereum.js +88 -88
- package/lib/constants/coins/fantom.js +5 -5
- package/lib/constants/coins/kava.js +1 -1
- package/lib/constants/coins/polygon.js +18 -18
- package/lib/constants/coins/zksync.js +1 -1
- package/lib/constants/factory/crypto.js +32 -32
- package/lib/constants/factory/stable.js +57 -57
- package/lib/constants/network_constants.js +37 -37
- package/lib/constants/pools/arbitrum.js +8 -8
- package/lib/constants/pools/aurora.js +2 -2
- package/lib/constants/pools/avalanche.js +13 -13
- package/lib/constants/pools/ethereum.js +89 -89
- package/lib/constants/pools/fantom.js +13 -13
- package/lib/constants/pools/moonbeam.js +3 -3
- package/lib/constants/pools/optimism.js +3 -3
- package/lib/constants/pools/polygon.js +21 -21
- package/lib/constants/pools/xdai.js +13 -13
- package/lib/curve.d.ts +1 -1
- package/lib/curve.js +38 -38
- package/lib/dao.js +12 -12
- package/lib/external-api.d.ts +0 -9
- package/lib/external-api.js +75 -104
- package/lib/factory/deploy.js +12 -12
- package/lib/factory/factory-api.js +13 -13
- package/lib/factory/factory-crypto.js +10 -10
- package/lib/factory/factory-tricrypto.js +11 -11
- package/lib/factory/factory-twocrypto.js +9 -9
- package/lib/factory/factory.js +13 -13
- package/lib/index.d.ts +59 -59
- package/lib/index.js +3 -3
- package/lib/pools/PoolTemplate.js +59 -59
- package/lib/pools/mixins/depositMixins.js +14 -14
- package/lib/pools/mixins/depositWrappedMixins.js +8 -8
- package/lib/pools/mixins/swapMixins.js +12 -12
- package/lib/pools/mixins/swapWrappedMixins.js +8 -8
- package/lib/pools/mixins/withdrawImbalanceMixins.js +12 -12
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +6 -6
- package/lib/pools/mixins/withdrawMixins.js +14 -14
- package/lib/pools/mixins/withdrawOneCoinMixins.js +14 -14
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +6 -6
- package/lib/pools/mixins/withdrawWrappedMixins.js +6 -6
- package/lib/pools/subClasses/gaugePool.js +4 -4
- package/lib/pools/subClasses/statsPool.js +3 -3
- package/lib/pools/utils.js +11 -11
- package/lib/route-graph.worker.js +3 -3
- package/lib/router.js +4 -5
- package/lib/utils.js +22 -24
- package/package.json +21 -18
|
@@ -11,7 +11,7 @@ import memoize from "memoizee";
|
|
|
11
11
|
import { _getAllGaugesFormatted } from '../external-api.js';
|
|
12
12
|
import { _getCoinAddresses, _ensureAllowance, _getUsdRate, hasAllowance, ensureAllowance, ensureAllowanceEstimateGas, BN, toBN, toStringFromBN, parseUnits, getEthIndex, fromBN, _cutZeros, _setContracts, _get_small_x, _get_price_impact, checkNumber, _getRewardsFromApi, mulBy1_3, smartNumber, DIGas, _getAddress, findAbiFunction, PERIODS, } from '../utils.js';
|
|
13
13
|
import { curve, OLD_CHAINS } from "../curve.js";
|
|
14
|
-
import ERC20Abi from '../constants/abis/ERC20.json'
|
|
14
|
+
import ERC20Abi from '../constants/abis/ERC20.json' with { type: 'json' };
|
|
15
15
|
import { CorePool } from "./subClasses/corePool.js";
|
|
16
16
|
import { StatsPool } from "./subClasses/statsPool.js";
|
|
17
17
|
import { WalletPool } from "./subClasses/walletPool.js";
|
|
@@ -19,7 +19,7 @@ import { checkVyperVulnerability } from "./utils.js";
|
|
|
19
19
|
export class PoolTemplate extends CorePool {
|
|
20
20
|
constructor(id) {
|
|
21
21
|
super(id);
|
|
22
|
-
this._calcTokenApy = (
|
|
22
|
+
this._calcTokenApy = (...args_1) => __awaiter(this, [...args_1], void 0, function* (futureWorkingSupplyBN = null) {
|
|
23
23
|
const totalLiquidityUSD = yield this.stats.totalLiquidity();
|
|
24
24
|
if (Number(totalLiquidityUSD) === 0)
|
|
25
25
|
return [0, 0];
|
|
@@ -63,7 +63,7 @@ export class PoolTemplate extends CorePool {
|
|
|
63
63
|
const boostedApyBN = baseApyBN.times(2.5);
|
|
64
64
|
return [baseApyBN.times(100).toNumber(), boostedApyBN.times(100).toNumber()];
|
|
65
65
|
});
|
|
66
|
-
this._calcLpTokenAmount = memoize((
|
|
66
|
+
this._calcLpTokenAmount = memoize((_amounts_1, ...args_1) => __awaiter(this, [_amounts_1, ...args_1], void 0, function* (_amounts, isDeposit = true, useUnderlying = true) {
|
|
67
67
|
if (this.isCrypto) {
|
|
68
68
|
try {
|
|
69
69
|
return yield this._pureCalcLpTokenAmount(_amounts, isDeposit, useUnderlying);
|
|
@@ -116,11 +116,11 @@ export class PoolTemplate extends CorePool {
|
|
|
116
116
|
}), {
|
|
117
117
|
primitive: true,
|
|
118
118
|
promise: true,
|
|
119
|
-
maxAge: 30 * 1000,
|
|
119
|
+
maxAge: 30 * 1000, // 30 sec
|
|
120
120
|
length: 3,
|
|
121
121
|
});
|
|
122
122
|
// ---------------- CRV PROFIT, CLAIM, BOOSTING ----------------
|
|
123
|
-
this.crvProfit = (
|
|
123
|
+
this.crvProfit = (...args_1) => __awaiter(this, [...args_1], void 0, function* (address = "") {
|
|
124
124
|
if (this.rewardsOnly())
|
|
125
125
|
throw Error(`${this.name} has Rewards-Only Gauge. Use rewardsProfit instead`);
|
|
126
126
|
address = address || curve.signerAddress;
|
|
@@ -177,7 +177,7 @@ export class PoolTemplate extends CorePool {
|
|
|
177
177
|
price: crvPrice,
|
|
178
178
|
};
|
|
179
179
|
});
|
|
180
|
-
this.userBoost = (
|
|
180
|
+
this.userBoost = (...args_1) => __awaiter(this, [...args_1], void 0, function* (address = "") {
|
|
181
181
|
if (this.gauge.address === curve.constants.ZERO_ADDRESS)
|
|
182
182
|
throw Error(`${this.name} doesn't have gauge`);
|
|
183
183
|
if (this.rewardsOnly())
|
|
@@ -220,7 +220,7 @@ export class PoolTemplate extends CorePool {
|
|
|
220
220
|
const boostBN = futureWorkingBalanceBN.div(0.4).div(balanceBN);
|
|
221
221
|
return [boostBN, toBN(_futureWorkingSupply)];
|
|
222
222
|
});
|
|
223
|
-
this.userFutureBoost = (
|
|
223
|
+
this.userFutureBoost = (...args_1) => __awaiter(this, [...args_1], void 0, function* (address = "") {
|
|
224
224
|
if (this.rewardsOnly())
|
|
225
225
|
throw Error(`${this.name} has Rewards-Only Gauge. Use stats.rewardsApy instead`);
|
|
226
226
|
address = _getAddress(address);
|
|
@@ -231,7 +231,7 @@ export class PoolTemplate extends CorePool {
|
|
|
231
231
|
return '2.5';
|
|
232
232
|
return boostBN.toFixed(4).replace(/([0-9])0+$/, '$1');
|
|
233
233
|
});
|
|
234
|
-
this.userCrvApy = (
|
|
234
|
+
this.userCrvApy = (...args_1) => __awaiter(this, [...args_1], void 0, function* (address = "") {
|
|
235
235
|
if (this.rewardsOnly())
|
|
236
236
|
throw Error(`${this.name} has Rewards-Only Gauge. Use stats.rewardsApy instead`);
|
|
237
237
|
address = _getAddress(address);
|
|
@@ -243,7 +243,7 @@ export class PoolTemplate extends CorePool {
|
|
|
243
243
|
return NaN;
|
|
244
244
|
return BN(minApy).times(BN(boost)).toNumber();
|
|
245
245
|
});
|
|
246
|
-
this.userFutureCrvApy = (
|
|
246
|
+
this.userFutureCrvApy = (...args_1) => __awaiter(this, [...args_1], void 0, function* (address = "") {
|
|
247
247
|
if (this.rewardsOnly())
|
|
248
248
|
throw Error(`${this.name} has Rewards-Only Gauge. Use stats.rewardsApy instead`);
|
|
249
249
|
address = _getAddress(address);
|
|
@@ -284,7 +284,7 @@ export class PoolTemplate extends CorePool {
|
|
|
284
284
|
return addresses.length === 1 ? result[addresses[0]] : result;
|
|
285
285
|
});
|
|
286
286
|
// ---------------- REWARDS PROFIT, CLAIM ----------------
|
|
287
|
-
this.rewardTokens = memoize((
|
|
287
|
+
this.rewardTokens = memoize((...args_1) => __awaiter(this, [...args_1], void 0, function* (useApi = true) {
|
|
288
288
|
if (this.gauge.address === curve.constants.ZERO_ADDRESS)
|
|
289
289
|
return [];
|
|
290
290
|
if (useApi) {
|
|
@@ -340,7 +340,7 @@ export class PoolTemplate extends CorePool {
|
|
|
340
340
|
promise: true,
|
|
341
341
|
maxAge: 30 * 60 * 1000, // 30m
|
|
342
342
|
});
|
|
343
|
-
this.rewardsProfit = (
|
|
343
|
+
this.rewardsProfit = (...args_1) => __awaiter(this, [...args_1], void 0, function* (address = "") {
|
|
344
344
|
if (this.gauge.address === curve.constants.ZERO_ADDRESS)
|
|
345
345
|
throw Error(`${this.name} doesn't have gauge`);
|
|
346
346
|
address = address || curve.signerAddress;
|
|
@@ -585,8 +585,8 @@ export class PoolTemplate extends CorePool {
|
|
|
585
585
|
return !findAbiFunction(curve.contracts[this.gauge.address].abi, 'inflation_rate')
|
|
586
586
|
.find((func) => ['', 'uint256'].includes(func.inputs.map((a) => `${a.type}`).join(',')));
|
|
587
587
|
}
|
|
588
|
-
_pureCalcLpTokenAmount(
|
|
589
|
-
return __awaiter(this,
|
|
588
|
+
_pureCalcLpTokenAmount(_amounts_1) {
|
|
589
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, isDeposit = true, useUnderlying = true) {
|
|
590
590
|
const calcContractAddress = this.isMeta && useUnderlying ? this.zap : this.address;
|
|
591
591
|
const N_coins = useUnderlying ? this.underlyingCoins.length : this.wrappedCoins.length;
|
|
592
592
|
const contract = curve.contracts[calcContractAddress].contract;
|
|
@@ -602,8 +602,8 @@ export class PoolTemplate extends CorePool {
|
|
|
602
602
|
return yield contract.calc_token_amount(_amounts, curve.constantOptions);
|
|
603
603
|
});
|
|
604
604
|
}
|
|
605
|
-
calcLpTokenAmount(
|
|
606
|
-
return __awaiter(this,
|
|
605
|
+
calcLpTokenAmount(amounts_1) {
|
|
606
|
+
return __awaiter(this, arguments, void 0, function* (amounts, isDeposit = true) {
|
|
607
607
|
if (amounts.length !== this.underlyingCoinAddresses.length) {
|
|
608
608
|
throw Error(`${this.name} pool has ${this.underlyingCoinAddresses.length} coins (amounts provided for ${amounts.length})`);
|
|
609
609
|
}
|
|
@@ -612,8 +612,8 @@ export class PoolTemplate extends CorePool {
|
|
|
612
612
|
return curve.formatUnits(_expected);
|
|
613
613
|
});
|
|
614
614
|
}
|
|
615
|
-
calcLpTokenAmountWrapped(
|
|
616
|
-
return __awaiter(this,
|
|
615
|
+
calcLpTokenAmountWrapped(amounts_1) {
|
|
616
|
+
return __awaiter(this, arguments, void 0, function* (amounts, isDeposit = true) {
|
|
617
617
|
if (amounts.length !== this.wrappedCoinAddresses.length) {
|
|
618
618
|
throw Error(`${this.name} pool has ${this.wrappedCoinAddresses.length} coins (amounts provided for ${amounts.length})`);
|
|
619
619
|
}
|
|
@@ -626,8 +626,8 @@ export class PoolTemplate extends CorePool {
|
|
|
626
626
|
});
|
|
627
627
|
}
|
|
628
628
|
// ---------------- DEPOSIT ----------------
|
|
629
|
-
getSeedAmounts(
|
|
630
|
-
return __awaiter(this,
|
|
629
|
+
getSeedAmounts(amount1_1) {
|
|
630
|
+
return __awaiter(this, arguments, void 0, function* (amount1, useUnderlying = false) {
|
|
631
631
|
const amount1BN = BN(amount1);
|
|
632
632
|
if (amount1BN.lte(0))
|
|
633
633
|
throw Error("Initial deposit amounts must be > 0");
|
|
@@ -748,8 +748,8 @@ export class PoolTemplate extends CorePool {
|
|
|
748
748
|
return yield ensureAllowanceEstimateGas(this.underlyingCoinAddresses, amounts, this.zap || this.address);
|
|
749
749
|
});
|
|
750
750
|
}
|
|
751
|
-
depositApprove(
|
|
752
|
-
return __awaiter(this,
|
|
751
|
+
depositApprove(amounts_1) {
|
|
752
|
+
return __awaiter(this, arguments, void 0, function* (amounts, isMax = true) {
|
|
753
753
|
return yield ensureAllowance(this.underlyingCoinAddresses, amounts, this.zap || this.address, isMax);
|
|
754
754
|
});
|
|
755
755
|
}
|
|
@@ -760,8 +760,8 @@ export class PoolTemplate extends CorePool {
|
|
|
760
760
|
});
|
|
761
761
|
}
|
|
762
762
|
// OVERRIDE
|
|
763
|
-
deposit(
|
|
764
|
-
return __awaiter(this,
|
|
763
|
+
deposit(amounts_1) {
|
|
764
|
+
return __awaiter(this, arguments, void 0, function* (amounts, slippage = 0.5) {
|
|
765
765
|
throw Error(`deposit method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
766
766
|
});
|
|
767
767
|
}
|
|
@@ -821,8 +821,8 @@ export class PoolTemplate extends CorePool {
|
|
|
821
821
|
});
|
|
822
822
|
}
|
|
823
823
|
// OVERRIDE
|
|
824
|
-
depositWrapped(
|
|
825
|
-
return __awaiter(this,
|
|
824
|
+
depositWrapped(amounts_1) {
|
|
825
|
+
return __awaiter(this, arguments, void 0, function* (amounts, slippage = 0.5) {
|
|
826
826
|
throw Error(`depositWrapped method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
827
827
|
});
|
|
828
828
|
}
|
|
@@ -892,8 +892,8 @@ export class PoolTemplate extends CorePool {
|
|
|
892
892
|
return (yield curve.contracts[this.gauge.address].contract.withdraw(_lpTokenAmount, Object.assign(Object.assign({}, curve.options), { gasLimit }))).hash;
|
|
893
893
|
});
|
|
894
894
|
}
|
|
895
|
-
claimableCrv(
|
|
896
|
-
return __awaiter(this,
|
|
895
|
+
claimableCrv() {
|
|
896
|
+
return __awaiter(this, arguments, void 0, function* (address = "") {
|
|
897
897
|
if (this.rewardsOnly())
|
|
898
898
|
throw Error(`${this.name} has Rewards-Only Gauge. Use claimableRewards instead`);
|
|
899
899
|
address = address || curve.signerAddress;
|
|
@@ -964,8 +964,8 @@ export class PoolTemplate extends CorePool {
|
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
966
|
// TODO 1. Fix aave and saave error
|
|
967
|
-
claimableRewards(
|
|
968
|
-
return __awaiter(this,
|
|
967
|
+
claimableRewards() {
|
|
968
|
+
return __awaiter(this, arguments, void 0, function* (address = "") {
|
|
969
969
|
if (this.gauge.address === curve.constants.ZERO_ADDRESS) {
|
|
970
970
|
throw Error(`claimableRewards method doesn't exist for pool ${this.name} (id: ${this.name}). There is no gauge`);
|
|
971
971
|
}
|
|
@@ -1101,8 +1101,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1101
1101
|
return yield this._depositAndStake(amounts, 1, true, true);
|
|
1102
1102
|
});
|
|
1103
1103
|
}
|
|
1104
|
-
depositAndStake(
|
|
1105
|
-
return __awaiter(this,
|
|
1104
|
+
depositAndStake(amounts_1) {
|
|
1105
|
+
return __awaiter(this, arguments, void 0, function* (amounts, slippage = 0.1) {
|
|
1106
1106
|
if (this.gauge.address === curve.constants.ZERO_ADDRESS) {
|
|
1107
1107
|
throw Error(`depositAndStake method doesn't exist for pool ${this.name} (id: ${this.name}). There is no gauge`);
|
|
1108
1108
|
}
|
|
@@ -1200,8 +1200,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1200
1200
|
return yield this._depositAndStake(amounts, 1, false, true);
|
|
1201
1201
|
});
|
|
1202
1202
|
}
|
|
1203
|
-
depositAndStakeWrapped(
|
|
1204
|
-
return __awaiter(this,
|
|
1203
|
+
depositAndStakeWrapped(amounts_1) {
|
|
1204
|
+
return __awaiter(this, arguments, void 0, function* (amounts, slippage = 0.1) {
|
|
1205
1205
|
if (this.gauge.address === curve.constants.ZERO_ADDRESS) {
|
|
1206
1206
|
throw Error(`depositAndStakeWrapped method doesn't exist for pool ${this.name} (id: ${this.name}). There is no gauge`);
|
|
1207
1207
|
}
|
|
@@ -1304,8 +1304,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1304
1304
|
});
|
|
1305
1305
|
}
|
|
1306
1306
|
// OVERRIDE
|
|
1307
|
-
withdraw(
|
|
1308
|
-
return __awaiter(this,
|
|
1307
|
+
withdraw(lpTokenAmount_1) {
|
|
1308
|
+
return __awaiter(this, arguments, void 0, function* (lpTokenAmount, slippage = 0.5) {
|
|
1309
1309
|
throw Error(`withdraw method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
1310
1310
|
});
|
|
1311
1311
|
}
|
|
@@ -1323,8 +1323,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1323
1323
|
});
|
|
1324
1324
|
}
|
|
1325
1325
|
// OVERRIDE
|
|
1326
|
-
withdrawWrapped(
|
|
1327
|
-
return __awaiter(this,
|
|
1326
|
+
withdrawWrapped(lpTokenAmount_1) {
|
|
1327
|
+
return __awaiter(this, arguments, void 0, function* (lpTokenAmount, slippage = 0.5) {
|
|
1328
1328
|
throw Error(`withdrawWrapped method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
1329
1329
|
});
|
|
1330
1330
|
}
|
|
@@ -1413,8 +1413,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1413
1413
|
});
|
|
1414
1414
|
}
|
|
1415
1415
|
// OVERRIDE
|
|
1416
|
-
withdrawImbalance(
|
|
1417
|
-
return __awaiter(this,
|
|
1416
|
+
withdrawImbalance(amounts_1) {
|
|
1417
|
+
return __awaiter(this, arguments, void 0, function* (amounts, slippage = 0.5) {
|
|
1418
1418
|
throw Error(`withdrawImbalance method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
1419
1419
|
});
|
|
1420
1420
|
}
|
|
@@ -1443,8 +1443,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1443
1443
|
});
|
|
1444
1444
|
}
|
|
1445
1445
|
// OVERRIDE
|
|
1446
|
-
withdrawImbalanceWrapped(
|
|
1447
|
-
return __awaiter(this,
|
|
1446
|
+
withdrawImbalanceWrapped(amounts_1) {
|
|
1447
|
+
return __awaiter(this, arguments, void 0, function* (amounts, slippage = 0.5) {
|
|
1448
1448
|
throw Error(`withdrawImbalanceWrapped method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
1449
1449
|
});
|
|
1450
1450
|
}
|
|
@@ -1526,8 +1526,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1526
1526
|
});
|
|
1527
1527
|
}
|
|
1528
1528
|
// OVERRIDE
|
|
1529
|
-
withdrawOneCoin(
|
|
1530
|
-
return __awaiter(this,
|
|
1529
|
+
withdrawOneCoin(lpTokenAmount_1, coin_1) {
|
|
1530
|
+
return __awaiter(this, arguments, void 0, function* (lpTokenAmount, coin, slippage = 0.5) {
|
|
1531
1531
|
throw Error(`withdrawOneCoin method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
1532
1532
|
});
|
|
1533
1533
|
}
|
|
@@ -1564,8 +1564,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1564
1564
|
});
|
|
1565
1565
|
}
|
|
1566
1566
|
// OVERRIDE
|
|
1567
|
-
withdrawOneCoinWrapped(
|
|
1568
|
-
return __awaiter(this,
|
|
1567
|
+
withdrawOneCoinWrapped(lpTokenAmount_1, coin_1) {
|
|
1568
|
+
return __awaiter(this, arguments, void 0, function* (lpTokenAmount, coin, slippage = 0.5) {
|
|
1569
1569
|
throw Error(`withdrawOneCoinWrapped method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
1570
1570
|
});
|
|
1571
1571
|
}
|
|
@@ -1579,8 +1579,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1579
1579
|
return lpTotalBalanceBN;
|
|
1580
1580
|
});
|
|
1581
1581
|
}
|
|
1582
|
-
userBalances(
|
|
1583
|
-
return __awaiter(this,
|
|
1582
|
+
userBalances() {
|
|
1583
|
+
return __awaiter(this, arguments, void 0, function* (address = "") {
|
|
1584
1584
|
address = address || curve.signerAddress;
|
|
1585
1585
|
if (!address)
|
|
1586
1586
|
throw Error("Need to connect wallet or pass address into args");
|
|
@@ -1590,8 +1590,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1590
1590
|
return yield this.withdrawExpected(lpTotalBalanceBN.toFixed(18));
|
|
1591
1591
|
});
|
|
1592
1592
|
}
|
|
1593
|
-
userWrappedBalances(
|
|
1594
|
-
return __awaiter(this,
|
|
1593
|
+
userWrappedBalances() {
|
|
1594
|
+
return __awaiter(this, arguments, void 0, function* (address = "") {
|
|
1595
1595
|
address = address || curve.signerAddress;
|
|
1596
1596
|
if (!address)
|
|
1597
1597
|
throw Error("Need to connect wallet or pass address into args");
|
|
@@ -1601,15 +1601,15 @@ export class PoolTemplate extends CorePool {
|
|
|
1601
1601
|
return yield this.withdrawWrappedExpected(lpTotalBalanceBN.toFixed(18));
|
|
1602
1602
|
});
|
|
1603
1603
|
}
|
|
1604
|
-
userLiquidityUSD(
|
|
1605
|
-
return __awaiter(this,
|
|
1604
|
+
userLiquidityUSD() {
|
|
1605
|
+
return __awaiter(this, arguments, void 0, function* (address = "") {
|
|
1606
1606
|
const lpBalanceBN = yield this._userLpTotalBalance(address);
|
|
1607
1607
|
const lpPrice = yield _getUsdRate(this.lpToken);
|
|
1608
1608
|
return lpBalanceBN.times(lpPrice).toFixed(8);
|
|
1609
1609
|
});
|
|
1610
1610
|
}
|
|
1611
|
-
baseProfit(
|
|
1612
|
-
return __awaiter(this,
|
|
1611
|
+
baseProfit() {
|
|
1612
|
+
return __awaiter(this, arguments, void 0, function* (address = "") {
|
|
1613
1613
|
const apyData = yield this.stats.baseApy();
|
|
1614
1614
|
if (!('week' in apyData))
|
|
1615
1615
|
return { day: "0", week: "0", month: "0", year: "0" };
|
|
@@ -1627,8 +1627,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1627
1627
|
};
|
|
1628
1628
|
});
|
|
1629
1629
|
}
|
|
1630
|
-
userShare(
|
|
1631
|
-
return __awaiter(this,
|
|
1630
|
+
userShare() {
|
|
1631
|
+
return __awaiter(this, arguments, void 0, function* (address = "") {
|
|
1632
1632
|
const withGauge = this.gauge.address !== curve.constants.ZERO_ADDRESS;
|
|
1633
1633
|
address = address || curve.signerAddress;
|
|
1634
1634
|
if (!address)
|
|
@@ -1802,8 +1802,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1802
1802
|
});
|
|
1803
1803
|
}
|
|
1804
1804
|
// OVERRIDE
|
|
1805
|
-
swap(
|
|
1806
|
-
return __awaiter(this,
|
|
1805
|
+
swap(inputCoin_1, outputCoin_1, amount_1) {
|
|
1806
|
+
return __awaiter(this, arguments, void 0, function* (inputCoin, outputCoin, amount, slippage = 0.5) {
|
|
1807
1807
|
throw Error(`swap method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
1808
1808
|
});
|
|
1809
1809
|
}
|
|
@@ -1864,8 +1864,8 @@ export class PoolTemplate extends CorePool {
|
|
|
1864
1864
|
});
|
|
1865
1865
|
}
|
|
1866
1866
|
// OVERRIDE
|
|
1867
|
-
swapWrapped(
|
|
1868
|
-
return __awaiter(this,
|
|
1867
|
+
swapWrapped(inputCoin_1, outputCoin_1, amount_1) {
|
|
1868
|
+
return __awaiter(this, arguments, void 0, function* (inputCoin, outputCoin, amount, slippage = 0.5) {
|
|
1869
1869
|
throw Error(`swapWrapped method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
1870
1870
|
});
|
|
1871
1871
|
}
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { curve } from "../../curve.js";
|
|
11
11
|
import { _ensureAllowance, fromBN, getEthIndex, hasAllowance, toBN, parseUnits, mulBy1_3, DIGas, smartNumber } from '../../utils.js';
|
|
12
12
|
// @ts-ignore
|
|
13
|
-
function _depositCheck(
|
|
14
|
-
return __awaiter(this,
|
|
13
|
+
function _depositCheck(amounts_1) {
|
|
14
|
+
return __awaiter(this, arguments, void 0, function* (amounts, estimateGas = false) {
|
|
15
15
|
if (amounts.length !== this.underlyingCoinAddresses.length) {
|
|
16
16
|
throw Error(`${this.name} pool has ${this.underlyingCoinAddresses.length} coins (amounts provided for ${amounts.length})`);
|
|
17
17
|
}
|
|
@@ -29,8 +29,8 @@ function _depositCheck(amounts, estimateGas = false) {
|
|
|
29
29
|
return amounts.map((amount, i) => parseUnits(amount, this.underlyingDecimals[i]));
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
function _depositMinAmount(
|
|
33
|
-
return __awaiter(this,
|
|
32
|
+
function _depositMinAmount(_amounts_1) {
|
|
33
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage = 0.5) {
|
|
34
34
|
// @ts-ignore
|
|
35
35
|
const _expectedLpTokenAmount = yield this._calcLpTokenAmount(_amounts);
|
|
36
36
|
const minAmountBN = toBN(_expectedLpTokenAmount).times(100 - slippage).div(100);
|
|
@@ -40,8 +40,8 @@ function _depositMinAmount(_amounts, slippage = 0.5) {
|
|
|
40
40
|
// @ts-ignore
|
|
41
41
|
export const depositMetaFactoryMixin = {
|
|
42
42
|
// @ts-ignore
|
|
43
|
-
_deposit(
|
|
44
|
-
return __awaiter(this,
|
|
43
|
+
_deposit(_amounts_1, slippage_1) {
|
|
44
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage, estimateGas = false) {
|
|
45
45
|
if (!estimateGas)
|
|
46
46
|
yield _ensureAllowance(this.underlyingCoinAddresses, _amounts, this.zap);
|
|
47
47
|
// @ts-ignore
|
|
@@ -76,8 +76,8 @@ export const depositMetaFactoryMixin = {
|
|
|
76
76
|
// @ts-ignore
|
|
77
77
|
export const depositCryptoMetaFactoryMixin = {
|
|
78
78
|
// @ts-ignore
|
|
79
|
-
_deposit(
|
|
80
|
-
return __awaiter(this,
|
|
79
|
+
_deposit(_amounts_1, slippage_1) {
|
|
80
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage, estimateGas = false) {
|
|
81
81
|
if (!estimateGas)
|
|
82
82
|
yield _ensureAllowance(this.underlyingCoinAddresses, _amounts, this.zap);
|
|
83
83
|
// @ts-ignore
|
|
@@ -112,8 +112,8 @@ export const depositCryptoMetaFactoryMixin = {
|
|
|
112
112
|
// @ts-ignore
|
|
113
113
|
export const depositZapMixin = {
|
|
114
114
|
// @ts-ignore
|
|
115
|
-
_deposit(
|
|
116
|
-
return __awaiter(this,
|
|
115
|
+
_deposit(_amounts_1, slippage_1) {
|
|
116
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage, estimateGas = false) {
|
|
117
117
|
if (!estimateGas)
|
|
118
118
|
yield _ensureAllowance(this.underlyingCoinAddresses, _amounts, this.zap);
|
|
119
119
|
// @ts-ignore
|
|
@@ -151,8 +151,8 @@ export const depositZapMixin = {
|
|
|
151
151
|
// @ts-ignore
|
|
152
152
|
export const depositLendingOrCryptoMixin = {
|
|
153
153
|
// @ts-ignore
|
|
154
|
-
_deposit(
|
|
155
|
-
return __awaiter(this,
|
|
154
|
+
_deposit(_amounts_1, slippage_1) {
|
|
155
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage, estimateGas = false) {
|
|
156
156
|
if (!estimateGas)
|
|
157
157
|
yield _ensureAllowance(this.underlyingCoinAddresses, _amounts, this.address);
|
|
158
158
|
// @ts-ignore
|
|
@@ -187,8 +187,8 @@ export const depositLendingOrCryptoMixin = {
|
|
|
187
187
|
// @ts-ignore
|
|
188
188
|
export const depositPlainMixin = {
|
|
189
189
|
// @ts-ignore
|
|
190
|
-
_deposit(
|
|
191
|
-
return __awaiter(this,
|
|
190
|
+
_deposit(_amounts_1, slippage_1) {
|
|
191
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage, estimateGas = false) {
|
|
192
192
|
if (!estimateGas)
|
|
193
193
|
yield _ensureAllowance(this.wrappedCoinAddresses, _amounts, this.address);
|
|
194
194
|
// @ts-ignore
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { curve } from "../../curve.js";
|
|
11
11
|
import { _ensureAllowance, fromBN, getEthIndex, hasAllowance, toBN, parseUnits, mulBy1_3, DIGas, smartNumber } from '../../utils.js';
|
|
12
|
-
function _depositWrappedCheck(
|
|
13
|
-
return __awaiter(this,
|
|
12
|
+
function _depositWrappedCheck(amounts_1) {
|
|
13
|
+
return __awaiter(this, arguments, void 0, function* (amounts, estimateGas = false) {
|
|
14
14
|
if (this.isFake) {
|
|
15
15
|
throw Error(`depositWrappedExpected method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
16
16
|
}
|
|
@@ -31,8 +31,8 @@ function _depositWrappedCheck(amounts, estimateGas = false) {
|
|
|
31
31
|
return amounts.map((amount, i) => parseUnits(amount, this.wrappedDecimals[i]));
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
function _depositWrappedMinAmount(
|
|
35
|
-
return __awaiter(this,
|
|
34
|
+
function _depositWrappedMinAmount(_amounts_1) {
|
|
35
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage = 0.5) {
|
|
36
36
|
// @ts-ignore
|
|
37
37
|
const _expectedLpTokenAmount = yield this._calcLpTokenAmount(_amounts, true, false);
|
|
38
38
|
const minAmountBN = toBN(_expectedLpTokenAmount).times(100 - slippage).div(100);
|
|
@@ -42,8 +42,8 @@ function _depositWrappedMinAmount(_amounts, slippage = 0.5) {
|
|
|
42
42
|
// @ts-ignore
|
|
43
43
|
export const depositWrapped2argsMixin = {
|
|
44
44
|
// @ts-ignore
|
|
45
|
-
_depositWrapped(
|
|
46
|
-
return __awaiter(this,
|
|
45
|
+
_depositWrapped(_amounts_1, slippage_1) {
|
|
46
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage, estimateGas = false) {
|
|
47
47
|
if (!estimateGas)
|
|
48
48
|
yield _ensureAllowance(this.wrappedCoinAddresses, _amounts, this.address);
|
|
49
49
|
// @ts-ignore
|
|
@@ -78,8 +78,8 @@ export const depositWrapped2argsMixin = {
|
|
|
78
78
|
// @ts-ignore
|
|
79
79
|
export const depositWrapped3argsMixin = {
|
|
80
80
|
// @ts-ignore
|
|
81
|
-
_depositWrapped(
|
|
82
|
-
return __awaiter(this,
|
|
81
|
+
_depositWrapped(_amounts_1, slippage_1) {
|
|
82
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage, estimateGas = false) {
|
|
83
83
|
if (!estimateGas)
|
|
84
84
|
yield _ensureAllowance(this.wrappedCoinAddresses, _amounts, this.address);
|
|
85
85
|
// @ts-ignore
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { curve } from "../../curve.js";
|
|
11
11
|
import { _ensureAllowance, _getCoinDecimals, fromBN, hasAllowance, isEth, toBN, parseUnits, mulBy1_3, DIGas, smartNumber } from '../../utils.js';
|
|
12
12
|
// @ts-ignore
|
|
13
|
-
function _swapCheck(
|
|
14
|
-
return __awaiter(this,
|
|
13
|
+
function _swapCheck(inputCoin_1, outputCoin_1, amount_1) {
|
|
14
|
+
return __awaiter(this, arguments, void 0, function* (inputCoin, outputCoin, amount, estimateGas = false) {
|
|
15
15
|
// @ts-ignore
|
|
16
16
|
const contractAddress = this._swapContractAddress();
|
|
17
17
|
// @ts-ignore
|
|
@@ -31,8 +31,8 @@ function _swapCheck(inputCoin, outputCoin, amount, estimateGas = false) {
|
|
|
31
31
|
return [i, j, _amount];
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
function _swapMinAmount(
|
|
35
|
-
return __awaiter(this,
|
|
34
|
+
function _swapMinAmount(i_1, j_1, _amount_1) {
|
|
35
|
+
return __awaiter(this, arguments, void 0, function* (i, j, _amount, slippage = 0.5) {
|
|
36
36
|
// @ts-ignore
|
|
37
37
|
const _expected = yield this._swapExpected(i, j, _amount);
|
|
38
38
|
const [outputCoinDecimals] = _getCoinDecimals(this.underlyingCoinAddresses[j]);
|
|
@@ -43,8 +43,8 @@ function _swapMinAmount(i, j, _amount, slippage = 0.5) {
|
|
|
43
43
|
// @ts-ignore
|
|
44
44
|
export const swapTricrypto2Mixin = {
|
|
45
45
|
// @ts-ignore
|
|
46
|
-
_swap(
|
|
47
|
-
return __awaiter(this,
|
|
46
|
+
_swap(i_1, j_1, _amount_1, slippage_1) {
|
|
47
|
+
return __awaiter(this, arguments, void 0, function* (i, j, _amount, slippage, estimateGas = false) {
|
|
48
48
|
// @ts-ignore
|
|
49
49
|
const contractAddress = this._swapContractAddress();
|
|
50
50
|
if (!estimateGas)
|
|
@@ -80,8 +80,8 @@ export const swapTricrypto2Mixin = {
|
|
|
80
80
|
// @ts-ignore
|
|
81
81
|
export const swapMetaFactoryMixin = {
|
|
82
82
|
// @ts-ignore
|
|
83
|
-
_swap(
|
|
84
|
-
return __awaiter(this,
|
|
83
|
+
_swap(i_1, j_1, _amount_1, slippage_1) {
|
|
84
|
+
return __awaiter(this, arguments, void 0, function* (i, j, _amount, slippage, estimateGas = false) {
|
|
85
85
|
// @ts-ignore
|
|
86
86
|
const contractAddress = this._swapContractAddress();
|
|
87
87
|
if (!estimateGas)
|
|
@@ -117,8 +117,8 @@ export const swapMetaFactoryMixin = {
|
|
|
117
117
|
// @ts-ignore
|
|
118
118
|
export const swapCryptoMetaFactoryMixin = {
|
|
119
119
|
// @ts-ignore
|
|
120
|
-
_swap(
|
|
121
|
-
return __awaiter(this,
|
|
120
|
+
_swap(i_1, j_1, _amount_1, slippage_1) {
|
|
121
|
+
return __awaiter(this, arguments, void 0, function* (i, j, _amount, slippage, estimateGas = false) {
|
|
122
122
|
// @ts-ignore
|
|
123
123
|
const contractAddress = this._swapContractAddress();
|
|
124
124
|
if (!estimateGas)
|
|
@@ -154,8 +154,8 @@ export const swapCryptoMetaFactoryMixin = {
|
|
|
154
154
|
// @ts-ignore
|
|
155
155
|
export const swapMixin = {
|
|
156
156
|
// @ts-ignore
|
|
157
|
-
_swap(
|
|
158
|
-
return __awaiter(this,
|
|
157
|
+
_swap(i_1, j_1, _amount_1, slippage_1) {
|
|
158
|
+
return __awaiter(this, arguments, void 0, function* (i, j, _amount, slippage, estimateGas = false) {
|
|
159
159
|
// @ts-ignore
|
|
160
160
|
const contractAddress = this._swapContractAddress();
|
|
161
161
|
if (!estimateGas)
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { curve } from "../../curve.js";
|
|
11
11
|
import { _ensureAllowance, _getCoinDecimals, ensureAllowance, ensureAllowanceEstimateGas, fromBN, hasAllowance, isEth, toBN, parseUnits, mulBy1_3, DIGas, smartNumber } from '../../utils.js';
|
|
12
12
|
// @ts-ignore
|
|
13
|
-
function _swapWrappedCheck(
|
|
14
|
-
return __awaiter(this,
|
|
13
|
+
function _swapWrappedCheck(inputCoin_1, outputCoin_1, amount_1) {
|
|
14
|
+
return __awaiter(this, arguments, void 0, function* (inputCoin, outputCoin, amount, estimateGas = false) {
|
|
15
15
|
// @ts-ignore
|
|
16
16
|
const i = this._getCoinIdx(inputCoin, false);
|
|
17
17
|
// @ts-ignore
|
|
@@ -29,8 +29,8 @@ function _swapWrappedCheck(inputCoin, outputCoin, amount, estimateGas = false) {
|
|
|
29
29
|
return [i, j, _amount];
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
function _swapWrappedMinAmount(
|
|
33
|
-
return __awaiter(this,
|
|
32
|
+
function _swapWrappedMinAmount(i_1, j_1, _amount_1) {
|
|
33
|
+
return __awaiter(this, arguments, void 0, function* (i, j, _amount, slippage = 0.5) {
|
|
34
34
|
// @ts-ignore
|
|
35
35
|
const _expected = yield this._swapWrappedExpected(i, j, _amount);
|
|
36
36
|
const [outputCoinDecimals] = _getCoinDecimals(this.wrappedCoinAddresses[j]);
|
|
@@ -41,8 +41,8 @@ function _swapWrappedMinAmount(i, j, _amount, slippage = 0.5) {
|
|
|
41
41
|
// @ts-ignore
|
|
42
42
|
export const swapWrappedTricrypto2Mixin = {
|
|
43
43
|
// @ts-ignore
|
|
44
|
-
_swapWrapped(
|
|
45
|
-
return __awaiter(this,
|
|
44
|
+
_swapWrapped(i_1, j_1, _amount_1, slippage_1) {
|
|
45
|
+
return __awaiter(this, arguments, void 0, function* (i, j, _amount, slippage, estimateGas = false) {
|
|
46
46
|
if (!estimateGas)
|
|
47
47
|
yield _ensureAllowance([this.wrappedCoinAddresses[i]], [_amount], this.address);
|
|
48
48
|
const _minRecvAmount = yield _swapWrappedMinAmount.call(this, i, j, _amount, slippage);
|
|
@@ -75,8 +75,8 @@ export const swapWrappedTricrypto2Mixin = {
|
|
|
75
75
|
// @ts-ignore
|
|
76
76
|
export const swapWrappedMixin = {
|
|
77
77
|
// @ts-ignore
|
|
78
|
-
_swapWrapped(
|
|
79
|
-
return __awaiter(this,
|
|
78
|
+
_swapWrapped(i_1, j_1, _amount_1, slippage_1) {
|
|
79
|
+
return __awaiter(this, arguments, void 0, function* (i, j, _amount, slippage, estimateGas = false) {
|
|
80
80
|
if (!estimateGas)
|
|
81
81
|
yield _ensureAllowance([this.wrappedCoinAddresses[i]], [_amount], this.address);
|
|
82
82
|
const _minRecvAmount = yield _swapWrappedMinAmount.call(this, i, j, _amount, slippage);
|
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { curve } from "../../curve.js";
|
|
11
11
|
import { _ensureAllowance, fromBN, hasAllowance, toBN, parseUnits, mulBy1_3, smartNumber, DIGas } from '../../utils.js';
|
|
12
12
|
// @ts-ignore
|
|
13
|
-
function _withdrawImbalanceCheck(
|
|
14
|
-
return __awaiter(this,
|
|
13
|
+
function _withdrawImbalanceCheck(amounts_1) {
|
|
14
|
+
return __awaiter(this, arguments, void 0, function* (amounts, estimateGas = false) {
|
|
15
15
|
const lpTokenAmount = yield this.withdrawImbalanceExpected(amounts);
|
|
16
16
|
const lpTokenBalance = (yield this.wallet.lpTokenBalances())['lpToken'];
|
|
17
17
|
if (Number(lpTokenBalance) < Number(lpTokenAmount)) {
|
|
@@ -25,8 +25,8 @@ function _withdrawImbalanceCheck(amounts, estimateGas = false) {
|
|
|
25
25
|
return amounts.map((amount, i) => parseUnits(amount, this.underlyingDecimals[i]));
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
function _withdrawImbalanceMaxBurnAmount(
|
|
29
|
-
return __awaiter(this,
|
|
28
|
+
function _withdrawImbalanceMaxBurnAmount(_amounts_1) {
|
|
29
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage = 0.5) {
|
|
30
30
|
// @ts-ignore
|
|
31
31
|
const _expectedLpTokenAmount = yield this._calcLpTokenAmount(_amounts, false);
|
|
32
32
|
const maxBurnAmountBN = toBN(_expectedLpTokenAmount).times(100 + slippage).div(100);
|
|
@@ -36,8 +36,8 @@ function _withdrawImbalanceMaxBurnAmount(_amounts, slippage = 0.5) {
|
|
|
36
36
|
// @ts-ignore
|
|
37
37
|
export const withdrawImbalanceMetaFactoryMixin = {
|
|
38
38
|
// @ts-ignore
|
|
39
|
-
_withdrawImbalance(
|
|
40
|
-
return __awaiter(this,
|
|
39
|
+
_withdrawImbalance(_amounts_1, slippage_1) {
|
|
40
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage, estimateGas = false) {
|
|
41
41
|
const _maxBurnAmount = yield _withdrawImbalanceMaxBurnAmount.call(this, _amounts, slippage);
|
|
42
42
|
if (!estimateGas)
|
|
43
43
|
yield _ensureAllowance([this.lpToken], [_maxBurnAmount], this.zap);
|
|
@@ -69,8 +69,8 @@ export const withdrawImbalanceMetaFactoryMixin = {
|
|
|
69
69
|
// @ts-ignore
|
|
70
70
|
export const withdrawImbalanceZapMixin = {
|
|
71
71
|
// @ts-ignore
|
|
72
|
-
_withdrawImbalance(
|
|
73
|
-
return __awaiter(this,
|
|
72
|
+
_withdrawImbalance(_amounts_1, slippage_1) {
|
|
73
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage, estimateGas = false) {
|
|
74
74
|
const _maxBurnAmount = yield _withdrawImbalanceMaxBurnAmount.call(this, _amounts, slippage);
|
|
75
75
|
if (!estimateGas)
|
|
76
76
|
yield _ensureAllowance([this.lpToken], [_maxBurnAmount], this.zap);
|
|
@@ -102,8 +102,8 @@ export const withdrawImbalanceZapMixin = {
|
|
|
102
102
|
// @ts-ignore
|
|
103
103
|
export const withdrawImbalanceLendingMixin = {
|
|
104
104
|
// @ts-ignore
|
|
105
|
-
_withdrawImbalance(
|
|
106
|
-
return __awaiter(this,
|
|
105
|
+
_withdrawImbalance(_amounts_1, slippage_1) {
|
|
106
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage, estimateGas = false) {
|
|
107
107
|
const _maxBurnAmount = yield _withdrawImbalanceMaxBurnAmount.call(this, _amounts, slippage);
|
|
108
108
|
const contract = curve.contracts[this.address].contract;
|
|
109
109
|
const gas = yield contract.remove_liquidity_imbalance.estimateGas(_amounts, _maxBurnAmount, true, curve.constantOptions);
|
|
@@ -133,8 +133,8 @@ export const withdrawImbalanceLendingMixin = {
|
|
|
133
133
|
// @ts-ignore
|
|
134
134
|
export const withdrawImbalancePlainMixin = {
|
|
135
135
|
// @ts-ignore
|
|
136
|
-
_withdrawImbalance(
|
|
137
|
-
return __awaiter(this,
|
|
136
|
+
_withdrawImbalance(_amounts_1, slippage_1) {
|
|
137
|
+
return __awaiter(this, arguments, void 0, function* (_amounts, slippage, estimateGas = false) {
|
|
138
138
|
const _maxBurnAmount = yield _withdrawImbalanceMaxBurnAmount.call(this, _amounts, slippage);
|
|
139
139
|
const contract = curve.contracts[this.address].contract;
|
|
140
140
|
const gas = yield contract.remove_liquidity_imbalance.estimateGas(_amounts, _maxBurnAmount, curve.constantOptions);
|