/** * LP 查询 - 类型定义 */ import type { FlapChain } from '../../flap/portal.js'; export interface DexConfig { name: string; v2Factory?: string; v3Factory?: string; v2Router?: string; v3Router?: string; quoterV2?: string; enabled: boolean; } export interface ChainDexConfig { wrappedNative: string; wrappedNativeSymbol: string; stableCoins: Array<{ address: string; symbol: string; decimals: number; }>; dexes: Record; } export interface PoolPairInfo { quoteToken: string; quoteSymbol: string; quoteDecimals: number; pairAddress: string; reserveToken: string; reserveQuote: string; reserveQuoteRaw?: bigint; reserveTokenRaw?: bigint; poolRatio?: string; } export interface V3PoolInfo extends PoolPairInfo { fee: number; } export interface DexPoolInfo { dexName: string; dexKey: string; v2Pairs: PoolPairInfo[]; v3Pools: V3PoolInfo[]; } export interface BestPoolInfo { dex: string; dexKey: string; version: 'v2' | 'v3'; fee?: number; quoteToken: string; quoteSymbol: string; quoteDecimals: number; pairAddress: string; liquidity: string; liquidityRaw: bigint; reserveToken?: string; reserveTokenRaw?: bigint; poolRatio?: string; } export type LPPlatform = 'FOUR' | 'FLAP' | 'DAOAAS' | 'PANCAKESWAP_V2' | 'PANCAKESWAP_V3' | 'UNISWAP_V2' | 'UNISWAP_V3' | 'IROSWAP_V2' | 'MULTI_DEX' | 'UNKNOWN'; export interface LPInfo { platform: LPPlatform; decimals?: number; totalSupply?: string; totalSupplyRaw?: bigint; taxRate?: number; four?: { helper: string; reserveNative?: string; offerTokens?: string; lastPrice?: string; }; flap?: { quoteToken?: string; quoteSymbol?: string; quoteDecimals?: number; reserveNative?: string; circulatingSupply?: string; price?: string; taxRate?: number; }; daoaas?: { quoteToken?: string; quoteSymbol?: string; quoteDecimals?: number; reserveNative?: string; circulatingSupply?: string; price?: string; status?: number; }; allPools: DexPoolInfo[]; bestPools: BestPoolInfo[]; } export interface InspectOptions { chain: 'BSC' | 'MONAD' | 'XLAYER' | 'ENI'; rpcUrl: string; flapChain?: FlapChain; v3FeeTiers?: number[]; customDexConfig?: Partial; multicall3?: string; debug?: boolean; formatBalances?: boolean; }