GET
/
v1
/
networks
/
{network}
/
blockchains
/
{blockchainId}
/
balances
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.balances.getBalancesByAddresses({
    blockTimestamp: 1599696000,
    addresses: "avax1h2ccj9f5ay5acl6tyn9mwmw32p8wref8vl8ctg",
    blockchainId: "p-chain",
    network: "mainnet",
  });

  // Handle the result
  console.log(result);
}

run();
{
  "balances": {
    "unlockedUnstaked": [
      {
        "assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
        "name": "Avalanche",
        "symbol": "AVAX",
        "denomination": 9,
        "type": "secp256k1",
        "amount": "5001000",
        "utxoCount": 1
      }
    ],
    "unlockedStaked": [
      {
        "assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
        "name": "Avalanche",
        "symbol": "AVAX",
        "denomination": 9,
        "type": "secp256k1",
        "amount": "5001000",
        "utxoCount": 1
      }
    ],
    "lockedPlatform": [
      {
        "assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
        "name": "Avalanche",
        "symbol": "AVAX",
        "denomination": 9,
        "type": "secp256k1",
        "amount": "5001000",
        "utxoCount": 1
      }
    ],
    "lockedStakeable": [
      {
        "assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
        "name": "Avalanche",
        "symbol": "AVAX",
        "denomination": 9,
        "type": "secp256k1",
        "amount": "5001000",
        "utxoCount": 1
      }
    ],
    "lockedStaked": [
      {
        "assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
        "name": "Avalanche",
        "symbol": "AVAX",
        "denomination": 9,
        "type": "secp256k1",
        "amount": "5001000",
        "utxoCount": 1
      }
    ],
    "pendingStaked": [
      {
        "assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
        "name": "Avalanche",
        "symbol": "AVAX",
        "denomination": 9,
        "type": "secp256k1",
        "amount": "5001000",
        "utxoCount": 1
      }
    ],
    "atomicMemoryUnlocked": [
      {
        "assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
        "name": "Avalanche",
        "symbol": "AVAX",
        "denomination": 9,
        "type": "secp256k1",
        "amount": "5001000",
        "utxoCount": 1,
        "sharedWithChainId": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
        "status": "<string>"
      }
    ],
    "atomicMemoryLocked": [
      {
        "assetId": "th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof",
        "name": "Avalanche",
        "symbol": "AVAX",
        "denomination": 9,
        "type": "secp256k1",
        "amount": "5001000",
        "utxoCount": 1,
        "sharedWithChainId": "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM",
        "status": "<string>"
      }
    ]
  },
  "chainInfo": {
    "chainName": "p-chain",
    "network": "mainnet"
  }
}

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:
11111111111111111111111111111111LpoYY,
2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM,
2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm,
2piQ2AVHCjnduiWXsSY15DtbVuwHE2cwMHYnEXHsLL73BBkdbV,
2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5,
yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp,
vV3cui1DsEPC3nLCGH9rorwo8s6BYxM2Hz4QFE5gEYjwTqAu,
p-chain,
x-chain,
c-chain
network
enum<string>
required

Either mainnet or testnet/fuji.

Available options:
mainnet,
fuji,
testnet,
devnet

Query Parameters

blockTimestamp
integer

An epoch timestamp in seconds. Balance will be calculated at this timestamp.

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".

Response

200
application/json
Successful response
balances
object
required
chainInfo
object
required