Skip to content
You can fetch token accounts by owner. There are two ways to do it.
These examples read the token accounts of a mainnet wallet, 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.
  1. Get All Token Account
Kit
Output from a local Surfpool network
Output
  1. Filter By Mint
Kit
Output from a local Surfpool network
Output