avm.getAssetDescription - AVAX
Example code for the avm.getAssetDescription JSON-RPC method. Complete guide on how to use avm.getAssetDescription JSON-RPC in GetBlock Web3 documentation.
Returns metadata for an asset on the X-Chain — name, symbol, denomination (decimals), and asset ID.
Parameters
assetID
string
Yes
Asset ID (CB58)
Request Example
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/ext/bc/X' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "avm.getAssetDescription",
"params": {
"assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
},
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "avm.getAssetDescription",
"params": {
"assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z"
},
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/ext/bc/X',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data, null, 2)))
.catch(error => console.log(error));Response Example
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": {
"assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z",
"name": "Avalanche",
"symbol": "AVAX",
"denomination": "9"
}
}Response Parameters
result.assetID
string
Asset ID echoed back
result.name
string
Asset name
result.symbol
string
Asset symbol (ticker)
result.denomination
string
Number of decimals (AVAX = 9)
Use Cases
Showing asset names/symbols in wallet UIs
Formatting balances with the correct decimal precision
Asset directories and explorers
Error Handling
404
Not Found
Missing or invalid <ACCESS-TOKEN>
-32602
Invalid params
Request parameters are missing or malformed
429
Too Many Requests
Rate limit exceeded for your plan
SDK Integration
Last updated
Was this helpful?