JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
network: "mainnet",
});
async function run() {
const result = await avalanche.data.primaryNetwork.transactions.listAssetTransactions({
txTypes: [
"AddValidatorTx",
],
startTimestamp: 1689541049,
endTimestamp: 1689800249,
pageSize: 10,
blockchainId: "x-chain",
assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
});
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions \
--header 'x-glacier-api-key: <api-key>'import requests
url = "https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions"
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/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions",
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/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions"
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/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions")
.header("x-glacier-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions")
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{
"transactions": [
{
"txHash": "<string>",
"timestamp": 123,
"memo": "<string>",
"consumedUtxos": [
{
"addresses": [
"<string>"
],
"asset": {
"assetId": "<string>",
"name": "<string>",
"symbol": "<string>",
"denomination": 123,
"amount": "<string>"
},
"consumedOnChainId": "<string>",
"createdOnChainId": "<string>",
"utxoId": "<string>",
"creationTxHash": "<string>",
"locktime": 123,
"outputIndex": "<string>",
"threshold": 123,
"timestamp": 123,
"utxoType": "<string>",
"consumingTxHash": "<string>",
"utxoBytes": "<string>",
"consumingTxTimestamp": 123,
"credentials": [
{
"signature": "<string>",
"publicKey": "<string>"
}
],
"groupId": 123,
"payload": "<string>"
}
],
"emittedUtxos": [
{
"addresses": [
"<string>"
],
"asset": {
"assetId": "<string>",
"name": "<string>",
"symbol": "<string>",
"denomination": 123,
"amount": "<string>"
},
"consumedOnChainId": "<string>",
"createdOnChainId": "<string>",
"utxoId": "<string>",
"creationTxHash": "<string>",
"locktime": 123,
"outputIndex": "<string>",
"threshold": 123,
"timestamp": 123,
"utxoType": "<string>",
"consumingTxHash": "<string>",
"utxoBytes": "<string>",
"consumingTxTimestamp": 123,
"credentials": [
{
"signature": "<string>",
"publicKey": "<string>"
}
],
"groupId": 123,
"payload": "<string>"
}
],
"amountUnlocked": [
{
"assetId": "<string>",
"name": "<string>",
"symbol": "<string>",
"denomination": 123,
"amount": "<string>"
}
],
"amountCreated": [
{
"assetId": "<string>",
"name": "<string>",
"symbol": "<string>",
"denomination": 123,
"amount": "<string>"
}
],
"vertices": [
{
"hash": "<string>",
"height": 123,
"timestamp": 123
}
],
"sourceChain": "<string>",
"destinationChain": "<string>",
"assetCreated": {
"assetId": "<string>",
"name": "<string>",
"symbol": "<string>",
"denomination": 123,
"createdAtTimestamp": 123
}
}
],
"chainInfo": {},
"nextPageToken": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}Transactions
List asset transactions
Lists asset transactions corresponding to the given asset id on the X-Chain.
GET
/
v1
/
networks
/
{network}
/
blockchains
/
{blockchainId}
/
assets
/
{assetId}
/
transactions
JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
network: "mainnet",
});
async function run() {
const result = await avalanche.data.primaryNetwork.transactions.listAssetTransactions({
txTypes: [
"AddValidatorTx",
],
startTimestamp: 1689541049,
endTimestamp: 1689800249,
pageSize: 10,
blockchainId: "x-chain",
assetId: "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
});
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions \
--header 'x-glacier-api-key: <api-key>'import requests
url = "https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions"
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/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions",
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/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions"
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/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions")
.header("x-glacier-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/assets/{assetId}/transactions")
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{
"transactions": [
{
"txHash": "<string>",
"timestamp": 123,
"memo": "<string>",
"consumedUtxos": [
{
"addresses": [
"<string>"
],
"asset": {
"assetId": "<string>",
"name": "<string>",
"symbol": "<string>",
"denomination": 123,
"amount": "<string>"
},
"consumedOnChainId": "<string>",
"createdOnChainId": "<string>",
"utxoId": "<string>",
"creationTxHash": "<string>",
"locktime": 123,
"outputIndex": "<string>",
"threshold": 123,
"timestamp": 123,
"utxoType": "<string>",
"consumingTxHash": "<string>",
"utxoBytes": "<string>",
"consumingTxTimestamp": 123,
"credentials": [
{
"signature": "<string>",
"publicKey": "<string>"
}
],
"groupId": 123,
"payload": "<string>"
}
],
"emittedUtxos": [
{
"addresses": [
"<string>"
],
"asset": {
"assetId": "<string>",
"name": "<string>",
"symbol": "<string>",
"denomination": 123,
"amount": "<string>"
},
"consumedOnChainId": "<string>",
"createdOnChainId": "<string>",
"utxoId": "<string>",
"creationTxHash": "<string>",
"locktime": 123,
"outputIndex": "<string>",
"threshold": 123,
"timestamp": 123,
"utxoType": "<string>",
"consumingTxHash": "<string>",
"utxoBytes": "<string>",
"consumingTxTimestamp": 123,
"credentials": [
{
"signature": "<string>",
"publicKey": "<string>"
}
],
"groupId": 123,
"payload": "<string>"
}
],
"amountUnlocked": [
{
"assetId": "<string>",
"name": "<string>",
"symbol": "<string>",
"denomination": 123,
"amount": "<string>"
}
],
"amountCreated": [
{
"assetId": "<string>",
"name": "<string>",
"symbol": "<string>",
"denomination": 123,
"amount": "<string>"
}
],
"vertices": [
{
"hash": "<string>",
"height": 123,
"timestamp": 123
}
],
"sourceChain": "<string>",
"destinationChain": "<string>",
"assetCreated": {
"assetId": "<string>",
"name": "<string>",
"symbol": "<string>",
"denomination": 123,
"createdAtTimestamp": 123
}
}
],
"chainInfo": {},
"nextPageToken": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}{
"message": "<string>",
"statusCode": 123,
"error": "<string>"
}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 primary network blockchain id or alias.
Available options:
2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM, 2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm, x-chain Either mainnet or testnet/fuji.
Available options:
mainnet, fuji, testnet Asset ID for any asset on X-Chain
Query Parameters
Query param for filtering items based on transaction types.
Available options:
AddValidatorTx, AddSubnetValidatorTx, AddDelegatorTx, CreateChainTx, CreateSubnetTx, ImportTx, ExportTx, AdvanceTimeTx, RewardValidatorTx, RemoveSubnetValidatorTx, TransformSubnetTx, AddPermissionlessValidatorTx, AddPermissionlessDelegatorTx, BaseTx, TransferSubnetOwnershipTx, ConvertSubnetToL1Tx, RegisterL1ValidatorTx, SetL1ValidatorWeightTx, DisableL1ValidatorTx, IncreaseL1ValidatorBalanceTx, UNKNOWN, CreateAssetTx, OperationTx Query param for retrieving items after a specific timestamp.
Required range:
x >= 0Query param for retrieving items before a specific timestamp.
Required range:
x >= 0A 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 100.
Required range:
1 <= x <= 100Was this page helpful?
⌘I