import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
chainId: "43114",
});
async function run() {
const result = await avalanche.data.evm.address.balances.listErc1155({
blockNumber: "6479329",
pageSize: 10,
address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
});
for await (const page of result) {
console.log(page);
}
}
run();{
"nativeTokenBalance": {
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"chainId": "<string>",
"balance": "<string>",
"logoUri": "<string>",
"price": {
"currencyCode": "usd",
"value": 123
},
"balanceValue": {
"currencyCode": "usd",
"value": 123
}
},
"erc1155TokenBalances": [
{
"address": "<string>",
"ercType": "ERC-1155",
"tokenId": "<string>",
"tokenUri": "<string>",
"metadata": {
"indexStatus": "UNKNOWN",
"metadataLastUpdatedTimestamp": 123,
"name": "<string>",
"symbol": "<string>",
"imageUri": "<string>",
"description": "<string>",
"animationUri": "<string>",
"externalUrl": "<string>",
"background": "<string>",
"decimals": 123,
"properties": "<string>"
},
"chainId": "<string>",
"balance": "<string>"
}
],
"nextPageToken": "<string>"
}Lists ERC-1155 token balances of a wallet address.
Balance at a given block can be retrieved with the blockNumber parameter.
Balance for a specific contract can be retrieved with the contractAddress parameter.
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
chainId: "43114",
});
async function run() {
const result = await avalanche.data.evm.address.balances.listErc1155({
blockNumber: "6479329",
pageSize: 10,
address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
});
for await (const page of result) {
console.log(page);
}
}
run();{
"nativeTokenBalance": {
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"chainId": "<string>",
"balance": "<string>",
"logoUri": "<string>",
"price": {
"currencyCode": "usd",
"value": 123
},
"balanceValue": {
"currencyCode": "usd",
"value": 123
}
},
"erc1155TokenBalances": [
{
"address": "<string>",
"ercType": "ERC-1155",
"tokenId": "<string>",
"tokenUri": "<string>",
"metadata": {
"indexStatus": "UNKNOWN",
"metadataLastUpdatedTimestamp": 123,
"name": "<string>",
"symbol": "<string>",
"imageUri": "<string>",
"description": "<string>",
"animationUri": "<string>",
"externalUrl": "<string>",
"background": "<string>",
"decimals": 123,
"properties": "<string>"
},
"chainId": "<string>",
"balance": "<string>"
}
],
"nextPageToken": "<string>"
}Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
A supported evm chain id or blockchain id. Use the /chains endpoint to get a list of supported chain ids.
A wallet address.
The block number, if not defined the block number will be the latest block.
A page token, received from a previous list call. Provide this to retrieve the subsequent page.
The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 500.
1 <= x <= 500A contract addresses to filter by.
Successful response
The native token balance for the address.
Show child attributes
The list of ERC-1155 token balances for the address.
Show child attributes
A token, which can be sent as pageToken to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
Was this page helpful?