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>"
}Lists asset transactions corresponding to the given asset id on the X-Chain.
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>"
}Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
A primary network blockchain id or alias.
2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM, 2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm, x-chain Either mainnet or testnet/fuji.
mainnet, fuji, testnet Asset ID for any asset on X-Chain
Query param for filtering items based on transaction types.
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.
x >= 0Query param for retrieving items before a specific timestamp.
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.
1 <= x <= 100Successful response
Show child attributes
Unique ID for this transaction.
Represents chain format this transaction is included in.
non-linear, linear Latest timestamp in seconds this transaction was accepted out of the same transaction accepted in other vertices.
Type of transaction.
BaseTx, CreateAssetTx, OperationTx, ImportTx, ExportTx, UNKNOWN Hex encoded memo bytes for this transaction.
Show child attributes
Addresses that are eligible to sign the consumption of this output.
Show child attributes
Unique ID for an asset.
Name of this asset.
Symbol for this asset (max 4 characters).
Denomination of this asset to represent fungibility.
Type of asset like SECP256K1 or NFT.
secp256k1, nft Amount of the asset.
Blockchain ID on which this output is consumed on.
Blockchain ID on which this output is created on.
UTXO ID for this output.
Transaction ID that created this output.
Locktime in seconds after which this output can be consumed.
Postion of this output in a list of lexiographically sorted outputs of a transaction.
Minimum number of signatures required to consume this output.
Unix timestamp in seconds at which this outptut was created.
Type of output.
Transaction ID that consumed this output.
The bytes of the UTXO
Unix timestamp in seconds at which this output was consumed.
Index representing the minting set for the NFT mint output.
Hex encoded data for NFT assets.
Show child attributes
Addresses that are eligible to sign the consumption of this output.
Show child attributes
Unique ID for an asset.
Name of this asset.
Symbol for this asset (max 4 characters).
Denomination of this asset to represent fungibility.
Type of asset like SECP256K1 or NFT.
secp256k1, nft Amount of the asset.
Blockchain ID on which this output is consumed on.
Blockchain ID on which this output is created on.
UTXO ID for this output.
Transaction ID that created this output.
Locktime in seconds after which this output can be consumed.
Postion of this output in a list of lexiographically sorted outputs of a transaction.
Minimum number of signatures required to consume this output.
Unix timestamp in seconds at which this outptut was created.
Type of output.
Transaction ID that consumed this output.
The bytes of the UTXO
Unix timestamp in seconds at which this output was consumed.
Index representing the minting set for the NFT mint output.
Hex encoded data for NFT assets.
Assets unlocked by inputs of this transaction.
Show child attributes
Unique ID for an asset.
Name of this asset.
Symbol for this asset (max 4 characters).
Denomination of this asset to represent fungibility.
Type of asset like SECP256K1 or NFT.
secp256k1, nft Amount of the asset.
Assets created by outputs of this transaction.
Show child attributes
Unique ID for an asset.
Name of this asset.
Symbol for this asset (max 4 characters).
Denomination of this asset to represent fungibility.
Type of asset like SECP256K1 or NFT.
secp256k1, nft Amount of the asset.
A transaction on X-Chain can be accepted over multiple vertices.
Show child attributes
Source chain for an atomic transaction.
Destination chain for an atomic transaction.
AssetAmount details of the asset created in CreateAssetTx
Show child attributes
Unique ID for an asset.
Name of this asset.
Symbol for this asset (max 4 characters).
Denomination of this asset to represent fungibility.
Type of asset like SECP256K1 or NFT.
secp256k1, nft Timestamp in seconds this asset was created on.
Cap represents if an asset is a variable or fixed cap asset.
fixed, variable 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?