On this page
JSON-RPC Reference
Reference for common Ethereum JSON-RPC and wallet methods used with OneKey.
All methods are called via window.$onekey.ethereum.request({ method, params }).
Account Methods
| Method | Description |
|---|---|
| eth_requestAccounts | Request user’s accounts (triggers connection popup) |
| eth_accounts | Get connected accounts (no popup) |
| wallet_requestPermissions | Request specific permissions |
| wallet_getPermissions | Get current permissions |
Transaction Methods
| Method | Description |
|---|---|
| eth_sendTransaction | Send a transaction |
| eth_call | Execute a call without creating a transaction |
| eth_estimateGas | Estimate gas for a transaction |
| eth_getTransactionByHash | Get transaction by hash |
| eth_getTransactionReceipt | Get transaction receipt |
Signing Methods
| Method | Description |
|---|---|
| personal_sign | Sign a message (EIP-191) |
| eth_signTypedData_v4 | Sign typed data (EIP-712) |
Network Methods
| Method | Description |
|---|---|
| eth_chainId | Get current chain ID |
| wallet_switchEthereumChain | Switch to a different chain |
| wallet_addEthereumChain | Add a new chain |
| wallet_watchAsset | Add a token to wallet |
Standard Ethereum Methods
Additional Ethereum JSON-RPC methods depend on the connected network and wallet implementation. See the Ethereum JSON-RPC specification for the complete list.
Common methods include:
eth_blockNumber- Get current block numbereth_getBalance- Get account balanceeth_getCode- Get contract codeeth_getLogs- Get event logs
Last updated on