eth_getBalance
eth_getBalance(address, blockNumber) → quantity Returns the OKRW balance of the specified address at a given block. Since OKRW is the native token, this returns the native balance (equivalent to ETH balance on Ethereum).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
address | string | ✓ | The address to check balance for (20 bytes, hex-encoded with 0x prefix) |
blockNumber | string | ✓ | Block number in hex, or 'latest', 'earliest', 'pending' |
Returns
Type:
string The balance in aokrw (base units, hex-encoded; 18 decimals, mirroring Ethereum's wei↔ETH). Divide by 10^18 to get the display OKRW amount.
Errors
| Code | Name | Description |
|---|---|---|
-32602 | Invalid params | Invalid address format or block number |
Examples
Get balance at latest block
Returns the current OKRW balance of the address
curl -X POST https://rpc-testnet.maroo.io \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "latest"],
"id": 1
}' Response
0xD3C21BCECCEDA1000000 decodes to 10^24 aokrw — that is, 1,000,000 OKRW.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xD3C21BCECCEDA1000000"
}