listTokenBalances
method for Base. For Solana token balances, use the REST API directly.
Additional information can be found in our SDK Reference.
In this guide, you will learn how to retrieve ERC-20 and native gas token balances of an address on Base networks.
Install dependencies
Create an .env file
.env
file in your project root:Add API credentials
.env
file:Field | Description |
---|---|
balances | The list of EVM token balances. |
amount | Amount of a given token in JSON format, includes amount , denominated in the smallest indivisible unit of the token; and decimals . |
token | General information about a token in JSON format. |
network | Name of the blockchain network, e.g. base . |
symbol | The symbol of the ERC-20 or native gas token, e.g. ETH . |
name | The name of the ERC-20 or native gas token, e.g. Ether . |
contractAddress | Address of the ERC-20 or native gas token smart contract. |
nextPageToken | The token for the next page of items, if any. |
listTokenBalances
supports paginated responses for addresses with many balances:
listTokenBalances