/** * Unified bridge engine: Circle CCTP V2 (primary, $0 fee) + Relay + deBridge DLN (fallback). * * CCTP V2 routes (all tested with real TX): * Sol→EVM: Circle auto-relay (free) * EVM→EVM: attestation poll + manual receiveMessage on dest chain * EVM→Sol: attestation poll + Solana receiveMessage (ALT + 400k CU) * * Handles USDC bridging between Solana ↔ Arbitrum ↔ Base ↔ HyperCore * for cross-exchange rebalancing in funding arb. */ export declare const CHAIN_IDS: { readonly solana: 7565164; readonly arbitrum: 42161; readonly base: 8453; }; export declare const USDC_ADDRESSES: Record; export declare const EXCHANGE_TO_CHAIN: Record; /** * Check USDC balance on an EVM chain. * Returns balance in USDC (human-readable). */ export declare function getEvmUsdcBalance(chain: string, address: string): Promise; /** * Check USDC balance on Solana. * Returns balance in USDC (human-readable). */ export declare function getSolanaUsdcBalance(ownerPubkey: string): Promise; /** * Check USDC balance for a bridge source chain + address. */ export declare function checkBridgeBalance(srcChain: string, senderAddress: string, requiredAmount: number): Promise<{ balance: number; sufficient: boolean; }>; /** * Get native gas token balance (ETH for EVM, SOL for Solana). * Returns balance in human-readable units. */ export declare function getNativeGasBalance(chain: string, address: string): Promise; /** * Check gas balance on source (and optionally destination) chains before bridging. * Returns errors for any chain with insufficient gas. */ export declare function checkBridgeGasBalance(srcChain: string, srcAddress: string, dstChain: string, dstAddress: string, needsDstGas: boolean): Promise<{ ok: boolean; errors: string[]; }>; export interface BridgeQuote { provider: "debridge" | "cctp" | "relay"; srcChain: string; dstChain: string; amountIn: number; amountOut: number; fee: number; estimatedTime: number; gasIncluded: boolean; gasNote?: string; raw: unknown; } export interface BridgeResult { provider: string; txHash: string; srcChain: string; dstChain: string; amountIn: number; amountOut: number; receiveTxHash?: string; } /** * Get a bridge quote via deBridge DLN. */ export declare function getDebridgeQuote(srcChain: string, dstChain: string, amountUsdc: number, senderAddress: string, recipientAddress: string): Promise; /** * Execute a deBridge bridge transaction. * Returns the TX hash after signing and submitting. */ export declare function executeDebridgeBridge(bridgeQuote: BridgeQuote, signerKey: string): Promise; export declare const CCTP_DOMAINS: Record; /** * Get a CCTP V2 bridge quote. Supports EVM ↔ EVM, Solana ↔ EVM, and → HyperCore. * * Uses Circle Forwarding Service when available (all routes except →Solana): * - Circle handles dst chain mint automatically, no manual receiveMessage needed. * - Service fee ~$0.20 (included in maxFee). * * @param fast - If true, use fast finality (1000): ~1-2 min, $1-1.3 + $0.20 forwarding. * If false (default), use standard finality (2000): ~2-5 min, ~$0.20 forwarding. */ export declare function getCctpQuote(srcChain: string, dstChain: string, amountUsdc: number, fast?: boolean): Promise; /** * Execute a CCTP V2 bridge. Routes to the appropriate implementation. * * @param fast - If true, use fast finality (1000): Circle auto-relays, no manual receiveMessage. * If false (default), use standard finality (2000): cheaper but requires manual relay. */ export declare function executeCctpBridge(srcChain: string, dstChain: string, amountUsdc: number, signerKey: string, recipientAddress: string, dstSignerKey?: string, // EVM key for receiveMessage (Solana→EVM) or Solana key for receiveMessage (EVM→Solana) fast?: boolean): Promise; /** * Call receiveMessage on Solana MessageTransmitter V2 to complete an EVM→Solana bridge. * This mints USDC on Solana after the attestation is ready. */ export declare function executeSolanaReceiveMessage(messageHex: string, // "0x..." CCTP message from Iris API attestationHex: string, // "0x..." attestation from Iris API recipientAddress: string, // Solana wallet pubkey (base58) payerKey: string): Promise; export declare function getRelayQuote(srcChain: string, dstChain: string, amountUsdc: number, senderAddress: string, recipientAddress: string): Promise; export declare function executeRelayBridge(bridgeQuote: BridgeQuote, signerKey: string): Promise; /** * Get the best bridge quote. Strategy: * - CCTP primary ($0 fee) for all routes: Solana↔EVM, EVM↔EVM, →HyperCore * - Relay + deBridge DLN in parallel, pick cheapest */ /** * Get quotes from ALL available providers in parallel. * Returns sorted by amountOut (best first). */ export declare function getAllQuotes(srcChain: string, dstChain: string, amountUsdc: number, senderAddress: string, recipientAddress: string): Promise; /** * Get the best quote across all providers. */ export declare function getBestQuote(srcChain: string, dstChain: string, amountUsdc: number, senderAddress: string, recipientAddress: string): Promise; /** * Execute a bridge using the specified or best available provider. * @param provider - Optional: force a specific provider ("cctp" | "relay" | "debridge") */ export declare function executeBestBridge(srcChain: string, dstChain: string, amountUsdc: number, signerKey: string, senderAddress: string, recipientAddress: string, dstSignerKey?: string, // Optional EVM key for manual receiveMessage (standard finality) provider?: "cctp" | "relay" | "debridge", fast?: boolean): Promise; /** * Check bridge order status via deBridge. */ export declare function checkDebridgeStatus(orderId: string): Promise>;