@curvefi/api 2.66.29 → 2.66.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/lib/boosting.d.ts +33 -32
  2. package/lib/boosting.js +320 -252
  3. package/lib/cached.d.ts +4 -3
  4. package/lib/cached.js +63 -19
  5. package/lib/constants/utils.d.ts +14 -1
  6. package/lib/constants/utils.js +21 -6
  7. package/lib/curve.d.ts +5 -5
  8. package/lib/curve.js +21 -38
  9. package/lib/dao.d.ts +32 -31
  10. package/lib/dao.js +420 -350
  11. package/lib/external-api.d.ts +1 -1
  12. package/lib/external-api.js +2 -2
  13. package/lib/factory/common.d.ts +2 -1
  14. package/lib/factory/common.js +1 -1
  15. package/lib/factory/deploy.d.ts +46 -45
  16. package/lib/factory/deploy.js +630 -551
  17. package/lib/factory/factory-api.d.ts +3 -2
  18. package/lib/factory/factory-api.js +22 -23
  19. package/lib/factory/factory-crypto.d.ts +1 -1
  20. package/lib/factory/factory-crypto.js +12 -15
  21. package/lib/factory/factory-tricrypto.d.ts +1 -1
  22. package/lib/factory/factory-tricrypto.js +14 -15
  23. package/lib/factory/factory-twocrypto.d.ts +1 -1
  24. package/lib/factory/factory-twocrypto.js +12 -13
  25. package/lib/factory/factory.d.ts +4 -3
  26. package/lib/factory/factory.js +21 -24
  27. package/lib/index.d.ts +413 -104
  28. package/lib/index.js +253 -257
  29. package/lib/interfaces.d.ts +2 -0
  30. package/lib/pools/PoolTemplate.d.ts +13 -12
  31. package/lib/pools/PoolTemplate.js +279 -285
  32. package/lib/pools/mixins/common.js +2 -2
  33. package/lib/pools/mixins/depositBalancedAmountsMixins.d.ts +12 -4
  34. package/lib/pools/mixins/depositBalancedAmountsMixins.js +1 -15
  35. package/lib/pools/mixins/depositMixins.d.ts +25 -5
  36. package/lib/pools/mixins/depositMixins.js +38 -76
  37. package/lib/pools/mixins/depositWrappedMixins.d.ts +10 -2
  38. package/lib/pools/mixins/depositWrappedMixins.js +17 -33
  39. package/lib/pools/mixins/poolBalancesMixin.d.ts +6 -2
  40. package/lib/pools/mixins/poolBalancesMixin.js +3 -5
  41. package/lib/pools/mixins/swapMixins.d.ts +20 -4
  42. package/lib/pools/mixins/swapMixins.js +36 -70
  43. package/lib/pools/mixins/swapWrappedMixins.d.ts +19 -4
  44. package/lib/pools/mixins/swapWrappedMixins.js +32 -60
  45. package/lib/pools/mixins/withdrawExpectedMixins.d.ts +12 -4
  46. package/lib/pools/mixins/withdrawExpectedMixins.js +6 -11
  47. package/lib/pools/mixins/withdrawImbalanceMixins.d.ts +20 -4
  48. package/lib/pools/mixins/withdrawImbalanceMixins.js +26 -53
  49. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.d.ts +10 -2
  50. package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +12 -27
  51. package/lib/pools/mixins/withdrawMixins.d.ts +25 -5
  52. package/lib/pools/mixins/withdrawMixins.js +33 -67
  53. package/lib/pools/mixins/withdrawOneCoinExpectedMixins.d.ts +12 -4
  54. package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +8 -13
  55. package/lib/pools/mixins/withdrawOneCoinMixins.d.ts +25 -5
  56. package/lib/pools/mixins/withdrawOneCoinMixins.js +32 -66
  57. package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.d.ts +6 -2
  58. package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +4 -7
  59. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.d.ts +10 -2
  60. package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +13 -29
  61. package/lib/pools/mixins/withdrawWrappedMixins.d.ts +10 -2
  62. package/lib/pools/mixins/withdrawWrappedMixins.js +14 -28
  63. package/lib/pools/poolConstructor.d.ts +2 -1
  64. package/lib/pools/poolConstructor.js +27 -28
  65. package/lib/pools/subClasses/corePool.d.ts +4 -1
  66. package/lib/pools/subClasses/corePool.js +5 -7
  67. package/lib/pools/subClasses/gaugePool.d.ts +5 -3
  68. package/lib/pools/subClasses/gaugePool.js +19 -18
  69. package/lib/pools/subClasses/statsPool.d.ts +2 -0
  70. package/lib/pools/subClasses/statsPool.js +22 -10
  71. package/lib/pools/subClasses/walletPool.d.ts +2 -1
  72. package/lib/pools/subClasses/walletPool.js +6 -6
  73. package/lib/pools/utils.d.ts +7 -6
  74. package/lib/pools/utils.js +316 -297
  75. package/lib/route-graph.worker.d.ts +2 -2
  76. package/lib/route-graph.worker.js +4 -6
  77. package/lib/router.d.ts +12 -11
  78. package/lib/router.js +331 -295
  79. package/lib/utils.d.ts +34 -33
  80. package/lib/utils.js +481 -435
  81. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import memoize from "memoizee";
2
2
  import { ICurveLiteNetwork, IDaoProposal, IDaoProposalListItem, IDict, IExtendedPoolDataFromApi, IGaugesDataFromApi, INetworkName, IPoolType, IVolumeAndAPYs } from "./interfaces";
3
- export declare const uncached_getAllPoolsFromApi: (network: INetworkName, isLiteChain?: boolean) => Promise<Record<IPoolType, IExtendedPoolDataFromApi>>;
3
+ export declare const uncached_getAllPoolsFromApi: (network: INetworkName, isLiteChain: boolean) => Promise<Record<IPoolType, IExtendedPoolDataFromApi>>;
4
4
  export declare const createUsdPricesDict: (allTypesExtendedPoolData: IExtendedPoolDataFromApi[]) => IDict<number>;
5
5
  export declare const createCrvApyDict: (allTypesExtendedPoolData: IExtendedPoolDataFromApi[]) => IDict<[number, number]>;
6
6
  export declare const _getSubgraphData: ((network: INetworkName) => Promise<IVolumeAndAPYs>) & memoize.Memoized<(network: INetworkName) => Promise<IVolumeAndAPYs>>;
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import memoize from "memoizee";
11
- const uncached_getPoolsFromApi = (network_1, poolType_1, ...args_1) => __awaiter(void 0, [network_1, poolType_1, ...args_1], void 0, function* (network, poolType, isLiteChain = false) {
11
+ const uncached_getPoolsFromApi = (network, poolType, isLiteChain) => __awaiter(void 0, void 0, void 0, function* () {
12
12
  var _a;
13
13
  const api = isLiteChain ? "https://api-core.curve.finance/v1/" : "https://api.curve.finance/api";
14
14
  const url = `${api}/getPools/${network}/${poolType}`;
@@ -16,7 +16,7 @@ const uncached_getPoolsFromApi = (network_1, poolType_1, ...args_1) => __awaiter
16
16
  });
17
17
  const getPoolTypes = (isLiteChain) => isLiteChain ? ["factory-twocrypto", "factory-tricrypto", "factory-stable-ng"] :
18
18
  ["main", "crypto", "factory", "factory-crvusd", "factory-eywa", "factory-crypto", "factory-twocrypto", "factory-tricrypto", "factory-stable-ng"];
19
- export const uncached_getAllPoolsFromApi = (network_1, ...args_1) => __awaiter(void 0, [network_1, ...args_1], void 0, function* (network, isLiteChain = false) {
19
+ export const uncached_getAllPoolsFromApi = (network, isLiteChain) => __awaiter(void 0, void 0, void 0, function* () {
20
20
  return Object.fromEntries(yield Promise.all(getPoolTypes(isLiteChain).map((poolType) => __awaiter(void 0, void 0, void 0, function* () {
21
21
  const data = yield uncached_getPoolsFromApi(network, poolType, isLiteChain);
22
22
  return [poolType, data];
@@ -1,3 +1,4 @@
1
1
  import { ICurve, IPoolDataShort } from "../interfaces";
2
+ import { Curve } from "../curve";
2
3
  export declare function setFactoryZapContracts(this: ICurve, isCrypto: boolean): void;
3
- export declare function getPoolIdByAddress(poolList: IPoolDataShort[], address: string): string;
4
+ export declare function getPoolIdByAddress(this: Curve, poolList: IPoolDataShort[], address: string): string;
@@ -17,6 +17,6 @@ export function getPoolIdByAddress(poolList, address) {
17
17
  return pool.id;
18
18
  }
19
19
  else {
20
- return getPoolIdBySwapAddress(address.toLowerCase());
20
+ return getPoolIdBySwapAddress.call(this, address.toLowerCase());
21
21
  }
22
22
  }
@@ -1,70 +1,71 @@
1
1
  import { ethers } from "ethers";
2
- export declare const deployStablePlainPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, // %
2
+ import { Curve } from "../curve.js";
3
+ export declare function deployStablePlainPoolEstimateGas(this: Curve, name: string, symbol: string, coins: string[], A: number | string, fee: number | string, // %
3
4
  assetType: 0 | 1 | 2 | 3, // 0 = USD, 1 = ETH, 2 = BTC, 3 = Other
4
5
  implementationIdx: 0 | 1 | 2 | 3 | 4 | 5, emaTime?: number, // seconds
5
- oracleAddress?: string, methodName?: string) => Promise<number>;
6
- export declare const deployStablePlainPool: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, // %
6
+ oracleAddress?: string, methodName?: string): Promise<number>;
7
+ export declare function deployStablePlainPool(this: Curve, name: string, symbol: string, coins: string[], A: number | string, fee: number | string, // %
7
8
  assetType: 0 | 1 | 2 | 3, // 0 = USD, 1 = ETH, 2 = BTC, 3 = Other
8
9
  implementationIdx: 0 | 1 | 2 | 3 | 4 | 5, emaTime?: number, // seconds
9
- oracleAddress?: string, methodName?: string) => Promise<ethers.ContractTransactionResponse>;
10
- export declare const deployStableNgPlainPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, // %
10
+ oracleAddress?: string, methodName?: string): Promise<ethers.ContractTransactionResponse>;
11
+ export declare function deployStableNgPlainPoolEstimateGas(this: Curve, name: string, symbol: string, coins: string[], A: number | string, fee: number | string, // %
11
12
  offpegFeeMultiplier: number | string, assetTypes: Array<0 | 1 | 2 | 3>, // 0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626
12
13
  implementationIdx: 0, emaTime: number, // seconds
13
- oracleAddresses: string[], methodNames: string[]) => Promise<number>;
14
- export declare const deployStableNgPlainPool: (name: string, symbol: string, coins: string[], A: number | string, fee: number | string, // %
14
+ oracleAddresses: string[], methodNames: string[]): Promise<number>;
15
+ export declare function deployStableNgPlainPool(this: Curve, name: string, symbol: string, coins: string[], A: number | string, fee: number | string, // %
15
16
  offpegFeeMultiplier: number | string, assetTypes: Array<0 | 1 | 2 | 3>, // 0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626
16
17
  implementationIdx: 0, emaTime: number, // seconds
17
- oracleAddresses: string[], methodNames: string[]) => Promise<ethers.ContractTransactionResponse>;
18
- export declare const getDeployedStablePlainPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
19
- export declare const _setOracle: (poolAddress: string, oracleAddress: string, methodName: string, estimateGas: boolean) => Promise<ethers.ContractTransactionResponse | number>;
20
- export declare const setOracleEstimateGas: (poolAddress: string, oracleAddress?: string, methodName?: string) => Promise<number>;
21
- export declare const setOracle: (poolAddress: string, oracleAddress?: string, methodName?: string) => Promise<ethers.ContractTransactionResponse>;
22
- export declare const deployStableMetaPoolEstimateGas: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, // %
23
- implementationIdx: 0 | 1) => Promise<number>;
24
- export declare const deployStableMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, // %
25
- implementationIdx: 0 | 1) => Promise<ethers.ContractTransactionResponse>;
26
- export declare const deployStableNgMetaPoolEstimateGas: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, // %
18
+ oracleAddresses: string[], methodNames: string[]): Promise<ethers.ContractTransactionResponse>;
19
+ export declare function getDeployedStablePlainPoolAddress(this: Curve, tx: ethers.ContractTransactionResponse): Promise<string>;
20
+ export declare function _setOracle(this: Curve, poolAddress: string, oracleAddress: string, methodName: string, estimateGas: boolean): Promise<ethers.ContractTransactionResponse | number>;
21
+ export declare function setOracleEstimateGas(this: Curve, poolAddress: string, oracleAddress?: string, methodName?: string): Promise<number>;
22
+ export declare function setOracle(this: Curve, poolAddress: string, oracleAddress?: string, methodName?: string): Promise<ethers.ContractTransactionResponse>;
23
+ export declare function deployStableMetaPoolEstimateGas(this: Curve, basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, // %
24
+ implementationIdx: 0 | 1): Promise<number>;
25
+ export declare function deployStableMetaPool(this: Curve, basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, // %
26
+ implementationIdx: 0 | 1): Promise<ethers.ContractTransactionResponse>;
27
+ export declare function deployStableNgMetaPoolEstimateGas(this: Curve, basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, // %
27
28
  offpegFeeMultiplier: number | string, assetType: 0 | 1 | 2 | 3, // 0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626
28
29
  emaTime: number, // seconds
29
- implementationIdx: 0, methodName: string, oracleAddress: string) => Promise<number>;
30
- export declare const deployStableNgMetaPool: (basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, // %
30
+ implementationIdx: 0, methodName: string, oracleAddress: string): Promise<number>;
31
+ export declare function deployStableNgMetaPool(this: Curve, basePool: string, name: string, symbol: string, coin: string, A: number | string, fee: number | string, // %
31
32
  offpegFeeMultiplier: number | string, emaTime: number, // seconds
32
33
  implementationIdx: 0, assetType: 0 | 1 | 2 | 3, // 0 = Standard, 1 = Oracle, 2 = Rebasing, 3 = ERC4626
33
- methodName: string, oracleAddress: string) => Promise<ethers.ContractTransactionResponse>;
34
- export declare const getDeployedStableMetaPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
35
- export declare const deployCryptoPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
34
+ methodName: string, oracleAddress: string): Promise<ethers.ContractTransactionResponse>;
35
+ export declare function getDeployedStableMetaPoolAddress(this: Curve, tx: ethers.ContractTransactionResponse): Promise<string>;
36
+ export declare function deployCryptoPoolEstimateGas(this: Curve, name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
36
37
  outFee: number | string, // %
37
38
  allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, // Seconds
38
- initialPrice: number | string) => Promise<number>;
39
- export declare const deployCryptoPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
39
+ initialPrice: number | string): Promise<number>;
40
+ export declare function deployCryptoPool(this: Curve, name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
40
41
  outFee: number | string, // %
41
42
  allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, // Seconds
42
- initialPrice: number | string) => Promise<ethers.ContractTransactionResponse>;
43
- export declare const getDeployedCryptoPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
44
- export declare const deployTwocryptoPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
43
+ initialPrice: number | string): Promise<ethers.ContractTransactionResponse>;
44
+ export declare function getDeployedCryptoPoolAddress(this: Curve, tx: ethers.ContractTransactionResponse): Promise<string>;
45
+ export declare function deployTwocryptoPoolEstimateGas(this: Curve, name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
45
46
  outFee: number | string, // %
46
47
  allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, // Seconds
47
- initialPrice: number | string) => Promise<number>;
48
- export declare const deployTwocryptoPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
48
+ initialPrice: number | string): Promise<number>;
49
+ export declare function deployTwocryptoPool(this: Curve, name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
49
50
  outFee: number | string, // %
50
51
  allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, maHalfTime: number, // Seconds
51
- initialPrice: number | string) => Promise<ethers.ContractTransactionResponse>;
52
- export declare const getDeployedTwocryptoPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
53
- export declare const deployTricryptoPoolEstimateGas: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
52
+ initialPrice: number | string): Promise<ethers.ContractTransactionResponse>;
53
+ export declare function getDeployedTwocryptoPoolAddress(this: Curve, tx: ethers.ContractTransactionResponse): Promise<string>;
54
+ export declare function deployTricryptoPoolEstimateGas(this: Curve, name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
54
55
  outFee: number | string, // %
55
56
  allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, emaTime: number, // Seconds
56
- initialPrices: (number | string)[]) => Promise<number>;
57
- export declare const deployTricryptoPool: (name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
57
+ initialPrices: (number | string)[]): Promise<number>;
58
+ export declare function deployTricryptoPool(this: Curve, name: string, symbol: string, coins: string[], A: number | string, gamma: number | string, midFee: number | string, // %
58
59
  outFee: number | string, // %
59
60
  allowedExtraProfit: number | string, feeGamma: number | string, adjustmentStep: number | string, emaTime: number, // Seconds
60
- initialPrices: (number | string)[]) => Promise<ethers.ContractTransactionResponse>;
61
- export declare const getDeployedTricryptoPoolAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
62
- export declare const deployGaugeEstimateGas: (pool: string, factory: string) => Promise<number>;
63
- export declare const deployGauge: (pool: string, factory: string) => Promise<ethers.ContractTransactionResponse>;
64
- export declare const deployGaugeSidechainEstimateGas: (pool: string, salt: string) => Promise<number>;
65
- export declare const deployGaugeSidechain: (pool: string, salt: string) => Promise<ethers.ContractTransactionResponse>;
66
- export declare const deployGaugeMirrorEstimateGas: (chainId: number, salt: string) => Promise<number>;
67
- export declare const deployGaugeMirror: (chainId: number, salt: string) => Promise<ethers.ContractTransactionResponse>;
68
- export declare const getDeployedGaugeAddress: (tx: ethers.ContractTransactionResponse) => Promise<string>;
69
- export declare const getDeployedGaugeMirrorAddressByTx: (tx: ethers.ContractTransactionResponse) => Promise<string>;
70
- export declare const getDeployedGaugeMirrorAddress: (chainId: number) => Promise<string>;
61
+ initialPrices: (number | string)[]): Promise<ethers.ContractTransactionResponse>;
62
+ export declare function getDeployedTricryptoPoolAddress(this: Curve, tx: ethers.ContractTransactionResponse): Promise<string>;
63
+ export declare function deployGaugeEstimateGas(this: Curve, pool: string, factory: string): Promise<number>;
64
+ export declare function deployGauge(this: Curve, pool: string, factory: string): Promise<ethers.ContractTransactionResponse>;
65
+ export declare function deployGaugeSidechainEstimateGas(this: Curve, pool: string, salt: string): Promise<number>;
66
+ export declare function deployGaugeSidechain(this: Curve, pool: string, salt: string): Promise<ethers.ContractTransactionResponse>;
67
+ export declare function deployGaugeMirrorEstimateGas(this: Curve, chainId: number, salt: string): Promise<number>;
68
+ export declare function deployGaugeMirror(this: Curve, chainId: number, salt: string): Promise<ethers.ContractTransactionResponse>;
69
+ export declare function getDeployedGaugeAddress(this: Curve, tx: ethers.ContractTransactionResponse): Promise<string>;
70
+ export declare function getDeployedGaugeMirrorAddressByTx(this: Curve, tx: ethers.ContractTransactionResponse): Promise<string>;
71
+ export declare function getDeployedGaugeMirrorAddress(this: Curve, chainId: number): Promise<string>;