mega balance
Thebalance command retrieves the ETH balance of an address or stored Foundry account on the selected network.
Usage
Arguments
Options
When using a custom RPC, Mega CLI verifies that its chain ID matches
--network.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Check an account or address balance on local, testnet, or mainnet
balance command retrieves the ETH balance of an address or stored Foundry account on the selected network.
mega balance [address] [options]
| Argument | Description |
|---|---|
address | Ethereum address to check. Optional when using --account |
| Option | Description |
|---|---|
--network <network> | Select local, testnet, or mainnet. Defaults to local |
-r, --rpc-url <url> | Override the selected network’s default RPC URL |
--account <name> | Resolve an account from Foundry’s keystore instead of providing an address |
-e, --ether | Show the balance in ETH instead of wei |
| Network | Chain ID | Default RPC |
|---|---|---|
local | 31337 | http://127.0.0.1:8545 |
testnet | 6343 | https://carrot.megaeth.com/rpc |
mainnet | 4326 | https://mainnet.megaeth.com/rpc |
--network.
mega balance 0x742d35Cc6634C0532925a3b844Bc454e4438f44e
mega balance --account myaccount --network testnet --ether
mega balance 0x742d35Cc6634C0532925a3b844Bc454e4438f44e \
--network mainnet \
--ether
mega balance 0x742d35Cc6634C0532925a3b844Bc454e4438f44e \
--network testnet \
--rpc-url https://your-testnet-rpc.example \
--ether
Was this page helpful?
