/** * @type {Record} */ export const rpcErrorCodeToMessage = { [-1]: 'Unknown error', // Standard JSON-RPC 2.0 errors [-32700]: 'Parse error', [-32600]: 'Invalid request', [-32601]: 'Method not found', [-32602]: 'Invalid params', [-32603]: 'Internal error', // EIP-1474 and common convention errors [-32000]: 'Invalid input', [-32001]: 'Resource not found', [-32002]: 'Resource unavailable', [-32003]: 'Transaction rejected', [-32004]: 'Method not supported', [-32005]: 'Limit exceeded', [-32015]: 'VM execution error', [-32020]: 'Account locked', [3]: 'Execution reverted', // Tevm-specific implementation errors [-32006]: 'Block gas limit exceeded', [-32007]: 'Unsupported chain', [-32008]: 'Nonce already used', [-32009]: 'Insufficient permissions', [-32011]: 'Transaction too large', [-32012]: 'Invalid gas price', [-32013]: 'Invalid address', [-32014]: 'Transaction underpriced', // Other provider-specific errors (for compatibility) [4001]: 'User rejected request', [4100]: 'Unauthorized', [4200]: 'Method not supported', [4900]: 'Provider disconnected', [4901]: 'Provider disconnected from chain', [-32010]: 'Transaction cost exceeds current gas limit', [-32042]: 'Method not found', [-32500]: 'Invalid user operation', [-32501]: 'User operation validation error', [-32521]: 'Invalid signature', [-32604]: 'Record not found', [-32605]: 'Rate Limit', [-32606]: 'Illegal Ip', [-32607]: 'Call Limit', [-32612]: 'Tracing/debugging blocked', [-32613]: 'Tracing/debugging blocked', [-32616]: 'WebSocket response size exceeded', [-33000]: 'Payment required', [-33100]: 'Forbidden', [-33200]: 'Too Many Requests', [-33300]: 'Too Many Requests', [-33400]: 'Too Many Requests', }