Skip to main content

getBalance

Callable


  • Get the balance of an address at a given block.


    Type parameters

    Parameters

    Returns Promise<NumberTypes[ReturnFormat[number]]>

    The current balance for the given address in wei.

    web3.eth.getBalance("0x407d73d8a49eeb85d32cf465507dd71d507100c1").then(console.log);
    > 1000000000000n

    web3.eth.getBalance("0x407d73d8a49eeb85d32cf465507dd71d507100c1", { number: FMT_NUMBER.HEX , bytes: FMT_BYTES.HEX }).then(console.log);
    > "0xe8d4a51000"