@pancakeswap/infinity-sdk 1.0.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/LICENSE +674 -0
- package/README.md +12 -0
- package/dist/abis/BinMigratorAbi.d.ts +652 -0
- package/dist/abis/BinMigratorAbi.d.ts.map +1 -0
- package/dist/abis/BinPoolManagerAbi.d.ts +1184 -0
- package/dist/abis/BinPoolManagerAbi.d.ts.map +1 -0
- package/dist/abis/BinPositionManagerAbi.d.ts +667 -0
- package/dist/abis/BinPositionManagerAbi.d.ts.map +1 -0
- package/dist/abis/BinQuoterAbi.d.ts +644 -0
- package/dist/abis/BinQuoterAbi.d.ts.map +1 -0
- package/dist/abis/CLMigratorAbi.d.ts +650 -0
- package/dist/abis/CLMigratorAbi.d.ts.map +1 -0
- package/dist/abis/CLPoolManagerAbi.d.ts +1075 -0
- package/dist/abis/CLPoolManagerAbi.d.ts.map +1 -0
- package/dist/abis/CLPositionManagerAbi.d.ts +1130 -0
- package/dist/abis/CLPositionManagerAbi.d.ts.map +1 -0
- package/dist/abis/CLQuoterAbi.d.ts +644 -0
- package/dist/abis/CLQuoterAbi.d.ts.map +1 -0
- package/dist/abis/FarmingOffChainAbi.d.ts +982 -0
- package/dist/abis/FarmingOffChainAbi.d.ts.map +1 -0
- package/dist/abis/FarmingOffChainCLHelperAbi.d.ts +40 -0
- package/dist/abis/FarmingOffChainCLHelperAbi.d.ts.map +1 -0
- package/dist/abis/MixedQuoterAbi.d.ts +347 -0
- package/dist/abis/MixedQuoterAbi.d.ts.map +1 -0
- package/dist/abis/Permit2ForwardAbi.d.ts +124 -0
- package/dist/abis/Permit2ForwardAbi.d.ts.map +1 -0
- package/dist/abis/ProtocolFeeControllerAbi.d.ts +276 -0
- package/dist/abis/ProtocolFeeControllerAbi.d.ts.map +1 -0
- package/dist/abis/VaultAbi.d.ts +669 -0
- package/dist/abis/VaultAbi.d.ts.map +1 -0
- package/dist/abis/index.d.ts +15 -0
- package/dist/abis/index.d.ts.map +1 -0
- package/dist/constants/abiStructFragments.d.ts +15 -0
- package/dist/constants/abiStructFragments.d.ts.map +1 -0
- package/dist/constants/actions.d.ts +43 -0
- package/dist/constants/actions.d.ts.map +1 -0
- package/dist/constants/actionsAbiParameters.d.ts +244 -0
- package/dist/constants/actionsAbiParameters.d.ts.map +1 -0
- package/dist/constants/addresses.d.ts +22 -0
- package/dist/constants/addresses.d.ts.map +1 -0
- package/dist/constants/binPool.d.ts +11 -0
- package/dist/constants/binPool.d.ts.map +1 -0
- package/dist/constants/fee.d.ts +21 -0
- package/dist/constants/fee.d.ts.map +1 -0
- package/dist/constants/hooksList/bsc.d.ts +8 -0
- package/dist/constants/hooksList/bsc.d.ts.map +1 -0
- package/dist/constants/hooksList/bscTestnet.d.ts +21 -0
- package/dist/constants/hooksList/bscTestnet.d.ts.map +1 -0
- package/dist/constants/hooksList/dynamicFeeHook.d.ts +15 -0
- package/dist/constants/hooksList/dynamicFeeHook.d.ts.map +1 -0
- package/dist/constants/hooksList/index.d.ts +14 -0
- package/dist/constants/hooksList/index.d.ts.map +1 -0
- package/dist/constants/index.d.ts +11 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/internalConstants.d.ts +11 -0
- package/dist/constants/internalConstants.d.ts.map +1 -0
- package/dist/entities/index.d.ts +2 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/pool.d.ts +104 -0
- package/dist/entities/pool.d.ts.map +1 -0
- package/dist/functions/bin/addBinLiquidityMulticall.d.ts +22 -0
- package/dist/functions/bin/addBinLiquidityMulticall.d.ts.map +1 -0
- package/dist/functions/bin/calldatas/addLiquidity.d.ts +18 -0
- package/dist/functions/bin/calldatas/addLiquidity.d.ts.map +1 -0
- package/dist/functions/bin/calldatas/index.d.ts +7 -0
- package/dist/functions/bin/calldatas/index.d.ts.map +1 -0
- package/dist/functions/bin/calldatas/initializePool.d.ts +3 -0
- package/dist/functions/bin/calldatas/initializePool.d.ts.map +1 -0
- package/dist/functions/bin/calldatas/liquidity.d.ts +1 -0
- package/dist/functions/bin/calldatas/liquidity.d.ts.map +1 -0
- package/dist/functions/bin/calldatas/mint.d.ts +15 -0
- package/dist/functions/bin/calldatas/mint.d.ts.map +1 -0
- package/dist/functions/bin/calldatas/modifyLiquidities.d.ts +3 -0
- package/dist/functions/bin/calldatas/modifyLiquidities.d.ts.map +1 -0
- package/dist/functions/bin/calldatas/removeLiquidity.d.ts +15 -0
- package/dist/functions/bin/calldatas/removeLiquidity.d.ts.map +1 -0
- package/dist/functions/bin/calldatas/swap.d.ts +4 -0
- package/dist/functions/bin/calldatas/swap.d.ts.map +1 -0
- package/dist/functions/bin/createBinPool.d.ts +62 -0
- package/dist/functions/bin/createBinPool.d.ts.map +1 -0
- package/dist/functions/bin/decodeBinAmount.d.ts +16 -0
- package/dist/functions/bin/decodeBinAmount.d.ts.map +1 -0
- package/dist/functions/bin/getAmounts.d.ts +26 -0
- package/dist/functions/bin/getAmounts.d.ts.map +1 -0
- package/dist/functions/bin/getBinLiquidityConfigs.d.ts +7 -0
- package/dist/functions/bin/getBinLiquidityConfigs.d.ts.map +1 -0
- package/dist/functions/bin/getBinPoolTokenPrice.d.ts +4 -0
- package/dist/functions/bin/getBinPoolTokenPrice.d.ts.map +1 -0
- package/dist/functions/bin/getExternalFeeAmt.d.ts +6 -0
- package/dist/functions/bin/getExternalFeeAmt.d.ts.map +1 -0
- package/dist/functions/bin/getFeeAmount.d.ts +8 -0
- package/dist/functions/bin/getFeeAmount.d.ts.map +1 -0
- package/dist/functions/bin/getFeeAmountFrom.d.ts +9 -0
- package/dist/functions/bin/getFeeAmountFrom.d.ts.map +1 -0
- package/dist/functions/bin/getIdFromPrice.d.ts +11 -0
- package/dist/functions/bin/getIdFromPrice.d.ts.map +1 -0
- package/dist/functions/bin/getIdSlippage.d.ts +2 -0
- package/dist/functions/bin/getIdSlippage.d.ts.map +1 -0
- package/dist/functions/bin/getLiquidityShape.d.ts +32 -0
- package/dist/functions/bin/getLiquidityShape.d.ts.map +1 -0
- package/dist/functions/bin/getNextNonEmptyBin.d.ts +15 -0
- package/dist/functions/bin/getNextNonEmptyBin.d.ts.map +1 -0
- package/dist/functions/bin/getPriceFromId.d.ts +13 -0
- package/dist/functions/bin/getPriceFromId.d.ts.map +1 -0
- package/dist/functions/bin/index.d.ts +17 -0
- package/dist/functions/bin/index.d.ts.map +1 -0
- package/dist/functions/bin/liquidityConfigs.d.ts +15 -0
- package/dist/functions/bin/liquidityConfigs.d.ts.map +1 -0
- package/dist/functions/bin/parseReserveOfBin.d.ts +11 -0
- package/dist/functions/bin/parseReserveOfBin.d.ts.map +1 -0
- package/dist/functions/bin/priceConvert.d.ts +3 -0
- package/dist/functions/bin/priceConvert.d.ts.map +1 -0
- package/dist/functions/bin/swap.d.ts +20 -0
- package/dist/functions/bin/swap.d.ts.map +1 -0
- package/dist/functions/clamm/addCLLiquidityMulticall.d.ts +18 -0
- package/dist/functions/clamm/addCLLiquidityMulticall.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/burn.d.ts +4 -0
- package/dist/functions/clamm/calldatas/burn.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/claim.d.ts +9 -0
- package/dist/functions/clamm/calldatas/claim.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/decreaseLiquidity.d.ts +14 -0
- package/dist/functions/clamm/calldatas/decreaseLiquidity.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/donate.d.ts +4 -0
- package/dist/functions/clamm/calldatas/donate.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/increaseLiquidity.d.ts +4 -0
- package/dist/functions/clamm/calldatas/increaseLiquidity.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/index.d.ts +12 -0
- package/dist/functions/clamm/calldatas/index.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/initialize.d.ts +3 -0
- package/dist/functions/clamm/calldatas/initialize.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/initializePool.d.ts +3 -0
- package/dist/functions/clamm/calldatas/initializePool.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/mint.d.ts +4 -0
- package/dist/functions/clamm/calldatas/mint.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/modifyLiquidities.d.ts +3 -0
- package/dist/functions/clamm/calldatas/modifyLiquidities.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/modifyLiquidity.d.ts +10 -0
- package/dist/functions/clamm/calldatas/modifyLiquidity.d.ts.map +1 -0
- package/dist/functions/clamm/calldatas/swap.d.ts +9 -0
- package/dist/functions/clamm/calldatas/swap.d.ts.map +1 -0
- package/dist/functions/clamm/getCLPool.d.ts +6 -0
- package/dist/functions/clamm/getCLPool.d.ts.map +1 -0
- package/dist/functions/clamm/index.d.ts +5 -0
- package/dist/functions/clamm/index.d.ts.map +1 -0
- package/dist/functions/getPool.d.ts +19 -0
- package/dist/functions/getPool.d.ts.map +1 -0
- package/dist/functions/hooks/index.d.ts +2 -0
- package/dist/functions/hooks/index.d.ts.map +1 -0
- package/dist/functions/hooks/isDynamicFeeHook.d.ts +5 -0
- package/dist/functions/hooks/isDynamicFeeHook.d.ts.map +1 -0
- package/dist/functions/index.d.ts +5 -0
- package/dist/functions/index.d.ts.map +1 -0
- package/dist/functions/tick.d.ts +3 -0
- package/dist/functions/tick.d.ts.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7578 -0
- package/dist/index.mjs +7430 -0
- package/dist/types.d.ts +183 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/ActionsPlanner.d.ts +32 -0
- package/dist/utils/ActionsPlanner.d.ts.map +1 -0
- package/dist/utils/calculateSwapFee.d.ts +11 -0
- package/dist/utils/calculateSwapFee.d.ts.map +1 -0
- package/dist/utils/convertBinIdsToRelative.d.ts +12 -0
- package/dist/utils/convertBinIdsToRelative.d.ts.map +1 -0
- package/dist/utils/decodeHooksRegistration.d.ts +4 -0
- package/dist/utils/decodeHooksRegistration.d.ts.map +1 -0
- package/dist/utils/decodePoolKey.d.ts +3 -0
- package/dist/utils/decodePoolKey.d.ts.map +1 -0
- package/dist/utils/decodePoolParameters.d.ts +4 -0
- package/dist/utils/decodePoolParameters.d.ts.map +1 -0
- package/dist/utils/encodeHooksRegistration.d.ts +4 -0
- package/dist/utils/encodeHooksRegistration.d.ts.map +1 -0
- package/dist/utils/encodeMulticall.d.ts +3 -0
- package/dist/utils/encodeMulticall.d.ts.map +1 -0
- package/dist/utils/encodePermit2.d.ts +6 -0
- package/dist/utils/encodePermit2.d.ts.map +1 -0
- package/dist/utils/encodePoolKey.d.ts +9 -0
- package/dist/utils/encodePoolKey.d.ts.map +1 -0
- package/dist/utils/encodePoolParameters.d.ts +5 -0
- package/dist/utils/encodePoolParameters.d.ts.map +1 -0
- package/dist/utils/getAddLiquidityParameters.d.ts +66 -0
- package/dist/utils/getAddLiquidityParameters.d.ts.map +1 -0
- package/dist/utils/getBinIds.d.ts +9 -0
- package/dist/utils/getBinIds.d.ts.map +1 -0
- package/dist/utils/getIsInitializedByPoolKey.d.ts +4 -0
- package/dist/utils/getIsInitializedByPoolKey.d.ts.map +1 -0
- package/dist/utils/getPoolId.d.ts +10 -0
- package/dist/utils/getPoolId.d.ts.map +1 -0
- package/dist/utils/index.d.ts +17 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/isInfinitySupported.d.ts +6 -0
- package/dist/utils/isInfinitySupported.d.ts.map +1 -0
- package/dist/utils/math/TreeMath.d.ts +12 -0
- package/dist/utils/math/TreeMath.d.ts.map +1 -0
- package/dist/utils/math/index.d.ts +4 -0
- package/dist/utils/math/index.d.ts.map +1 -0
- package/dist/utils/math/mulShift.d.ts +3 -0
- package/dist/utils/math/mulShift.d.ts.map +1 -0
- package/dist/utils/math/shiftDiv.d.ts +3 -0
- package/dist/utils/math/shiftDiv.d.ts.map +1 -0
- package/dist/utils/parseProtocolFee.d.ts +4 -0
- package/dist/utils/parseProtocolFee.d.ts.map +1 -0
- package/dist/utils/poolIdToPoolKey.d.ts +17 -0
- package/dist/utils/poolIdToPoolKey.d.ts.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/functions/bin/calldatas/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,QAAQ,CAAA;AACtB,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initializePool.d.ts","sourceRoot":"","sources":["../../../../src/functions/bin/calldatas/initializePool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAGxC,eAAO,MAAM,8CAA8C,YAAa,OAAO,CAAC,KAAK,CAAC,YAAY,MAAM,GAAG,MAAM,kBAMhH,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=liquidity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquidity.d.ts","sourceRoot":"","sources":["../../../../src/functions/bin/calldatas/liquidity.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
import { PoolKey } from '../../../types';
|
|
3
|
+
import { LiquidityConfig } from '../liquidityConfigs';
|
|
4
|
+
export type BinPoolMintParams = {
|
|
5
|
+
/**
|
|
6
|
+
* nft minted to
|
|
7
|
+
*/
|
|
8
|
+
to: Address;
|
|
9
|
+
liquidityConfigs: LiquidityConfig[];
|
|
10
|
+
amountIn: [bigint, bigint];
|
|
11
|
+
binStep: bigint;
|
|
12
|
+
salt: string | number;
|
|
13
|
+
};
|
|
14
|
+
export declare const binPoolMintCalldata: <THookData extends Hex>(key: PoolKey, params: BinPoolMintParams, hookData: THookData) => `0x${string}`;
|
|
15
|
+
//# sourceMappingURL=mint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mint.d.ts","sourceRoot":"","sources":["../../../../src/functions/bin/calldatas/mint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAsB,GAAG,EAAS,MAAM,MAAM,CAAA;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,OAAO,EAAyB,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE5E,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,EAAE,EAAE,OAAO,CAAA;IACX,gBAAgB,EAAE,eAAe,EAAE,CAAA;IAEnC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,SAAS,SAAS,GAAG,OAClD,OAAO,UACJ,iBAAiB,YACf,SAAS,kBAqBpB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modifyLiquidities.d.ts","sourceRoot":"","sources":["../../../../src/functions/bin/calldatas/modifyLiquidities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAsB,MAAM,MAAM,CAAA;AAG9C,eAAO,MAAM,kCAAkC,UAAW,GAAG,YAAY,MAAM,kBAM9E,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
import { PoolKey } from '../../../types';
|
|
3
|
+
export type RemoveBinLiquidityParam = {
|
|
4
|
+
poolKey: PoolKey<'Bin'>;
|
|
5
|
+
amount0Min: bigint;
|
|
6
|
+
amount1Min: bigint;
|
|
7
|
+
ids: number[];
|
|
8
|
+
amounts: bigint[];
|
|
9
|
+
from: Address;
|
|
10
|
+
hookData?: Hex;
|
|
11
|
+
wrapAddress?: Address;
|
|
12
|
+
recipient?: Address;
|
|
13
|
+
};
|
|
14
|
+
export declare const encodeBinPositionManagerRemoveLiquidityCalldata: (params: RemoveBinLiquidityParam, deadline: bigint) => `0x${string}`;
|
|
15
|
+
//# sourceMappingURL=removeLiquidity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeLiquidity.d.ts","sourceRoot":"","sources":["../../../../src/functions/bin/calldatas/removeLiquidity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,GAAG,EAA0C,MAAM,MAAM,CAAA;AAE3E,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAKxC,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,MAAM,EAAE,CAAA;IACb,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,+CAA+C,WAAY,uBAAuB,YAAY,MAAM,kBAoBhH,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../../../src/functions/bin/calldatas/swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAsB,MAAM,MAAM,CAAA;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAGxC,eAAO,MAAM,mBAAmB,YACrB,OAAO,CAAC,KAAK,CAAC,YACb,OAAO,YACP,MAAM,aACN,GAAG,kBAOd,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { BigintIsh, Currency } from '@pancakeswap/swap-sdk-core';
|
|
2
|
+
import { Address } from 'viem';
|
|
3
|
+
import type { BinTree } from '../../types';
|
|
4
|
+
type ActiveId = number;
|
|
5
|
+
type Reserve = {
|
|
6
|
+
reserveX: bigint;
|
|
7
|
+
reserveY: bigint;
|
|
8
|
+
};
|
|
9
|
+
export type BinPoolState = {
|
|
10
|
+
/**
|
|
11
|
+
* the first currency of the pool
|
|
12
|
+
*/
|
|
13
|
+
currencyX: Currency;
|
|
14
|
+
/**
|
|
15
|
+
* the second currency of the pool
|
|
16
|
+
*/
|
|
17
|
+
currencyY: Currency;
|
|
18
|
+
/**
|
|
19
|
+
* the bin step of the pool
|
|
20
|
+
* constraints: 1 <= binStep <= 100
|
|
21
|
+
*/
|
|
22
|
+
binStep: bigint;
|
|
23
|
+
/**
|
|
24
|
+
* current active bin id of the pool
|
|
25
|
+
*/
|
|
26
|
+
activeId: bigint;
|
|
27
|
+
reserveOfBin: Record<ActiveId, Reserve>;
|
|
28
|
+
/**
|
|
29
|
+
* fee charged by Liquidity Providers
|
|
30
|
+
* constraints: 0 <= lpFee <= 10000(10%)
|
|
31
|
+
* unit: bps
|
|
32
|
+
* 1 = 0.01%
|
|
33
|
+
*/
|
|
34
|
+
lpFee: bigint;
|
|
35
|
+
/**
|
|
36
|
+
* fee charged by the protocol
|
|
37
|
+
* constraints: 0 <= protocolFee <= 1000(0.1%)
|
|
38
|
+
* the first element is the feeRate charged when swapForX
|
|
39
|
+
* the second element is the feeRate charged when swapForY
|
|
40
|
+
* unit: bps/100
|
|
41
|
+
* 1 = 0.0001%
|
|
42
|
+
*/
|
|
43
|
+
protocolFees: [bigint, bigint];
|
|
44
|
+
lmPool?: Address;
|
|
45
|
+
tree?: BinTree;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Returns a new BinPoolState object
|
|
49
|
+
*/
|
|
50
|
+
export declare const createBinPool: ({ currencyA, currencyB, activeId, binStep, lpFee, protocolFees, lmPool, tree: treeOverride, reserveOfBin, }: {
|
|
51
|
+
currencyA: Currency;
|
|
52
|
+
currencyB: Currency;
|
|
53
|
+
activeId: BigintIsh;
|
|
54
|
+
binStep: BigintIsh;
|
|
55
|
+
lpFee: BigintIsh;
|
|
56
|
+
protocolFees?: [BigintIsh, BigintIsh];
|
|
57
|
+
lmPool?: Address;
|
|
58
|
+
tree?: BinTree;
|
|
59
|
+
reserveOfBin?: Record<ActiveId, Reserve>;
|
|
60
|
+
}) => BinPoolState;
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=createBinPool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createBinPool.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/createBinPool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,4BAA4B,CAAA;AAEhF,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAG9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAG1C,KAAK,QAAQ,GAAG,MAAM,CAAA;AACtB,KAAK,OAAO,GAAG;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,SAAS,EAAE,QAAQ,CAAA;IACnB;;OAEG;IACH,SAAS,EAAE,QAAQ,CAAA;IACnB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACvC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;OAOG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,gHAUvB;IACD,SAAS,EAAE,QAAQ,CAAA;IACnB,SAAS,EAAE,QAAQ,CAAA;IACnB,QAAQ,EAAE,SAAS,CAAA;IACnB,OAAO,EAAE,SAAS,CAAA;IAClB,KAAK,EAAE,SAAS,CAAA;IAChB,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IACrC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;CACzC,KAAG,YA4CH,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Bytes32 } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Decode a bytes32 amount into two amounts, one for each token
|
|
4
|
+
* [0 - 128[: x1
|
|
5
|
+
* [128 - 256[: x2
|
|
6
|
+
*
|
|
7
|
+
* @returns amountX the amount of the first token
|
|
8
|
+
* @returns amountY the amount of the second token
|
|
9
|
+
*/
|
|
10
|
+
export declare const decodeBinAmount: (amount: Bytes32 | bigint) => {
|
|
11
|
+
amountX: bigint;
|
|
12
|
+
amountY: bigint;
|
|
13
|
+
};
|
|
14
|
+
export declare const decodeBinAmountForX: (amount: Bytes32) => bigint;
|
|
15
|
+
export declare const decodeBinAmountForY: (amount: Bytes32) => bigint;
|
|
16
|
+
//# sourceMappingURL=decodeBinAmount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decodeBinAmount.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/decodeBinAmount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,WAClB,OAAO,GAAG,MAAM,KACvB;IACD,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAchB,CAAA;AAED,eAAO,MAAM,mBAAmB,WAAY,OAAO,KAAG,MAErD,CAAA;AAED,eAAO,MAAM,mBAAmB,WAAY,OAAO,KAAG,MAErD,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BinPoolState } from './createBinPool';
|
|
2
|
+
export type AmountsChanged = {
|
|
3
|
+
/**
|
|
4
|
+
* The amounts of tokens that will be added to the pool, including fees
|
|
5
|
+
*/
|
|
6
|
+
amountsInWithFee: [bigint, bigint];
|
|
7
|
+
/**
|
|
8
|
+
* The amounts of tokens that will be removed from the pool
|
|
9
|
+
*/
|
|
10
|
+
amountsOutOfBin: [bigint, bigint];
|
|
11
|
+
/**
|
|
12
|
+
* The fees that will be charged
|
|
13
|
+
*/
|
|
14
|
+
totalFees: [bigint, bigint];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Returns the amounts of tokens that will be added and removed from the bin during a swap
|
|
18
|
+
* along with the fees that will be charged
|
|
19
|
+
*
|
|
20
|
+
* @param binPool BinPoolState
|
|
21
|
+
* @param swapForY boolean
|
|
22
|
+
* @param amountIn bigint
|
|
23
|
+
* @returns AmountsChanged
|
|
24
|
+
*/
|
|
25
|
+
export declare const getAmounts: (binPool: BinPoolState, swapForY: boolean, amountIn: bigint) => AmountsChanged;
|
|
26
|
+
//# sourceMappingURL=getAmounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAmounts.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/getAmounts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAK9C,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC;;OAEG;IACH,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC;;OAEG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC5B,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,YAAa,YAAY,YAAY,OAAO,YAAY,MAAM,KAAG,cA2CvF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBinLiquidityConfigs.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/getBinLiquidityConfigs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAYpD,eAAO,MAAM,sBAAsB,SAAU;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,KAAG,eAAe,EAc/G,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Currency, Price } from '@pancakeswap/swap-sdk-core';
|
|
2
|
+
import { BinPoolState } from './createBinPool';
|
|
3
|
+
export declare function getBinPoolTokenPrice(pool: Pick<BinPoolState, 'currencyX' | 'currencyY' | 'activeId' | 'binStep'>, base: Currency): Price<Currency, Currency>;
|
|
4
|
+
//# sourceMappingURL=getBinPoolTokenPrice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBinPoolTokenPrice.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/getBinPoolTokenPrice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAK9C,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC,EAC5E,IAAI,EAAE,QAAQ,6BAgBf"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* given amount(totalFeeAmount) and protocolFee, swapFee
|
|
3
|
+
* returns the protocol fee amount
|
|
4
|
+
*/
|
|
5
|
+
export declare const getExternalFeeAmt: (amounts: [bigint, bigint], protocolFees: [bigint, bigint], swapFee: bigint) => [bigint, bigint];
|
|
6
|
+
//# sourceMappingURL=getExternalFeeAmt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getExternalFeeAmt.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/getExternalFeeAmt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YACnB,CAAC,MAAM,EAAE,MAAM,CAAC,gBACX,CAAC,MAAM,EAAE,MAAM,CAAC,WACrB,MAAM,KACd,CAAC,MAAM,EAAE,MAAM,CAYjB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFeeAmount.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/getFeeAmount.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,YAAY,WAAY,MAAM,WAAW,MAAM,KAAG,MAK9D,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the fee amount from the amount with fees, rounding up
|
|
3
|
+
*
|
|
4
|
+
* @param amountWithFees the amount with fees
|
|
5
|
+
* @param feeBips fee in bips
|
|
6
|
+
* @returns fee amount
|
|
7
|
+
*/
|
|
8
|
+
export declare const getFeeAmountFrom: (amountWithFees: bigint, feeBips: bigint) => bigint;
|
|
9
|
+
//# sourceMappingURL=getFeeAmountFrom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFeeAmountFrom.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/getFeeAmountFrom.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,mBAAoB,MAAM,WAAW,MAAM,KAAG,MAI1E,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Currency, Price } from '@pancakeswap/swap-sdk-core';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the price of bin given its id and the bin step
|
|
4
|
+
*/
|
|
5
|
+
export declare const getIdFromPrice: (price: number, binStep: number) => number;
|
|
6
|
+
export declare const getIdFromCurrencyPrice: (price: Price<Currency, Currency>, binStep: number) => number;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated
|
|
9
|
+
*/
|
|
10
|
+
export declare const getIdFromInvertedPrice: (price: number, binStep: number) => number;
|
|
11
|
+
//# sourceMappingURL=getIdFromPrice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getIdFromPrice.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/getIdFromPrice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAG5D;;GAEG;AACH,eAAO,MAAM,cAAc,UAAW,MAAM,WAAW,MAAM,KAAG,MAE/D,CAAA;AAED,eAAO,MAAM,sBAAsB,UAAW,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,WAAW,MAAM,KAAG,MAK1F,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,UAAW,MAAM,WAAW,MAAM,KAAG,MAEvE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getIdSlippage.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/getIdSlippage.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,uBAAwB,MAAM,WAAW,MAAM,YAAY,MAAM,WAE1F,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BinLiquidityShape } from '../../types';
|
|
2
|
+
export type GetLiquidityShapeParams = {
|
|
3
|
+
shape: BinLiquidityShape;
|
|
4
|
+
lowerBinId: number;
|
|
5
|
+
upperBinId: number;
|
|
6
|
+
amount0: bigint;
|
|
7
|
+
amount1: bigint;
|
|
8
|
+
activeIdDesired: number;
|
|
9
|
+
};
|
|
10
|
+
export type LiquidityShape = {
|
|
11
|
+
deltaIds: number[];
|
|
12
|
+
distributionX: bigint[];
|
|
13
|
+
distributionY: bigint[];
|
|
14
|
+
};
|
|
15
|
+
export declare const getLiquidityShape: ({ shape, lowerBinId, upperBinId, activeIdDesired, amount0, amount1, }: GetLiquidityShapeParams) => LiquidityShape;
|
|
16
|
+
export type BinRange = [bigint, bigint];
|
|
17
|
+
export type GenerateLiquidityShapeParams = {
|
|
18
|
+
binIds: number[];
|
|
19
|
+
amount0: bigint;
|
|
20
|
+
amount1: bigint;
|
|
21
|
+
};
|
|
22
|
+
export declare const getSpotLiquidityShape: ({ binIds, amount0, amount1 }: GenerateLiquidityShapeParams) => LiquidityShape;
|
|
23
|
+
/**
|
|
24
|
+
* follow Gaussian Distribution Curve
|
|
25
|
+
* @param param0
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
export declare const getCurveLiquidityShape: ({ binIds, amount0, amount1, sd, }: GenerateLiquidityShapeParams & {
|
|
29
|
+
sd?: number;
|
|
30
|
+
}) => LiquidityShape;
|
|
31
|
+
export declare const getBidAskLiquidityShape: ({ binIds, amount0, amount1 }: GenerateLiquidityShapeParams) => LiquidityShape;
|
|
32
|
+
//# sourceMappingURL=getLiquidityShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLiquidityShape.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/getLiquidityShape.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAG/C,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,iBAAiB,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,iBAAiB,0EAO3B,uBAAuB,KAAG,cAiB5B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACvC,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,qBAAqB,iCAAkC,4BAA4B,KAAG,cAuClG,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,sCAKhC,4BAA4B,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,cA+FnD,CAAA;AAED,eAAO,MAAM,uBAAuB,iCAAkC,4BAA4B,KAAG,cAoEpG,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BinPoolState } from './createBinPool';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the next non-empty bin
|
|
4
|
+
*
|
|
5
|
+
* the next non-empty bin is the bin that is closest to the activeId.
|
|
6
|
+
* if swapForY is true, it will return the next bin to the right (higher),
|
|
7
|
+
* otherwise it will return the next bin to the left (lower)
|
|
8
|
+
*
|
|
9
|
+
* @param binPool
|
|
10
|
+
* @param activeId
|
|
11
|
+
* @param swapForY
|
|
12
|
+
* @returns next non-empty bin
|
|
13
|
+
*/
|
|
14
|
+
export declare const getNextNonEmptyBin: (binPool: BinPoolState, activeId: bigint, swapForY: boolean) => bigint;
|
|
15
|
+
//# sourceMappingURL=getNextNonEmptyBin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNextNonEmptyBin.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/getNextNonEmptyBin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,YAAa,YAAY,YAAY,MAAM,YAAY,OAAO,KAAG,MAM/F,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Currency, Price } from '@pancakeswap/swap-sdk-core';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the price from the given activeId and binStep
|
|
4
|
+
*
|
|
5
|
+
* @param activeId
|
|
6
|
+
* @param binStep
|
|
7
|
+
* @returns price: 128.128 fixed point number
|
|
8
|
+
*/
|
|
9
|
+
export declare const getPriceX128FromId: (activeId: bigint, binStep: bigint) => bigint;
|
|
10
|
+
export declare const getPriceFromId: (activeId: number, binStep: number) => number;
|
|
11
|
+
export declare const getCurrencyPriceFromId: (activeId: number, binStep: number, baseCurrency: Currency, quoteCurrency: Currency) => Price<Currency, Currency>;
|
|
12
|
+
export declare const getInvertedPriceFromId: (activeId: number, binStep: number) => number;
|
|
13
|
+
//# sourceMappingURL=getPriceFromId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPriceFromId.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/getPriceFromId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAiB5D;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,aAAc,MAAM,WAAW,MAAM,KAAG,MAgCtE,CAAA;AAED,eAAO,MAAM,cAAc,aAAc,MAAM,WAAW,MAAM,KAAG,MAElE,CAAA;AAED,eAAO,MAAM,sBAAsB,aACvB,MAAM,WACP,MAAM,gBACD,QAAQ,iBACP,QAAQ,KACtB,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAM1B,CAAA;AAED,eAAO,MAAM,sBAAsB,aAAc,MAAM,WAAW,MAAM,KAAG,MAE1E,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './addBinLiquidityMulticall';
|
|
2
|
+
export * from './calldatas';
|
|
3
|
+
export * from './createBinPool';
|
|
4
|
+
export * from './getAmounts';
|
|
5
|
+
export * from './getBinPoolTokenPrice';
|
|
6
|
+
export * from './getExternalFeeAmt';
|
|
7
|
+
export * from './getFeeAmount';
|
|
8
|
+
export * from './getFeeAmountFrom';
|
|
9
|
+
export * from './getIdFromPrice';
|
|
10
|
+
export * from './getIdSlippage';
|
|
11
|
+
export * from './getLiquidityShape';
|
|
12
|
+
export * from './getNextNonEmptyBin';
|
|
13
|
+
export * from './getPriceFromId';
|
|
14
|
+
export * from './parseReserveOfBin';
|
|
15
|
+
export * from './priceConvert';
|
|
16
|
+
export * from './swap';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,QAAQ,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
export type LiquidityConfig = {
|
|
3
|
+
/**
|
|
4
|
+
* The distribution of the first token
|
|
5
|
+
*/
|
|
6
|
+
distributionX: bigint;
|
|
7
|
+
/**
|
|
8
|
+
* The distribution of the second token
|
|
9
|
+
*/
|
|
10
|
+
distributionY: bigint;
|
|
11
|
+
id: bigint;
|
|
12
|
+
};
|
|
13
|
+
export declare const encodeLiquidityConfig: ({ distributionX, distributionY, id }: LiquidityConfig) => `0x${string}`;
|
|
14
|
+
export declare const decodeLiquidityConfig: (config: Hex) => LiquidityConfig;
|
|
15
|
+
//# sourceMappingURL=liquidityConfigs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquidityConfigs.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/liquidityConfigs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAS,MAAM,MAAM,CAAA;AAEjC,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,eAAO,MAAM,qBAAqB,yCAA0C,eAAe,kBAI1F,CAAA;AAED,eAAO,MAAM,qBAAqB,WAAY,GAAG,KAAG,eAMnD,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const parseReserveOfBin: (liquidities: Array<{
|
|
2
|
+
binId: string | number;
|
|
3
|
+
liquidity: bigint | string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}>) => {
|
|
6
|
+
binId: number;
|
|
7
|
+
liquidity: bigint;
|
|
8
|
+
reserveX: bigint;
|
|
9
|
+
reserveY: bigint;
|
|
10
|
+
}[];
|
|
11
|
+
//# sourceMappingURL=parseReserveOfBin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseReserveOfBin.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/parseReserveOfBin.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,gBACf,KAAK,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,CAAC;WAqBS,MAAM;eACF,MAAM;cACP,MAAM;cACN,MAAM;GAGrB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priceConvert.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/priceConvert.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B,UAAW,MAAM,WAGzD,CAAA;AAED,eAAO,MAAM,4BAA4B,UAAW,MAAM,WAGzD,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BinPoolState } from './createBinPool';
|
|
2
|
+
/**
|
|
3
|
+
* dryrun of swap to a given bin pool
|
|
4
|
+
*/
|
|
5
|
+
export declare const swap: (binPool: BinPoolState, amountIn: bigint, swapForY: boolean) => {
|
|
6
|
+
binPool: BinPoolState;
|
|
7
|
+
feeForProtocol: bigint;
|
|
8
|
+
result: [bigint, bigint];
|
|
9
|
+
};
|
|
10
|
+
export declare const getSwapIn: (binPool: BinPoolState, amountOut: bigint, swapForY: boolean) => {
|
|
11
|
+
amountIn: bigint;
|
|
12
|
+
fee: bigint;
|
|
13
|
+
amountOutLeft: bigint;
|
|
14
|
+
};
|
|
15
|
+
export declare const getSwapOut: (binPool: BinPoolState, amountIn: bigint, swapForY: boolean) => {
|
|
16
|
+
amountOut: bigint;
|
|
17
|
+
fee: bigint;
|
|
18
|
+
amountInLeft: bigint;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=swap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../../src/functions/bin/swap.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAO9C;;GAEG;AACH,eAAO,MAAM,IAAI,YACN,YAAY,YACX,MAAM,YACN,OAAO,KAChB;IACD,OAAO,EAAE,YAAY,CAAA;IACrB,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAgEzB,CAAA;AAED,eAAO,MAAM,SAAS,YAAa,YAAY,aAAa,MAAM,YAAY,OAAO;;;;CA4CpF,CAAA;AAED,eAAO,MAAM,UAAU,YAAa,YAAY,YAAY,MAAM,YAAY,OAAO;;;;CA0CpF,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
import { CLPositionConfig, Permit2Signature } from '../../types';
|
|
3
|
+
export declare const addCLLiquidityMulticall: ({ isInitialized, sqrtPriceX96, tokenId, positionConfig, liquidity, owner, recipient, amount0Max, amount1Max, deadline, modifyPositionHookData, token0Permit2Signature, token1Permit2Signature, }: {
|
|
4
|
+
isInitialized: boolean;
|
|
5
|
+
sqrtPriceX96: bigint;
|
|
6
|
+
tokenId?: bigint;
|
|
7
|
+
positionConfig: CLPositionConfig;
|
|
8
|
+
liquidity: bigint;
|
|
9
|
+
owner: Address;
|
|
10
|
+
recipient: Address;
|
|
11
|
+
amount0Max: bigint;
|
|
12
|
+
amount1Max: bigint;
|
|
13
|
+
deadline: bigint;
|
|
14
|
+
modifyPositionHookData: Hex;
|
|
15
|
+
token0Permit2Signature?: Permit2Signature;
|
|
16
|
+
token1Permit2Signature?: Permit2Signature;
|
|
17
|
+
}) => `0x${string}`;
|
|
18
|
+
//# sourceMappingURL=addCLLiquidityMulticall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addCLLiquidityMulticall.d.ts","sourceRoot":"","sources":["../../../src/functions/clamm/addCLLiquidityMulticall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAShE,eAAO,MAAM,uBAAuB,qMAcjC;IACD,aAAa,EAAE,OAAO,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,gBAAgB,CAAA;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,sBAAsB,EAAE,GAAG,CAAA;IAC3B,sBAAsB,CAAC,EAAE,gBAAgB,CAAA;IACzC,sBAAsB,CAAC,EAAE,gBAAgB,CAAA;CAC1C,kBA2CA,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
import { CLPositionConfig } from '../../../types';
|
|
3
|
+
export declare const encodeCLPositionManagerBurnCalldata: (tokenId: bigint, positionConfig: CLPositionConfig, amount0Min: bigint, amount1Min: bigint, hookData: Hex | undefined, deadline: bigint) => `0x${string}`;
|
|
4
|
+
//# sourceMappingURL=burn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"burn.d.ts","sourceRoot":"","sources":["../../../../src/functions/clamm/calldatas/burn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,GAAG,EAAE,MAAM,MAAM,CAAA;AAG9C,OAAO,EAAE,gBAAgB,EAA2B,MAAM,gBAAgB,CAAA;AAI1E,eAAO,MAAM,mCAAmC,YACrC,MAAM,kBACC,gBAAgB,cACpB,MAAM,cACN,MAAM,YACR,GAAG,wBACH,MAAM,kBAoBjB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../../../src/functions/clamm/calldatas/claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsB,MAAM,MAAM,CAAA;AAGlD,UAAU,WAAW;IACnB,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,OAAO,EAAE,CAAA;CACjB;AACD,eAAO,MAAM,mBAAmB,gBAAiB,WAAW,EAAE,kBAM7D,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
import { PoolKey } from '../../../types';
|
|
3
|
+
export declare const encodeCLPositionManagerDecreaseLiquidityCalldata: ({ tokenId, poolKey, liquidity, amount0Min, amount1Min, wrapAddress, recipient, hookData, deadline, }: {
|
|
4
|
+
tokenId: bigint;
|
|
5
|
+
poolKey: PoolKey<"CL">;
|
|
6
|
+
liquidity: bigint;
|
|
7
|
+
amount0Min: bigint;
|
|
8
|
+
amount1Min: bigint;
|
|
9
|
+
wrapAddress?: Address;
|
|
10
|
+
recipient?: Address;
|
|
11
|
+
hookData?: Hex;
|
|
12
|
+
deadline: bigint;
|
|
13
|
+
}) => `0x${string}`;
|
|
14
|
+
//# sourceMappingURL=decreaseLiquidity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decreaseLiquidity.d.ts","sourceRoot":"","sources":["../../../../src/functions/clamm/calldatas/decreaseLiquidity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,GAAG,EAA+B,MAAM,MAAM,CAAA;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAIxC,eAAO,MAAM,gDAAgD,yGAU1D;IACD,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,kBAWA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"donate.d.ts","sourceRoot":"","sources":["../../../../src/functions/clamm/calldatas/donate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,GAAG,EAAE,MAAM,MAAM,CAAA;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAGxC,eAAO,MAAM,0BAA0B,YAC5B,OAAO,CAAC,IAAI,CAAC,WACb,MAAM,WACN,MAAM,aACL,GAAG,kBAOd,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
import { CLPositionConfig } from '../../../types';
|
|
3
|
+
export declare const encodeCLPositionManagerIncreaseLiquidityCalldata: (tokenId: bigint, positionConfig: CLPositionConfig, liquidity: bigint, amount0Max: bigint, amount1Max: bigint, hookData: Hex | undefined, deadline: bigint) => `0x${string}`;
|
|
4
|
+
//# sourceMappingURL=increaseLiquidity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"increaseLiquidity.d.ts","sourceRoot":"","sources":["../../../../src/functions/clamm/calldatas/increaseLiquidity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAIjD,eAAO,MAAM,gDAAgD,YAClD,MAAM,kBACC,gBAAgB,aACrB,MAAM,cACL,MAAM,cACN,MAAM,YACR,GAAG,wBACH,MAAM,kBAMjB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './burn';
|
|
2
|
+
export * from './decreaseLiquidity';
|
|
3
|
+
export * from './donate';
|
|
4
|
+
export * from './increaseLiquidity';
|
|
5
|
+
export * from './initialize';
|
|
6
|
+
export * from './initializePool';
|
|
7
|
+
export * from './mint';
|
|
8
|
+
export * from './modifyLiquidities';
|
|
9
|
+
export * from './modifyLiquidity';
|
|
10
|
+
export * from './swap';
|
|
11
|
+
export * from './claim';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/functions/clamm/calldatas/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,QAAQ,CAAA;AACtB,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/functions/clamm/calldatas/initialize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAGxC,eAAO,MAAM,8BAA8B,YAAa,OAAO,CAAC,IAAI,CAAC,gBAAgB,MAAM,kBAM1F,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initializePool.d.ts","sourceRoot":"","sources":["../../../../src/functions/clamm/calldatas/initializePool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAGxC,eAAO,MAAM,6CAA6C,YAAa,OAAO,CAAC,IAAI,CAAC,gBAAgB,MAAM,kBAMzG,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Address, Hex } from 'viem';
|
|
2
|
+
import { CLPositionConfig } from '../../../types';
|
|
3
|
+
export declare const encodeCLPositionManagerMintCalldata: (positionConfig: CLPositionConfig, liquidity: bigint, recipient: Address, amount0Max: bigint, amount1Max: bigint, deadline: bigint, hookData?: Hex) => `0x${string}`;
|
|
4
|
+
//# sourceMappingURL=mint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mint.d.ts","sourceRoot":"","sources":["../../../../src/functions/clamm/calldatas/mint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsB,GAAG,EAAe,MAAM,MAAM,CAAA;AAGpE,OAAO,EAAE,gBAAgB,EAA2B,MAAM,gBAAgB,CAAA;AAI1E,eAAO,MAAM,mCAAmC,mBAC9B,gBAAgB,aACrB,MAAM,aACN,OAAO,cACN,MAAM,cACN,MAAM,YACR,MAAM,aACN,GAAG,kBAwBd,CAAA"}
|