getBalanceByOwnerAtSlot
Returns a wallet's total balance of a single SPL Token or Token-2022 mint as of a specific slot, already summed across every token account the wallet held of that mint. It returns a single figure rather than the list of accounts returned by getTokenAccountsByOwnerAtSlot.
A wallet can own more than one token account for the same mint. The optional scope parameter selects which of them the result covers: all (default) sums every token account the wallet held of that mint at that slot, ata returns the balance of the wallet's canonical Associated Token Account only (derived from (wallet, token program, mint), with the token program selected from the mint so Token-2022 mints resolve correctly). When a wallet holds exactly one token account of the mint, both scopes return the same value.
Available on Solana mainnet only. The request may also be sent as a positional array [wallet, mint, slot, scope], and owner is accepted as an alias for wallet.
Path Parameters
docs-demoFor higher throughput, create your own API key
Request
Base-58 encoded pubkey of the wallet whose balance you want. owner is accepted as an alias.
Base-58 encoded pubkey of the token mint. SPL Token and Token-2022 mints are both supported.
The slot to reconstruct the balance at. There is no "latest slot" default; omitting slot is an error.
allWhich of the wallet's token accounts the balance covers. all (default) sums every token account the wallet held of that mint at that slot; ata returns the balance of the wallet's canonical Associated Token Account only. Case-sensitive.
Defaults to "all".
Responses
200
The wallet's total token balance for that mint at the requested slot, with the slot the balance was computed at.