Coinbase Wallet SDK
eth_getBalance
Get the balance of an account at a given block
Defined in the Ethereum JSON-RPC Specification
Returns the balance of the account of given address.
Parameters
The address to check for balance (20 bytes).
Integer block number, or the string “latest”, “earliest” or “pending”.
Returns
A hexadecimal string representing the current balance in wei.
Error Handling
Code | Message | Description |
---|---|---|
-32602 | Invalid address or block parameter | The provided address or block parameter is invalid |
4100 | Requested method not supported | The method is not supported by the wallet |
The result represents the balance in wei. To convert to ETH, divide by 10^18.