Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 1.14 KB

cast-balance.md

File metadata and controls

54 lines (34 loc) · 1.14 KB

cast balance

NAME

cast-balance - Get the balance of an account in wei.

SYNOPSIS

cast balance [options] who

DESCRIPTION

Get the balance of an account.

The argument who can be an ENS name or an address.

OPTIONS

Query Options

-B block
--block block
    The block height you want to query at.

    Can be a block number, or any of the tags: earliest, finalized, safe, latest or pending.

-e ether
--ether ether
     If this flag is used then balance will be shown in ether

RPC Options

{{#include ../common/rpc-url-option.md}}

{{#include common-options.md}}

EXAMPLES

  1. Get the balance of beer.eth
    cast balance beer.eth
  2. Get the ERC20 balance of any address using RPC URL
    # To load the variables in the .env file
    source .env
    
    # To get the USDT balance of Binance
    cast balance --erc20 0xdAC17F958D2ee523a2206206994597C13D831ec7 0xF977814e90dA44bFA03b6295A0616a897441aceC --rpc-url $MAINNET_RPC_URL

SEE ALSO

cast, cast nonce