@curvefi/api 2.65.28 → 2.65.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/eslint.config.mjs +88 -0
  2. package/lib/boosting.js +13 -13
  3. package/lib/constants/coins/avalanche.js +4 -4
  4. package/lib/constants/coins/base.js +1 -1
  5. package/lib/constants/coins/celo.js +1 -1
  6. package/lib/constants/coins/ethereum.js +88 -88
  7. package/lib/constants/coins/fantom.js +5 -5
  8. package/lib/constants/coins/kava.js +1 -1
  9. package/lib/constants/coins/polygon.js +18 -18
  10. package/lib/constants/coins/zksync.js +1 -1
  11. package/lib/constants/factory/crypto.js +32 -32
  12. package/lib/constants/factory/stable.js +57 -57
  13. package/lib/constants/network_constants.js +37 -37
  14. package/lib/constants/pools/arbitrum.js +8 -8
  15. package/lib/constants/pools/aurora.js +2 -2
  16. package/lib/constants/pools/avalanche.js +13 -13
  17. package/lib/constants/pools/ethereum.js +89 -89
  18. package/lib/constants/pools/fantom.js +13 -13
  19. package/lib/constants/pools/moonbeam.js +3 -3
  20. package/lib/constants/pools/optimism.js +3 -3
  21. package/lib/constants/pools/polygon.js +21 -21
  22. package/lib/constants/pools/xdai.js +13 -13
  23. package/lib/curve.d.ts +1 -1
  24. package/lib/curve.js +38 -38
  25. package/lib/dao.js +12 -12
  26. package/lib/external-api.d.ts +0 -9
  27. package/lib/external-api.js +75 -104
  28. package/lib/factory/deploy.js +12 -12
  29. package/lib/factory/factory-api.js +13 -13
  30. package/lib/factory/factory-crypto.js +10 -10
  31. package/lib/factory/factory-tricrypto.js +11 -11
  32. package/lib/factory/factory-twocrypto.js +9 -9
  33. package/lib/factory/factory.js +13 -13
  34. package/lib/index.d.ts +59 -59
  35. package/lib/index.js +3 -3
  36. package/lib/pools/PoolTemplate.js +59 -59
  37. package/lib/pools/mixins/depositMixins.js +14 -14
  38. package/lib/pools/mixins/depositWrappedMixins.js +8 -8
  39. package/lib/pools/mixins/swapMixins.js +12 -12
  40. package/lib/pools/mixins/swapWrappedMixins.js +8 -8
  41. package/lib/pools/mixins/withdrawImbalanceMixins.js +12 -12
  42. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +6 -6
  43. package/lib/pools/mixins/withdrawMixins.js +14 -14
  44. package/lib/pools/mixins/withdrawOneCoinMixins.js +14 -14
  45. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +6 -6
  46. package/lib/pools/mixins/withdrawWrappedMixins.js +6 -6
  47. package/lib/pools/subClasses/gaugePool.js +4 -4
  48. package/lib/pools/subClasses/statsPool.js +3 -3
  49. package/lib/pools/utils.js +11 -11
  50. package/lib/route-graph.worker.js +3 -3
  51. package/lib/router.js +4 -5
  52. package/lib/utils.js +22 -24
  53. package/package.json +21 -18
@@ -8,10 +8,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { curve } from "../curve.js";
11
- import ERC20ABI from "../constants/abis/ERC20.json" assert { type: 'json' };
12
- import twocryptoFactorySwapABI from "../constants/abis/factory-twocrypto/factory-twocrypto-pool.json" assert { type: 'json' };
13
- import factoryGaugeABI from "../constants/abis/gauge_factory.json" assert { type: 'json' };
14
- import gaugeChildABI from "../constants/abis/gauge_child.json" assert { type: 'json' };
11
+ import ERC20ABI from "../constants/abis/ERC20.json" with { type: 'json' };
12
+ import twocryptoFactorySwapABI from "../constants/abis/factory-twocrypto/factory-twocrypto-pool.json" with { type: 'json' };
13
+ import factoryGaugeABI from "../constants/abis/gauge_factory.json" with { type: 'json' };
14
+ import gaugeChildABI from "../constants/abis/gauge_child.json" with { type: 'json' };
15
15
  const deepFlatten = (arr) => [].concat(...arr.map((v) => (Array.isArray(v) ? deepFlatten(v) : v)));
16
16
  function getRecentlyCreatedCryptoPoolId(swapAddress) {
17
17
  return __awaiter(this, void 0, void 0, function* () {
@@ -25,8 +25,8 @@ function getRecentlyCreatedCryptoPoolId(swapAddress) {
25
25
  throw Error("Unknown pool");
26
26
  });
27
27
  }
28
- function getTwocryptoFactoryIdsAndSwapAddresses(fromIdx = 0) {
29
- return __awaiter(this, void 0, void 0, function* () {
28
+ function getTwocryptoFactoryIdsAndSwapAddresses() {
29
+ return __awaiter(this, arguments, void 0, function* (fromIdx = 0) {
30
30
  const factoryContract = this.contracts[this.constants.ALIASES.twocrypto_factory].contract;
31
31
  const factoryMulticallContract = this.contracts[this.constants.ALIASES.twocrypto_factory].multicallContract;
32
32
  const poolCount = Number(curve.formatUnits(yield factoryContract.pool_count(this.constantOptions), 0));
@@ -164,8 +164,8 @@ function getCoinsData(tokenAddresses, coinAddresses, existingCoinAddrNameDict, e
164
164
  return [tokenSymbols, tokenNames, coinAddrNamesDict, coinAddrDecimalsDict];
165
165
  });
166
166
  }
167
- export function getTwocryptoFactoryPoolData(fromIdx = 0, swapAddress) {
168
- return __awaiter(this, void 0, void 0, function* () {
167
+ export function getTwocryptoFactoryPoolData() {
168
+ return __awaiter(this, arguments, void 0, function* (fromIdx = 0, swapAddress) {
169
169
  const [poolIds, swapAddresses] = swapAddress ?
170
170
  [[yield getRecentlyCreatedCryptoPoolId.call(this, swapAddress)], [swapAddress.toLowerCase()]]
171
171
  : yield getTwocryptoFactoryIdsAndSwapAddresses.call(this, fromIdx);
@@ -193,7 +193,7 @@ export function getTwocryptoFactoryPoolData(fromIdx = 0, swapAddress) {
193
193
  token_address: swapAddresses[i],
194
194
  gauge_address: gaugeAddresses[i],
195
195
  is_crypto: true,
196
- is_plain: underlyingCoinAddresses[i].toString() === coinAddresses[i].toString(),
196
+ is_plain: underlyingCoinAddresses[i].toString() === coinAddresses[i].toString(), // WETH/ETH - NOT Plain
197
197
  is_factory: true,
198
198
  underlying_coins: [...underlyingCoinAddresses[i].map((addr) => coinAddressNameDict[addr])],
199
199
  wrapped_coins: [...coinAddresses[i].map((addr) => coinAddressNameDict[addr])],
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { Contract as MulticallContract } from "@curvefi/ethcall";
11
11
  import { curve } from "../curve.js";
12
- import ERC20ABI from "../constants/abis/ERC20.json" assert { type: 'json' };
13
- import PlainStableSwapNGABI from "../constants/abis/factory-stable-ng/plain-stableswap-ng.json" assert { type: 'json' };
12
+ import ERC20ABI from "../constants/abis/ERC20.json" with { type: 'json' };
13
+ import PlainStableSwapNGABI from "../constants/abis/factory-stable-ng/plain-stableswap-ng.json" with { type: 'json' };
14
14
  import MetaStableSwapNGABI from "../constants/abis/factory-stable-ng/meta-stableswap-ng.json" assert { type: 'json' };
15
- import factoryGaugeABI from "../constants/abis/gauge_factory.json" assert { type: 'json' };
16
- import gaugeChildABI from "../constants/abis/gauge_child.json" assert { type: 'json' };
17
- import StableNgBasePoolZapABI from "../constants/abis/stable-ng-base-pool-zap.json" assert { type: 'json' };
15
+ import factoryGaugeABI from "../constants/abis/gauge_factory.json" with { type: 'json' };
16
+ import gaugeChildABI from "../constants/abis/gauge_child.json" with { type: 'json' };
17
+ import StableNgBasePoolZapABI from "../constants/abis/stable-ng-base-pool-zap.json" with { type: 'json' };
18
18
  import { getPoolIdByAddress, setFactoryZapContracts } from "./common.js";
19
19
  import { getPoolName, isStableNgPool } from "../utils.js";
20
20
  export const BLACK_LIST = {
@@ -71,9 +71,9 @@ function getRecentlyCreatedPoolId(swapAddress, factoryAddress) {
71
71
  throw Error("Unknown pool");
72
72
  });
73
73
  }
74
- function getFactoryIdsAndSwapAddresses(fromIdx = 0, factoryAddress) {
75
- var _a;
76
- return __awaiter(this, void 0, void 0, function* () {
74
+ function getFactoryIdsAndSwapAddresses() {
75
+ return __awaiter(this, arguments, void 0, function* (fromIdx = 0, factoryAddress) {
76
+ var _a;
77
77
  const factoryContract = this.contracts[factoryAddress].contract;
78
78
  const factoryMulticallContract = this.contracts[factoryAddress].multicallContract;
79
79
  const poolCount = Number(curve.formatUnits(yield factoryContract.pool_count(this.constantOptions), 0));
@@ -222,9 +222,9 @@ function getCoinsData(coinAddresses, existingCoinAddrNameDict, existingCoinAddrD
222
222
  return [coinAddrNamesDict, coinAddrDecimalsDict];
223
223
  });
224
224
  }
225
- export function getFactoryPoolData(fromIdx = 0, swapAddress, factoryAddress = curve.constants.ALIASES.factory) {
226
- var _a, _b, _c;
227
- return __awaiter(this, void 0, void 0, function* () {
225
+ export function getFactoryPoolData() {
226
+ return __awaiter(this, arguments, void 0, function* (fromIdx = 0, swapAddress, factoryAddress = curve.constants.ALIASES.factory) {
227
+ var _a, _b, _c;
228
228
  const [rawPoolIds, rawSwapAddresses] = swapAddress ?
229
229
  [[yield getRecentlyCreatedPoolId.call(this, swapAddress, factoryAddress)], [swapAddress.toLowerCase()]]
230
230
  : yield getFactoryIdsAndSwapAddresses.call(this, fromIdx, factoryAddress);
@@ -282,7 +282,7 @@ export function getFactoryPoolData(fromIdx = 0, swapAddress, factoryAddress = cu
282
282
  swap_address: swapAddresses[i],
283
283
  token_address: swapAddresses[i],
284
284
  gauge_address: gaugeAddresses[i],
285
- implementation_address: implementations[i],
285
+ implementation_address: implementations[i], // Only for testing
286
286
  is_plain: true,
287
287
  is_factory: true,
288
288
  underlying_coins: [...coinAddresses[i].map((addr) => coinAddressNameDict[addr])],
@@ -324,7 +324,7 @@ export function getFactoryPoolData(fromIdx = 0, swapAddress, factoryAddress = cu
324
324
  token_address: swapAddresses[i],
325
325
  gauge_address: gaugeAddresses[i],
326
326
  deposit_address,
327
- implementation_address: implementations[i],
327
+ implementation_address: implementations[i], // Only for testing
328
328
  is_meta: true,
329
329
  is_factory: true,
330
330
  base_pool: basePools.ids[i],
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;
@@ -69,9 +69,9 @@ declare const curve: {
69
69
  fetchPools: (useApi?: boolean) => Promise<void>;
70
70
  fetchNewPools: () => Promise<string[]>;
71
71
  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>;
72
+ 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
73
  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>;
74
+ deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, implementationIdx: 0 | 1) => Promise<ethers.ContractTransactionResponse>;
75
75
  deployGauge: (poolAddress: string) => Promise<ethers.ContractTransactionResponse>;
76
76
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
77
77
  deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
@@ -83,9 +83,9 @@ declare const curve: {
83
83
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
84
84
  gaugeImplementation: () => string;
85
85
  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>;
86
+ 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
87
  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>;
88
+ deployMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, implementationIdx: 0 | 1) => Promise<number>;
89
89
  deployGauge: (poolAddress: string) => Promise<number>;
90
90
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<number>;
91
91
  deployGaugeMirror: (chainId: number, salt: string) => Promise<number>;
@@ -103,8 +103,8 @@ declare const curve: {
103
103
  fetchPools: (useApi?: boolean) => Promise<void>;
104
104
  fetchNewPools: () => Promise<string[]>;
105
105
  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>;
106
+ 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>;
107
+ 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
108
  deployGauge: (poolAddress: string) => Promise<ethers.ContractTransactionResponse>;
109
109
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
110
110
  deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
@@ -115,15 +115,15 @@ declare const curve: {
115
115
  getDeployedGaugeMirrorAddressByTx: (tx: ethers.ContractTransactionResponse) => Promise<string>;
116
116
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
117
117
  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>;
118
+ 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>;
119
+ 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
120
  };
121
121
  };
122
122
  cryptoFactory: {
123
123
  fetchPools: (useApi?: boolean) => Promise<void>;
124
124
  fetchNewPools: () => Promise<string[]>;
125
125
  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>;
126
+ 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
127
  deployGauge: (poolAddress: string) => Promise<ethers.ContractTransactionResponse>;
128
128
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
129
129
  deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
@@ -134,7 +134,7 @@ declare const curve: {
134
134
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
135
135
  gaugeImplementation: () => string;
136
136
  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>;
137
+ 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
138
  deployGauge: (poolAddress: string) => Promise<number>;
139
139
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<number>;
140
140
  deployGaugeMirror: (chainId: number, salt: string) => Promise<number>;
@@ -144,7 +144,7 @@ declare const curve: {
144
144
  fetchPools: (useApi?: boolean) => Promise<void>;
145
145
  fetchNewPools: () => Promise<string[]>;
146
146
  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>;
147
+ 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
148
  deployGauge: (poolAddress: string) => Promise<ethers.ContractTransactionResponse>;
149
149
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
150
150
  deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
@@ -155,7 +155,7 @@ declare const curve: {
155
155
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
156
156
  gaugeImplementation: () => string;
157
157
  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>;
158
+ 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
159
  deployGauge: (poolAddress: string) => Promise<number>;
160
160
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<number>;
161
161
  deployGaugeMirror: (chainId: number, salt: string) => Promise<number>;
@@ -165,7 +165,7 @@ declare const curve: {
165
165
  fetchPools: (useApi?: boolean) => Promise<void>;
166
166
  fetchNewPools: () => Promise<string[]>;
167
167
  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>;
168
+ 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
169
  deployGauge: (poolAddress: string) => Promise<ethers.ContractTransactionResponse>;
170
170
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
171
171
  deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
@@ -176,17 +176,17 @@ declare const curve: {
176
176
  fetchRecentlyDeployedPool: (poolAddress: string) => Promise<string>;
177
177
  gaugeImplementation: () => string;
178
178
  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>;
179
+ 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
180
  deployGauge: (poolAddress: string) => Promise<number>;
181
181
  deployGaugeSidechain: (poolAddress: string, salt: string) => Promise<number>;
182
182
  deployGaugeMirror: (chainId: number, salt: string) => Promise<number>;
183
183
  };
184
184
  };
185
185
  estimateGas: {
186
- ensureAllowance: (coins: string[], amounts: (string | number)[], spender: string, isMax?: boolean) => Promise<number | number[]>;
186
+ ensureAllowance: (coins: string[], amounts: (number | string)[], spender: string, isMax?: boolean) => Promise<number | number[]>;
187
187
  };
188
188
  boosting: {
189
- getCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces.js").IDict<string>>;
189
+ getCrv: (...addresses: string[] | string[][]) => Promise<import("./interfaces.js").IDict<string> | string>;
190
190
  getLockedAmountAndUnlockTime: (...addresses: string[] | string[][]) => Promise<import("./interfaces.js").IDict<{
191
191
  lockedAmount: string;
192
192
  unlockTime: number;
@@ -194,13 +194,13 @@ declare const curve: {
194
194
  lockedAmount: string;
195
195
  unlockTime: number;
196
196
  }>;
197
- getVeCrv: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces.js").IDict<string>>;
198
- getVeCrvPct: (...addresses: string[] | string[][]) => Promise<string | import("./interfaces.js").IDict<string>>;
197
+ getVeCrv: (...addresses: string[] | string[][]) => Promise<import("./interfaces.js").IDict<string> | string>;
198
+ getVeCrvPct: (...addresses: string[] | string[][]) => Promise<import("./interfaces.js").IDict<string> | string>;
199
199
  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>;
200
+ isApproved: (amount: number | string) => Promise<boolean>;
201
+ approve: (amount: number | string) => Promise<string[]>;
202
+ createLock: (amount: number | string, days: number) => Promise<string>;
203
+ increaseAmount: (amount: number | string) => Promise<string>;
204
204
  increaseUnlockTime: (days: number) => Promise<string>;
205
205
  withdrawLockedCrv: () => Promise<string>;
206
206
  claimableFees: (address?: string) => Promise<string>;
@@ -208,9 +208,9 @@ declare const curve: {
208
208
  claimableFeesCrvUSD: (address?: string) => Promise<string>;
209
209
  claimFeesCrvUSD: (address?: string) => Promise<string>;
210
210
  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>;
211
+ approve: (amount: number | string) => Promise<number | number[]>;
212
+ createLock: (amount: number | string, days: number) => Promise<number>;
213
+ increaseAmount: (amount: number | string) => Promise<number>;
214
214
  increaseUnlockTime: (days: number) => Promise<number>;
215
215
  withdrawLockedCrv: () => Promise<number>;
216
216
  claimFees: (address?: string) => Promise<number>;
@@ -219,42 +219,42 @@ declare const curve: {
219
219
  sidechain: {
220
220
  lastEthBlock: () => Promise<number>;
221
221
  getAnycallBalance: () => Promise<string>;
222
- topUpAnycall: (amount?: string | number) => Promise<string>;
223
- lastBlockSent: (chainId: number) => Promise<number>;
222
+ topUpAnycall: (amount?: number | string) => Promise<string>;
223
+ lastBlockSent: (chainId: import("./interfaces.js").IChainId) => Promise<number>;
224
224
  blockToSend: () => Promise<number>;
225
- sendBlockhash: (block: number, chainId: number) => Promise<string>;
225
+ sendBlockhash: (block: number, chainId: import("./interfaces.js").IChainId) => Promise<string>;
226
226
  submitProof: (block: number, address?: string) => Promise<string>;
227
227
  estimateGas: {
228
- topUpAnycall: (amount?: string | number) => Promise<number>;
229
- sendBlockhash: (block: number, chainId: number) => Promise<number>;
228
+ topUpAnycall: (amount?: number | string) => Promise<number>;
229
+ sendBlockhash: (block: number, chainId: import("./interfaces.js").IChainId) => Promise<number>;
230
230
  submitProof: (block: number, address?: string) => Promise<number>;
231
231
  };
232
232
  };
233
233
  };
234
234
  router: {
235
- getBestRouteAndOutput: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<{
235
+ getBestRouteAndOutput: (inputCoin: string, outputCoin: string, amount: number | string) => Promise<{
236
236
  route: import("./interfaces.js").IRoute;
237
237
  output: string;
238
238
  }>;
239
239
  getArgs: (route: import("./interfaces.js").IRoute) => {
240
240
  _route: string[];
241
241
  _swapParams: number[][];
242
- _pools?: string[] | undefined;
243
- _basePools?: string[] | undefined;
244
- _baseTokens?: string[] | undefined;
245
- _secondBasePools?: string[] | undefined;
246
- _secondBaseTokens?: string[] | undefined;
242
+ _pools?: string[];
243
+ _basePools?: string[];
244
+ _baseTokens?: string[];
245
+ _secondBasePools?: string[];
246
+ _secondBaseTokens?: string[];
247
247
  };
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>;
248
+ expected: (inputCoin: string, outputCoin: string, amount: number | string) => Promise<string>;
249
+ required: (inputCoin: string, outputCoin: string, outAmount: number | string) => Promise<string>;
250
+ priceImpact: (inputCoin: string, outputCoin: string, amount: number | string) => Promise<number>;
251
+ isApproved: (inputCoin: string, amount: number | string) => Promise<boolean>;
252
+ approve: (inputCoin: string, amount: number | string) => Promise<string[]>;
253
+ swap: (inputCoin: string, outputCoin: string, amount: number | string, slippage?: number) => Promise<ethers.ContractTransactionResponse>;
254
254
  getSwappedAmount: (tx: ethers.ContractTransactionResponse, outputCoin: string) => Promise<string>;
255
255
  estimateGas: {
256
- approve: (inputCoin: string, amount: string | number) => Promise<number | number[]>;
257
- swap: (inputCoin: string, outputCoin: string, amount: string | number) => Promise<number | number[]>;
256
+ approve: (inputCoin: string, amount: number | string) => Promise<number | number[]>;
257
+ swap: (inputCoin: string, outputCoin: string, amount: number | string) => Promise<number | number[]>;
258
258
  };
259
259
  };
260
260
  dao: {
@@ -272,13 +272,13 @@ declare const curve: {
272
272
  lockedCrv: string;
273
273
  unlockTime: number;
274
274
  }>;
275
- crvLockIsApproved: (amount: string | number) => Promise<boolean>;
276
- calcCrvUnlockTime: (days: string | number, start?: string | number) => number;
275
+ crvLockIsApproved: (amount: number | string) => Promise<boolean>;
276
+ calcCrvUnlockTime: (days: number | string, start?: number | string) => number;
277
277
  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>;
278
+ crvLockApprove: (amount: number | string) => Promise<string[]>;
279
+ createCrvLock: (amount: number | string, days: number | string) => Promise<string>;
280
+ increaseCrvLockedAmount: (amount: number | string) => Promise<string>;
281
+ increaseCrvUnlockTime: (days: number | string) => Promise<string>;
282
282
  withdrawLockedCrv: () => Promise<string>;
283
283
  claimFees: (address?: string) => Promise<string>;
284
284
  getVotingGaugeList: () => Promise<import("./interfaces.js").IVotingGauge[]>;
@@ -288,7 +288,7 @@ declare const curve: {
288
288
  veCrvUsed: string;
289
289
  }>;
290
290
  voteForGaugeNextTime: (gauge: string) => Promise<number>;
291
- voteForGauge: (gauge: string, power: string | number) => Promise<string>;
291
+ voteForGauge: (gauge: string, power: number | string) => Promise<string>;
292
292
  getProposalList: () => Promise<import("./interfaces.js").IDaoProposalListItem[]>;
293
293
  getProposal: (type: "PARAMETER" | "OWNERSHIP", id: number) => Promise<import("./interfaces.js").IDaoProposal>;
294
294
  userProposalVotes: (address?: string) => Promise<import("./interfaces.js").IDaoProposalUserListItem[]>;
@@ -296,13 +296,13 @@ declare const curve: {
296
296
  executeVote: (type: import("./interfaces.js").TVoteType, id: number) => Promise<string>;
297
297
  isCanVoteExecute: (type: import("./interfaces.js").TVoteType, id: number) => Promise<boolean>;
298
298
  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[]>;
299
+ crvLockApprove: (amount: number | string) => Promise<number | number[]>;
300
+ createCrvLock: (amount: number | string, days: number | string) => Promise<number | number[]>;
301
+ increaseCrvLockedAmount: (amount: number | string) => Promise<number | number[]>;
302
+ increaseCrvUnlockTime: (days: number | string) => Promise<number | number[]>;
303
303
  withdrawLockedCrv: () => Promise<number | number[]>;
304
304
  claimFees: (address?: string) => Promise<number | number[]>;
305
- voteForGauge: (gauge: string, power: string | number) => Promise<number | number[]>;
305
+ voteForGauge: (gauge: string, power: number | string) => Promise<number | number[]>;
306
306
  voteForProposal: (type: import("./interfaces.js").TVoteType, id: number, support: boolean) => Promise<number | number[]>;
307
307
  executeVote: (type: import("./interfaces.js").TVoteType, id: number) => Promise<number | number[]>;
308
308
  };
package/lib/index.js CHANGED
@@ -15,8 +15,8 @@ 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;
@@ -149,7 +149,7 @@ const curve = {
149
149
  fetchRecentlyDeployedPool: _curve.fetchRecentlyDeployedTwocryptoFactoryPool,
150
150
  gaugeImplementation: () => _curve.getGaugeImplementation("factory-twocrypto"),
151
151
  estimateGas: {
152
- deployPool: deployTwocryptoPoolEstimateGas,
152
+ deployPool: deployTwocryptoPoolEstimateGas, //
153
153
  deployGauge: (poolAddress) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeEstimateGas(poolAddress, _curve.constants.ALIASES.twocrypto_factory); }),
154
154
  deployGaugeSidechain: (poolAddress, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeSidechainEstimateGas(poolAddress, salt); }),
155
155
  deployGaugeMirror: (chainId, salt) => __awaiter(void 0, void 0, void 0, function* () { return deployGaugeMirrorEstimateGas(chainId, salt); }),