import { RouteResponse, BRIDGES, SwapVenue, SkipSupportedAsset, LifiRouteResponse, IncludedStep, LifiSupportedAsset, RelayRouteResponse, RelayFee } from '@leapwallet/elements-core'; import { SWRConfiguration } from 'swr'; import type { OperationJSON } from '@skip-go/client'; import { SkipSupportedChainData } from './use-skip-supported-chains'; export type UseRouteResponse = { sourceAssetChain: SkipSupportedChainData; sourceAsset: SkipSupportedAsset; destinationAssetChain: SkipSupportedChainData; destinationAsset: SkipSupportedAsset; transactionCount: number; operations: OperationJSON[]; amountIn: string; amountOut?: string; destinationAddress?: string; response: RouteResponse; }; export type UseAggregatedRouteResponse = { aggregator: RouteAggregator; sourceAssetChain: SkipSupportedChainData; sourceAsset: LifiSupportedAsset | SkipSupportedAsset; destinationAssetChain: SkipSupportedChainData; destinationAsset: LifiSupportedAsset | SkipSupportedAsset; transactionCount: number; operations: OperationJSON[] | IncludedStep[] | RelayRouteResponse['steps']; amountIn: string; amountOut?: string; destinationAddress?: string; response: LifiRouteResponse | RouteResponse | RelayRouteResponse; }; export declare enum RouteAggregator { LIFI = "LIFI", SKIP = "SKIP", RELAY = "RELAY" } export type LifiRouteOverallResponse = { aggregator: RouteAggregator.LIFI; response: LifiRouteResponse; sourceAssetChain: SkipSupportedChainData; sourceAsset: SkipSupportedAsset; transactionCount: number; operations: IncludedStep[]; amountIn: string; amountOut: string; destinationAssetChain: SkipSupportedChainData; destinationAsset: SkipSupportedAsset; }; export type SkipRouteResponse = { aggregator: RouteAggregator.SKIP; response: RouteResponse; sourceAssetChain: SkipSupportedChainData; sourceAsset: SkipSupportedAsset; destinationAssetChain: SkipSupportedChainData; destinationAsset: SkipSupportedAsset; transactionCount: number; operations: OperationJSON[]; amountIn: string; amountOut: string; }; export declare class RouteError extends Error { constructor(message: string); } /** * React hook to get the Skip Route Quote for an amount, a source token/chain and destination token/chain pair * * @deprecated */ export declare const useRoute: (amountIn: string, sourceAsset?: SkipSupportedAsset, sourceAssetChain?: SkipSupportedChainData, destinationAsset?: SkipSupportedAsset, destinationAssetChain?: SkipSupportedChainData, enabled?: boolean, allowedBridges?: BRIDGES[], swapVenues?: SwapVenue[], enableSmartSwap?: boolean, smartRelay?: boolean, config?: SWRConfiguration, isDirectTransfer?: boolean, basisPointsFees?: string) => { readonly routeResponse: { sourceAssetChain: SkipSupportedChainData; sourceAsset: SkipSupportedAsset; destinationAssetChain: SkipSupportedChainData; destinationAsset: SkipSupportedAsset; transactionCount: number; operations: any[]; amountIn: string; amountOut: string; response: RouteResponse; } | undefined; readonly routeError: any; readonly amountOut: string; readonly isLoadingRoute: boolean; readonly routeKey: string | null; readonly refresh: () => Promise; readonly isValidatingRoute: boolean; }; /** * React hook to get the Skip Route Quote for an amount, a source token/chain and destination token/chain pair */ export declare const useRouteV2: ({ amountIn, sourceAsset, sourceAssetChain, destinationAsset, destinationAssetChain, enabled, allowedBridges, swapVenues, enableSmartSwap, smartRelay, isDirectTransfer, basisPointsFees, enableEvmSwap, enableGoFast }: { enabled: boolean; smartRelay: boolean; amountIn: string; sourceAsset?: SkipSupportedAsset | undefined; sourceAssetChain?: SkipSupportedChainData | undefined; destinationAsset?: SkipSupportedAsset | undefined; destinationAssetChain?: SkipSupportedChainData | undefined; allowedBridges?: BRIDGES[] | undefined; swapVenues?: SwapVenue[] | undefined; enableSmartSwap?: boolean | undefined; isDirectTransfer?: boolean | undefined; basisPointsFees?: string | undefined; enableEvmSwap?: boolean | undefined; enableGoFast?: boolean | undefined; }, config?: SWRConfiguration) => { readonly routeResponse: { sourceAssetChain: SkipSupportedChainData; sourceAsset: SkipSupportedAsset; destinationAssetChain: SkipSupportedChainData; destinationAsset: SkipSupportedAsset; transactionCount: number; operations: any[]; amountIn: string; amountOut: string; response: RouteResponse; } | undefined; readonly routeError: any; readonly amountOut: string; readonly isLoadingRoute: boolean; readonly routeKey: string | null; readonly refresh: () => Promise; readonly isValidatingRoute: boolean; }; export type AffiliateFeesPaid = { totalBasisPoints: number; affiliates: { feeBasisPoints: number; address: string; }[]; }; export declare const useRouteV2WithFees: ({ amountIn, sourceAsset, sourceAssetChain, destinationAsset, destinationAssetChain, enabled, allowedBridges, swapVenues, enableSmartSwap, smartRelay, isDirectTransfer, basisPointsFees, enableEvmSwap, enableGoFast }: { enabled: boolean; smartRelay: boolean; amountIn: string; sourceAsset?: SkipSupportedAsset | undefined; sourceAssetChain?: SkipSupportedChainData | undefined; destinationAsset?: SkipSupportedAsset | undefined; destinationAssetChain?: SkipSupportedChainData | undefined; allowedBridges?: BRIDGES[] | undefined; swapVenues?: SwapVenue[] | undefined; enableSmartSwap?: boolean | undefined; isDirectTransfer?: boolean | undefined; basisPointsFees?: string | undefined; enableEvmSwap?: boolean | undefined; enableGoFast?: boolean | undefined; }, affiliates?: { [x: string]: { affiliates: { basis_points_fee: string; address: string; }[]; totalBasisPoints: number; }; } | undefined, config?: SWRConfiguration) => { readonly routeResponse: { sourceAssetChain: SkipSupportedChainData; sourceAsset: SkipSupportedAsset; destinationAssetChain: SkipSupportedChainData; destinationAsset: SkipSupportedAsset; transactionCount: number; operations: any[]; amountIn: string; amountOut: string; response: RouteResponse; } | undefined; readonly routeError: any; readonly amountOut: string; readonly isLoadingRoute: boolean; readonly routeKey: string | null; readonly refresh: () => Promise; readonly isValidatingRoute: boolean; readonly affiliateFeesPaid: { totalBasisPoints: number; affiliates: { feeBasisPoints: number; address: string; }[]; } | undefined; }; export interface SkipRouteData { aggregator: RouteAggregator.SKIP; response: RouteResponse; } export interface LifiRouteData { aggregator: RouteAggregator.LIFI; response: LifiRouteResponse; } export interface RelayRouteData { aggregator: RouteAggregator.RELAY; response: RelayRouteResponse; } interface BaseRouteResult { sourceAssetChain: SkipSupportedChainData; sourceAsset: SkipSupportedAsset; destinationAssetChain: SkipSupportedChainData; destinationAsset: SkipSupportedAsset; transactionCount: number; amountIn: string; amountOut: string; } export interface SkipRouteResult extends BaseRouteResult, SkipRouteData { operations: RouteResponse['operations']; } export interface LifiRouteResult extends BaseRouteResult, LifiRouteData { operations: LifiRouteResponse['steps']; } export interface RelayRouteResult extends BaseRouteResult, RelayRouteData { operations: RelayRouteResponse['steps']; } export type AggregatorRouteResult = SkipRouteResult | LifiRouteResult | RelayRouteResult; export interface UseAggregatedRouteReturn { routeResponse?: AggregatorRouteResult; routeError?: Error; amountOut: string; isLoadingRoute: boolean; routeKey: string | null; refresh: () => void; isValidatingRoute: boolean; } /** * React hook to use multiple liquidity aggregator services to get the Route Quote for an amount, a source token/chain and destination token/chain pair */ export declare const useAggregatedRoute: (amountIn: string, sourceAsset?: SkipSupportedAsset, sourceAssetChain?: SkipSupportedChainData, destinationAsset?: SkipSupportedAsset, destinationAssetChain?: SkipSupportedChainData, enabled?: boolean, allowedBridges?: BRIDGES[], swapVenues?: SwapVenue[], enableSmartSwap?: boolean, smartRelay?: boolean, config?: SWRConfiguration, isDirectTransfer?: boolean, basesPointFee?: string, sourceChainAddress?: string, enableEvmSwap?: boolean, enableGoFast?: boolean) => { routeResponse: SkipRouteResult | LifiRouteResult | undefined; routeError: any; amountOut: string; isLoadingRoute: boolean; routeKey: string | null; refresh: () => Promise; isValidatingRoute: boolean; }; /** * Aggregated Route with fees, extension of useRouteV2WithFees * TODO: account affiliate fees for LiFi routes and chains */ export declare const useAggregatedRouteV2WithFees: ({ amountIn, sourceAsset, sourceAssetChain, destinationAsset, destinationAssetChain, enabled, allowedBridges, swapVenues, enableSmartSwap, smartRelay, isDirectTransfer, basisPointsFees, sourceChainAddress, destinationChainAddress, selectedAggregator, lifiIntegratorName, lifiFeePercentage, relayFees, enableEvmSwap, enableGoFast }: { enabled: boolean; smartRelay: boolean; amountIn: string; sourceAsset?: SkipSupportedAsset | undefined; sourceAssetChain?: SkipSupportedChainData | undefined; destinationAsset?: SkipSupportedAsset | undefined; destinationAssetChain?: SkipSupportedChainData | undefined; allowedBridges?: BRIDGES[] | undefined; swapVenues?: SwapVenue[] | undefined; enableSmartSwap?: boolean | undefined; isDirectTransfer?: boolean | undefined; basisPointsFees?: string | undefined; sourceChainAddress?: string | undefined; destinationChainAddress?: string | undefined; selectedAggregator?: RouteAggregator | undefined; lifiIntegratorName?: string | undefined; lifiFeePercentage?: number | undefined; relayFees?: RelayFee[] | undefined; enableEvmSwap?: boolean | undefined; enableGoFast?: boolean | undefined; }, affiliates?: { [x: string]: { affiliates: { basis_points_fee: string; address: string; }[]; totalBasisPoints: number; }; } | undefined, config?: SWRConfiguration) => { readonly routeResponse: AggregatorRouteResult | undefined; readonly routeError: any; readonly amountOut: string; readonly isLoadingRoute: boolean; readonly routeKey: string | null; readonly refresh: () => Promise; readonly isValidatingRoute: boolean; readonly affiliateFeesPaid: { totalBasisPoints: number; affiliates: { feeBasisPoints: number; address: string; }[]; } | undefined; readonly isGoFastRouteAvailable: any; }; export {};