post https://alchemy-sdk-core-example.com//getTokenBalances
Returns token balances for a specific address given a list of contracts. Alchemy Enhanced API.
Parameters
DATA
, 20 Bytes - The address for which token balances will be checked- One of:
Array
- A list of contract addresses. Suggested limit:100
addresses.- The
String
"DEFAULT_TOKENS" - denotes a query for the top 100 tokens by 24-hour volume - only available on Mainnet for Ethereum, Polygon, and Arbitrum. - The
String
"erc20" - denotes the set of erc20 tokens that the address has ever held. This list is produced by an address's historical transfer activity and includes all tokens that the address has ever received.
- Options (optional) - An object that contains the following settings:
pageKey
: Applies only to theerc20
request type. Used to paginate through tokens that an owner has held.
Returns
Object
- An object with the following fields:
address
:DATA
, 20 Bytes - The address for which token balances were checkedtokenBalances
:Array
- returns an array of token balance objects. Each object contains:contractAddress
tokenBalance
: hex encodederror
- One of
tokenBalance
orerror
will be null.
pageKey
:String
- Applies only to theerc20
request type. An address to be passed into thepageKey
of the next request in order to paginate through all of an owner's tokens.
Use Cases
For guidance on how to leverage this method, check out the following tutorials:
The below parameter inputs do not work, please reference the section above instead.