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();curl --request GET \
--url https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155 \
--header 'x-glacier-api-key: <api-key>'import requests
url = "https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155"
headers = {"x-glacier-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-glacier-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-glacier-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155")
.header("x-glacier-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-glacier-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"nativeTokenBalance": {
"name": "Wrapped AVAX",
"symbol": "WAVAX",
"decimals": 18,
"chainId": "43114",
"balance": "2000000000000000000",
"logoUri": "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg",
"price": {
"currencyCode": "usd",
"value": "42.42"
},
"balanceValue": {
"currencyCode": "usd",
"value": "42.42"
}
},
"erc1155TokenBalances": [
{
"address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
"ercType": "ERC-1155",
"tokenId": "<string>",
"tokenUri": "<string>",
"metadata": {
"indexStatus": "indexed",
"metadataLastUpdatedTimestamp": 123,
"name": "<string>",
"symbol": "<string>",
"imageUri": "<string>",
"description": "<string>",
"animationUri": "<string>",
"externalUrl": "<string>",
"background": "<string>",
"decimals": 123,
"properties": "<string>"
},
"chainId": "43114",
"balance": "2000000000000000000"
}
],
"nextPageToken": "<string>"
}{
"message": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"message": "<string>",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "<string>",
"statusCode": 403,
"error": "Forbidden"
}{
"message": "<string>",
"statusCode": 404,
"error": "Not Found"
}{
"message": "<string>",
"statusCode": 429,
"error": "Too Many Requests"
}{
"message": "<string>",
"statusCode": 500,
"error": "Internal Server Error"
}{
"message": "<string>",
"statusCode": 502,
"error": "Bad Gateway"
}{
"message": "<string>",
"statusCode": 503,
"error": "Service Unavailable"
}List ERC-1155 balances
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();curl --request GET \
--url https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155 \
--header 'x-glacier-api-key: <api-key>'import requests
url = "https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155"
headers = {"x-glacier-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-glacier-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-glacier-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155")
.header("x-glacier-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/chains/{chainId}/addresses/{address}/balances:listErc1155")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-glacier-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"nativeTokenBalance": {
"name": "Wrapped AVAX",
"symbol": "WAVAX",
"decimals": 18,
"chainId": "43114",
"balance": "2000000000000000000",
"logoUri": "https://images.ctfassets.net/gcj8jwzm6086/5VHupNKwnDYJvqMENeV7iJ/fdd6326b7a82c8388e4ee9d4be7062d4/avalanche-avax-logo.svg",
"price": {
"currencyCode": "usd",
"value": "42.42"
},
"balanceValue": {
"currencyCode": "usd",
"value": "42.42"
}
},
"erc1155TokenBalances": [
{
"address": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
"ercType": "ERC-1155",
"tokenId": "<string>",
"tokenUri": "<string>",
"metadata": {
"indexStatus": "indexed",
"metadataLastUpdatedTimestamp": 123,
"name": "<string>",
"symbol": "<string>",
"imageUri": "<string>",
"description": "<string>",
"animationUri": "<string>",
"externalUrl": "<string>",
"background": "<string>",
"decimals": 123,
"properties": "<string>"
},
"chainId": "43114",
"balance": "2000000000000000000"
}
],
"nextPageToken": "<string>"
}{
"message": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"message": "<string>",
"statusCode": 401,
"error": "Unauthorized"
}{
"message": "<string>",
"statusCode": 403,
"error": "Forbidden"
}{
"message": "<string>",
"statusCode": 404,
"error": "Not Found"
}{
"message": "<string>",
"statusCode": 429,
"error": "Too Many Requests"
}{
"message": "<string>",
"statusCode": 500,
"error": "Internal Server Error"
}{
"message": "<string>",
"statusCode": 502,
"error": "Bad Gateway"
}{
"message": "<string>",
"statusCode": 503,
"error": "Service Unavailable"
}Authorizations
Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
Path Parameters
A supported evm chain id or blockchain id. Use the /chains endpoint to get a list of supported chain ids.
A wallet address.
Query Parameters
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.
Response
Successful response
The native token balance for the address.
Show child attributes
Show child attributes
The list of ERC-1155 token balances for the address.
Show child attributes
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?