Docs
Supported ChainsImmutableJSON-RPC APIAccount Methods

eth_getBalance - Immutable RPC Method

Query account balance on Immutable. Essential for wallet applications and Web3 gaming (Gods Unchained, RavenQuest), gaming NFTs with enforced royalties, and cross-chain game assets on the gaming-optimized zkEVM with 660+ games, 5.5M+ Passport signups, and $40M TVL.

Returns the balance of a given address on Immutable.

Why Immutable? Build on the gaming-optimized zkEVM with 660+ games, 5.5M+ Passport signups, and $40M TVL with first EVM chain with enforceable royalties, Polygon zkEVM technology, $2B+ ecosystem funding, and Agglayer cross-chain liquidity.

Use Cases

The eth_getBalance method is essential for:

  • Wallet applications - Display user balances
  • Transaction validation - Check if account has sufficient funds
  • DeFi applications - Monitor collateral and liquidity for Web3 gaming (Gods Unchained, RavenQuest), gaming NFTs with enforced royalties, and cross-chain game assets
  • Account monitoring - Track balance changes over time

Request Parameters

Request
addressDATA

20-byte address to check balance for

blockParameterQUANTITY|TAG

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

Response Body

Response
resultQUANTITY

Integer of the current balance in wei (hexadecimal)

Code Examples

Bash
curl -X POST https://api-immutable-zkevm-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_getBalance",
    "params": [
      "0x3A0C2Ba54D6CBd3121f01b96DFd20e99D1696c9D",
      "latest"
    ],
    "id": 1
  }'
JavaScript
import { JsonRpcProvider, formatEther } from 'ethers';

const provider = new JsonRpcProvider('https://api-immutable-zkevm-mainnet.n.dwellir.com/YOUR_API_KEY');

const address = '0x3A0C2Ba54D6CBd3121f01b96DFd20e99D1696c9D';
const balanceWei = await provider.getBalance(address);
const balance = formatEther(balanceWei);

console.log(`Balance: ${balance}`);

// Get balance at specific block
const historicalBalance = await provider.getBalance(address, 1000000);
console.log(`Historical balance: ${formatEther(historicalBalance)}`);
Python
from web3 import Web3

w3 = Web3(Web3.HTTPProvider('https://api-immutable-zkevm-mainnet.n.dwellir.com/YOUR_API_KEY'))

address = '0x3A0C2Ba54D6CBd3121f01b96DFd20e99D1696c9D'
balance_wei = w3.eth.get_balance(address)
balance = w3.from_wei(balance_wei, 'ether')

print(f'Balance: {balance}')

# Get balance at specific block
historical_balance = w3.eth.get_balance(address, block_identifier=1000000)
print(f'Historical balance: {w3.from_wei(historical_balance, "ether")}')
Go
package main

import (
    "context"
    "fmt"
    "log"
    "math/big"

    "github.com/ethereum/go-ethereum/common"
    "github.com/ethereum/go-ethereum/ethclient"
)

func main() {
    client, err := ethclient.Dial("https://api-immutable-zkevm-mainnet.n.dwellir.com/YOUR_API_KEY")
    if err != nil {
        log.Fatal(err)
    }

    address := common.HexToAddress("0x3A0C2Ba54D6CBd3121f01b96DFd20e99D1696c9D")
    balance, err := client.BalanceAt(context.Background(), address, nil)
    if err != nil {
        log.Fatal(err)
    }

    // Convert to ether
    fbalance := new(big.Float).SetInt(balance)
    ethValue := new(big.Float).Quo(fbalance, big.NewFloat(1e18))

    fmt.Printf("Balance: %f\n", ethValue)
}

Error Handling

Error CodeMessageDescription
-32602Invalid paramsInvalid address format or block parameter
-32000Execution errorNode execution error