Skip to main content

JSON-RPC reference

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

MethodPurpose
eth_requestAccountsRequest user authorization and return to account
eth_accountsRead the currently authorized account
eth_chainIdRead the current chain ID
eth_sendTransactionRequest user confirmation and send the transaction
eth_signOriginal data signature, not advised for use in production environments
personal_signPrefixed personal message signature
eth_signTypedData_v4EIP-712 Structured Data Signature

error code

CodeDescriptionRecommended handling
4001User rejected the requestKeep the flow retryable and let users retry
4902Chain is not recognizedAsk the user to add the network with wallet_addEthereumChain
-32602Malformed request dataCheck parameter order, address, and 0x prefix
-32603Provider internal failureVerify the current network, request content, and wallet state