# getTokenLargestAccounts
Information
This method is enabled for elastic Solana devnet nodes on US Ashburn (ash1) and Amsterdam (ams1) with a rate limit of 2 requests per second (RPS).
Solana API method that returns the 20 largest accounts of a particular SPL token type.
Parameters:
<string>
— the public key of the NFT collection, as a base58 encoded string.<object>
— (optional) configuration object containing the following field:commitment: <string>
— (optional) commitment.
Returns:
The result will be an RPC response JSON object with value
equal to an array of JSON objects, which will contain:
address: <string>
— the address of the token account.amount: <string>
— the raw token account balance without decimals, a string representation of u64.decimals: <u8>
— number of base 10 digits to the right of the decimal place.uiAmount: <number|null>
— the token account balance, using mint-prescribed decimals.uiAmountString: <string>
— the token account balance as a string, using mint-prescribed decimals.
Example:
- Solana web3.js
- Solana.py
- cURL
import { Connection } from "@solana/web3.js"
const nodeUrl = "CHAINSTACK_NODE_URL"
const connect = new Connection(nodeUrl);
(async () => {
const MINT_ADDRESS = new PublicKey("Duch2MmgCar9UGt76smK5HcJ7anBRa31uNZZvNJt3b5S");
const connection = new Connection(nodeUrl);
const accounts = connection.getTokenLargestAccounts(MINT_ADDRESS)
console.log(await accounts)
})();