import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
chainId: "43114",
});
async function run() {
const result = await avalanche.data.evm.address.balances.listCollectibles({
pageSize: 10,
address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
});
for await (const page of result) {
console.log(page);
}
}
run();{
"collectibleBalances": [
{
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"ercType": "ERC-721",
"tokenId": "<string>",
"tokenUri": "<string>",
"metadata": {
"indexStatus": "UNKNOWN",
"metadataLastUpdatedTimestamp": 123,
"name": "<string>",
"symbol": "<string>",
"imageUri": "<string>",
"description": "<string>",
"animationUri": "<string>",
"externalUrl": "<string>",
"background": "<string>",
"attributes": "<string>"
},
"chainId": "<string>",
"ownerAddress": "<string>"
}
],
"nextPageToken": "<string>"
}Lists ERC-721 and ERC-1155 token balances of a wallet address.
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.listCollectibles({
pageSize: 10,
address: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
contractAddress: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
});
for await (const page of result) {
console.log(page);
}
}
run();{
"collectibleBalances": [
{
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"ercType": "ERC-721",
"tokenId": "<string>",
"tokenUri": "<string>",
"metadata": {
"indexStatus": "UNKNOWN",
"metadataLastUpdatedTimestamp": 123,
"name": "<string>",
"symbol": "<string>",
"imageUri": "<string>",
"description": "<string>",
"animationUri": "<string>",
"externalUrl": "<string>",
"background": "<string>",
"attributes": "<string>"
},
"chainId": "<string>",
"ownerAddress": "<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.
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
Was this page helpful?