/** * Withdrawal Processing Transaction Decoder * * Decodes transaction calldata to extract which (year, month, day) cluster * was processed when a WithdrawalProcessed event was emitted. */ import type { ContractTransactionReceipt, Interface } from 'ethers'; export interface ProcessingCallData { functionName: 'processAllClaimsByDate' | 'claim' | 'unknown'; year: number; month: number; day: number; maxLimit?: number; receiverAddr?: string; error?: string; } /** * Decode withdrawal processing transaction calldata. * Handles both processAllClaimsByDate() and claim() functions. * * Both functions have the same first 3 parameters: (year, month, day) * * @param txData - Raw transaction data (tx.data from provider.getTransaction()) * @param iface - ethers Interface initialized with vault ABI * @returns Decoded parameters or error */ export declare function decodeWithdrawalProcessing(txData: string, iface: Interface): ProcessingCallData; /** * Fallback: Parse receipt logs if calldata decoding fails. * * This handles the multicall wrapper case where the outer tx.data * is the multicall wrapper, not the vault function. By parsing logs, * we can infer what happened on-chain. * * Note: This is a best-effort fallback. Ideal solution is Option 2 * (subgraph indexing) to avoid RPC calls altogether. * * @param receipt - Transaction receipt from provider * @param vaultAddress - Expected vault address * @param iface - ethers Interface with vault ABI * @returns Decoded parameters from logs, or error */ export declare function decodeFromReceiptLogs(receipt: ContractTransactionReceipt | null, vaultAddress: string, iface: Interface): Promise; /** * Detect if this is a multicall/batch transaction. * Common patterns: * - Uniswap Multicall: 0x1f0464f6 * - Gnosis Safe: 0x6a761202 * - 1inch Aggregator: 0x7c025200 * * @param functionName - Function name from parsed decoded tx * @returns true if this appears to be a batch/multicall */ export declare function isMulticall(functionName: string): boolean; /** * Detect if the decoded function is one we care about for withdrawal processing. * * @param functionName - Function name from decoding * @returns true if this is a withdrawal processing function */ export declare function isWithdrawalProcessingFunction(functionName: string): boolean;