fetch_address_balances#

API documentation for tradeexecutor.ethereum.onchain_balance.fetch_address_balances Python function.

fetch_address_balances(web3, address, assets, block_number=None, filter_zero=True)[source]#

Get token balances an address is holding.

Parameters:
  • web3 (Web3) – Our web3 connection

  • address (Union[HexAddress, str]) –

    Ethereum address.

    Hot wallet or vault.

  • assets (List[AssetIdentifier]) – The asset list we checj.

  • block_number (int | None) –

    Optional historical block number when to do the scan.

    Needs an archive node for old blocks.

  • filter_zero – Do not return zero balances

Return type:

Iterable[OnChainBalance]