//#region extensions/crypto/src/services/dex-aggregator.d.ts /** * DEX Aggregator — multi-source swap quoting with best-price selection. * * Queries multiple DEX aggregators in parallel and returns the best quote * (factoring in output amount and gas cost). Falls back gracefully if any * aggregator is unavailable. * * Supported aggregators: * - 0x (current default) * - 1inch Fusion * - ParaSwap * - CowSwap (MEV-protected) * - Odos (multi-hop optimization) * - KyberSwap * - OpenOcean */ interface SwapQuote { aggregator: string; sellToken: string; buyToken: string; sellAmount: string; buyAmount: string; price: number; gasEstimate: string; gasPrice?: string; gasCostUsd?: number; netOutputUsd?: number; route?: string; data?: unknown; error?: string; } interface AggregatorConfig { enabled?: boolean; apiKeyEnv?: string; baseUrl: string; } interface DexAggregatorConfig { /** Which aggregators to use. Default: all available. */ aggregators?: Partial>; /** Chain ID. Default: 8453 (Base). */ chainId?: number; /** Slippage in basis points. Default: 50 (0.5%). */ slippageBps?: number; /** Quote timeout per aggregator in ms. Default: 5000. */ timeoutMs?: number; } declare class DexAggregator { private chainId; private slippageBps; private timeoutMs; private aggregators; constructor(config?: DexAggregatorConfig); /** Get the list of enabled aggregator names. */ getEnabled(): string[]; /** * Get quotes from all enabled aggregators in parallel. * Returns all results (including errors) sorted by best output. */ getQuotes(sellToken: string, buyToken: string, sellAmount: string, chainId?: number): Promise; /** * Get the single best quote across all aggregators. * Optionally factors in gas cost (if netOutputUsd is available). */ getBestQuote(sellToken: string, buyToken: string, sellAmount: string, chainId?: number): Promise; private fetchSingle; } declare function getDexAggregator(config?: DexAggregatorConfig): DexAggregator; declare function resetDexAggregator(): void; //#endregion export { AggregatorConfig, DexAggregator, DexAggregatorConfig, SwapQuote, getDexAggregator, resetDexAggregator }; //# sourceMappingURL=dex-aggregator.d.mts.map