@curvefi/api 2.63.0 → 2.63.2

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.
Files changed (83) hide show
  1. package/lib/boosting.js +247 -645
  2. package/lib/constants/L2Networks.js +1 -1
  3. package/lib/constants/aliases.js +19 -19
  4. package/lib/constants/coins/arbitrum.js +5 -5
  5. package/lib/constants/coins/aurora.js +5 -5
  6. package/lib/constants/coins/avalanche.js +6 -6
  7. package/lib/constants/coins/base.js +5 -5
  8. package/lib/constants/coins/bsc.js +5 -5
  9. package/lib/constants/coins/celo.js +5 -5
  10. package/lib/constants/coins/ethereum.js +9 -9
  11. package/lib/constants/coins/fantom.js +7 -7
  12. package/lib/constants/coins/fraxtal.js +5 -5
  13. package/lib/constants/coins/kava.js +5 -5
  14. package/lib/constants/coins/mantle.js +5 -5
  15. package/lib/constants/coins/moonbeam.js +5 -5
  16. package/lib/constants/coins/optimism.js +5 -5
  17. package/lib/constants/coins/polygon.js +6 -6
  18. package/lib/constants/coins/xdai.js +5 -5
  19. package/lib/constants/coins/xlayer.js +5 -5
  20. package/lib/constants/coins/zksync.js +5 -5
  21. package/lib/constants/pools/arbitrum.js +1 -1
  22. package/lib/constants/pools/aurora.js +1 -1
  23. package/lib/constants/pools/avalanche.js +1 -1
  24. package/lib/constants/pools/base.js +1 -1
  25. package/lib/constants/pools/bsc.js +1 -1
  26. package/lib/constants/pools/celo.js +1 -1
  27. package/lib/constants/pools/ethereum.js +2 -2
  28. package/lib/constants/pools/fantom.js +1 -1
  29. package/lib/constants/pools/fraxtal.js +1 -1
  30. package/lib/constants/pools/kava.js +1 -1
  31. package/lib/constants/pools/mantle.js +1 -1
  32. package/lib/constants/pools/moonbeam.js +1 -1
  33. package/lib/constants/pools/optimism.js +1 -1
  34. package/lib/constants/pools/polygon.js +1 -1
  35. package/lib/constants/pools/xdai.js +1 -1
  36. package/lib/constants/pools/xlayer.js +1 -1
  37. package/lib/constants/pools/zksync.js +1 -1
  38. package/lib/constants/tricryptoDeployImplementations.js +1 -1
  39. package/lib/constants/utils.js +18 -19
  40. package/lib/constants/volumeNetworks.js +1 -1
  41. package/lib/curve.d.ts +10 -6
  42. package/lib/curve.js +534 -909
  43. package/lib/dao.js +351 -705
  44. package/lib/external-api.js +127 -256
  45. package/lib/factory/common.js +4 -4
  46. package/lib/factory/constants-crypto.js +33 -33
  47. package/lib/factory/constants.js +34 -34
  48. package/lib/factory/deploy.js +542 -907
  49. package/lib/factory/factory-api.js +205 -269
  50. package/lib/factory/factory-crypto.js +202 -342
  51. package/lib/factory/factory-tricrypto.js +164 -286
  52. package/lib/factory/factory-twocrypto.js +151 -269
  53. package/lib/factory/factory.js +245 -385
  54. package/lib/index.js +109 -198
  55. package/lib/interfaces.d.ts +46 -6
  56. package/lib/pools/PoolTemplate.js +1774 -3027
  57. package/lib/pools/gaugePool.js +112 -251
  58. package/lib/pools/mixins/common.js +22 -93
  59. package/lib/pools/mixins/depositBalancedAmountsMixins.js +52 -118
  60. package/lib/pools/mixins/depositMixins.js +160 -386
  61. package/lib/pools/mixins/depositWrappedMixins.js +79 -205
  62. package/lib/pools/mixins/poolBalancesMixin.js +24 -87
  63. package/lib/pools/mixins/swapMixins.js +139 -324
  64. package/lib/pools/mixins/swapWrappedMixins.js +111 -265
  65. package/lib/pools/mixins/withdrawExpectedMixins.js +27 -91
  66. package/lib/pools/mixins/withdrawImbalanceMixins.js +111 -293
  67. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +58 -169
  68. package/lib/pools/mixins/withdrawMixins.js +139 -359
  69. package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +20 -75
  70. package/lib/pools/mixins/withdrawOneCoinMixins.js +140 -360
  71. package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +10 -51
  72. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +60 -167
  73. package/lib/pools/mixins/withdrawWrappedMixins.js +57 -167
  74. package/lib/pools/poolConstructor.js +11 -31
  75. package/lib/pools/utils.js +301 -469
  76. package/lib/route-finder.worker.d.ts +9 -0
  77. package/lib/route-finder.worker.js +112 -0
  78. package/lib/route-graph.worker.d.ts +11 -0
  79. package/lib/route-graph.worker.js +334 -0
  80. package/lib/router.js +323 -912
  81. package/lib/utils.d.ts +8 -7
  82. package/lib/utils.js +540 -927
  83. package/package.json +3 -2
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
- if (options === void 0) { options = {}; }
47
- return __awaiter(this, void 0, void 0, function () {
48
- return __generator(this, function (_a) {
49
- switch (_a.label) {
50
- case 0: return [4 /*yield*/, _curve.init(providerType, providerSettings, options)];
51
- case 1:
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
- var curve = {
66
- init: init,
30
+ const curve = {
31
+ init,
67
32
  chainId: 0,
68
33
  signerAddress: '',
69
- setCustomFeeData: setCustomFeeData,
34
+ setCustomFeeData,
70
35
  getPoolList: _curve.getPoolList,
71
36
  getMainPoolList: _curve.getMainPoolList,
72
- getUserPoolListByLiquidity: getUserPoolListByLiquidity,
73
- getUserPoolListByClaimable: getUserPoolListByClaimable,
74
- getUserPoolList: getUserPoolList,
75
- getUserLiquidityUSD: getUserLiquidityUSD,
76
- getUserClaimable: getUserClaimable,
77
- PoolTemplate: PoolTemplate,
78
- getBasePools: getBasePools,
79
- getPool: getPool,
80
- getUsdRate: getUsdRate,
81
- getGasPriceFromL1: getGasPriceFromL1,
82
- getGasPriceFromL2: getGasPriceFromL2,
83
- getGasInfoForL2: getGasInfoForL2,
84
- getGasPrice: getGasPrice,
85
- getTVL: getTVL,
86
- getBalances: getBalances,
87
- getAllowance: getAllowance,
88
- hasAllowance: hasAllowance,
89
- ensureAllowance: ensureAllowance,
90
- getCoinsData: getCoinsData,
91
- getVolume: getVolume,
92
- hasDepositAndStake: hasDepositAndStake,
93
- hasRouter: 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: setOracle,
64
+ setOracle,
100
65
  deployMetaPool: deployStableMetaPool,
101
- deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
102
- return [2 /*return*/, deployGauge(poolAddress, _curve.constants.ALIASES.factory)];
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: function () { return _curve.getGaugeImplementation("factory"); },
75
+ gaugeImplementation: () => _curve.getGaugeImplementation("factory"),
117
76
  estimateGas: {
118
77
  deployPlainPool: deployStablePlainPoolEstimateGas,
119
78
  setOracle: setOracleEstimateGas,
120
79
  deployMetaPool: deployStableMetaPoolEstimateGas,
121
- deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
122
- return [2 /*return*/, deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.factory)];
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: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
147
- return [2 /*return*/, deployGauge(poolAddress, _curve.constants.ALIASES.stable_ng_factory)];
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: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
172
- return [2 /*return*/, deployGauge(poolAddress, _curve.constants.ALIASES.crypto_factory)];
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: function () { return _curve.getGaugeImplementation("factory-crypto"); },
126
+ gaugeImplementation: () => _curve.getGaugeImplementation("factory-crypto"),
186
127
  estimateGas: {
187
128
  deployPool: deployCryptoPoolEstimateGas,
188
- deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
189
- return [2 /*return*/, deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.crypto_factory)];
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: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
205
- return [2 /*return*/, deployGauge(poolAddress, _curve.constants.ALIASES.twocrypto_factory)];
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: function () { return _curve.getGaugeImplementation("factory-twocrypto"); },
147
+ gaugeImplementation: () => _curve.getGaugeImplementation("factory-twocrypto"),
219
148
  estimateGas: {
220
149
  deployPool: deployTwocryptoPoolEstimateGas,
221
- deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
222
- return [2 /*return*/, deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.twocrypto_factory)];
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: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
238
- return [2 /*return*/, deployGauge(poolAddress, _curve.constants.ALIASES.tricrypto_factory)];
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: function () { return _curve.getGaugeImplementation("factory-tricrypto"); },
168
+ gaugeImplementation: () => _curve.getGaugeImplementation("factory-tricrypto"),
252
169
  estimateGas: {
253
170
  deployPool: deployTricryptoPoolEstimateGas,
254
- deployGauge: function (poolAddress) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
255
- return [2 /*return*/, deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.tricrypto_factory)];
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: getCrv,
270
- getLockedAmountAndUnlockTime: getLockedAmountAndUnlockTime,
271
- getVeCrv: getVeCrv,
272
- getVeCrvPct: getVeCrvPct,
273
- calcUnlockTime: calcUnlockTime,
274
- isApproved: isApproved,
275
- approve: approve,
276
- createLock: createLock,
277
- increaseAmount: increaseAmount,
278
- increaseUnlockTime: increaseUnlockTime,
279
- withdrawLockedCrv: withdrawLockedCrv,
280
- claimableFees: claimableFees,
281
- claimFees: claimFees,
282
- claimableFeesCrvUSD: claimableFeesCrvUSD,
283
- claimFeesCrvUSD: 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: lastEthBlock,
295
- getAnycallBalance: getAnycallBalance,
296
- topUpAnycall: topUpAnycall,
297
- lastBlockSent: lastBlockSent,
298
- blockToSend: blockToSend,
299
- sendBlockhash: sendBlockhash,
300
- submitProof: 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: getBestRouteAndOutput,
310
- getArgs: 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: swap,
317
- getSwappedAmount: 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: crvSupplyStats,
327
- userCrv: userCrv,
328
- userVeCrv: userVeCrv,
329
- crvLockIsApproved: crvLockIsApproved,
330
- calcCrvUnlockTime: calcCrvUnlockTime,
237
+ crvSupplyStats,
238
+ userCrv,
239
+ userVeCrv,
240
+ crvLockIsApproved,
241
+ calcCrvUnlockTime,
331
242
  claimableFees: daoClaimableFees,
332
243
  // Transaction methods
333
- crvLockApprove: crvLockApprove,
334
- createCrvLock: createCrvLock,
335
- increaseCrvLockedAmount: increaseCrvLockedAmount,
336
- increaseCrvUnlockTime: 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: getVotingGaugeList,
342
- userGaugeVotes: userGaugeVotes,
343
- voteForGaugeNextTime: voteForGaugeNextTime,
252
+ getVotingGaugeList,
253
+ userGaugeVotes,
254
+ voteForGaugeNextTime,
344
255
  // Transaction methods
345
- voteForGauge: voteForGauge,
256
+ voteForGauge,
346
257
  // --- Proposal voting ---
347
258
  // View methods
348
- getProposalList: getProposalList,
349
- getProposal: getProposal,
350
- userProposalVotes: userProposalVotes,
259
+ getProposalList,
260
+ getProposal,
261
+ userProposalVotes,
351
262
  // Transaction methods
352
- voteForProposal: voteForProposal,
353
- executeVote: executeVote,
354
- isCanVoteExecute: isCanVoteExecute,
263
+ voteForProposal,
264
+ executeVote,
265
+ isCanVoteExecute,
355
266
  estimateGas: {
356
267
  // --- CRV lock ---
357
268
  crvLockApprove: crvLockApproveEstimateGas,
@@ -137,12 +137,7 @@ export interface IPoolDataShort {
137
137
  id: string;
138
138
  address: string;
139
139
  }
140
- export interface ISubgraphPoolData {
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;
@@ -268,3 +263,48 @@ export interface IBasePoolShortItem {
268
263
  token: string;
269
264
  }
270
265
  export type TVoteType = "PARAMETER" | "OWNERSHIP";
266
+ export type AbiParameter = {
267
+ type: string;
268
+ name?: string;
269
+ components?: readonly AbiParameter[];
270
+ };
271
+ type CtorMutability = 'payable' | 'nonpayable';
272
+ export type AbiStateMutability = 'pure' | 'view' | CtorMutability;
273
+ export type AbiFunction = {
274
+ type: 'function';
275
+ constant?: boolean;
276
+ gas?: number;
277
+ inputs: readonly AbiParameter[];
278
+ name: string;
279
+ outputs: readonly AbiParameter[];
280
+ payable?: boolean | undefined;
281
+ stateMutability: AbiStateMutability;
282
+ };
283
+ export type AbiConstructor = {
284
+ type: 'constructor';
285
+ inputs: readonly AbiParameter[];
286
+ payable?: boolean;
287
+ stateMutability: CtorMutability;
288
+ };
289
+ export type AbiFallback = {
290
+ type: 'fallback';
291
+ payable?: boolean;
292
+ stateMutability: CtorMutability;
293
+ };
294
+ export type AbiReceive = {
295
+ type: 'receive';
296
+ stateMutability: Extract<AbiStateMutability, 'payable'>;
297
+ };
298
+ export type AbiEvent = {
299
+ type: 'event';
300
+ anonymous?: boolean;
301
+ inputs: readonly AbiParameter[];
302
+ name: string;
303
+ };
304
+ export type AbiError = {
305
+ type: 'error';
306
+ inputs: readonly AbiParameter[];
307
+ name: string;
308
+ };
309
+ export type Abi = (AbiConstructor | AbiError | AbiEvent | AbiFallback | AbiFunction | AbiReceive)[];
310
+ export {};