UNPKG

kirapay-axelar-sdk

Version:

TypeScript SDK for cross-chain swaps with CCIP and Axelar bridges

41 lines (40 loc) 1.39 kB
import { ConfigManager } from "../core/config"; import { type QuoteParams, type RouteQuote } from "./types"; import { SwapRoute, SwapToRatioRoute } from "@uniswap/smart-order-router"; /** * Service that uses Uniswap Smart Order Router for optimal routing decisions * This replaces the manual fee tier scanning and path finding logic */ export declare class SmartOrderRouterService { private configManager; private routers; constructor(configManager: ConfigManager); /** * Get or create AlphaRouter for a specific chain */ private getRouter; /** * Convert our Token type to Uniswap SDK Token */ private toUniToken; /** * Get optimal route using Smart Order Router * @param params Quote parameters * @param slippageBps Slippage tolerance in basis points (1 = 0.01%), defaults to 50 (0.5%) * @returns Optimal route with quote and full quote object for transaction building */ getOptimalRoute(params: QuoteParams, slippageBps?: number): Promise<{ value: bigint; route: RouteQuote; quote: SwapRoute | SwapToRatioRoute; }>; /** * Extract simplified route info from Smart Order Router quote * Supports V2, V3 and V4 pool legs */ private extractRouteInfo; /** * Get token decimal from the blockchain using viem */ private getTokenDecimal; }