Get Started
Learn
- Tutorials
Health Check
- Health Check
EVM
- Chains
- Blocks
- Transactions
- Balances
- Contracts
- NFTs
Primary Network
- Network, Chains & subnet
- Validators & Delegators
- Blocks
- Vertices
- Transactions
- Balances & UTXOs
- Rewards
- Assets
ICM Services
- Teleporter
- Interchain Messaging
- Signature Aggregator
Operations
- Operations
Usage Metrics
- Usage Metrics
Get balances
Gets primary network balances for one of the Primary Network chains for the supplied addresses.
C-Chain balances returned are only the shared atomic memory balance. For EVM balance, use the /v1/chains/:chainId/addresses/:addressId/balances:getNative
endpoint.
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
Api keys provide higher access to rate limits. To obtain an api key, sign up for an account at https://avacloud.io/.
Path Parameters
A primary network blockchain id or alias.
11111111111111111111111111111111LpoYY
, 2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM
, 2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm
, 2piQ2AVHCjnduiWXsSY15DtbVuwHE2cwMHYnEXHsLL73BBkdbV
, 2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5
, yH8D7ThNJkxmtkuv2jgBa4P1Rn3Qpr4pPr7QYNfcdoS6k6HWp
, vV3cui1DsEPC3nLCGH9rorwo8s6BYxM2Hz4QFE5gEYjwTqAu
, p-chain
, x-chain
, c-chain
Either mainnet or testnet/fuji.
mainnet
, fuji
, testnet
, devnet
Query Parameters
An epoch timestamp in seconds. Balance will be calculated at this timestamp.
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
A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of unstaked Avax that is consumable by any transaction.
Unique ID for an asset.
"th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof"
Name of this asset.
"Avalanche"
Symbol for this asset (max 4 characters).
"AVAX"
Denomination of this asset to represent fungibility.
9
Type of asset like SECP256K1 or NFT.
secp256k1
, nft
Amount of the asset.
"5001000"
1
A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of staked Avax that is consumable by any transaction when the staking period ends.
Unique ID for an asset.
"th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof"
Name of this asset.
"Avalanche"
Symbol for this asset (max 4 characters).
"AVAX"
Denomination of this asset to represent fungibility.
9
Type of asset like SECP256K1 or NFT.
secp256k1
, nft
Amount of the asset.
"5001000"
1
A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of unstaked Avax that is locked at the platform level and not consumable by any transaction at the current time.
Unique ID for an asset.
"th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof"
Name of this asset.
"Avalanche"
Symbol for this asset (max 4 characters).
"AVAX"
Denomination of this asset to represent fungibility.
9
Type of asset like SECP256K1 or NFT.
secp256k1
, nft
Amount of the asset.
"5001000"
1
A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of unstaked Avax that is locked at the platform level and only consumeable for staking transactions.
Unique ID for an asset.
"th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof"
Name of this asset.
"Avalanche"
Symbol for this asset (max 4 characters).
"AVAX"
Denomination of this asset to represent fungibility.
9
Type of asset like SECP256K1 or NFT.
secp256k1
, nft
Amount of the asset.
"5001000"
1
A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of staked Avax that will be locked when the staking period ends.
Unique ID for an asset.
"th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof"
Name of this asset.
"Avalanche"
Symbol for this asset (max 4 characters).
"AVAX"
Denomination of this asset to represent fungibility.
9
Type of asset like SECP256K1 or NFT.
secp256k1
, nft
Amount of the asset.
"5001000"
1
A list of objects containing P-chain Asset basic info, amount, and utxo count of that Asset ID. Denotes the amount of staked Avax whose staking period has not yet started.
Unique ID for an asset.
"th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof"
Name of this asset.
"Avalanche"
Symbol for this asset (max 4 characters).
"AVAX"
Denomination of this asset to represent fungibility.
9
Type of asset like SECP256K1 or NFT.
secp256k1
, nft
Amount of the asset.
"5001000"
1
A list of objects containing P-chain Asset basic info, amount and utxo count of that Asset ID. Denotes the amount of unlocked Avax in the atomic memory between P-Chain and other chain.
Unique ID for an asset.
"th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof"
Name of this asset.
"Avalanche"
Symbol for this asset (max 4 characters).
"AVAX"
Denomination of this asset to represent fungibility.
9
Type of asset like SECP256K1 or NFT.
secp256k1
, nft
Amount of the asset.
"5001000"
1
"2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM"
A list of objects containing P-chain Asset basic info, amount and utxo count of that Asset ID. Denotes the amount of locked Avax in the atomic memory between P-Chain and other chain.
Unique ID for an asset.
"th5aLdWLi32yS9ED6uLGoMMubqHjzMsXhKWwzP6yZTYQKYzof"
Name of this asset.
"Avalanche"
Symbol for this asset (max 4 characters).
"AVAX"
Denomination of this asset to represent fungibility.
9
Type of asset like SECP256K1 or NFT.
secp256k1
, nft
Amount of the asset.
"5001000"
1
"2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM"
Was this page helpful?
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"
}
}