Overview
getTokenAccounts lists token accounts filtered by owner, by mint, or both. Filter by mint to page through every holder of a token; filter by owner to list a wallet’s token accounts. Unlike getProgramAccounts, it pages, so it works for mints with millions of holders.
Accounts with a zero balance are left out unless you set showZeroBalance.
Parameters
Pass at least one ofowner and mint.
Page number, starting at 1. See Pagination.
Display options:
showZeroBalance. Also accepted as displayOptions.Response
Code Examples
Holders of a mint
Count every holder of a token
Rust
Counting every holder of a token with the OrbitFlare Rust SDK:GetTokenAccounts::by_owner or GetTokenAccounts::by_mint, or set both with .owner() and .mint(). The SDK rejects a request that has neither before sending it.