export declare enum McpErrorCode { UNKNOWN = 1000, INTERNAL = 1001, INVALID_PARAMS = 1002, NOT_FOUND = 1003, TIMEOUT = 1004, CHAIN_NOT_INITIALIZED = 2000, CHAIN_NOT_FOUND = 2001, CHAIN_NOT_READY = 2002, CHAIN_WRITE_DISABLED = 2003, CHAIN_CONNECTION_FAILED = 2004, AGENT_NOT_FOUND = 3000, AGENT_INVALID_ID = 3001, AGENT_PARSE_ERROR = 3002, FEEDBACK_NOT_FOUND = 4000, FEEDBACK_INVALID_SCORE = 4001, FEEDBACK_SUBMIT_FAILED = 4002, CACHE_INIT_FAILED = 5000, CACHE_QUERY_FAILED = 5001, CACHE_SYNC_FAILED = 5002, INDEXER_NOT_AVAILABLE = 6000, INDEXER_QUERY_FAILED = 6001, CONFIG_INVALID = 7000, CONFIG_MISSING_REQUIRED = 7001, WALLET_ERROR = 8000, WALLET_NOT_FOUND = 8001, WALLET_LOCKED = 8002, WALLET_INVALID_PASSWORD = 8003 } export declare class McpError extends Error { readonly code: McpErrorCode; readonly details?: Record; constructor(code: McpErrorCode, message: string, details?: Record); toJSON(): Record; static isNotFound(error: unknown): boolean; } export declare function notFoundError(resource: string, id: string): McpError; export declare function invalidParamsError(message: string, params?: Record): McpError; export declare function chainNotReadyError(chainId: string): McpError; export declare function chainNotFoundError(chainId: string): McpError; export declare function agentNotFoundError(agentId: string): McpError; export declare function indexerNotAvailableError(chainId: string): McpError; export declare function walletError(message: string, details?: Record): McpError; /** * Sanitize error messages to prevent sensitive data leakage * Removes potential private keys, tokens, and other sensitive patterns */ export declare function sanitizeErrorMessage(message: string): string; /** * Wrap a handler function with error handling * Converts unexpected errors to McpError with sanitized message */ export declare function wrapHandler(handler: (args: unknown) => Promise, context: string): (args: unknown) => Promise; //# sourceMappingURL=mcp-error.d.ts.map