eth_getbalance - Worldchain

Example code for the eth_getBalance JSON-RPC method. Complete guide on how to use eth_getBalance JSON-RPC in GetBlock Web3 documentation.

Returns the balance of the specified address on the World Chain network. The balance is returned in wei.

Parameters

Parameter
Type
Description

address

string

The address to check for balance (20 bytes)

blockNumber

string

Block number in hex, or "latest", "earliest", "pending"

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getBalance",
    "params": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "latest"],
    "id": "getblock.io"
}'

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0x2386F26FC10000"
}

Response Parameters

Field
Type
Description

result

string

Hexadecimal representation of the balance in wei

Use Case

The eth_getBalance method on World Chain is typically used for:

  • Wallet balance display

  • Transaction validation

  • Portfolio management

  • Account monitoring

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN

Web3 Integration

Last updated

Was this helpful?