@curvefi/api 1.16.1 → 1.18.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.
- package/README.md +98 -0
- package/lib/constants/abis/abis-ethereum.js +6 -6
- package/lib/constants/abis/json/deposit_and_stake.json +51 -0
- package/lib/constants/abis/json/factory-v2/DepositZapMetaBtcPolygon.json +197 -0
- package/lib/constants/abis/json/factory-v2/DepositZapMetaUsdPolygon.json +197 -0
- package/lib/constants/abis/json/factory-v2/MetaBTC.json +919 -0
- package/lib/constants/abis/json/factory-v2/MetaBTCBalances.json +932 -0
- package/lib/constants/abis/json/factory-v2/MetaBTCBalancesRen.json +932 -0
- package/lib/constants/abis/json/factory-v2/MetaBTCRen.json +919 -0
- package/lib/constants/abis/json/factory-v2/MetaUSD.json +919 -0
- package/lib/constants/abis/json/factory-v2/MetaUSDBalances.json +932 -0
- package/lib/constants/abis/json/factory-v2/Plain2Balances.json +845 -0
- package/lib/constants/abis/json/factory-v2/Plain2Basic.json +845 -0
- package/lib/constants/abis/json/factory-v2/Plain2ETH.json +845 -0
- package/lib/constants/abis/json/factory-v2/Plain2Optimized.json +844 -0
- package/lib/constants/abis/json/factory-v2/Plain3Balances.json +845 -0
- package/lib/constants/abis/json/factory-v2/Plain3Basic.json +845 -0
- package/lib/constants/abis/json/factory-v2/Plain3ETH.json +845 -0
- package/lib/constants/abis/json/factory-v2/Plain3Optimized.json +845 -0
- package/lib/constants/abis/json/factory-v2/Plain4Balances.json +845 -0
- package/lib/constants/abis/json/factory-v2/Plain4Basic.json +845 -0
- package/lib/constants/abis/json/factory-v2/Plain4ETH.json +845 -0
- package/lib/constants/abis/json/factory-v2/Plain4Optimized.json +845 -0
- package/lib/constants/abis/json/factory.json +1063 -0
- package/lib/constants/aliases.d.ts +4 -0
- package/lib/constants/aliases.js +4 -0
- package/lib/constants/coins-polygon.js +3 -2
- package/lib/curve.d.ts +4 -0
- package/lib/curve.js +44 -0
- package/lib/factory.d.ts +32 -0
- package/lib/factory.js +607 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +15 -0
- package/lib/interfaces.d.ts +15 -1
- package/lib/pools.d.ts +22 -0
- package/lib/pools.js +462 -69
- package/lib/utils.d.ts +8 -1
- package/lib/utils.js +121 -8
- package/package.json +4 -2
package/lib/interfaces.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export interface DictInterface<T> {
|
|
|
2
2
|
[index: string]: T;
|
|
3
3
|
}
|
|
4
4
|
export interface PoolDataInterface {
|
|
5
|
-
reference_asset: 'USD' | 'EUR' | 'BTC' | 'ETH' | 'LINK' | 'CRYPTO';
|
|
5
|
+
reference_asset: 'USD' | 'EUR' | 'BTC' | 'ETH' | 'LINK' | 'CRYPTO' | 'OTHER';
|
|
6
6
|
N_COINS: number;
|
|
7
7
|
underlying_decimals: number[];
|
|
8
8
|
decimals: number[];
|
|
@@ -38,6 +38,8 @@ export interface PoolDataInterface {
|
|
|
38
38
|
meta_coin_addresses?: string[];
|
|
39
39
|
all_coin_addresses?: string[];
|
|
40
40
|
is_factory?: boolean;
|
|
41
|
+
is_plain_factory?: boolean;
|
|
42
|
+
is_meta_factory?: boolean;
|
|
41
43
|
adapter_abi?: any;
|
|
42
44
|
old_adapter_address?: string;
|
|
43
45
|
adapter_biconomy_address?: string;
|
|
@@ -57,3 +59,15 @@ export interface RewardsApyInterface {
|
|
|
57
59
|
symbol: string;
|
|
58
60
|
apy: string;
|
|
59
61
|
}
|
|
62
|
+
export interface IPoolStats {
|
|
63
|
+
volume: number;
|
|
64
|
+
apy: {
|
|
65
|
+
day: number;
|
|
66
|
+
week: number;
|
|
67
|
+
month: number;
|
|
68
|
+
total: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export interface IStats {
|
|
72
|
+
[index: string]: IPoolStats;
|
|
73
|
+
}
|
package/lib/pools.d.ts
CHANGED
|
@@ -21,12 +21,18 @@ export declare class Pool {
|
|
|
21
21
|
isCrypto: boolean;
|
|
22
22
|
basePool: string;
|
|
23
23
|
isFactory: boolean;
|
|
24
|
+
isMetaFactory: boolean;
|
|
25
|
+
isPlainFactory: boolean;
|
|
24
26
|
rewardTokens: string[];
|
|
25
27
|
estimateGas: {
|
|
26
28
|
addLiquidityApprove: (amounts: string[]) => Promise<number>;
|
|
27
29
|
addLiquidity: (amounts: string[]) => Promise<number>;
|
|
30
|
+
depositAndStakeApprove: (amounts: string[]) => Promise<number>;
|
|
31
|
+
depositAndStake: (amounts: string[]) => Promise<number>;
|
|
28
32
|
addLiquidityWrappedApprove: (amounts: string[]) => Promise<number>;
|
|
29
33
|
addLiquidityWrapped: (amounts: string[]) => Promise<number>;
|
|
34
|
+
depositAndStakeWrappedApprove: (amounts: string[]) => Promise<number>;
|
|
35
|
+
depositAndStakeWrapped: (amounts: string[]) => Promise<number>;
|
|
30
36
|
gaugeDepositApprove: (lpTokenAmount: string) => Promise<number>;
|
|
31
37
|
gaugeDeposit: (lpTokenAmount: string) => Promise<number>;
|
|
32
38
|
gaugeWithdraw: (lpTokenAmount: string) => Promise<number>;
|
|
@@ -72,6 +78,7 @@ export declare class Pool {
|
|
|
72
78
|
private getPoolBalances;
|
|
73
79
|
private getPoolWrappedBalances;
|
|
74
80
|
private getTotalLiquidity;
|
|
81
|
+
private _getPoolStats;
|
|
75
82
|
private getVolume;
|
|
76
83
|
private getBaseApy;
|
|
77
84
|
private getTokenApy;
|
|
@@ -84,6 +91,14 @@ export declare class Pool {
|
|
|
84
91
|
private addLiquidityEstimateGas;
|
|
85
92
|
balancedAmounts: () => Promise<string[]>;
|
|
86
93
|
addLiquidity: (amounts: string[]) => Promise<string>;
|
|
94
|
+
depositAndStakeExpected: (amounts: string[]) => Promise<string>;
|
|
95
|
+
depositAndStakeSlippage: (amounts: string[]) => Promise<string>;
|
|
96
|
+
depositAndStakeIsApproved: (amounts: string[]) => Promise<boolean>;
|
|
97
|
+
private depositAndStakeApproveEstimateGas;
|
|
98
|
+
depositAndStakeApprove: (amounts: string[]) => Promise<string[]>;
|
|
99
|
+
private depositAndStakeEstimateGas;
|
|
100
|
+
depositAndStake: (amounts: string[]) => Promise<string>;
|
|
101
|
+
private _depositAndStake;
|
|
87
102
|
balancedWrappedAmounts: () => Promise<string[]>;
|
|
88
103
|
addLiquidityWrappedExpected: (amounts: string[]) => Promise<string>;
|
|
89
104
|
addLiquidityWrappedSlippage: (amounts: string[]) => Promise<string>;
|
|
@@ -92,6 +107,13 @@ export declare class Pool {
|
|
|
92
107
|
addLiquidityWrappedApprove: (amounts: string[]) => Promise<string[]>;
|
|
93
108
|
private addLiquidityWrappedEstimateGas;
|
|
94
109
|
addLiquidityWrapped: (amounts: string[]) => Promise<string>;
|
|
110
|
+
depositAndStakeWrappedExpected: (amounts: string[]) => Promise<string>;
|
|
111
|
+
depositAndStakeWrappedSlippage: (amounts: string[]) => Promise<string>;
|
|
112
|
+
depositAndStakeWrappedIsApproved: (amounts: string[]) => Promise<boolean>;
|
|
113
|
+
private depositAndStakeWrappedApproveEstimateGas;
|
|
114
|
+
depositAndStakeWrappedApprove: (amounts: string[]) => Promise<string[]>;
|
|
115
|
+
private depositAndStakeWrappedEstimateGas;
|
|
116
|
+
depositAndStakeWrapped: (amounts: string[]) => Promise<string>;
|
|
95
117
|
removeLiquidityExpected: (lpTokenAmount: string) => Promise<string[]>;
|
|
96
118
|
removeLiquidityIsApproved: (lpTokenAmount: string) => Promise<boolean>;
|
|
97
119
|
private removeLiquidityApproveEstimateGas;
|