import { EventFragment } from 'ethers'; import type { CcipCctpMessageSentEvent } from './solana/types.ts'; import { type CCIPMessage, type CCIPRequest } from './types.ts'; export declare const LBTC_EVENT: EventFragment; interface CircleDecodedMessageBody { burnToken: string; mintRecipient: string; amount: string; messageSender: string; } interface CircleDecodedMessage { sourceDomain: string; destinationDomain: string; nonce: string; sender: string; recipient: string; destinationCaller: string; messageBody: string; decodedMessageBody?: CircleDecodedMessageBody; } interface CircleMessage { attestation?: string; message: string; eventNonce: string; cctpVersion: number; status: string; decodedMessage?: CircleDecodedMessage; delayReason?: string | null; } interface CircleApiV2Response { messages: CircleMessage[]; } /** * Returns the USDC attestation for a given MessageSent Log * https://developers.circle.com/stablecoins/reference/getattestation * * @param message - payload of USDC MessageSent(bytes message) event * @param isTestnet - true if this was from a testnet * @returns USDC/CCTP attestation bytes */ export declare function getUsdcAttestation(message: string, isTestnet: boolean): Promise; /** * Fetches USDC attestation status using Circle's CCTP v2 API * * @param sourceDomainId - Circle CCTP source domain ID * @param transactionHash - Transaction hash of the USDC transfer * @returns Circle API response with attestation status and details */ export declare function getUsdcAttestationV2(sourceDomainId: number, transactionHash: string): Promise; /** * Fetches offchain token data for cross-chain token transfers * * This is the main entry point for fetching attestations and encoding offchain data * required for CCIP token transfers (e.g., CCTP). * * Routes to chain-specific implementations based on the source chain type: * - Solana sources → fetchSolanaOffchainTokenData(...) * - EVM sources → fetchEVMOffchainTokenData(...) * * Output encoding depends on destination chain: * - EVM destinations → ABI-encoded tuple * - Solana destinations → Borsh-encoded struct * * @param request.tx - Transaction to analyze * @param request.lane - Source and destination chain selectors * @param request.message - CCIP message with token transfer details * @param request.log - Specific log entry that triggered this request * @returns Array of encoded offchain token data * * @throws Error if transaction parsing or attestation fetching fails * * @example * Solana → EVM transfer * const data = await fetchOffchainTokenData({ * lane: { sourceChainSelector: 16423721717087811551n, destChainSelector: 1n }, * message: { tokenAmounts: [...] }, * log: { transactionHash: "3k81..." }, * tx: { logs: [...] } * }) */ export declare function fetchOffchainTokenData(request: Pick & { message: CCIPMessage; log: Pick; }): Promise; /** * Analyzes a Solana transaction to extract CcipCctpMessageSentEvent, fetch Circle attestation, * and encode the data in the format required by the destination chain. * * @param request - CCIP request containing transaction data and chain routing info * @returns Array of encoded offchain token data (only one supported for Solana right now) * * @throws Error if transaction hash is missing or CcipCctpMessageSentEvent parsing fails * * @example * const tokenData = await fetchSolanaOffchainTokenData({ * lane: { sourceChainSelector: ..., destChainSelector: ... }, * message: { ... }, * log: { transactionHash: "3k81TLhJuhwB8fvurCwyMPHXR3k9Tmtqe2ZrUQ8e3rMxk9fWFJT2xVHGgKJg1785FkJcaiQkthY4m86JrESGPhMY" }, * tx: { logs: [...] } * }) */ export declare function fetchSolanaOffchainTokenData(request: Pick & { message: CCIPMessage; log: Pick; }): Promise; /** * Parses CcipCctpMessageSentEvent from a Solana transaction by analyzing program logs * * @param txSignature - Solana transaction signature to analyze * @param sourceChainSelector - Source chain selector to determine RPC endpoint * @returns Array of parsed CcipCctpMessageSentEvent found in the transaction (only 1 supported though) * * @throws Error if transaction is not found or RPC fails * * @example * const events = await parseSolanaCctpEvents( * '3k81TLhJuhwB8fvurCwyMPHXR3k9Tmtqe2ZrUQ8e3rMxk9fWFJT2xVHGgKJg1785FkJcaiQkthY4m86JrESGPhMY', * 16423721717087811551n // Solana Devnet * ) */ export declare function parseCcipCctpEvents(txSignature: string, sourceChainSelector: bigint): Promise; /** * Encodes CCTP message and attestation * * @param destChainSelector - Target chain selector (determines encoding format) * @param message - CCTP message as hex string (e.g., "0x123...") * @param attestation - Circle API attestation as hex string * @returns Encoded data - ABI tuple for EVM, Borsh-encoded for Solana * * @example * * const solanaData = encodeOffchainTokenData(16423721717087811551n, "0x123...", "0xabc...") */ export declare function encodeOffchainTokenData(destChainSelector: bigint, message: string, attestation: string): string; export {}; //# sourceMappingURL=offchain.d.ts.map