import { SupportedChain } from './types'; import { IAsyncStorage } from './storage'; export declare enum RelayChainId { solana = "792703809", bitcoin = "8253038" } export declare enum TradeType { EXACT_INPUT = "EXACT_INPUT", EXACT_OUTPUT = "EXACT_OUTPUT", EXPECTED_OUTPUT = "EXPECTED_OUTPUT" } type NativeToken = { id: string; symbol: string; name: string; address: string; decimals: number; supportsBridging: boolean; }; type ChainContracts = { multicall3: string; multicaller: string; onlyOwnerMulticaller: string; relayReceiver: string; erc20Router: string; approvalProxy: string; }; type RelayAsset = { chainId: number; address: string; symbol: string; name: string; decimals: number; metadata: { logoURI: string; verified: boolean; isNative: boolean; }; }; type RelaySupportedAsset = { chainId: string; originDenom: string; originChainId: string; denom: string; name: string; symbol: string; decimals: number; logoUri: string; coingeckoId: string | undefined; tokenContract?: string; trace: string; isCw20: boolean | undefined; priceUSD?: string; }; export type RelaySupportedAssetsArgs = { chainIds?: string[]; defaultList: boolean; depositAddressOnly: boolean; term?: string; verified?: boolean; limit?: number; }; export type RelayFee = { recipient: string; fee: string; }; export type RelayRouteRequest = { user?: string; recipient?: string; originChainId: string; destinationChainId: string; originCurrency: string; destinationCurrency: string; amount: string; tradeType: TradeType; txs?: { to: string; value: string; data: string; }[]; referrer?: string; refundTo?: string; refundOnOrigin?: boolean; useReceiver?: boolean; useExternalLiquidity?: boolean; usePermit?: boolean; useDepositAddress?: boolean; /** * Use BPS (basis points) for slippage */ slippageTolerance?: string; appFees?: RelayFee[]; gasLimitForDepositSpecifiedTxs?: number; userOperationGasOverhead?: number; forceSolverExecution?: boolean; }; type RelayFees = { currency: RelayAsset; amount: string; amountFormatted: string; amountUsd: string; minimumAmount: string; }; export type StepItem = { status: string; data: { from: string; to: string; data: string; value: string; maxFeePerGas: string; maxPriorityFeePerGas: string; chainId?: number; }; check: { endpoint: string; method: string; }; }; export type TransactionStep = { id: string; action: string; description: string; kind: 'transaction' | 'signature'; requestId: string; items: StepItem[]; }; export type RelayRouteResponse = { steps: TransactionStep[]; fees: { gas: RelayFees; relayer: RelayFees; relayerGas: RelayFees; relayerService: RelayFees; app: RelayFees; }; details: { operation: 'send' | 'swap' | 'wrap' | 'unwrap' | 'bridge'; sender: string; recipient: string; currencyIn: { currency: RelayAsset; amount: string; amountFormatted: string; amountUsd: string; minimumAmount: string; }; currencyOut: { currency: RelayAsset; amount: string; amountFormatted: string; amountUsd: string; minimumAmount: string; }; totalImpact: { usd: string; percent: string; }; swapImpact: { usd: string; percent: string; }; rate: string; slippageTolerance: { origin: { usd: string; value: string; percent: string; }; destination: { usd: string; value: string; percent: string; }; }; timeEstimate: number; userBalance: string; }; does_swap: boolean; swap_price_impact_percent?: string; request?: RelayRouteRequest; }; export type RelayTrackTransactionRequest = { requestId: string; }; export type RelayTrackerResponse = { status: 'refund' | 'delayed' | 'waiting' | 'failure' | 'pending' | 'success'; inTxHashes: string[]; txHashes: string[]; time: number; originChainId: number; destinationChainId: number; }; export type ChainVM = 'evm' | 'bvm'; export type RelayChain = { id: number; name: string; displayName: string; httpRpcUrl?: string; wsRpcUrl?: string; explorerUrl?: string; icon: { dark?: string; light?: string; squaredDark?: string; squaredLight?: string; }; currency: NativeToken; depositEnabled?: boolean; blockProductionLagging?: boolean; iconUrl: string | null; logoUrl: string | null; brandColor?: string | null; vmType?: ChainVM; baseChainId?: number | null; contracts: ChainContracts; }; export declare const RELAY_API_BASE_URL = "https://api.relay.link"; export declare class RelayAPI { private static cache; private static activeRequests; private static ky; static isCacheInitialized(): boolean; static initializeCache(storage: IAsyncStorage): void; static getChains(includeChains?: string): Promise<{ success: false; error: string; } | { success: true; chains: RelayChain[]; }>; static getSupportedChains(): Promise<{ success: false; error: string; } | { success: true; chains: SupportedChain[]; }>; static getSupportedAssets(args: RelaySupportedAssetsArgs): Promise<{ success: false; error: string; } | { success: true; assets: Record; }>; static getRoute(args: RelayRouteRequest): Promise<{ success: false; error: string; } | { success: true; route: RelayRouteResponse; }>; static trackTransaction(args: RelayTrackTransactionRequest): Promise<{ success: true; response: RelayTrackerResponse; } | { success: false; error: string; }>; static getTokenPrice(address?: string, chainId?: string, expiryDuration?: number): Promise; } export {};