/** * Contract Error Handling Utilities * * Provides utilities for extracting and handling contract revert errors. * Maps known error selectors to user-friendly messages. * * @module contracts/errors */ /** * Known contract error signatures mapped to user-friendly messages. * * Error selectors are the first 4 bytes of keccak256(error signature). * Example: keccak256("VaultAlreadyExists()") = 0x04aabf33... */ export declare const CONTRACT_ERRORS: Record; /** * Extract error data from various error formats. * * Viem and wallet providers wrap errors in multiple levels. This function * searches through the error chain to find the revert data. * * @param error - The error object to extract data from * @returns The error data (e.g., "0x04aabf33") or undefined */ export declare function extractErrorData(error: unknown): string | undefined; /** * Get a user-friendly error message for a contract error. * * @param error - The error object from a contract call * @returns A user-friendly error message, or undefined if error is not recognized */ export declare function getContractErrorMessage(error: unknown): string | undefined; /** * Check if an error is a known contract error. * * @param error - The error object to check * @returns True if the error is a known contract error */ export declare function isKnownContractError(error: unknown): boolean; /** * Handle a contract error by throwing a user-friendly error. * * This function extracts error data, maps it to a user-friendly message, * and throws an appropriate error. Use this in catch blocks after contract calls. * * @param error - The error from a contract call * @throws Always throws an error with a descriptive message */ export declare function handleContractError(error: unknown): never; //# sourceMappingURL=errors.d.ts.map