@curvefi/api 2.66.30 → 2.66.31
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.d.ts +33 -32
- package/lib/boosting.js +320 -252
- package/lib/cached.d.ts +4 -3
- package/lib/cached.js +63 -19
- package/lib/constants/utils.d.ts +14 -1
- package/lib/constants/utils.js +21 -6
- package/lib/curve.d.ts +5 -5
- package/lib/curve.js +21 -38
- package/lib/dao.d.ts +32 -31
- package/lib/dao.js +420 -350
- package/lib/external-api.d.ts +1 -1
- package/lib/external-api.js +2 -2
- package/lib/factory/common.d.ts +2 -1
- package/lib/factory/common.js +1 -1
- package/lib/factory/deploy.d.ts +46 -45
- package/lib/factory/deploy.js +630 -551
- package/lib/factory/factory-api.d.ts +3 -2
- package/lib/factory/factory-api.js +22 -23
- package/lib/factory/factory-crypto.d.ts +1 -1
- package/lib/factory/factory-crypto.js +12 -15
- package/lib/factory/factory-tricrypto.d.ts +1 -1
- package/lib/factory/factory-tricrypto.js +14 -15
- package/lib/factory/factory-twocrypto.d.ts +1 -1
- package/lib/factory/factory-twocrypto.js +12 -13
- package/lib/factory/factory.d.ts +4 -3
- package/lib/factory/factory.js +21 -24
- package/lib/index.d.ts +413 -104
- package/lib/index.js +253 -257
- package/lib/interfaces.d.ts +2 -0
- package/lib/pools/PoolTemplate.d.ts +13 -12
- package/lib/pools/PoolTemplate.js +279 -285
- package/lib/pools/mixins/common.js +2 -2
- package/lib/pools/mixins/depositBalancedAmountsMixins.d.ts +12 -4
- package/lib/pools/mixins/depositBalancedAmountsMixins.js +1 -15
- package/lib/pools/mixins/depositMixins.d.ts +25 -5
- package/lib/pools/mixins/depositMixins.js +38 -76
- package/lib/pools/mixins/depositWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/depositWrappedMixins.js +17 -33
- package/lib/pools/mixins/poolBalancesMixin.d.ts +6 -2
- package/lib/pools/mixins/poolBalancesMixin.js +3 -5
- package/lib/pools/mixins/swapMixins.d.ts +20 -4
- package/lib/pools/mixins/swapMixins.js +36 -70
- package/lib/pools/mixins/swapWrappedMixins.d.ts +19 -4
- package/lib/pools/mixins/swapWrappedMixins.js +32 -60
- package/lib/pools/mixins/withdrawExpectedMixins.d.ts +12 -4
- package/lib/pools/mixins/withdrawExpectedMixins.js +6 -11
- package/lib/pools/mixins/withdrawImbalanceMixins.d.ts +20 -4
- package/lib/pools/mixins/withdrawImbalanceMixins.js +26 -53
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +12 -27
- package/lib/pools/mixins/withdrawMixins.d.ts +25 -5
- package/lib/pools/mixins/withdrawMixins.js +33 -67
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.d.ts +12 -4
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +8 -13
- package/lib/pools/mixins/withdrawOneCoinMixins.d.ts +25 -5
- package/lib/pools/mixins/withdrawOneCoinMixins.js +32 -66
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.d.ts +6 -2
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +4 -7
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +13 -29
- package/lib/pools/mixins/withdrawWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/withdrawWrappedMixins.js +14 -28
- package/lib/pools/poolConstructor.d.ts +2 -1
- package/lib/pools/poolConstructor.js +27 -28
- package/lib/pools/subClasses/corePool.d.ts +4 -1
- package/lib/pools/subClasses/corePool.js +5 -7
- package/lib/pools/subClasses/gaugePool.d.ts +5 -3
- package/lib/pools/subClasses/gaugePool.js +19 -18
- package/lib/pools/subClasses/statsPool.d.ts +2 -0
- package/lib/pools/subClasses/statsPool.js +22 -10
- package/lib/pools/subClasses/walletPool.d.ts +2 -1
- package/lib/pools/subClasses/walletPool.js +6 -6
- package/lib/pools/utils.d.ts +7 -6
- package/lib/pools/utils.js +316 -297
- package/lib/route-graph.worker.d.ts +2 -2
- package/lib/route-graph.worker.js +4 -6
- package/lib/router.d.ts +12 -11
- package/lib/router.js +331 -295
- package/lib/utils.d.ts +34 -33
- package/lib/utils.js +481 -435
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -10,280 +10,276 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { PoolTemplate, getPool } from "./pools/index.js";
|
|
11
11
|
import { getUserPoolListByLiquidity, getUserPoolListByClaimable, getUserPoolList, getUserLiquidityUSD, getUserClaimable, } from "./pools/utils.js";
|
|
12
12
|
import { getBestRouteAndOutput, getArgs, swapExpected, swapRequired, swapPriceImpact, swapIsApproved, swapApproveEstimateGas, swapApprove, swapEstimateGas, swap, getSwappedAmount, } from "./router.js";
|
|
13
|
-
import {
|
|
13
|
+
import { Curve } from "./curve.js";
|
|
14
14
|
import { getCrv, getLockedAmountAndUnlockTime, getVeCrv, getVeCrvPct, calcUnlockTime, createLockEstimateGas, createLock, isApproved, approveEstimateGas, approve, increaseAmountEstimateGas, increaseAmount, increaseUnlockTimeEstimateGas, increaseUnlockTime, withdrawLockedCrvEstimateGas, withdrawLockedCrv, claimableFees, claimFeesEstimateGas, claimFees, lastEthBlock, getAnycallBalance, topUpAnycall, topUpAnycallEstimateGas, lastBlockSent, blockToSend, sendBlockhash, sendBlockhashEstimateGas, submitProof, submitProofEstimateGas, claimFeesCrvUSDEstimateGas, claimableFeesCrvUSD, claimFeesCrvUSD, calculateVeCrv, } from "./boosting.js";
|
|
15
15
|
import { getBalances, getAllowance, hasAllowance, ensureAllowanceEstimateGas, ensureAllowance, getUsdRate, getGasPriceFromL1, getGasPriceFromL2, getGasInfoForL2, getTVL, getCoinsData, getVolume, hasDepositAndStake, hasRouter, getBasePools, getGasPrice, getCurveLiteNetworks, } from "./utils.js";
|
|
16
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';
|
|
17
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";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.factory); }),
|
|
87
|
-
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas(poolAddress, salt); }),
|
|
88
|
-
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas(chainId, salt); }),
|
|
18
|
+
export const createCurve = () => {
|
|
19
|
+
const _curve = new Curve();
|
|
20
|
+
function init(...params) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
yield _curve.init(...params);
|
|
23
|
+
this.signerAddress = _curve.signerAddress;
|
|
24
|
+
this.chainId = _curve.chainId;
|
|
25
|
+
this.isNoRPC = _curve.isNoRPC;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
init,
|
|
30
|
+
chainId: 0, // until init is called
|
|
31
|
+
signerAddress: '',
|
|
32
|
+
setCustomFeeData: _curve.setCustomFeeData.bind(_curve),
|
|
33
|
+
getPoolList: _curve.getPoolList.bind(_curve),
|
|
34
|
+
getMainPoolList: _curve.getMainPoolList.bind(_curve),
|
|
35
|
+
getUserPoolListByLiquidity: getUserPoolListByLiquidity.bind(_curve),
|
|
36
|
+
getUserPoolListByClaimable: getUserPoolListByClaimable.bind(_curve),
|
|
37
|
+
getUserPoolList: getUserPoolList.bind(_curve),
|
|
38
|
+
getUserLiquidityUSD: getUserLiquidityUSD.bind(_curve),
|
|
39
|
+
getUserClaimable: getUserClaimable.bind(_curve),
|
|
40
|
+
PoolTemplate: PoolTemplate.bind(_curve),
|
|
41
|
+
getBasePools: getBasePools.bind(_curve),
|
|
42
|
+
getPool: getPool.bind(_curve),
|
|
43
|
+
getUsdRate: getUsdRate.bind(_curve),
|
|
44
|
+
getGasPriceFromL1: getGasPriceFromL1.bind(_curve),
|
|
45
|
+
getGasPriceFromL2: getGasPriceFromL2.bind(_curve),
|
|
46
|
+
getGasInfoForL2: getGasInfoForL2.bind(_curve),
|
|
47
|
+
getGasPrice: getGasPrice.bind(_curve),
|
|
48
|
+
getTVL: getTVL.bind(_curve),
|
|
49
|
+
getBalances: getBalances.bind(_curve),
|
|
50
|
+
getAllowance: getAllowance.bind(_curve),
|
|
51
|
+
hasAllowance: hasAllowance.bind(_curve),
|
|
52
|
+
ensureAllowance: ensureAllowance.bind(_curve),
|
|
53
|
+
getCoinsData: getCoinsData.bind(_curve),
|
|
54
|
+
getVolume: getVolume.bind(_curve),
|
|
55
|
+
hasDepositAndStake: hasDepositAndStake.bind(_curve),
|
|
56
|
+
hasRouter: hasRouter.bind(_curve),
|
|
57
|
+
getCurveLiteNetworks: getCurveLiteNetworks.bind(_curve),
|
|
58
|
+
getNetworkConstants: _curve.getNetworkConstants.bind(_curve),
|
|
59
|
+
getIsLiteChain: _curve.getIsLiteChain.bind(_curve),
|
|
60
|
+
isNoRPC: _curve.isNoRPC,
|
|
61
|
+
factory: {
|
|
62
|
+
fetchPools: _curve.fetchFactoryPools.bind(_curve),
|
|
63
|
+
fetchNewPools: _curve.fetchNewFactoryPools.bind(_curve),
|
|
64
|
+
getPoolList: _curve.getFactoryPoolList.bind(_curve),
|
|
65
|
+
deployPlainPool: deployStablePlainPool.bind(_curve),
|
|
66
|
+
setOracle: setOracle.bind(_curve),
|
|
67
|
+
deployMetaPool: deployStableMetaPool.bind(_curve),
|
|
68
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge.call(_curve, poolAddress, _curve.constants.ALIASES.factory); }),
|
|
69
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain.call(_curve, poolAddress, salt); }),
|
|
70
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror.call(_curve, chainId, salt); }),
|
|
71
|
+
getDeployedPlainPoolAddress: getDeployedStablePlainPoolAddress.bind(_curve),
|
|
72
|
+
getDeployedMetaPoolAddress: getDeployedStableMetaPoolAddress.bind(_curve),
|
|
73
|
+
getDeployedGaugeAddress: getDeployedGaugeAddress.bind(_curve),
|
|
74
|
+
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress.bind(_curve),
|
|
75
|
+
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx.bind(_curve),
|
|
76
|
+
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedFactoryPool.bind(_curve),
|
|
77
|
+
gaugeImplementation: () => _curve.getGaugeImplementation("factory"),
|
|
78
|
+
estimateGas: {
|
|
79
|
+
deployPlainPool: deployStablePlainPoolEstimateGas.bind(_curve),
|
|
80
|
+
setOracle: setOracleEstimateGas.bind(_curve),
|
|
81
|
+
deployMetaPool: deployStableMetaPoolEstimateGas.bind(_curve),
|
|
82
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas.call(_curve, poolAddress, _curve.constants.ALIASES.factory); }),
|
|
83
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas.call(_curve, poolAddress, salt); }),
|
|
84
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas.call(_curve, chainId, salt); }),
|
|
85
|
+
},
|
|
89
86
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
getPoolList: _curve.getCrvusdFactoryPoolList,
|
|
94
|
-
},
|
|
95
|
-
EYWAFactory: {
|
|
96
|
-
fetchPools: _curve.fetchEywaFactoryPools,
|
|
97
|
-
getPoolList: _curve.getEywaFactoryPoolList,
|
|
98
|
-
},
|
|
99
|
-
stableNgFactory: {
|
|
100
|
-
fetchPools: _curve.fetchStableNgFactoryPools,
|
|
101
|
-
fetchNewPools: _curve.fetchNewStableNgFactoryPools,
|
|
102
|
-
getPoolList: _curve.getStableNgFactoryPoolList,
|
|
103
|
-
deployPlainPool: deployStableNgPlainPool,
|
|
104
|
-
deployMetaPool: deployStableNgMetaPool,
|
|
105
|
-
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge(poolAddress, _curve.constants.ALIASES.stable_ng_factory); }),
|
|
106
|
-
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain(poolAddress, salt); }),
|
|
107
|
-
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror(chainId, salt); }),
|
|
108
|
-
getDeployedPlainPoolAddress: getDeployedStablePlainPoolAddress,
|
|
109
|
-
getDeployedMetaPoolAddress: getDeployedStableMetaPoolAddress,
|
|
110
|
-
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
111
|
-
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress,
|
|
112
|
-
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx,
|
|
113
|
-
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedStableNgFactoryPool,
|
|
114
|
-
estimateGas: {
|
|
115
|
-
deployPlainPool: deployStableNgPlainPoolEstimateGas,
|
|
116
|
-
deployMetaPool: deployStableNgMetaPoolEstimateGas,
|
|
87
|
+
crvUSDFactory: {
|
|
88
|
+
fetchPools: _curve.fetchCrvusdFactoryPools.bind(_curve),
|
|
89
|
+
getPoolList: _curve.getCrvusdFactoryPoolList.bind(_curve),
|
|
117
90
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
fetchNewPools: _curve.fetchNewCryptoFactoryPools,
|
|
122
|
-
getPoolList: _curve.getCryptoFactoryPoolList,
|
|
123
|
-
deployPool: deployCryptoPool,
|
|
124
|
-
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge(poolAddress, _curve.constants.ALIASES.crypto_factory); }),
|
|
125
|
-
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain(poolAddress, salt); }),
|
|
126
|
-
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror(chainId, salt); }),
|
|
127
|
-
getDeployedPoolAddress: getDeployedCryptoPoolAddress,
|
|
128
|
-
getDeployedGaugeAddress: getDeployedGaugeAddress,
|
|
129
|
-
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress,
|
|
130
|
-
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx,
|
|
131
|
-
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedCryptoFactoryPool,
|
|
132
|
-
gaugeImplementation: () => _curve.getGaugeImplementation("factory-crypto"),
|
|
133
|
-
estimateGas: {
|
|
134
|
-
deployPool: deployCryptoPoolEstimateGas,
|
|
135
|
-
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.crypto_factory); }),
|
|
136
|
-
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas(poolAddress, salt); }),
|
|
137
|
-
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas(chainId, salt); }),
|
|
91
|
+
EYWAFactory: {
|
|
92
|
+
fetchPools: _curve.fetchEywaFactoryPools.bind(_curve),
|
|
93
|
+
getPoolList: _curve.getEywaFactoryPoolList.bind(_curve),
|
|
138
94
|
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas(chainId, salt); }),
|
|
95
|
+
stableNgFactory: {
|
|
96
|
+
fetchPools: _curve.fetchStableNgFactoryPools.bind(_curve),
|
|
97
|
+
fetchNewPools: _curve.fetchNewStableNgFactoryPools.bind(_curve),
|
|
98
|
+
getPoolList: _curve.getStableNgFactoryPoolList.bind(_curve),
|
|
99
|
+
deployPlainPool: deployStableNgPlainPool.bind(_curve),
|
|
100
|
+
deployMetaPool: deployStableNgMetaPool.bind(_curve),
|
|
101
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge.call(_curve, poolAddress, _curve.constants.ALIASES.stable_ng_factory); }),
|
|
102
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain.call(_curve, poolAddress, salt); }),
|
|
103
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror.call(_curve, chainId, salt); }),
|
|
104
|
+
getDeployedPlainPoolAddress: getDeployedStablePlainPoolAddress.bind(_curve),
|
|
105
|
+
getDeployedMetaPoolAddress: getDeployedStableMetaPoolAddress.bind(_curve),
|
|
106
|
+
getDeployedGaugeAddress: getDeployedGaugeAddress.bind(_curve),
|
|
107
|
+
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress.bind(_curve),
|
|
108
|
+
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx.bind(_curve),
|
|
109
|
+
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedStableNgFactoryPool.bind(_curve),
|
|
110
|
+
estimateGas: {
|
|
111
|
+
deployPlainPool: deployStableNgPlainPoolEstimateGas.bind(_curve),
|
|
112
|
+
deployMetaPool: deployStableNgMetaPoolEstimateGas.bind(_curve),
|
|
113
|
+
},
|
|
159
114
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
115
|
+
cryptoFactory: {
|
|
116
|
+
fetchPools: _curve.fetchCryptoFactoryPools.bind(_curve),
|
|
117
|
+
fetchNewPools: _curve.fetchNewCryptoFactoryPools.bind(_curve),
|
|
118
|
+
getPoolList: _curve.getCryptoFactoryPoolList.bind(_curve),
|
|
119
|
+
deployPool: deployCryptoPool.bind(_curve),
|
|
120
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge.call(_curve, poolAddress, _curve.constants.ALIASES.crypto_factory); }),
|
|
121
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain.call(_curve, poolAddress, salt); }),
|
|
122
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror.call(_curve, chainId, salt); }),
|
|
123
|
+
getDeployedPoolAddress: getDeployedCryptoPoolAddress.bind(_curve),
|
|
124
|
+
getDeployedGaugeAddress: getDeployedGaugeAddress.bind(_curve),
|
|
125
|
+
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress.bind(_curve),
|
|
126
|
+
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx.bind(_curve),
|
|
127
|
+
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedCryptoFactoryPool.bind(_curve),
|
|
128
|
+
gaugeImplementation: () => _curve.getGaugeImplementation("factory-crypto"),
|
|
129
|
+
estimateGas: {
|
|
130
|
+
deployPool: deployCryptoPoolEstimateGas,
|
|
131
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas.call(_curve, poolAddress, _curve.constants.ALIASES.crypto_factory); }),
|
|
132
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas.call(_curve, poolAddress, salt); }),
|
|
133
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas.call(_curve, chainId, salt); }),
|
|
134
|
+
},
|
|
180
135
|
},
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
calculateVeCrv,
|
|
202
|
-
estimateGas: {
|
|
203
|
-
approve: approveEstimateGas,
|
|
204
|
-
createLock: createLockEstimateGas,
|
|
205
|
-
increaseAmount: increaseAmountEstimateGas,
|
|
206
|
-
increaseUnlockTime: increaseUnlockTimeEstimateGas,
|
|
207
|
-
withdrawLockedCrv: withdrawLockedCrvEstimateGas,
|
|
208
|
-
claimFees: claimFeesEstimateGas,
|
|
209
|
-
claimFeesCrvUSD: claimFeesCrvUSDEstimateGas,
|
|
136
|
+
twocryptoFactory: {
|
|
137
|
+
fetchPools: _curve.fetchTworyptoFactoryPools.bind(_curve),
|
|
138
|
+
fetchNewPools: _curve.fetchNewTwocryptoFactoryPools.bind(_curve),
|
|
139
|
+
getPoolList: _curve.getTworyptoFactoryPoolList.bind(_curve),
|
|
140
|
+
deployPool: deployTwocryptoPool.bind(_curve),
|
|
141
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge.call(_curve, poolAddress, _curve.constants.ALIASES.twocrypto_factory); }),
|
|
142
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain.call(_curve, poolAddress, salt); }),
|
|
143
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror.call(_curve, chainId, salt); }),
|
|
144
|
+
getDeployedPoolAddress: getDeployedTwocryptoPoolAddress.bind(_curve),
|
|
145
|
+
getDeployedGaugeAddress: getDeployedGaugeAddress.bind(_curve),
|
|
146
|
+
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress.bind(_curve),
|
|
147
|
+
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx.bind(_curve),
|
|
148
|
+
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedTwocryptoFactoryPool.bind(_curve),
|
|
149
|
+
gaugeImplementation: () => _curve.getGaugeImplementation("factory-twocrypto"),
|
|
150
|
+
estimateGas: {
|
|
151
|
+
deployPool: deployTwocryptoPoolEstimateGas, //
|
|
152
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas.call(_curve, poolAddress, _curve.constants.ALIASES.twocrypto_factory); }),
|
|
153
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas.call(_curve, poolAddress, salt); }),
|
|
154
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas.call(_curve, chainId, salt); }),
|
|
155
|
+
},
|
|
210
156
|
},
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
157
|
+
tricryptoFactory: {
|
|
158
|
+
fetchPools: _curve.fetchTricryptoFactoryPools.bind(_curve),
|
|
159
|
+
fetchNewPools: _curve.fetchNewTricryptoFactoryPools.bind(_curve),
|
|
160
|
+
getPoolList: _curve.getTricryptoFactoryPoolList.bind(_curve),
|
|
161
|
+
deployPool: deployTricryptoPool.bind(_curve),
|
|
162
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGauge.call(_curve, poolAddress, _curve.constants.ALIASES.tricrypto_factory); }),
|
|
163
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechain.call(_curve, poolAddress, salt); }),
|
|
164
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirror.call(_curve, chainId, salt); }),
|
|
165
|
+
getDeployedPoolAddress: getDeployedTricryptoPoolAddress.bind(_curve),
|
|
166
|
+
getDeployedGaugeAddress: getDeployedGaugeAddress.bind(_curve),
|
|
167
|
+
getDeployedGaugeMirrorAddress: getDeployedGaugeMirrorAddress.bind(_curve),
|
|
168
|
+
getDeployedGaugeMirrorAddressByTx: getDeployedGaugeMirrorAddressByTx.bind(_curve),
|
|
169
|
+
fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedTricryptoFactoryPool.bind(_curve),
|
|
170
|
+
gaugeImplementation: () => _curve.getGaugeImplementation("factory-tricrypto"),
|
|
219
171
|
estimateGas: {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
172
|
+
deployPool: deployTricryptoPoolEstimateGas.bind(_curve),
|
|
173
|
+
deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas.call(_curve, poolAddress, _curve.constants.ALIASES.tricrypto_factory); }),
|
|
174
|
+
deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas.call(_curve, poolAddress, salt); }),
|
|
175
|
+
deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas.call(_curve, chainId, salt); }),
|
|
223
176
|
},
|
|
224
177
|
},
|
|
225
|
-
},
|
|
226
|
-
router: {
|
|
227
|
-
getBestRouteAndOutput,
|
|
228
|
-
getArgs,
|
|
229
|
-
expected: swapExpected,
|
|
230
|
-
required: swapRequired,
|
|
231
|
-
priceImpact: swapPriceImpact,
|
|
232
|
-
isApproved: swapIsApproved,
|
|
233
|
-
approve: swapApprove,
|
|
234
|
-
swap,
|
|
235
|
-
getSwappedAmount,
|
|
236
178
|
estimateGas: {
|
|
237
|
-
|
|
238
|
-
swap: swapEstimateGas,
|
|
179
|
+
ensureAllowance: ensureAllowanceEstimateGas.bind(_curve),
|
|
239
180
|
},
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
181
|
+
boosting: {
|
|
182
|
+
getCrv: getCrv.bind(_curve),
|
|
183
|
+
getLockedAmountAndUnlockTime: getLockedAmountAndUnlockTime.bind(_curve),
|
|
184
|
+
getVeCrv: getVeCrv.bind(_curve),
|
|
185
|
+
getVeCrvPct: getVeCrvPct.bind(_curve),
|
|
186
|
+
calcUnlockTime: calcUnlockTime.bind(_curve),
|
|
187
|
+
isApproved: isApproved.bind(_curve),
|
|
188
|
+
approve: approve.bind(_curve),
|
|
189
|
+
createLock: createLock.bind(_curve),
|
|
190
|
+
increaseAmount: increaseAmount.bind(_curve),
|
|
191
|
+
increaseUnlockTime: increaseUnlockTime.bind(_curve),
|
|
192
|
+
withdrawLockedCrv: withdrawLockedCrv.bind(_curve),
|
|
193
|
+
claimableFees: claimableFees.bind(_curve),
|
|
194
|
+
claimFees: claimFees.bind(_curve),
|
|
195
|
+
claimableFeesCrvUSD: claimableFeesCrvUSD.bind(_curve),
|
|
196
|
+
claimFeesCrvUSD: claimFeesCrvUSD.bind(_curve),
|
|
197
|
+
calculateVeCrv, estimateGas: {
|
|
198
|
+
approve: approveEstimateGas.bind(_curve),
|
|
199
|
+
createLock: createLockEstimateGas.bind(_curve),
|
|
200
|
+
increaseAmount: increaseAmountEstimateGas.bind(_curve),
|
|
201
|
+
increaseUnlockTime: increaseUnlockTimeEstimateGas.bind(_curve),
|
|
202
|
+
withdrawLockedCrv: withdrawLockedCrvEstimateGas.bind(_curve),
|
|
203
|
+
claimFees: claimFeesEstimateGas.bind(_curve),
|
|
204
|
+
claimFeesCrvUSD: claimFeesCrvUSDEstimateGas.bind(_curve),
|
|
205
|
+
},
|
|
206
|
+
sidechain: {
|
|
207
|
+
lastEthBlock: lastEthBlock.bind(_curve),
|
|
208
|
+
getAnycallBalance: getAnycallBalance.bind(_curve),
|
|
209
|
+
topUpAnycall: topUpAnycall.bind(_curve),
|
|
210
|
+
lastBlockSent: lastBlockSent.bind(_curve),
|
|
211
|
+
blockToSend: blockToSend.bind(_curve),
|
|
212
|
+
sendBlockhash: sendBlockhash.bind(_curve),
|
|
213
|
+
submitProof: submitProof.bind(_curve),
|
|
214
|
+
estimateGas: {
|
|
215
|
+
topUpAnycall: topUpAnycallEstimateGas.bind(_curve),
|
|
216
|
+
sendBlockhash: sendBlockhashEstimateGas.bind(_curve),
|
|
217
|
+
submitProof: submitProofEstimateGas.bind(_curve),
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
router: {
|
|
222
|
+
getBestRouteAndOutput: getBestRouteAndOutput.bind(_curve),
|
|
223
|
+
getArgs: getArgs.bind(_curve),
|
|
224
|
+
expected: swapExpected.bind(_curve),
|
|
225
|
+
required: swapRequired.bind(_curve),
|
|
226
|
+
priceImpact: swapPriceImpact.bind(_curve),
|
|
227
|
+
isApproved: swapIsApproved.bind(_curve),
|
|
228
|
+
approve: swapApprove.bind(_curve),
|
|
229
|
+
swap: swap.bind(_curve),
|
|
230
|
+
getSwappedAmount: getSwappedAmount.bind(_curve),
|
|
231
|
+
estimateGas: {
|
|
232
|
+
approve: swapApproveEstimateGas.bind(_curve),
|
|
233
|
+
swap: swapEstimateGas.bind(_curve),
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
dao: {
|
|
274
237
|
// --- CRV lock ---
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
238
|
+
// View methods
|
|
239
|
+
crvSupplyStats: crvSupplyStats.bind(_curve),
|
|
240
|
+
userCrv: userCrv.bind(_curve),
|
|
241
|
+
userVeCrv: userVeCrv.bind(_curve),
|
|
242
|
+
crvLockIsApproved: crvLockIsApproved.bind(_curve),
|
|
243
|
+
calcCrvUnlockTime: calcCrvUnlockTime.bind(_curve),
|
|
244
|
+
claimableFees: daoClaimableFees.bind(_curve),
|
|
245
|
+
// Transaction methods
|
|
246
|
+
crvLockApprove: crvLockApprove.bind(_curve),
|
|
247
|
+
createCrvLock: createCrvLock.bind(_curve),
|
|
248
|
+
increaseCrvLockedAmount: increaseCrvLockedAmount.bind(_curve),
|
|
249
|
+
increaseCrvUnlockTime: increaseCrvUnlockTime.bind(_curve),
|
|
250
|
+
withdrawLockedCrv: daoWithdrawLockedCrv.bind(_curve),
|
|
251
|
+
claimFees: daoClaimFees.bind(_curve),
|
|
281
252
|
// --- Gauge voting ---
|
|
282
|
-
|
|
253
|
+
// View methods
|
|
254
|
+
getVotingGaugeList: getVotingGaugeList.bind(_curve),
|
|
255
|
+
userGaugeVotes: userGaugeVotes.bind(_curve),
|
|
256
|
+
voteForGaugeNextTime: voteForGaugeNextTime.bind(_curve),
|
|
257
|
+
// Transaction methods
|
|
258
|
+
voteForGauge: voteForGauge.bind(_curve),
|
|
283
259
|
// --- Proposal voting ---
|
|
284
|
-
|
|
285
|
-
|
|
260
|
+
// View methods
|
|
261
|
+
getProposalList: getProposalList.bind(_curve),
|
|
262
|
+
getProposal: getProposal.bind(_curve),
|
|
263
|
+
userProposalVotes: userProposalVotes.bind(_curve),
|
|
264
|
+
// Transaction methods
|
|
265
|
+
voteForProposal: voteForProposal.bind(_curve),
|
|
266
|
+
executeVote: executeVote.bind(_curve),
|
|
267
|
+
isCanVoteExecute: isCanVoteExecute.bind(_curve),
|
|
268
|
+
estimateGas: {
|
|
269
|
+
// --- CRV lock ---
|
|
270
|
+
crvLockApprove: crvLockApproveEstimateGas.bind(_curve),
|
|
271
|
+
createCrvLock: createCrvLockEstimateGas.bind(_curve),
|
|
272
|
+
increaseCrvLockedAmount: increaseCrvLockedAmountEstimateGas.bind(_curve),
|
|
273
|
+
increaseCrvUnlockTime: increaseCrvUnlockTimeEstimateGas.bind(_curve),
|
|
274
|
+
withdrawLockedCrv: daoWithdrawLockedCrvEstimateGas.bind(_curve),
|
|
275
|
+
claimFees: daoClaimFeesEstimateGas.bind(_curve),
|
|
276
|
+
// --- Gauge voting ---
|
|
277
|
+
voteForGauge: voteForGaugeEstimateGas.bind(_curve),
|
|
278
|
+
// --- Proposal voting ---
|
|
279
|
+
voteForProposal: voteForProposalEstimateGas.bind(_curve),
|
|
280
|
+
executeVote: executeVoteEstimateGas.bind(_curve),
|
|
281
|
+
},
|
|
286
282
|
},
|
|
287
|
-
}
|
|
283
|
+
};
|
|
288
284
|
};
|
|
289
|
-
export default
|
|
285
|
+
export default createCurve();
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Contract, ethers } from "ethers";
|
|
2
2
|
import { Contract as MulticallContract, Provider as MulticallProvider } from "@curvefi/ethcall";
|
|
3
|
+
import { BigNumberish, Numeric } from "ethers";
|
|
3
4
|
export interface IDict<T> {
|
|
4
5
|
[index: string]: T;
|
|
5
6
|
}
|
|
@@ -119,6 +120,7 @@ export interface ICurve {
|
|
|
119
120
|
};
|
|
120
121
|
constants: INetworkConstants;
|
|
121
122
|
setContract: (address: string | undefined, abi: any) => void;
|
|
123
|
+
formatUnits(value: BigNumberish, unit?: string | Numeric): string;
|
|
122
124
|
}
|
|
123
125
|
export interface ICoinFromPoolDataApi {
|
|
124
126
|
address: string;
|