UKey Wallet Ethereum Provider uses the standard JSON-RPC request model. DApp calls account, network, signature and transaction related capabilities through provider.request({ method, params }).
Common methods
| Method | Purpose |
|---|
eth_requestAccounts | Request user authorization and return to account |
eth_accounts | Read the currently authorized account |
eth_chainId | Read the current chain ID |
eth_sendTransaction | Request user confirmation and send the transaction |
eth_sign | Original data signature, not advised for use in production environments |
personal_sign | Prefixed personal message signature |
eth_signTypedData_v4 | EIP-712 Structured Data Signature |
error code
| Code | Description | Recommended handling |
|---|
| 4001 | User rejected the request | Keep the flow retryable and let users retry |
| 4902 | Chain is not recognized | Ask the user to add the network with wallet_addEthereumChain |
| -32602 | Malformed request data | Check parameter order, address, and 0x prefix |
| -32603 | Provider internal failure | Verify the current network, request content, and wallet state |