Production readiness
Production readiness — errors, retries, state, security, and observability
Connection & state
Provider detection order:
window.$onekey.ethereum→ OneKey in multi‑provider list →window.ethereumAsk for connection on user intent (avoid unsolicited popups)
Listen to
accountsChanged/chainChangedand recreate clients as needed
Errors & retries
Standard codes: 4001 (rejected), 4902 (unknown chain)
Network/node errors: exponential backoff; capture and classify for telemetry
Tx polling: set timeouts and user guidance to avoid dead‑ends
Security & permissions
Nonce‑based sign‑in to prevent replay (see “Authenticate users”)
Don’t trust frontend‑supplied
chainId/addressserver‑side; re‑validateLimit dangerous RPCs; expose only what you need
Performance & UX
Cache read‑only data sensibly; prefer Multicall for many reads
Show clear network/account and fee information in UI
Prepare deeplinks and Universal Link fallbacks for mobile
Observability & support
Instrument key paths: connect rate, rejection rate, tx success rate
Record error codes with context (chain/node/method)
Provide copy‑ready error details for support and debugging
Last updated
Was this helpful?