JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
network: "mainnet",
});
async function run() {
const result = await avalanche.data.primaryNetwork.transactions.listActiveStakingTransactions({
addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg",
txTypes: [
"AddValidatorTx",
],
startTimestamp: 1689541049,
endTimestamp: 1689800249,
pageSize: 10,
blockchainId: "p-chain",
sortOrder: "asc",
});
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/transactions:listStaking \
--header 'x-glacier-api-key: <api-key>'import requests
url = "https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/transactions:listStaking"
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}/transactions:listStaking",
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}/transactions:listStaking"
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}/transactions:listStaking")
.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}/transactions:listStaking")
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": "3P91K6nuDFvDodcRuJTsgdf9SvYe5pMiKk38HppsoeAiEztCP",
"txType": "AddDelegatorTx",
"blockTimestamp": 1648672486,
"blockNumber": "<string>",
"blockHash": "<string>",
"consumedUtxos": [
{
"addresses": [
"avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"
],
"asset": {
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
},
"consumedOnChainId": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"createdOnChainId": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"utxoId": "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC",
"amount": "<string>",
"assetId": "<string>",
"blockNumber": "<string>",
"blockTimestamp": 123,
"outputIndex": 123,
"txHash": "<string>",
"utxoType": "STAKE",
"consumingTxHash": "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c",
"utxoBytes": "<string>",
"consumingBlockNumber": "<string>",
"consumingBlockTimestamp": 123,
"platformLocktime": 123,
"rewardType": "VALIDATOR",
"stakeableLocktime": 123,
"staked": true,
"threshold": 123,
"utxoEndTimestamp": 123,
"utxoStartTimestamp": 123
}
],
"emittedUtxos": [
{
"addresses": [
"avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"
],
"asset": {
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
},
"consumedOnChainId": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"createdOnChainId": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"utxoId": "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC",
"amount": "<string>",
"assetId": "<string>",
"blockNumber": "<string>",
"blockTimestamp": 123,
"outputIndex": 123,
"txHash": "<string>",
"utxoType": "STAKE",
"consumingTxHash": "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c",
"utxoBytes": "<string>",
"consumingBlockNumber": "<string>",
"consumingBlockTimestamp": 123,
"platformLocktime": 123,
"rewardType": "VALIDATOR",
"stakeableLocktime": 123,
"staked": true,
"threshold": 123,
"utxoEndTimestamp": 123,
"utxoStartTimestamp": 123
}
],
"value": [
{
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
}
],
"amountBurned": [
{
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
}
],
"amountStaked": [
{
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
}
],
"amountL1ValidatorBalanceBurned": [
{
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
}
],
"sourceChain": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"destinationChain": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"startTimestamp": 123,
"endTimestamp": 123,
"delegationFeePercent": "<string>",
"nodeId": "<string>",
"subnetId": "<string>",
"l1ValidatorManagerDetails": {
"blockchainId": "<string>",
"contractAddress": "<string>"
},
"l1ValidatorDetails": [
{
"validationId": "<string>",
"validationIdHex": "<string>",
"nodeId": "<string>",
"subnetId": "<string>",
"weight": 123,
"remainingBalance": 123,
"balanceChange": 123,
"blsCredentials": {}
}
],
"estimatedReward": "<string>",
"rewardTxHash": "<string>",
"rewardAddresses": [
"<string>"
],
"memo": "<string>",
"stakingTxHash": "<string>",
"subnetOwnershipInfo": {
"locktime": 0,
"threshold": 1,
"addresses": [
"avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"
]
},
"blsCredentials": {
"publicKey": "<string>",
"proofOfPossession": "<string>"
},
"blockchainInfo": {
"chainName": "<string>",
"vmId": "<string>",
"genesisData": {}
}
}
],
"chainInfo": {
"chainName": "p-chain",
"network": "mainnet"
},
"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"
}Transactions
List staking transactions
Lists active staking transactions on the P-Chain for the supplied addresses.
GET
/
v1
/
networks
/
{network}
/
blockchains
/
{blockchainId}
/
transactions:listStaking
JavaScript
import { Avalanche } from "@avalanche-sdk/chainkit";
const avalanche = new Avalanche({
network: "mainnet",
});
async function run() {
const result = await avalanche.data.primaryNetwork.transactions.listActiveStakingTransactions({
addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg",
txTypes: [
"AddValidatorTx",
],
startTimestamp: 1689541049,
endTimestamp: 1689800249,
pageSize: 10,
blockchainId: "p-chain",
sortOrder: "asc",
});
for await (const page of result) {
console.log(page);
}
}
run();curl --request GET \
--url https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/transactions:listStaking \
--header 'x-glacier-api-key: <api-key>'import requests
url = "https://glacier-api.avax.network/v1/networks/{network}/blockchains/{blockchainId}/transactions:listStaking"
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}/transactions:listStaking",
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}/transactions:listStaking"
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}/transactions:listStaking")
.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}/transactions:listStaking")
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": "3P91K6nuDFvDodcRuJTsgdf9SvYe5pMiKk38HppsoeAiEztCP",
"txType": "AddDelegatorTx",
"blockTimestamp": 1648672486,
"blockNumber": "<string>",
"blockHash": "<string>",
"consumedUtxos": [
{
"addresses": [
"avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"
],
"asset": {
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
},
"consumedOnChainId": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"createdOnChainId": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"utxoId": "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC",
"amount": "<string>",
"assetId": "<string>",
"blockNumber": "<string>",
"blockTimestamp": 123,
"outputIndex": 123,
"txHash": "<string>",
"utxoType": "STAKE",
"consumingTxHash": "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c",
"utxoBytes": "<string>",
"consumingBlockNumber": "<string>",
"consumingBlockTimestamp": 123,
"platformLocktime": 123,
"rewardType": "VALIDATOR",
"stakeableLocktime": 123,
"staked": true,
"threshold": 123,
"utxoEndTimestamp": 123,
"utxoStartTimestamp": 123
}
],
"emittedUtxos": [
{
"addresses": [
"avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"
],
"asset": {
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
},
"consumedOnChainId": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"createdOnChainId": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"utxoId": "68vLva9kfKUsX88ZPM8jdbf8qHUZRoZSFH6NdpAVTspkfrXDC",
"amount": "<string>",
"assetId": "<string>",
"blockNumber": "<string>",
"blockTimestamp": 123,
"outputIndex": 123,
"txHash": "<string>",
"utxoType": "STAKE",
"consumingTxHash": "3j9JpF1aGuQtLLbo3YkvvKkWrCZViXZjdeJQWUSEY5hcqUn2c",
"utxoBytes": "<string>",
"consumingBlockNumber": "<string>",
"consumingBlockTimestamp": 123,
"platformLocktime": 123,
"rewardType": "VALIDATOR",
"stakeableLocktime": 123,
"staked": true,
"threshold": 123,
"utxoEndTimestamp": 123,
"utxoStartTimestamp": 123
}
],
"value": [
{
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
}
],
"amountBurned": [
{
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
}
],
"amountStaked": [
{
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
}
],
"amountL1ValidatorBalanceBurned": [
{
"assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": 9,
"type": "secp256k1",
"amount": "5001000"
}
],
"sourceChain": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"destinationChain": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
"startTimestamp": 123,
"endTimestamp": 123,
"delegationFeePercent": "<string>",
"nodeId": "<string>",
"subnetId": "<string>",
"l1ValidatorManagerDetails": {
"blockchainId": "<string>",
"contractAddress": "<string>"
},
"l1ValidatorDetails": [
{
"validationId": "<string>",
"validationIdHex": "<string>",
"nodeId": "<string>",
"subnetId": "<string>",
"weight": 123,
"remainingBalance": 123,
"balanceChange": 123,
"blsCredentials": {}
}
],
"estimatedReward": "<string>",
"rewardTxHash": "<string>",
"rewardAddresses": [
"<string>"
],
"memo": "<string>",
"stakingTxHash": "<string>",
"subnetOwnershipInfo": {
"locktime": 0,
"threshold": 1,
"addresses": [
"avax1qm2a25eytsrj235hxg6jc0mwk99tss64eqevsw"
]
},
"blsCredentials": {
"publicKey": "<string>",
"proofOfPossession": "<string>"
},
"blockchainInfo": {
"chainName": "<string>",
"vmId": "<string>",
"genesisData": {}
}
}
],
"chainInfo": {
"chainName": "p-chain",
"network": "mainnet"
},
"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
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 Was this page helpful?