eth_getBalance - Manta RPC Method
Query account balance on Manta Pacific. Essential for wallet applications and ZK-enabled DeFi, private identity verification, and modular ZK applications via Universal Circuits on the modular ZK L2 with Celestia DA delivering the lowest fees for 200+ dApps.
Returns the balance of a given address on Manta Pacific.
Why Manta? Build on the modular ZK L2 with Celestia DA delivering the lowest fees for 200+ dApps with first L2 on Celestia mainnet, ZK-as-a-Service via Universal Circuits, Polygon CDK integration, and modular OP Stack architecture.
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 ZK-enabled DeFi, private identity verification, and modular ZK applications via Universal Circuits
- Account monitoring - Track balance changes over time
Request Parameters
20-byte address to check balance for
Block number in hex, or "latest", "earliest", "pending", "safe", "finalized"
Response Body
Integer of the current balance in wei (hexadecimal)
Code Examples
curl -X POST https://api-manta-pacific-archive.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0x0Dc808adcE2099A9F62AA87D9670745AbA741746",
"latest"
],
"id": 1
}'import { JsonRpcProvider, formatEther } from 'ethers';
const provider = new JsonRpcProvider('https://api-manta-pacific-archive.n.dwellir.com/YOUR_API_KEY');
const address = '0x0Dc808adcE2099A9F62AA87D9670745AbA741746';
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)}`);from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://api-manta-pacific-archive.n.dwellir.com/YOUR_API_KEY'))
address = '0x0Dc808adcE2099A9F62AA87D9670745AbA741746'
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")}')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-manta-pacific-archive.n.dwellir.com/YOUR_API_KEY")
if err != nil {
log.Fatal(err)
}
address := common.HexToAddress("0x0Dc808adcE2099A9F62AA87D9670745AbA741746")
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 Code | Message | Description |
|---|---|---|
| -32602 | Invalid params | Invalid address format or block parameter |
| -32000 | Execution error | Node execution error |
Related Methods
eth_getCode- Get contract bytecodeeth_getTransactionCount- Get account nonce
eth_getBlockByHash
Retrieve complete block data by block hash on Manta Pacific. Essential for ZK application developers, privacy-focused builders, and teams requiring modular scalability building on the modular ZK L2 with Celestia DA delivering the lowest fees for 200+ dApps.
eth_getCode
Get contract bytecode on Manta Pacific. Essential for verifying smart contracts for ZK-enabled DeFi, private identity verification, and modular ZK applications via Universal Circuits.