Skip to main content
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();
{
  "transactions": [
    {
      "txHash": "<string>",
      "chainFormat": "non-linear",
      "timestamp": 123,
      "txType": "BaseTx",
      "memo": "<string>",
      "consumedUtxos": [
        {
          "addresses": [
            "<string>"
          ],
          "asset": {
            "assetId": "<string>",
            "name": "<string>",
            "symbol": "<string>",
            "denomination": 123,
            "type": "secp256k1",
            "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,
            "type": "secp256k1",
            "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,
          "type": "secp256k1",
          "amount": "<string>"
        }
      ],
      "amountCreated": [
        {
          "assetId": "<string>",
          "name": "<string>",
          "symbol": "<string>",
          "denomination": 123,
          "type": "secp256k1",
          "amount": "<string>"
        }
      ],
      "vertices": [
        {
          "hash": "<string>",
          "height": 123,
          "timestamp": 123
        }
      ],
      "sourceChain": "<string>",
      "destinationChain": "<string>",
      "assetCreated": {
        "assetId": "<string>",
        "name": "<string>",
        "symbol": "<string>",
        "denomination": 123,
        "type": "secp256k1",
        "createdAtTimestamp": 123,
        "cap": "fixed"
      }
    }
  ],
  "chainInfo": {
    "chainName": "p-chain",
    "network": "mainnet"
  },
  "nextPageToken": "<string>"
}

Authorizations

x-glacier-api-key
string
header
required

Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.

Path Parameters

blockchainId
enum<string>
required

A primary network blockchain id or alias.

Available options:
2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM,
2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm,
x-chain
network
enum<string>
required

Either mainnet or testnet/fuji.

Available options:
mainnet,
fuji,
testnet
assetId
string
required

Asset ID for any asset on X-Chain

Query Parameters

txTypes
enum<string>[]

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
startTimestamp
integer

Query param for retrieving items after a specific timestamp.

Required range: x >= 0
endTimestamp
integer

Query param for retrieving items before a specific timestamp.

Required range: x >= 0
pageToken
string

A page token, received from a previous list call. Provide this to retrieve the subsequent page.

pageSize
integer
default:10

The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.

Required range: 1 <= x <= 100

Response

Successful response

transactions
object[]
required
chainInfo
object
required
nextPageToken
string

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.