GET
/
v1
/
networks
/
{network}
/
rewards
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";

const avaCloudSDK = new AvaCloudSDK({
  serverURL: "https://api.example.com",
  chainId: "43114",
  network: "mainnet",
});

async function run() {
  const result = await avaCloudSDK.data.primaryNetwork.rewards.listHistoricalPrimaryNetworkRewards({
    addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg",
    network: "mainnet",
    nodeIds: "NodeID-111111111111111111116DBWJs,NodeID-222222222222222222227DBWJs",
    sortOrder: "asc",
    currency: "usd",
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();
{
  "nextPageToken": "<string>",
  "historicalRewards": [
    {
      "addresses": [
        "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg"
      ],
      "txHash": "<string>",
      "amountStaked": "<string>",
      "nodeId": "<string>",
      "startTimestamp": 123,
      "endTimestamp": 123,
      "rewardType": "VALIDATOR",
      "utxoId": "<string>",
      "outputIndex": 123,
      "reward": {
        "assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
        "name": "Avalanche",
        "symbol": "AVAX",
        "denomination": 9,
        "type": "secp256k1",
        "amount": "5001000",
        "historicalPrice": {
          "currencyCode": "usd",
          "value": "42.42"
        }
      },
      "rewardTxHash": "<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

network
enum<string>
required

Either mainnet or testnet/fuji.

Available options:
mainnet,
fuji,
testnet,
devnet

Query Parameters

addresses
string

A comma separated list of X-Chain or P-Chain wallet addresses, starting with "avax"/"fuji", "P-avax"/"P-fuji" or "X-avax"/"X-fuji". Optional, but at least one of addresses or nodeIds is required.

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
nodeIds
string

A comma separated list of node ids to filter by. Optional, but at least one of addresses or nodeIds is required.

sortOrder
enum<string>

The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the sortBy query parameter, if provided.

Available options:
asc,
desc
currency
enum<string>

The currency that return values should use. Defaults to USD.

Available options:
usd,
eur,
aud,
cad,
chf,
clp,
cny,
czk,
dkk,
gbp,
hkd,
huf,
jpy,
nzd

Response

200
application/json
Successful response
historicalRewards
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.