Skip to content
In order to get the current supply, authority, or decimals a token has, you will need to get the account info for the token mint.
These examples read the PYUSD mint and the USDC metadata account, which exist only on mainnet. Run them against a Surfpool local network that forks mainnet (surfpool start --network mainnet fetches the accounts on demand), or point the RPC URL at a mainnet endpoint.

​Fetch Mint Account

Kit
Output from a local Surfpool network
Output

​Fetch Metaplex Token Metadata

For tokens using the Metaplex Token Metadata Program, you can fetch the metadata account to get the token’s name, symbol, and URI. The Kit examples use the Metaplex Token Metadata client. Install it together with @solana-program/token, which the client loads but doesn’t declare as a dependency:
@metaplex-foundation/mpl-token-metadata-kit 0.0.3 is built on Kit 6. It runs with Kit 8, but TypeScript reports the RPC types as incompatible until you resolve it onto your Kit version in package.json, then delete node_modules and package-lock.json and run npm install again:
Not all tokens have Metaplex metadata. Tokens created with Token Extensions (Token-2022) may use the different functionality instead. See Token Extensions Metadata for more information.