import { AnyNumber } from '@aptos-labs/ts-sdk'; interface SwapAMMParams { poolId: string; a2b: boolean; fixedAmountIn?: boolean; amount0: AnyNumber; amount1: AnyNumber; } interface SwapCLMMParams { poolId: string; amountIn: AnyNumber; minAmountOut: AnyNumber; a2b: boolean; fixedAmountIn: boolean; targetSqrtPrice: AnyNumber; } interface SwapStableParams { poolId: string; tokenIn: number; tokenOut: number; amountIn: AnyNumber; minAmountOut: AnyNumber; } interface BookEntry { amountIn: string; amountOut: string; price: string; } interface EstSwapBook { entries: BookEntry[]; from: number; to: number; } interface EstSwapBooks { books: [EstSwapBook, EstSwapBook]; poolId: string; } type SwapSourceField = "input" | "output"; interface GetEstSwapParams { amount: number; poolId: string; pair: [number, number]; a2b: boolean; field?: SwapSourceField; } interface EstSwapResult { amount: number; estAmount: number; field: SwapSourceField; error?: Error; } interface SwapSORParams { routeMatrix: RouteMatrix[]; amounts: string[]; slippage?: number; } interface GetSOREstSwapParams { poolId?: string; amount: number; fromAddr: string; toAddr: string; field?: SwapSourceField; } interface SOROrderBook { routeMatrix: RouteMatrix[][]; entries: Entry[]; fromAddr: string; toAddr: string; } interface RouteMatrix { plainPool: PlainPool; fromIdx: number; toIdx: number; } interface PlainPool { poolId: string; tokens: Token[]; sqrtPrice: string; feeTier: string; totalShare: string; liquidity: string; poolType: "CLMM" | "AMM" | "STABLE"; tickSpacing: number; amp: string; offpegFeeMultiplier: string; } interface Token { tokenAddr: string; tokenIdx: number; reserve: string; decimals: number; isVerified: boolean; img: string; ticker: string; color: string; } interface Entry { amounts: string[]; prices: string[]; routeIdx: number; isExceed: boolean; } interface SOREstSwapResult { sourceAmount: string; destAmount: string; sourceField: SwapSourceField; destField: SwapSourceField; amounts: string[]; error?: Error; routeIdx: number; prices: string[]; priceImpact: string; estPriceImpact: string; isExceed: boolean; routeMatrix: RouteMatrix[]; } export type { BookEntry, Entry, EstSwapBook, EstSwapBooks, EstSwapResult, GetEstSwapParams, GetSOREstSwapParams, PlainPool, RouteMatrix, SOREstSwapResult, SOROrderBook, SwapAMMParams, SwapCLMMParams, SwapSORParams, SwapSourceField, SwapStableParams, Token };