@curvefi/api 2.65.28 → 2.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +3 -0
  2. package/eslint.config.mjs +88 -0
  3. package/lib/boosting.js +13 -13
  4. package/lib/constants/coins/avalanche.js +4 -4
  5. package/lib/constants/coins/base.js +1 -1
  6. package/lib/constants/coins/celo.js +1 -1
  7. package/lib/constants/coins/ethereum.js +88 -88
  8. package/lib/constants/coins/fantom.js +5 -5
  9. package/lib/constants/coins/kava.js +1 -1
  10. package/lib/constants/coins/polygon.js +18 -18
  11. package/lib/constants/coins/zksync.js +1 -1
  12. package/lib/constants/factory/crypto.js +32 -32
  13. package/lib/constants/factory/stable.js +57 -57
  14. package/lib/constants/network_constants.js +37 -37
  15. package/lib/constants/pools/arbitrum.js +8 -8
  16. package/lib/constants/pools/aurora.js +2 -2
  17. package/lib/constants/pools/avalanche.js +13 -13
  18. package/lib/constants/pools/ethereum.js +89 -89
  19. package/lib/constants/pools/fantom.js +13 -13
  20. package/lib/constants/pools/moonbeam.js +3 -3
  21. package/lib/constants/pools/optimism.js +3 -3
  22. package/lib/constants/pools/polygon.js +21 -21
  23. package/lib/constants/pools/xdai.js +13 -13
  24. package/lib/curve.d.ts +10 -2
  25. package/lib/curve.js +80 -47
  26. package/lib/dao.js +12 -12
  27. package/lib/external-api.d.ts +0 -9
  28. package/lib/external-api.js +75 -104
  29. package/lib/factory/deploy.js +12 -12
  30. package/lib/factory/factory-api.js +13 -13
  31. package/lib/factory/factory-crypto.js +10 -10
  32. package/lib/factory/factory-tricrypto.js +11 -11
  33. package/lib/factory/factory-twocrypto.js +9 -9
  34. package/lib/factory/factory.js +13 -13
  35. package/lib/index.d.ts +60 -59
  36. package/lib/index.js +6 -3
  37. package/lib/pools/PoolTemplate.js +59 -59
  38. package/lib/pools/mixins/depositMixins.js +14 -14
  39. package/lib/pools/mixins/depositWrappedMixins.js +8 -8
  40. package/lib/pools/mixins/swapMixins.js +12 -12
  41. package/lib/pools/mixins/swapWrappedMixins.js +8 -8
  42. package/lib/pools/mixins/withdrawImbalanceMixins.js +12 -12
  43. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +6 -6
  44. package/lib/pools/mixins/withdrawMixins.js +14 -14
  45. package/lib/pools/mixins/withdrawOneCoinMixins.js +14 -14
  46. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +6 -6
  47. package/lib/pools/mixins/withdrawWrappedMixins.js +6 -6
  48. package/lib/pools/subClasses/gaugePool.js +4 -4
  49. package/lib/pools/subClasses/statsPool.js +3 -3
  50. package/lib/pools/utils.js +11 -11
  51. package/lib/route-graph.worker.js +3 -3
  52. package/lib/router.js +4 -5
  53. package/lib/utils.js +22 -24
  54. package/package.json +21 -18
package/lib/index.d.ts CHANGED
@@ -46,10 +46,10 @@ declare const curve: {
46
46
  getGasInfoForL2: () => Promise<Record<string, number | null>>;
47
47
  getGasPrice: () => Promise<number>;
48
48
  getTVL: (chainId?: number) => Promise<number>;
49
- getBalances: (coins: string[], ...addresses: string[] | string[][]) => Promise<string[] | import("./interfaces.js").IDict<string[]>>;
49
+ getBalances: (coins: string[], ...addresses: string[] | string[][]) => Promise<import("./interfaces.js").IDict<string[]> | string[]>;
50
50
  getAllowance: (coins: string[], address: string, spender: string) => Promise<string[]>;
51
- hasAllowance: (coins: string[], amounts: (string | number)[], address: string, spender: string) => Promise<boolean>;
52
- ensureAllowance: (coins: string[], amounts: (string | number)[], spender: string, isMax?: boolean) => Promise<string[]>;
51
+ hasAllowance: (coins: string[], amounts: (number | string)[], address: string, spender: string) => Promise<boolean>;
52
+ ensureAllowance: (coins: string[], amounts: (number | string)[], spender: string, isMax?: boolean) => Promise<string[]>;
53
53
  getCoinsData: (...coins: string[] | string[][]) => Promise<{
54
54
  name: string;
55
55
  symbol: string;
@@ -65,13 +65,14 @@ declare const curve: {
65
65
  getCurveLiteNetworks: () => Promise<import("./interfaces.js").ICurveLiteNetwork[]>;
66
66
  getNetworkConstants: () => import("./interfaces.js").INetworkConstants;
67
67
  getIsLiteChain: () => boolean;
68
+ isNoRPC: boolean;
68
69
  factory: {
69
70
  fetchPools: (useApi?: boolean) => Promise<void>;
70
71
  fetchNewPools: () => Promise<string[]>;
71
72
  getPoolList: () => string[];
72
- deployPlainPool: (name: string, symbol: string, coins: string[], A: string | number, fee: string | number, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3 | 4 | 5, emaTime?: number, oracleAddress?: string, methodName?: string) => Promise<ethers.ContractTransactionResponse>;
73
+ deployPlainPool: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3 | 4 | 5, emaTime?: number, oracleAddress?: string, methodName?: string) => Promise<ethers.ContractTransactionResponse>;
73
74
  setOracle: (poolAddress: string, oracleAddress?: string, methodName?: string) => Promise<ethers.ContractTransactionResponse>;
74
- deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: string | number, fee: string | number, implementationIdx: 0 | 1) => Promise<ethers.ContractTransactionResponse>;
75
+ deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, implementationIdx: 0 | 1) => Promise<ethers.ContractTransactionResponse>;
75
76
  deployGauge: (poolAddress: string) => Promise<ethers.ContractTransactionResponse>;
76
77
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
77
78
  deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
@@ -83,9 +84,9 @@ declare const curve: {
83
84
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
84
85
  gaugeImplementation: () => string;
85
86
  estimateGas: {
86
- deployPlainPool: (name: string, symbol: string, coins: string[], A: string | number, fee: string | number, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3 | 4 | 5, emaTime?: number, oracleAddress?: string, methodName?: string) => Promise<number>;
87
+ deployPlainPool: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, assetType: 0 | 1 | 2 | 3, implementationIdx: 0 | 1 | 2 | 3 | 4 | 5, emaTime?: number, oracleAddress?: string, methodName?: string) => Promise<number>;
87
88
  setOracle: (poolAddress: string, oracleAddress?: string, methodName?: string) => Promise<number>;
88
- deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: string | number, fee: string | number, implementationIdx: 0 | 1) => Promise<number>;
89
+ deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, implementationIdx: 0 | 1) => Promise<number>;
89
90
  deployGauge: (poolAddress: string) => Promise<number>;
90
91
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<number>;
91
92
  deployGaugeMirror: (chainId: number, salt: string) => Promise<number>;
@@ -103,8 +104,8 @@ declare const curve: {
103
104
  fetchPools: (useApi?: boolean) => Promise<void>;
104
105
  fetchNewPools: () => Promise<string[]>;
105
106
  getPoolList: () => string[];
106
- deployPlainPool: (name: string, symbol: string, coins: string[], A: string | number, fee: string | number, offpegFeeMultiplier: string | number, assetTypes: (0 | 1 | 2 | 3)[], implementationIdx: 0, emaTime: number, oracleAddresses: string[], methodNames: string[]) => Promise<ethers.ContractTransactionResponse>;
107
- deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: string | number, fee: string | number, offpegFeeMultiplier: string | number, emaTime: number, implementationIdx: 0, assetType: 0 | 1 | 2 | 3, methodName: string, oracleAddress: string) => Promise<ethers.ContractTransactionResponse>;
107
+ deployPlainPool: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, offpegFeeMultiplier: number | string, assetTypes: Array<0 | 1 | 2 | 3>, implementationIdx: 0, emaTime: number, oracleAddresses: string[], methodNames: string[]) => Promise<ethers.ContractTransactionResponse>;
108
+ deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, offpegFeeMultiplier: number | string, emaTime: number, implementationIdx: 0, assetType: 0 | 1 | 2 | 3, methodName: string, oracleAddress: string) => Promise<ethers.ContractTransactionResponse>;
108
109
  deployGauge: (poolAddress: string) => Promise<ethers.ContractTransactionResponse>;
109
110
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
110
111
  deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
@@ -115,15 +116,15 @@ declare const curve: {
115
116
  getDeployedGaugeMirrorAddressByTx: (tx: ethers.ContractTransactionResponse) => Promise<string>;
116
117
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
117
118
  estimateGas: {
118
- deployPlainPool: (name: string, symbol: string, coins: string[], A: string | number, fee: string | number, offpegFeeMultiplier: string | number, assetTypes: (0 | 1 | 2 | 3)[], implementationIdx: 0, emaTime: number, oracleAddresses: string[], methodNames: string[]) => Promise<number>;
119
- deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: string | number, fee: string | number, offpegFeeMultiplier: string | number, assetType: 0 | 1 | 2 | 3, emaTime: number, implementationIdx: 0, methodName: string, oracleAddress: string) => Promise<number>;
119
+ deployPlainPool: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, offpegFeeMultiplier: number | string, assetTypes: Array<0 | 1 | 2 | 3>, implementationIdx: 0, emaTime: number, oracleAddresses: string[], methodNames: string[]) => Promise<number>;
120
+ deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, offpegFeeMultiplier: number | string, assetType: 0 | 1 | 2 | 3, emaTime: number, implementationIdx: 0, methodName: string, oracleAddress: string) => Promise<number>;
120
121
  };
121
122
  };
122
123
  cryptoFactory: {
123
124
  fetchPools: (useApi?: boolean) => Promise<void>;
124
125
  fetchNewPools: () => Promise<string[]>;
125
126
  getPoolList: () => string[];
126
- deployPool: (name: string, symbol: string, coins: string[], A: string | number, gamma: string | number, midFee: string | number, outFee: string | number, allowedExtraProfit: string | number, feeGamma: string | number, adjustmentStep: string | number, maHalfTime: number, initialPrice: string | number) => Promise<ethers.ContractTransactionResponse>;
127
+ deployPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, initialPrice: number | string) => Promise<ethers.ContractTransactionResponse>;
127
128
  deployGauge: (poolAddress: string) => Promise<ethers.ContractTransactionResponse>;
128
129
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
129
130
  deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
@@ -134,7 +135,7 @@ declare const curve: {
134
135
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
135
136
  gaugeImplementation: () => string;
136
137
  estimateGas: {
137
- deployPool: (name: string, symbol: string, coins: string[], A: string | number, gamma: string | number, midFee: string | number, outFee: string | number, allowedExtraProfit: string | number, feeGamma: string | number, adjustmentStep: string | number, maHalfTime: number, initialPrice: string | number) => Promise<number>;
138
+ deployPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, initialPrice: number | string) => Promise<number>;
138
139
  deployGauge: (poolAddress: string) => Promise<number>;
139
140
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<number>;
140
141
  deployGaugeMirror: (chainId: number, salt: string) => Promise<number>;
@@ -144,7 +145,7 @@ declare const curve: {
144
145
  fetchPools: (useApi?: boolean) => Promise<void>;
145
146
  fetchNewPools: () => Promise<string[]>;
146
147
  getPoolList: () => string[];
147
- deployPool: (name: string, symbol: string, coins: string[], A: string | number, gamma: string | number, midFee: string | number, outFee: string | number, allowedExtraProfit: string | number, feeGamma: string | number, adjustmentStep: string | number, maHalfTime: number, initialPrice: string | number) => Promise<ethers.ContractTransactionResponse>;
148
+ deployPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, initialPrice: number | string) => Promise<ethers.ContractTransactionResponse>;
148
149
  deployGauge: (poolAddress: string) => Promise<ethers.ContractTransactionResponse>;
149
150
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
150
151
  deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
@@ -155,7 +156,7 @@ declare const curve: {
155
156
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
156
157
  gaugeImplementation: () => string;
157
158
  estimateGas: {
158
- deployPool: (name: string, symbol: string, coins: string[], A: string | number, gamma: string | number, midFee: string | number, outFee: string | number, allowedExtraProfit: string | number, feeGamma: string | number, adjustmentStep: string | number, maHalfTime: number, initialPrice: string | number) => Promise<number>;
159
+ deployPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, initialPrice: number | string) => Promise<number>;
159
160
  deployGauge: (poolAddress: string) => Promise<number>;
160
161
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<number>;
161
162
  deployGaugeMirror: (chainId: number, salt: string) => Promise<number>;
@@ -165,7 +166,7 @@ declare const curve: {
165
166
  fetchPools: (useApi?: boolean) => Promise<void>;
166
167
  fetchNewPools: () => Promise<string[]>;
167
168
  getPoolList: () => string[];
168
- deployPool: (name: string, symbol: string, coins: string[], A: string | number, gamma: string | number, midFee: string | number, outFee: string | number, allowedExtraProfit: string | number, feeGamma: string | number, adjustmentStep: string | number, emaTime: number, initialPrices: (string | number)[]) => Promise<ethers.ContractTransactionResponse>;
169
+ deployPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, emaTime: number, initialPrices: (number | string)[]) => Promise<ethers.ContractTransactionResponse>;
169
170
  deployGauge: (poolAddress: string) => Promise<ethers.ContractTransactionResponse>;
170
171
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
171
172
  deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
@@ -176,17 +177,17 @@ declare const curve: {
176
177
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
177
178
  gaugeImplementation: () => string;
178
179
  estimateGas: {
179
- deployPool: (name: string, symbol: string, coins: string[], A: string | number, gamma: string | number, midFee: string | number, outFee: string | number, allowedExtraProfit: string | number, feeGamma: string | number, adjustmentStep: string | number, emaTime: number, initialPrices: (string | number)[]) => Promise<number>;
180
+ deployPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, outFee: number | string, allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, emaTime: number, initialPrices: (number | string)[]) => Promise<number>;
180
181
  deployGauge: (poolAddress: string) => Promise<number>;
181
182
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<number>;
182
183
  deployGaugeMirror: (chainId: number, salt: string) => Promise<number>;
183
184
  };
184
185
  };
185
186
  estimateGas: {
186
- ensureAllowance: (coins: string[], amounts: (string | number)[], spender: string, isMax?: boolean) => Promise<number | number[]>;
187
+ ensureAllowance: (coins: string[], amounts: (number | string)[], spender: string, isMax?: boolean) => Promise<number | number[]>;
187
188
  };
188
189
  boosting: {
189
- getCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces.js").IDict<string>>;
190
+ getCrv: (...addresses: string[] | string[][]) => Promise<import("./interfaces.js").IDict<string> | string>;
190
191
  getLockedAmountAndUnlockTime: (...addresses: string[] | string[][]) => Promise<import("./interfaces.js").IDict<{
191
192
  lockedAmount: string;
192
193
  unlockTime: number;
@@ -194,13 +195,13 @@ declare const curve: {
194
195
  lockedAmount: string;
195
196
  unlockTime: number;
196
197
  }>;
197
- getVeCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces.js").IDict<string>>;
198
- getVeCrvPct: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces.js").IDict<string>>;
198
+ getVeCrv: (...addresses: string[] | string[][]) => Promise<import("./interfaces.js").IDict<string> | string>;
199
+ getVeCrvPct: (...addresses: string[] | string[][]) => Promise<import("./interfaces.js").IDict<string> | string>;
199
200
  calcUnlockTime: (days: number, start?: number) => number;
200
- isApproved: (amount: string | number) => Promise<boolean>;
201
- approve: (amount: string | number) => Promise<string[]>;
202
- createLock: (amount: string | number, days: number) => Promise<string>;
203
- increaseAmount: (amount: string | number) => Promise<string>;
201
+ isApproved: (amount: number | string) => Promise<boolean>;
202
+ approve: (amount: number | string) => Promise<string[]>;
203
+ createLock: (amount: number | string, days: number) => Promise<string>;
204
+ increaseAmount: (amount: number | string) => Promise<string>;
204
205
  increaseUnlockTime: (days: number) => Promise<string>;
205
206
  withdrawLockedCrv: () => Promise<string>;
206
207
  claimableFees: (address?: string) => Promise<string>;
@@ -208,9 +209,9 @@ declare const curve: {
208
209
  claimableFeesCrvUSD: (address?: string) => Promise<string>;
209
210
  claimFeesCrvUSD: (address?: string) => Promise<string>;
210
211
  estimateGas: {
211
- approve: (amount: string | number) => Promise<number | number[]>;
212
- createLock: (amount: string | number, days: number) => Promise<number>;
213
- increaseAmount: (amount: string | number) => Promise<number>;
212
+ approve: (amount: number | string) => Promise<number | number[]>;
213
+ createLock: (amount: number | string, days: number) => Promise<number>;
214
+ increaseAmount: (amount: number | string) => Promise<number>;
214
215
  increaseUnlockTime: (days: number) => Promise<number>;
215
216
  withdrawLockedCrv: () => Promise<number>;
216
217
  claimFees: (address?: string) => Promise<number>;
@@ -219,42 +220,42 @@ declare const curve: {
219
220
  sidechain: {
220
221
  lastEthBlock: () => Promise<number>;
221
222
  getAnycallBalance: () => Promise<string>;
222
- topUpAnycall: (amount?: string | number) => Promise<string>;
223
- lastBlockSent: (chainId: number) => Promise<number>;
223
+ topUpAnycall: (amount?: number | string) => Promise<string>;
224
+ lastBlockSent: (chainId: import("./interfaces.js").IChainId) => Promise<number>;
224
225
  blockToSend: () => Promise<number>;
225
- sendBlockhash: (block: number, chainId: number) => Promise<string>;
226
+ sendBlockhash: (block: number, chainId: import("./interfaces.js").IChainId) => Promise<string>;
226
227
  submitProof: (block: number, address?: string) => Promise<string>;
227
228
  estimateGas: {
228
- topUpAnycall: (amount?: string | number) => Promise<number>;
229
- sendBlockhash: (block: number, chainId: number) => Promise<number>;
229
+ topUpAnycall: (amount?: number | string) => Promise<number>;
230
+ sendBlockhash: (block: number, chainId: import("./interfaces.js").IChainId) => Promise<number>;
230
231
  submitProof: (block: number, address?: string) => Promise<number>;
231
232
  };
232
233
  };
233
234
  };
234
235
  router: {
235
- getBestRouteAndOutput: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<{
236
+ getBestRouteAndOutput: (inputCoin: string, outputCoin: string, amount: number | string) => Promise<{
236
237
  route: import("./interfaces.js").IRoute;
237
238
  output: string;
238
239
  }>;
239
240
  getArgs: (route: import("./interfaces.js").IRoute) => {
240
241
  _route: string[];
241
242
  _swapParams: number[][];
242
- _pools?: string[] | undefined;
243
- _basePools?: string[] | undefined;
244
- _baseTokens?: string[] | undefined;
245
- _secondBasePools?: string[] | undefined;
246
- _secondBaseTokens?: string[] | undefined;
243
+ _pools?: string[];
244
+ _basePools?: string[];
245
+ _baseTokens?: string[];
246
+ _secondBasePools?: string[];
247
+ _secondBaseTokens?: string[];
247
248
  };
248
- expected: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<string>;
249
- required: (inputCoin: string, outputCoin: string, outAmount: string | number) => Promise<string>;
250
- priceImpact: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<number>;
251
- isApproved: (inputCoin: string, amount: string | number) => Promise<boolean>;
252
- approve: (inputCoin: string, amount: string | number) => Promise<string[]>;
253
- swap: (inputCoin: string, outputCoin: string, amount: string | number, slippage?: number) => Promise<ethers.ContractTransactionResponse>;
249
+ expected: (inputCoin: string, outputCoin: string, amount: number | string) => Promise<string>;
250
+ required: (inputCoin: string, outputCoin: string, outAmount: number | string) => Promise<string>;
251
+ priceImpact: (inputCoin: string, outputCoin: string, amount: number | string) => Promise<number>;
252
+ isApproved: (inputCoin: string, amount: number | string) => Promise<boolean>;
253
+ approve: (inputCoin: string, amount: number | string) => Promise<string[]>;
254
+ swap: (inputCoin: string, outputCoin: string, amount: number | string, slippage?: number) => Promise<ethers.ContractTransactionResponse>;
254
255
  getSwappedAmount: (tx: ethers.ContractTransactionResponse, outputCoin: string) => Promise<string>;
255
256
  estimateGas: {
256
- approve: (inputCoin: string, amount: string | number) => Promise<number | number[]>;
257
- swap: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<number | number[]>;
257
+ approve: (inputCoin: string, amount: number | string) => Promise<number | number[]>;
258
+ swap: (inputCoin: string, outputCoin: string, amount: number | string) => Promise<number | number[]>;
258
259
  };
259
260
  };
260
261
  dao: {
@@ -272,13 +273,13 @@ declare const curve: {
272
273
  lockedCrv: string;
273
274
  unlockTime: number;
274
275
  }>;
275
- crvLockIsApproved: (amount: string | number) => Promise<boolean>;
276
- calcCrvUnlockTime: (days: string | number, start?: string | number) => number;
276
+ crvLockIsApproved: (amount: number | string) => Promise<boolean>;
277
+ calcCrvUnlockTime: (days: number | string, start?: number | string) => number;
277
278
  claimableFees: (address?: string) => Promise<string>;
278
- crvLockApprove: (amount: string | number) => Promise<string[]>;
279
- createCrvLock: (amount: string | number, days: string | number) => Promise<string>;
280
- increaseCrvLockedAmount: (amount: string | number) => Promise<string>;
281
- increaseCrvUnlockTime: (days: string | number) => Promise<string>;
279
+ crvLockApprove: (amount: number | string) => Promise<string[]>;
280
+ createCrvLock: (amount: number | string, days: number | string) => Promise<string>;
281
+ increaseCrvLockedAmount: (amount: number | string) => Promise<string>;
282
+ increaseCrvUnlockTime: (days: number | string) => Promise<string>;
282
283
  withdrawLockedCrv: () => Promise<string>;
283
284
  claimFees: (address?: string) => Promise<string>;
284
285
  getVotingGaugeList: () => Promise<import("./interfaces.js").IVotingGauge[]>;
@@ -288,7 +289,7 @@ declare const curve: {
288
289
  veCrvUsed: string;
289
290
  }>;
290
291
  voteForGaugeNextTime: (gauge: string) => Promise<number>;
291
- voteForGauge: (gauge: string, power: string | number) => Promise<string>;
292
+ voteForGauge: (gauge: string, power: number | string) => Promise<string>;
292
293
  getProposalList: () => Promise<import("./interfaces.js").IDaoProposalListItem[]>;
293
294
  getProposal: (type: "PARAMETER" | "OWNERSHIP", id: number) => Promise<import("./interfaces.js").IDaoProposal>;
294
295
  userProposalVotes: (address?: string) => Promise<import("./interfaces.js").IDaoProposalUserListItem[]>;
@@ -296,13 +297,13 @@ declare const curve: {
296
297
  executeVote: (type: import("./interfaces.js").TVoteType, id: number) => Promise<string>;
297
298
  isCanVoteExecute: (type: import("./interfaces.js").TVoteType, id: number) => Promise<boolean>;
298
299
  estimateGas: {
299
- crvLockApprove: (amount: string | number) => Promise<number | number[]>;
300
- createCrvLock: (amount: string | number, days: string | number) => Promise<number | number[]>;
301
- increaseCrvLockedAmount: (amount: string | number) => Promise<number | number[]>;
302
- increaseCrvUnlockTime: (days: string | number) => Promise<number | number[]>;
300
+ crvLockApprove: (amount: number | string) => Promise<number | number[]>;
301
+ createCrvLock: (amount: number | string, days: number | string) => Promise<number | number[]>;
302
+ increaseCrvLockedAmount: (amount: number | string) => Promise<number | number[]>;
303
+ increaseCrvUnlockTime: (days: number | string) => Promise<number | number[]>;
303
304
  withdrawLockedCrv: () => Promise<number | number[]>;
304
305
  claimFees: (address?: string) => Promise<number | number[]>;
305
- voteForGauge: (gauge: string, power: string | number) => Promise<number | number[]>;
306
+ voteForGauge: (gauge: string, power: number | string) => Promise<number | number[]>;
306
307
  voteForProposal: (type: import("./interfaces.js").TVoteType, id: number, support: boolean) => Promise<number | number[]>;
307
308
  executeVote: (type: import("./interfaces.js").TVoteType, id: number) => Promise<number | number[]>;
308
309
  };
package/lib/index.js CHANGED
@@ -15,13 +15,15 @@ import { getCrv, getLockedAmountAndUnlockTime, getVeCrv, getVeCrvPct, calcUnlock
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
- function init(providerType, providerSettings, options = {}) {
19
- return __awaiter(this, void 0, void 0, function* () {
18
+ function init(providerType_1, providerSettings_1) {
19
+ return __awaiter(this, arguments, void 0, function* (providerType, providerSettings, options = {}) {
20
20
  yield _curve.init(providerType, providerSettings, options);
21
21
  // @ts-ignore
22
22
  this.signerAddress = _curve.signerAddress;
23
23
  // @ts-ignore
24
24
  this.chainId = _curve.chainId;
25
+ // @ts-ignore
26
+ this.isNoRPC = _curve.isNoRPC;
25
27
  });
26
28
  }
27
29
  function setCustomFeeData(customFeeData) {
@@ -59,6 +61,7 @@ const curve = {
59
61
  getCurveLiteNetworks,
60
62
  getNetworkConstants: _curve.getNetworkConstants,
61
63
  getIsLiteChain: _curve.getIsLiteChain,
64
+ isNoRPC: _curve.isNoRPC,
62
65
  factory: {
63
66
  fetchPools: _curve.fetchFactoryPools,
64
67
  fetchNewPools: _curve.fetchNewFactoryPools,
@@ -149,7 +152,7 @@ const curve = {
149
152
  fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedTwocryptoFactoryPool,
150
153
  gaugeImplementation: () => _curve.getGaugeImplementation("factory-twocrypto"),
151
154
  estimateGas: {
152
- deployPool: deployTwocryptoPoolEstimateGas,
155
+ deployPool: deployTwocryptoPoolEstimateGas, //
153
156
  deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.twocrypto_factory); }),
154
157
  deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas(poolAddress, salt); }),
155
158
  deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas(chainId, salt); }),