@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.
- package/lib/boosting.d.ts +33 -32
- package/lib/boosting.js +320 -252
- package/lib/cached.d.ts +4 -3
- package/lib/cached.js +63 -19
- package/lib/constants/utils.d.ts +14 -1
- package/lib/constants/utils.js +21 -6
- package/lib/curve.d.ts +5 -5
- package/lib/curve.js +21 -38
- package/lib/dao.d.ts +32 -31
- package/lib/dao.js +420 -350
- package/lib/external-api.d.ts +1 -1
- package/lib/external-api.js +2 -2
- package/lib/factory/common.d.ts +2 -1
- package/lib/factory/common.js +1 -1
- package/lib/factory/deploy.d.ts +46 -45
- package/lib/factory/deploy.js +630 -551
- package/lib/factory/factory-api.d.ts +3 -2
- package/lib/factory/factory-api.js +22 -23
- package/lib/factory/factory-crypto.d.ts +1 -1
- package/lib/factory/factory-crypto.js +12 -15
- package/lib/factory/factory-tricrypto.d.ts +1 -1
- package/lib/factory/factory-tricrypto.js +14 -15
- package/lib/factory/factory-twocrypto.d.ts +1 -1
- package/lib/factory/factory-twocrypto.js +12 -13
- package/lib/factory/factory.d.ts +4 -3
- package/lib/factory/factory.js +21 -24
- package/lib/index.d.ts +413 -104
- package/lib/index.js +253 -257
- package/lib/interfaces.d.ts +2 -0
- package/lib/pools/PoolTemplate.d.ts +13 -12
- package/lib/pools/PoolTemplate.js +279 -285
- package/lib/pools/mixins/common.js +2 -2
- package/lib/pools/mixins/depositBalancedAmountsMixins.d.ts +12 -4
- package/lib/pools/mixins/depositBalancedAmountsMixins.js +1 -15
- package/lib/pools/mixins/depositMixins.d.ts +25 -5
- package/lib/pools/mixins/depositMixins.js +38 -76
- package/lib/pools/mixins/depositWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/depositWrappedMixins.js +17 -33
- package/lib/pools/mixins/poolBalancesMixin.d.ts +6 -2
- package/lib/pools/mixins/poolBalancesMixin.js +3 -5
- package/lib/pools/mixins/swapMixins.d.ts +20 -4
- package/lib/pools/mixins/swapMixins.js +36 -70
- package/lib/pools/mixins/swapWrappedMixins.d.ts +19 -4
- package/lib/pools/mixins/swapWrappedMixins.js +32 -60
- package/lib/pools/mixins/withdrawExpectedMixins.d.ts +12 -4
- package/lib/pools/mixins/withdrawExpectedMixins.js +6 -11
- package/lib/pools/mixins/withdrawImbalanceMixins.d.ts +20 -4
- package/lib/pools/mixins/withdrawImbalanceMixins.js +26 -53
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +12 -27
- package/lib/pools/mixins/withdrawMixins.d.ts +25 -5
- package/lib/pools/mixins/withdrawMixins.js +33 -67
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.d.ts +12 -4
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +8 -13
- package/lib/pools/mixins/withdrawOneCoinMixins.d.ts +25 -5
- package/lib/pools/mixins/withdrawOneCoinMixins.js +32 -66
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.d.ts +6 -2
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +4 -7
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +13 -29
- package/lib/pools/mixins/withdrawWrappedMixins.d.ts +10 -2
- package/lib/pools/mixins/withdrawWrappedMixins.js +14 -28
- package/lib/pools/poolConstructor.d.ts +2 -1
- package/lib/pools/poolConstructor.js +27 -28
- package/lib/pools/subClasses/corePool.d.ts +4 -1
- package/lib/pools/subClasses/corePool.js +5 -7
- package/lib/pools/subClasses/gaugePool.d.ts +5 -3
- package/lib/pools/subClasses/gaugePool.js +19 -18
- package/lib/pools/subClasses/statsPool.d.ts +2 -0
- package/lib/pools/subClasses/statsPool.js +22 -10
- package/lib/pools/subClasses/walletPool.d.ts +2 -1
- package/lib/pools/subClasses/walletPool.js +6 -6
- package/lib/pools/utils.d.ts +7 -6
- package/lib/pools/utils.js +316 -297
- package/lib/route-graph.worker.d.ts +2 -2
- package/lib/route-graph.worker.js +4 -6
- package/lib/router.d.ts +12 -11
- package/lib/router.js +331 -295
- package/lib/utils.d.ts +34 -33
- package/lib/utils.js +481 -435
- package/package.json +1 -1
package/lib/external-api.d.ts
CHANGED
|
@@ -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
|
|
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>>;
|
package/lib/external-api.js
CHANGED
|
@@ -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 = (
|
|
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 = (
|
|
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];
|
package/lib/factory/common.d.ts
CHANGED
|
@@ -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;
|
package/lib/factory/common.js
CHANGED
package/lib/factory/deploy.d.ts
CHANGED
|
@@ -1,70 +1,71 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
|
-
|
|
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)
|
|
6
|
-
export declare
|
|
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)
|
|
10
|
-
export declare
|
|
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[])
|
|
14
|
-
export declare
|
|
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[])
|
|
18
|
-
export declare
|
|
19
|
-
export declare
|
|
20
|
-
export declare
|
|
21
|
-
export declare
|
|
22
|
-
export declare
|
|
23
|
-
implementationIdx: 0 | 1)
|
|
24
|
-
export declare
|
|
25
|
-
implementationIdx: 0 | 1)
|
|
26
|
-
export declare
|
|
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)
|
|
30
|
-
export declare
|
|
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)
|
|
34
|
-
export declare
|
|
35
|
-
export declare
|
|
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)
|
|
39
|
-
export declare
|
|
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)
|
|
43
|
-
export declare
|
|
44
|
-
export declare
|
|
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)
|
|
48
|
-
export declare
|
|
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)
|
|
52
|
-
export declare
|
|
53
|
-
export declare
|
|
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)[])
|
|
57
|
-
export declare
|
|
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)[])
|
|
61
|
-
export declare
|
|
62
|
-
export declare
|
|
63
|
-
export declare
|
|
64
|
-
export declare
|
|
65
|
-
export declare
|
|
66
|
-
export declare
|
|
67
|
-
export declare
|
|
68
|
-
export declare
|
|
69
|
-
export declare
|
|
70
|
-
export declare
|
|
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>;
|