Learn how to use the enhancedGetTokensAndNFTs JSON-RPC method.
curl --request POST \
--url 'https://rpc.particle.network/solana/#enhancedGetTokensAndNFTs' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"chainId": 101,
"method": "enhancedGetTokensAndNFTs",
"params": [
{
"accountAddress": "6XU36wCxWobLx5Rtsb58kmgAJKVYmMVqy4SHXxENAyAe"
}
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"chainId": 101,
"result": {
"lamports": 123,
"nfts": [
{
"mint": "<string>",
"address": "<string>",
"isSemiFungible": true,
"name": "<string>",
"symbol": "<string>",
"image": "<string>",
"sellerFeeBasisPoints": 123,
"metadata": {
"key": 123,
"updateAuthority": "<string>",
"mint": "<string>",
"data": {
"name": "<string>",
"symbol": "<string>",
"uri": "<string>",
"sellerFeeBasisPoints": 123,
"creators": [
{
"address": "<string>",
"verified": true,
"share": 123
}
],
"uriData": {}
},
"primarySaleHappened": true,
"isMutable": true,
"editionNonce": 123
}
}
],
"tokens": [
{
"decimals": 123,
"amount": 123,
"address": "<string>",
"mint": "<string>",
"name": "<string>",
"symbol": "<string>",
"image": "<string>"
}
]
}
}enhancedGetTokensAndNFTsenhancedGetTokensAndNFTs, like its EVM counterpart, getTokensAndNFTs, retrieves a detailed list of tokens and NFTs that belong to a specific address. It takes:
address - a base58-encoded string.parseMetadataUri - Boolean (false by default).const axios = require('axios');
(async () => {
const response = await axios.post('https://rpc.particle.network/solana', {
chainId: 103,
jsonrpc: '2.0',
id: 0,
method: 'enhancedGetTokensAndNFTs',
params: ['6XU36wCxWobLx5Rtsb58kmgAJKVYmMVqy4SHXxENAyAe', {
parseMetadataUri: true,
}],
}, {
auth: {
username: 'Your Project Id',
password: 'Your Project Server Key',
}
});
console.log(response.data);
})();
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Request to get tokens and NFTs for an account.
Version of the JSON-RPC protocol, should be 2.0.
"2.0"
The request identifier.
1
The blockchain chain ID.
101
API method being called.
enhancedGetTokensAndNFTs Parameters for getting tokens and NFTs.
Account address details.
Show child attributes
Successful response with tokens and NFTs information.
Was this page helpful?
curl --request POST \
--url 'https://rpc.particle.network/solana/#enhancedGetTokensAndNFTs' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"chainId": 101,
"method": "enhancedGetTokensAndNFTs",
"params": [
{
"accountAddress": "6XU36wCxWobLx5Rtsb58kmgAJKVYmMVqy4SHXxENAyAe"
}
]
}
'{
"jsonrpc": "2.0",
"id": 1,
"chainId": 101,
"result": {
"lamports": 123,
"nfts": [
{
"mint": "<string>",
"address": "<string>",
"isSemiFungible": true,
"name": "<string>",
"symbol": "<string>",
"image": "<string>",
"sellerFeeBasisPoints": 123,
"metadata": {
"key": 123,
"updateAuthority": "<string>",
"mint": "<string>",
"data": {
"name": "<string>",
"symbol": "<string>",
"uri": "<string>",
"sellerFeeBasisPoints": 123,
"creators": [
{
"address": "<string>",
"verified": true,
"share": 123
}
],
"uriData": {}
},
"primarySaleHappened": true,
"isMutable": true,
"editionNonce": 123
}
}
],
"tokens": [
{
"decimals": 123,
"amount": 123,
"address": "<string>",
"mint": "<string>",
"name": "<string>",
"symbol": "<string>",
"image": "<string>"
}
]
}
}