@curvefi/api 2.30.1 → 2.31.1
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.js +137 -402
- package/lib/constants/abis/avaxcrypto/swap.json +1195 -0
- package/lib/constants/abis/avaxcrypto/zap.json +250 -0
- package/lib/constants/aliases.d.ts +11 -11
- package/lib/constants/aliases.js +12 -15
- package/lib/constants/coins/arbitrum.js +6 -9
- package/lib/constants/coins/aurora.js +6 -9
- package/lib/constants/coins/avalanche.js +12 -10
- package/lib/constants/coins/celo.js +6 -9
- package/lib/constants/coins/ethereum.js +10 -13
- package/lib/constants/coins/fantom.js +8 -11
- package/lib/constants/coins/kava.js +6 -9
- package/lib/constants/coins/moonbeam.js +6 -9
- package/lib/constants/coins/optimism.js +6 -9
- package/lib/constants/coins/polygon.js +7 -10
- package/lib/constants/coins/xdai.js +6 -9
- package/lib/constants/pools/arbitrum.d.ts +2 -4
- package/lib/constants/pools/arbitrum.js +22 -28
- package/lib/constants/pools/aurora.d.ts +2 -4
- package/lib/constants/pools/aurora.js +6 -12
- package/lib/constants/pools/avalanche.d.ts +2 -4
- package/lib/constants/pools/avalanche.js +51 -22
- package/lib/constants/pools/celo.d.ts +2 -4
- package/lib/constants/pools/celo.js +2 -5
- package/lib/constants/pools/ethereum.js +247 -253
- package/lib/constants/pools/fantom.d.ts +2 -4
- package/lib/constants/pools/fantom.js +28 -34
- package/lib/constants/pools/index.d.ts +11 -11
- package/lib/constants/pools/index.js +12 -25
- package/lib/constants/pools/kava.d.ts +2 -4
- package/lib/constants/pools/kava.js +2 -5
- package/lib/constants/pools/moonbeam.d.ts +2 -4
- package/lib/constants/pools/moonbeam.js +6 -12
- package/lib/constants/pools/optimism.d.ts +2 -4
- package/lib/constants/pools/optimism.js +9 -15
- package/lib/constants/pools/polygon.d.ts +2 -4
- package/lib/constants/pools/polygon.js +23 -28
- package/lib/constants/pools/xdai.d.ts +2 -4
- package/lib/constants/pools/xdai.js +25 -30
- package/lib/constants/utils.js +20 -29
- package/lib/curve.d.ts +9 -7
- package/lib/curve.js +397 -615
- package/lib/external-api.d.ts +1 -1
- package/lib/external-api.js +47 -140
- package/lib/factory/common.js +6 -10
- package/lib/factory/constants-crypto.js +48 -54
- package/lib/factory/constants.js +274 -280
- package/lib/factory/deploy.d.ts +8 -8
- package/lib/factory/deploy.js +177 -347
- package/lib/factory/factory-api.js +195 -278
- package/lib/factory/factory-crypto.js +170 -323
- package/lib/factory/factory.js +195 -350
- package/lib/index.d.ts +24 -25
- package/lib/index.js +87 -143
- package/lib/interfaces.d.ts +6 -5
- package/lib/interfaces.js +1 -2
- package/lib/pools/PoolTemplate.d.ts +1 -0
- package/lib/pools/PoolTemplate.js +1516 -2928
- package/lib/pools/index.d.ts +2 -2
- package/lib/pools/index.js +3 -7
- package/lib/pools/mixins/common.d.ts +3 -4
- package/lib/pools/mixins/common.js +23 -102
- package/lib/pools/mixins/depositBalancedAmountsMixins.d.ts +1 -1
- package/lib/pools/mixins/depositBalancedAmountsMixins.js +50 -139
- package/lib/pools/mixins/depositMixins.d.ts +1 -1
- package/lib/pools/mixins/depositMixins.js +145 -405
- package/lib/pools/mixins/depositWrappedMixins.d.ts +1 -1
- package/lib/pools/mixins/depositWrappedMixins.js +72 -227
- package/lib/pools/mixins/poolBalancesMixin.d.ts +1 -2
- package/lib/pools/mixins/poolBalancesMixin.js +25 -131
- package/lib/pools/mixins/swapMixins.d.ts +1 -1
- package/lib/pools/mixins/swapMixins.js +127 -353
- package/lib/pools/mixins/swapWrappedMixins.d.ts +1 -1
- package/lib/pools/mixins/swapWrappedMixins.js +90 -276
- package/lib/pools/mixins/withdrawExpectedMixins.d.ts +1 -2
- package/lib/pools/mixins/withdrawExpectedMixins.js +26 -154
- package/lib/pools/mixins/withdrawImbalanceMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawImbalanceMixins.js +99 -321
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +53 -192
- package/lib/pools/mixins/withdrawMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawMixins.js +124 -378
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +17 -92
- package/lib/pools/mixins/withdrawOneCoinMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawOneCoinMixins.js +125 -378
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +9 -66
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +55 -190
- package/lib/pools/mixins/withdrawWrappedMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawWrappedMixins.js +52 -191
- package/lib/pools/poolConstructor.d.ts +1 -1
- package/lib/pools/poolConstructor.js +79 -109
- package/lib/pools/utils.js +298 -500
- package/lib/router.d.ts +2 -2
- package/lib/router.js +406 -650
- package/lib/utils.d.ts +9 -9
- package/lib/utils.js +377 -731
- package/package.json +8 -8
package/lib/utils.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
1
|
import BigNumber from 'bignumber.js';
|
|
3
2
|
import { IChainId, IDict, INetworkName, IRewardFromApi } from './interfaces';
|
|
4
3
|
export declare const ETH_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
5
|
-
export declare const MAX_ALLOWANCE:
|
|
4
|
+
export declare const MAX_ALLOWANCE: bigint;
|
|
6
5
|
export declare const _cutZeros: (strn: string) => string;
|
|
7
6
|
export declare const checkNumber: (n: number | string) => number | string;
|
|
8
7
|
export declare const formatNumber: (n: number | string, decimals?: number) => string;
|
|
9
|
-
export declare const parseUnits: (n: number | string, decimals?: number) =>
|
|
8
|
+
export declare const parseUnits: (n: number | string, decimals?: number) => bigint;
|
|
10
9
|
export declare const BN: (val: number | string) => BigNumber;
|
|
11
|
-
export declare const toBN: (n:
|
|
10
|
+
export declare const toBN: (n: bigint, decimals?: number) => BigNumber;
|
|
12
11
|
export declare const toStringFromBN: (bn: BigNumber, decimals?: number) => string;
|
|
13
|
-
export declare const fromBN: (bn: BigNumber, decimals?: number) =>
|
|
12
|
+
export declare const fromBN: (bn: BigNumber, decimals?: number) => bigint;
|
|
14
13
|
export declare const isEth: (address: string) => boolean;
|
|
15
14
|
export declare const getEthIndex: (addresses: string[]) => number;
|
|
15
|
+
export declare const mulBy1_3: (n: bigint) => bigint;
|
|
16
16
|
export declare const _getCoinAddressesNoCheck: (...coins: string[] | string[][]) => string[];
|
|
17
17
|
export declare const _getCoinAddresses: (...coins: string[] | string[][]) => string[];
|
|
18
18
|
export declare const _getCoinDecimals: (...coinAddresses: string[] | string[][]) => number[];
|
|
19
19
|
export declare const _getBalances: (coins: string[], addresses: string[]) => Promise<IDict<string[]>>;
|
|
20
20
|
export declare const _prepareAddresses: (addresses: string[] | string[][]) => string[];
|
|
21
21
|
export declare const getBalances: (coins: string[], ...addresses: string[] | string[][]) => Promise<IDict<string[]> | string[]>;
|
|
22
|
-
export declare const _getAllowance: (coins: string[], address: string, spender: string) => Promise<
|
|
22
|
+
export declare const _getAllowance: (coins: string[], address: string, spender: string) => Promise<bigint[]>;
|
|
23
23
|
export declare const getAllowance: (coins: string[], address: string, spender: string) => Promise<string[]>;
|
|
24
24
|
export declare const hasAllowance: (coins: string[], amounts: (number | string)[], address: string, spender: string) => Promise<boolean>;
|
|
25
|
-
export declare const _ensureAllowance: (coins: string[], amounts:
|
|
25
|
+
export declare const _ensureAllowance: (coins: string[], amounts: bigint[], spender: string, isMax?: boolean) => Promise<string[]>;
|
|
26
26
|
export declare const ensureAllowanceEstimateGas: (coins: string[], amounts: (number | string)[], spender: string, isMax?: boolean) => Promise<number>;
|
|
27
27
|
export declare const ensureAllowance: (coins: string[], amounts: (number | string)[], spender: string, isMax?: boolean) => Promise<string[]>;
|
|
28
28
|
export declare const getPoolNameBySwapAddress: (swapAddress: string) => string;
|
|
@@ -38,8 +38,8 @@ export declare const getVolume: (network?: INetworkName | IChainId) => Promise<{
|
|
|
38
38
|
cryptoShare: number;
|
|
39
39
|
}>;
|
|
40
40
|
export declare const _setContracts: (address: string, abi: any) => void;
|
|
41
|
-
export declare const _get_small_x: (_x:
|
|
42
|
-
export declare const _get_price_impact: (_x:
|
|
41
|
+
export declare const _get_small_x: (_x: bigint, _y: bigint, x_decimals: number, y_decimals: number) => BigNumber;
|
|
42
|
+
export declare const _get_price_impact: (_x: bigint, _y: bigint, _small_x: bigint, _small_y: bigint, x_decimals: number, y_decimals: number) => BigNumber;
|
|
43
43
|
export declare const getCoinsData: (...coins: string[] | string[][]) => Promise<{
|
|
44
44
|
name: string;
|
|
45
45
|
symbol: string;
|