UNPKG

kirapay-axelar-sdk

Version:

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

62 lines (61 loc) 1.72 kB
import { type Address, type ChainId, type Token, type PoolParams } from "../core/types"; export type FeeTier = 0 | 100 | 500 | 3000 | 10000; /** * Parameters for quote request - simplified to use Smart Order Router */ export interface QuoteParams { rpc: string; chainId: ChainId; tokenIn: Address; tokenOut: Address; amountIn: bigint; isSrcSwap?: boolean; } /** * Parameters for swap transaction - simplified to use Smart Order Router */ export interface SwapParams { tokenIn: Token; tokenOut: Token; recipient: Address; amountIn: bigint; amountOut: bigint; minAmountOut: bigint; deadline?: bigint; slippageTolerance?: number; route?: { path: Address[]; fees: FeeTier[]; version: "V2" | "V3" | "V4"; poolAddresses?: Address[]; }; } export interface RouteQuote { gasEstimate: bigint; path: Address[]; fees: FeeTier[]; version: "V2" | "V3" | "V4"; poolAddresses?: Address[]; poolParams: PoolParams[]; } /** * DEX service interface defining functionality for decentralized exchanges */ export interface DexService { /** * Get a quote for a swap using Smart Order Router * @param params Quote parameters * @param slippageBps Slippage tolerance in basis points (1 = 0.01%), defaults to 50 (0.5%) * @returns The estimated output amount, optimal route, and full quote object */ quoteExactIn(params: QuoteParams, slippageBps?: number): Promise<{ value: bigint; route: { path: Address[]; fees: FeeTier[]; version: "V2" | "V3" | "V4"; poolAddresses?: Address[]; }; quote: any; }>; }