import type { FlapPortal } from '../shared/flap/portal.js'; import type { TokenStateV7 } from '../shared/flap/portal.js'; /** PancakeSwap Infinity CL PoolManager(BSC / Base 同址) */ export declare const PCS_INFINITY_CL_POOL_MANAGER_BSC = "0xa0FfB9c1CE1Fe56963B0321B32E7A0302114058b"; /** PancakeSwap Infinity Vault(全池代币记账;BSC / Base 同址) */ export declare const PCS_INFINITY_VAULT_BSC = "0x238a358808379702088667322f80aC48bAd5e6c4"; /** Flap Portal 毕业到 Infinity CL 时使用的 hooks(BSC) */ export declare const FLAP_INFINITY_HOOKS_BSC = "0xF1A9aA042454b8553bE3896597ff11a0f011c1c1"; export type InfinityPoolKey = { currency0: string; currency1: string; hooks: string; poolManager: string; fee: number; parameters: string; }; export type GraduatedDexMetrics = { price: string; progress: string; poolBNBAmount: string; poolTokenAmount: string; poolId?: string; infinityFee?: number; dexKind?: 'PCS_INFINITY_CL' | 'PANCAKE_V3' | 'PORTAL_QUOTE'; }; export declare function sortInfinityCurrencies(a: string, b: string): [string, string]; export declare function computeInfinityPoolId(key: InfinityPoolKey): string; export declare function buildFlapInfinityPoolKey(params: { tokenAddress: string; quoteTokenAddress: string; chain: string; lpFeeProfile?: number; }): InfinityPoolKey | null; /** 判断 getTokenV7.pool 是否为 Infinity CL PoolManager(而非 V3 pair) */ export declare function isInfinityCLPoolManagerAddress(pool: string, chain: string): boolean; /** 仅 V7 + Infinity CL 才走 Infinity 专用逻辑 */ export declare function isFlapInfinityCLGraduated(state: { pool?: string; tokenVersion?: bigint | number; }, chain: string): boolean; /** Portal quoteExactInput:链上 quoteToken 为 0 时必须用 native(0),不能用 WBNB */ export declare function resolvePortalQuoteInputToken(quoteTokenAddress: string, wrappedNativeAddress: string): string; export declare function infinitySpotPriceQuotePerToken(params: { sqrtPriceX96: bigint; tokenAddress: string; currency0: string; currency1: string; quoteTokenAddress: string; tokenDecimals?: number; quoteDecimals?: number; }): string | null; /** * Flap 毕业后(status=4)外盘统一入口: * - V7 / Infinity CL → Infinity + Portal quote 深度 * - 旧版 V3/V2(pool 为 pair 地址)→ 读 pair 余额 + slot0 * - 否则仅 Portal quote */ export declare function getFlapGraduatedDexMetrics(params: { portal: FlapPortal; tokenAddress: string; state: TokenStateV7; rpcUrl: string; wrappedNativeAddress?: string; chain?: string; }): Promise;