@curvefi/api 2.62.0 → 2.63.1
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/boosting.js +247 -645
- package/lib/constants/L2Networks.js +1 -1
- package/lib/constants/aliases.js +31 -31
- package/lib/constants/coins/arbitrum.js +5 -5
- package/lib/constants/coins/aurora.js +5 -5
- package/lib/constants/coins/avalanche.js +6 -6
- package/lib/constants/coins/base.js +5 -5
- package/lib/constants/coins/bsc.js +5 -5
- package/lib/constants/coins/celo.js +5 -5
- package/lib/constants/coins/ethereum.js +9 -9
- package/lib/constants/coins/fantom.js +7 -7
- package/lib/constants/coins/fraxtal.js +5 -5
- package/lib/constants/coins/kava.js +5 -5
- package/lib/constants/coins/mantle.js +5 -5
- package/lib/constants/coins/moonbeam.js +5 -5
- package/lib/constants/coins/optimism.js +5 -5
- package/lib/constants/coins/polygon.js +6 -6
- package/lib/constants/coins/xdai.js +5 -5
- package/lib/constants/coins/xlayer.js +5 -5
- package/lib/constants/coins/zksync.js +5 -5
- package/lib/constants/pools/arbitrum.js +1 -1
- package/lib/constants/pools/aurora.js +1 -1
- package/lib/constants/pools/avalanche.js +1 -1
- package/lib/constants/pools/base.js +1 -1
- package/lib/constants/pools/bsc.js +1 -1
- package/lib/constants/pools/celo.js +1 -1
- package/lib/constants/pools/ethereum.js +2 -2
- package/lib/constants/pools/fantom.js +1 -1
- package/lib/constants/pools/fraxtal.js +1 -1
- package/lib/constants/pools/kava.js +1 -1
- package/lib/constants/pools/mantle.js +1 -1
- package/lib/constants/pools/moonbeam.js +1 -1
- package/lib/constants/pools/optimism.js +1 -1
- package/lib/constants/pools/polygon.js +1 -1
- package/lib/constants/pools/xdai.js +1 -1
- package/lib/constants/pools/xlayer.js +1 -1
- package/lib/constants/pools/zksync.js +1 -1
- package/lib/constants/tricryptoDeployImplementations.js +3 -3
- package/lib/constants/utils.js +18 -19
- package/lib/constants/volumeNetworks.js +1 -1
- package/lib/curve.d.ts +3 -1
- package/lib/curve.js +534 -909
- package/lib/dao.js +351 -705
- package/lib/external-api.js +127 -256
- package/lib/factory/common.js +4 -4
- package/lib/factory/constants-crypto.js +33 -33
- package/lib/factory/constants.js +36 -46
- package/lib/factory/deploy.js +542 -907
- package/lib/factory/factory-api.js +205 -269
- package/lib/factory/factory-crypto.js +202 -342
- package/lib/factory/factory-tricrypto.js +164 -286
- package/lib/factory/factory-twocrypto.js +151 -269
- package/lib/factory/factory.js +245 -385
- package/lib/index.js +109 -198
- package/lib/interfaces.d.ts +1 -6
- package/lib/pools/PoolTemplate.js +1773 -3025
- package/lib/pools/gaugePool.js +112 -251
- package/lib/pools/mixins/common.js +22 -93
- package/lib/pools/mixins/depositBalancedAmountsMixins.js +52 -118
- package/lib/pools/mixins/depositMixins.js +160 -386
- package/lib/pools/mixins/depositWrappedMixins.js +79 -205
- package/lib/pools/mixins/poolBalancesMixin.js +24 -87
- package/lib/pools/mixins/swapMixins.js +139 -324
- package/lib/pools/mixins/swapWrappedMixins.js +111 -265
- package/lib/pools/mixins/withdrawExpectedMixins.js +27 -91
- package/lib/pools/mixins/withdrawImbalanceMixins.js +111 -293
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +58 -169
- package/lib/pools/mixins/withdrawMixins.js +139 -359
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +20 -75
- package/lib/pools/mixins/withdrawOneCoinMixins.js +140 -360
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +10 -51
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +60 -167
- package/lib/pools/mixins/withdrawWrappedMixins.js +57 -167
- package/lib/pools/poolConstructor.js +5 -25
- package/lib/pools/utils.js +301 -469
- package/lib/route-finder.worker.d.ts +9 -0
- package/lib/route-finder.worker.js +112 -0
- package/lib/route-graph.worker.d.ts +11 -0
- package/lib/route-graph.worker.js +334 -0
- package/lib/router.js +323 -912
- package/lib/utils.d.ts +5 -4
- package/lib/utils.js +539 -906
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -7,33 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
10
|
import { PoolTemplate, getPool } from "./pools/index.js";
|
|
38
11
|
import { getUserPoolListByLiquidity, getUserPoolListByClaimable, getUserPoolList, getUserLiquidityUSD, getUserClaimable, } from "./pools/utils.js";
|
|
39
12
|
import { getBestRouteAndOutput, getArgs, swapExpected, swapRequired, swapPriceImpact, swapIsApproved, swapApproveEstimateGas, swapApprove, swapEstimateGas, swap, getSwappedAmount, } from "./router.js";
|
|
@@ -42,91 +15,71 @@ import { getCrv, getLockedAmountAndUnlockTime, getVeCrv, getVeCrvPct, calcUnlock
|
|
|
42
15
|
import { getBalances, getAllowance, hasAllowance, ensureAllowanceEstimateGas, ensureAllowance, getUsdRate, getGasPriceFromL1, getGasPriceFromL2, getGasInfoForL2, getTVL, getCoinsData, getVolume, hasDepositAndStake, hasRouter, getBasePools, getGasPrice, } from "./utils.js";
|
|
43
16
|
import { deployStablePlainPool, deployStablePlainPoolEstimateGas, getDeployedStablePlainPoolAddress, setOracle, setOracleEstimateGas, deployStableMetaPool, deployStableMetaPoolEstimateGas, getDeployedStableMetaPoolAddress, deployCryptoPool, deployCryptoPoolEstimateGas, getDeployedCryptoPoolAddress, deployTricryptoPool, deployTricryptoPoolEstimateGas, getDeployedTricryptoPoolAddress, deployGauge, deployGaugeEstimateGas, getDeployedGaugeAddress, deployGaugeSidechain, deployGaugeSidechainEstimateGas, deployGaugeMirror, deployGaugeMirrorEstimateGas, getDeployedGaugeMirrorAddress, getDeployedGaugeMirrorAddressByTx, deployStableNgPlainPool, deployStableNgPlainPoolEstimateGas, deployStableNgMetaPool, deployStableNgMetaPoolEstimateGas, deployTwocryptoPool, deployTwocryptoPoolEstimateGas, getDeployedTwocryptoPoolAddress, } from './factory/deploy.js';
|
|
44
17
|
import { crvSupplyStats, userCrv, userVeCrv, crvLockIsApproved, crvLockApproveEstimateGas, crvLockApprove, calcCrvUnlockTime, createCrvLockEstimateGas, createCrvLock, increaseCrvLockedAmountEstimateGas, increaseCrvLockedAmount, increaseCrvUnlockTimeEstimateGas, increaseCrvUnlockTime, withdrawLockedCrvEstimateGas as daoWithdrawLockedCrvEstimateGas, withdrawLockedCrv as daoWithdrawLockedCrv, claimableFees as daoClaimableFees, claimFeesEstimateGas as daoClaimFeesEstimateGas, claimFees as daoClaimFees, getVotingGaugeList, userGaugeVotes, voteForGaugeNextTime, voteForGaugeEstimateGas, voteForGauge, getProposalList, getProposal, userProposalVotes, voteForProposalEstimateGas, voteForProposal, executeVote, executeVoteEstimateGas, isCanVoteExecute, } from "./dao.js";
|
|
45
|
-
function init(providerType, providerSettings, options) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
_a.sent();
|
|
53
|
-
// @ts-ignore
|
|
54
|
-
this.signerAddress = _curve.signerAddress;
|
|
55
|
-
// @ts-ignore
|
|
56
|
-
this.chainId = _curve.chainId;
|
|
57
|
-
return [2 /*return*/];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
18
|
+
function init(providerType, providerSettings, options = {}) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
yield _curve.init(providerType, providerSettings, options);
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
this.signerAddress = _curve.signerAddress;
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
this.chainId = _curve.chainId;
|
|
60
25
|
});
|
|
61
26
|
}
|
|
62
27
|
function setCustomFeeData(customFeeData) {
|
|
63
28
|
_curve.setCustomFeeData(customFeeData);
|
|
64
29
|
}
|
|
65
|
-
|
|
66
|
-
init
|
|
30
|
+
const curve = {
|
|
31
|
+
init,
|
|
67
32
|
chainId: 0,
|
|
68
33
|
signerAddress: '',
|
|
69
|
-
setCustomFeeData
|
|
34
|
+
setCustomFeeData,
|
|
70
35
|
getPoolList: _curve.getPoolList,
|
|
71
36
|
getMainPoolList: _curve.getMainPoolList,
|
|
72
|
-
getUserPoolListByLiquidity
|
|
73
|
-
getUserPoolListByClaimable
|
|
74
|
-
getUserPoolList
|
|
75
|
-
getUserLiquidityUSD
|
|
76
|
-
getUserClaimable
|
|
77
|
-
PoolTemplate
|
|
78
|
-
getBasePools
|
|
79
|
-
getPool
|
|
80
|
-
getUsdRate
|
|
81
|
-
getGasPriceFromL1
|
|
82
|
-
getGasPriceFromL2
|
|
83
|
-
getGasInfoForL2
|
|
84
|
-
getGasPrice
|
|
85
|
-
getTVL
|
|
86
|
-
getBalances
|
|
87
|
-
getAllowance
|
|
88
|
-
hasAllowance
|
|
89
|
-
ensureAllowance
|
|
90
|
-
getCoinsData
|
|
91
|
-
getVolume
|
|
92
|
-
hasDepositAndStake
|
|
93
|
-
hasRouter
|
|
37
|
+
getUserPoolListByLiquidity,
|
|
38
|
+
getUserPoolListByClaimable,
|
|
39
|
+
getUserPoolList,
|
|
40
|
+
getUserLiquidityUSD,
|
|
41
|
+
getUserClaimable,
|
|
42
|
+
PoolTemplate,
|
|
43
|
+
getBasePools,
|
|
44
|
+
getPool,
|
|
45
|
+
getUsdRate,
|
|
46
|
+
getGasPriceFromL1,
|
|
47
|
+
getGasPriceFromL2,
|
|
48
|
+
getGasInfoForL2,
|
|
49
|
+
getGasPrice,
|
|
50
|
+
getTVL,
|
|
51
|
+
getBalances,
|
|
52
|
+
getAllowance,
|
|
53
|
+
hasAllowance,
|
|
54
|
+
ensureAllowance,
|
|
55
|
+
getCoinsData,
|
|
56
|
+
getVolume,
|
|
57
|
+
hasDepositAndStake,
|
|
58
|
+
hasRouter,
|
|
94
59
|
factory: {
|
|
95
60
|
fetchPools: _curve.fetchFactoryPools,
|
|
96
61
|
fetchNewPools: _curve.fetchNewFactoryPools,
|
|
97
62
|
getPoolList: _curve.getFactoryPoolList,
|
|
98
63
|
deployPlainPool: deployStablePlainPool,
|
|
99
|
-
setOracle
|
|
64
|
+
setOracle,
|
|
100
65
|
deployMetaPool: deployStableMetaPool,
|
|
101
|
-
deployGauge:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
105
|
-
return [2 /*return*/, deployGaugeSidechain(poolAddress, salt)];
|
|
106
|
-
}); }); },
|
|
107
|
-
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
108
|
-
return [2 /*return*/, deployGaugeMirror(chainId, salt)];
|
|
109
|
-
}); }); },
|
|
66
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge(poolAddress, _curve.constants.ALIASES.factory); }),
|
|
67
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain(poolAddress, salt); }),
|
|
68
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror(chainId, salt); }),
|
|
110
69
|
getDeployedPlainPoolAddress: getDeployedStablePlainPoolAddress,
|
|
111
70
|
getDeployedMetaPoolAddress: getDeployedStableMetaPoolAddress,
|
|
112
71
|
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
113
72
|
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress,
|
|
114
73
|
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx,
|
|
115
74
|
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedFactoryPool,
|
|
116
|
-
gaugeImplementation:
|
|
75
|
+
gaugeImplementation: () => _curve.getGaugeImplementation("factory"),
|
|
117
76
|
estimateGas: {
|
|
118
77
|
deployPlainPool: deployStablePlainPoolEstimateGas,
|
|
119
78
|
setOracle: setOracleEstimateGas,
|
|
120
79
|
deployMetaPool: deployStableMetaPoolEstimateGas,
|
|
121
|
-
deployGauge:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
125
|
-
return [2 /*return*/, deployGaugeSidechainEstimateGas(poolAddress, salt)];
|
|
126
|
-
}); }); },
|
|
127
|
-
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
128
|
-
return [2 /*return*/, deployGaugeMirrorEstimateGas(chainId, salt)];
|
|
129
|
-
}); }); },
|
|
80
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.factory); }),
|
|
81
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas(poolAddress, salt); }),
|
|
82
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas(chainId, salt); }),
|
|
130
83
|
},
|
|
131
84
|
},
|
|
132
85
|
crvUSDFactory: {
|
|
@@ -143,15 +96,9 @@ var curve = {
|
|
|
143
96
|
getPoolList: _curve.getStableNgFactoryPoolList,
|
|
144
97
|
deployPlainPool: deployStableNgPlainPool,
|
|
145
98
|
deployMetaPool: deployStableNgMetaPool,
|
|
146
|
-
deployGauge:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
150
|
-
return [2 /*return*/, deployGaugeSidechain(poolAddress, salt)];
|
|
151
|
-
}); }); },
|
|
152
|
-
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
153
|
-
return [2 /*return*/, deployGaugeMirror(chainId, salt)];
|
|
154
|
-
}); }); },
|
|
99
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge(poolAddress, _curve.constants.ALIASES.stable_ng_factory); }),
|
|
100
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain(poolAddress, salt); }),
|
|
101
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror(chainId, salt); }),
|
|
155
102
|
getDeployedPlainPoolAddress: getDeployedStablePlainPoolAddress,
|
|
156
103
|
getDeployedMetaPoolAddress: getDeployedStableMetaPoolAddress,
|
|
157
104
|
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
@@ -168,32 +115,20 @@ var curve = {
|
|
|
168
115
|
fetchNewPools: _curve.fetchNewCryptoFactoryPools,
|
|
169
116
|
getPoolList: _curve.getCryptoFactoryPoolList,
|
|
170
117
|
deployPool: deployCryptoPool,
|
|
171
|
-
deployGauge:
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
175
|
-
return [2 /*return*/, deployGaugeSidechain(poolAddress, salt)];
|
|
176
|
-
}); }); },
|
|
177
|
-
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
178
|
-
return [2 /*return*/, deployGaugeMirror(chainId, salt)];
|
|
179
|
-
}); }); },
|
|
118
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge(poolAddress, _curve.constants.ALIASES.crypto_factory); }),
|
|
119
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain(poolAddress, salt); }),
|
|
120
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror(chainId, salt); }),
|
|
180
121
|
getDeployedPoolAddress: getDeployedCryptoPoolAddress,
|
|
181
122
|
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
182
123
|
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress,
|
|
183
124
|
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx,
|
|
184
125
|
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedCryptoFactoryPool,
|
|
185
|
-
gaugeImplementation:
|
|
126
|
+
gaugeImplementation: () => _curve.getGaugeImplementation("factory-crypto"),
|
|
186
127
|
estimateGas: {
|
|
187
128
|
deployPool: deployCryptoPoolEstimateGas,
|
|
188
|
-
deployGauge:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
192
|
-
return [2 /*return*/, deployGaugeSidechainEstimateGas(poolAddress, salt)];
|
|
193
|
-
}); }); },
|
|
194
|
-
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
195
|
-
return [2 /*return*/, deployGaugeMirrorEstimateGas(chainId, salt)];
|
|
196
|
-
}); }); },
|
|
129
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.crypto_factory); }),
|
|
130
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas(poolAddress, salt); }),
|
|
131
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas(chainId, salt); }),
|
|
197
132
|
},
|
|
198
133
|
},
|
|
199
134
|
twocryptoFactory: {
|
|
@@ -201,32 +136,20 @@ var curve = {
|
|
|
201
136
|
fetchNewPools: _curve.fetchNewTwocryptoFactoryPools,
|
|
202
137
|
getPoolList: _curve.getTworyptoFactoryPoolList,
|
|
203
138
|
deployPool: deployTwocryptoPool,
|
|
204
|
-
deployGauge:
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
208
|
-
return [2 /*return*/, deployGaugeSidechain(poolAddress, salt)];
|
|
209
|
-
}); }); },
|
|
210
|
-
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
211
|
-
return [2 /*return*/, deployGaugeMirror(chainId, salt)];
|
|
212
|
-
}); }); },
|
|
139
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge(poolAddress, _curve.constants.ALIASES.twocrypto_factory); }),
|
|
140
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain(poolAddress, salt); }),
|
|
141
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror(chainId, salt); }),
|
|
213
142
|
getDeployedPoolAddress: getDeployedTwocryptoPoolAddress,
|
|
214
143
|
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
215
144
|
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress,
|
|
216
145
|
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx,
|
|
217
146
|
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedTwocryptoFactoryPool,
|
|
218
|
-
gaugeImplementation:
|
|
147
|
+
gaugeImplementation: () => _curve.getGaugeImplementation("factory-twocrypto"),
|
|
219
148
|
estimateGas: {
|
|
220
149
|
deployPool: deployTwocryptoPoolEstimateGas,
|
|
221
|
-
deployGauge:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
225
|
-
return [2 /*return*/, deployGaugeSidechainEstimateGas(poolAddress, salt)];
|
|
226
|
-
}); }); },
|
|
227
|
-
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
228
|
-
return [2 /*return*/, deployGaugeMirrorEstimateGas(chainId, salt)];
|
|
229
|
-
}); }); },
|
|
150
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.twocrypto_factory); }),
|
|
151
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas(poolAddress, salt); }),
|
|
152
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas(chainId, salt); }),
|
|
230
153
|
},
|
|
231
154
|
},
|
|
232
155
|
tricryptoFactory: {
|
|
@@ -234,53 +157,41 @@ var curve = {
|
|
|
234
157
|
fetchNewPools: _curve.fetchNewTricryptoFactoryPools,
|
|
235
158
|
getPoolList: _curve.getTricryptoFactoryPoolList,
|
|
236
159
|
deployPool: deployTricryptoPool,
|
|
237
|
-
deployGauge:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
241
|
-
return [2 /*return*/, deployGaugeSidechain(poolAddress, salt)];
|
|
242
|
-
}); }); },
|
|
243
|
-
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
244
|
-
return [2 /*return*/, deployGaugeMirror(chainId, salt)];
|
|
245
|
-
}); }); },
|
|
160
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge(poolAddress, _curve.constants.ALIASES.tricrypto_factory); }),
|
|
161
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain(poolAddress, salt); }),
|
|
162
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror(chainId, salt); }),
|
|
246
163
|
getDeployedPoolAddress: getDeployedTricryptoPoolAddress,
|
|
247
164
|
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
248
165
|
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress,
|
|
249
166
|
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx,
|
|
250
167
|
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedTricryptoFactoryPool,
|
|
251
|
-
gaugeImplementation:
|
|
168
|
+
gaugeImplementation: () => _curve.getGaugeImplementation("factory-tricrypto"),
|
|
252
169
|
estimateGas: {
|
|
253
170
|
deployPool: deployTricryptoPoolEstimateGas,
|
|
254
|
-
deployGauge:
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
deployGaugeSidechain: function (poolAddress, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
258
|
-
return [2 /*return*/, deployGaugeSidechainEstimateGas(poolAddress, salt)];
|
|
259
|
-
}); }); },
|
|
260
|
-
deployGaugeMirror: function (chainId, salt) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
261
|
-
return [2 /*return*/, deployGaugeMirrorEstimateGas(chainId, salt)];
|
|
262
|
-
}); }); },
|
|
171
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.tricrypto_factory); }),
|
|
172
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas(poolAddress, salt); }),
|
|
173
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas(chainId, salt); }),
|
|
263
174
|
},
|
|
264
175
|
},
|
|
265
176
|
estimateGas: {
|
|
266
177
|
ensureAllowance: ensureAllowanceEstimateGas,
|
|
267
178
|
},
|
|
268
179
|
boosting: {
|
|
269
|
-
getCrv
|
|
270
|
-
getLockedAmountAndUnlockTime
|
|
271
|
-
getVeCrv
|
|
272
|
-
getVeCrvPct
|
|
273
|
-
calcUnlockTime
|
|
274
|
-
isApproved
|
|
275
|
-
approve
|
|
276
|
-
createLock
|
|
277
|
-
increaseAmount
|
|
278
|
-
increaseUnlockTime
|
|
279
|
-
withdrawLockedCrv
|
|
280
|
-
claimableFees
|
|
281
|
-
claimFees
|
|
282
|
-
claimableFeesCrvUSD
|
|
283
|
-
claimFeesCrvUSD
|
|
180
|
+
getCrv,
|
|
181
|
+
getLockedAmountAndUnlockTime,
|
|
182
|
+
getVeCrv,
|
|
183
|
+
getVeCrvPct,
|
|
184
|
+
calcUnlockTime,
|
|
185
|
+
isApproved,
|
|
186
|
+
approve,
|
|
187
|
+
createLock,
|
|
188
|
+
increaseAmount,
|
|
189
|
+
increaseUnlockTime,
|
|
190
|
+
withdrawLockedCrv,
|
|
191
|
+
claimableFees,
|
|
192
|
+
claimFees,
|
|
193
|
+
claimableFeesCrvUSD,
|
|
194
|
+
claimFeesCrvUSD,
|
|
284
195
|
estimateGas: {
|
|
285
196
|
approve: approveEstimateGas,
|
|
286
197
|
createLock: createLockEstimateGas,
|
|
@@ -291,13 +202,13 @@ var curve = {
|
|
|
291
202
|
claimFeesCrvUSD: claimFeesCrvUSDEstimateGas,
|
|
292
203
|
},
|
|
293
204
|
sidechain: {
|
|
294
|
-
lastEthBlock
|
|
295
|
-
getAnycallBalance
|
|
296
|
-
topUpAnycall
|
|
297
|
-
lastBlockSent
|
|
298
|
-
blockToSend
|
|
299
|
-
sendBlockhash
|
|
300
|
-
submitProof
|
|
205
|
+
lastEthBlock,
|
|
206
|
+
getAnycallBalance,
|
|
207
|
+
topUpAnycall,
|
|
208
|
+
lastBlockSent,
|
|
209
|
+
blockToSend,
|
|
210
|
+
sendBlockhash,
|
|
211
|
+
submitProof,
|
|
301
212
|
estimateGas: {
|
|
302
213
|
topUpAnycall: topUpAnycallEstimateGas,
|
|
303
214
|
sendBlockhash: sendBlockhashEstimateGas,
|
|
@@ -306,15 +217,15 @@ var curve = {
|
|
|
306
217
|
},
|
|
307
218
|
},
|
|
308
219
|
router: {
|
|
309
|
-
getBestRouteAndOutput
|
|
310
|
-
getArgs
|
|
220
|
+
getBestRouteAndOutput,
|
|
221
|
+
getArgs,
|
|
311
222
|
expected: swapExpected,
|
|
312
223
|
required: swapRequired,
|
|
313
224
|
priceImpact: swapPriceImpact,
|
|
314
225
|
isApproved: swapIsApproved,
|
|
315
226
|
approve: swapApprove,
|
|
316
|
-
swap
|
|
317
|
-
getSwappedAmount
|
|
227
|
+
swap,
|
|
228
|
+
getSwappedAmount,
|
|
318
229
|
estimateGas: {
|
|
319
230
|
approve: swapApproveEstimateGas,
|
|
320
231
|
swap: swapEstimateGas,
|
|
@@ -323,35 +234,35 @@ var curve = {
|
|
|
323
234
|
dao: {
|
|
324
235
|
// --- CRV lock ---
|
|
325
236
|
// View methods
|
|
326
|
-
crvSupplyStats
|
|
327
|
-
userCrv
|
|
328
|
-
userVeCrv
|
|
329
|
-
crvLockIsApproved
|
|
330
|
-
calcCrvUnlockTime
|
|
237
|
+
crvSupplyStats,
|
|
238
|
+
userCrv,
|
|
239
|
+
userVeCrv,
|
|
240
|
+
crvLockIsApproved,
|
|
241
|
+
calcCrvUnlockTime,
|
|
331
242
|
claimableFees: daoClaimableFees,
|
|
332
243
|
// Transaction methods
|
|
333
|
-
crvLockApprove
|
|
334
|
-
createCrvLock
|
|
335
|
-
increaseCrvLockedAmount
|
|
336
|
-
increaseCrvUnlockTime
|
|
244
|
+
crvLockApprove,
|
|
245
|
+
createCrvLock,
|
|
246
|
+
increaseCrvLockedAmount,
|
|
247
|
+
increaseCrvUnlockTime,
|
|
337
248
|
withdrawLockedCrv: daoWithdrawLockedCrv,
|
|
338
249
|
claimFees: daoClaimFees,
|
|
339
250
|
// --- Gauge voting ---
|
|
340
251
|
// View methods
|
|
341
|
-
getVotingGaugeList
|
|
342
|
-
userGaugeVotes
|
|
343
|
-
voteForGaugeNextTime
|
|
252
|
+
getVotingGaugeList,
|
|
253
|
+
userGaugeVotes,
|
|
254
|
+
voteForGaugeNextTime,
|
|
344
255
|
// Transaction methods
|
|
345
|
-
voteForGauge
|
|
256
|
+
voteForGauge,
|
|
346
257
|
// --- Proposal voting ---
|
|
347
258
|
// View methods
|
|
348
|
-
getProposalList
|
|
349
|
-
getProposal
|
|
350
|
-
userProposalVotes
|
|
259
|
+
getProposalList,
|
|
260
|
+
getProposal,
|
|
261
|
+
userProposalVotes,
|
|
351
262
|
// Transaction methods
|
|
352
|
-
voteForProposal
|
|
353
|
-
executeVote
|
|
354
|
-
isCanVoteExecute
|
|
263
|
+
voteForProposal,
|
|
264
|
+
executeVote,
|
|
265
|
+
isCanVoteExecute,
|
|
355
266
|
estimateGas: {
|
|
356
267
|
// --- CRV lock ---
|
|
357
268
|
crvLockApprove: crvLockApproveEstimateGas,
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -137,12 +137,7 @@ export interface IPoolDataShort {
|
|
|
137
137
|
id: string;
|
|
138
138
|
address: string;
|
|
139
139
|
}
|
|
140
|
-
export
|
|
141
|
-
address: string;
|
|
142
|
-
volumeUSD: number;
|
|
143
|
-
latestDailyApy: number;
|
|
144
|
-
latestWeeklyApy: number;
|
|
145
|
-
}
|
|
140
|
+
export type IRoutePoolData = Pick<IPoolData, 'is_lending' | 'wrapped_coin_addresses' | 'underlying_coin_addresses' | 'token_address'>;
|
|
146
141
|
export interface IExtendedPoolDataFromApi {
|
|
147
142
|
poolData: IPoolDataFromApi[];
|
|
148
143
|
tvl?: number;
|