Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
处理拒绝、限流和请求失败。
code
message
retryable
retryAfter
export function walletErrorMessage(error: unknown): string { if (typeof error === 'object' && error !== null && 'code' in error) { switch (error.code) { case 'USER_REJECTED': return '已取消操作' case 'UNAUTHORIZED': return '请连接钱包并授权所需功能' case 'CONTEXT_CHANGED': return '账户或网络已变化,请重新确认' case 'RATE_LIMITED': return '请求频繁,请稍后重试' case 'TIMEOUT': return '请求超时,请先查询交易状态' } } return error instanceof Error ? error.message : '钱包请求失败' }