getTokenAccountsByOwner RPC Method
Returns all SPL Token accounts by token owner.Parameters
string requiredPubkey of account owner to query
- Base-58 encoded string
object requiredA JSON object with one of the following fields:
mint: <string>- Pubkey of the specific token Mint- Base-58 encoded string
programId: <string>- Pubkey of the Token program that owns the accounts- Base-58 encoded string
object optionalConfiguration object containing the following fields:commitment
string optionalThe level of commitment desired when querying stateminContextSlot
number optionalThe minimum slot that the request can be evaluated atdataSlice
object optionalRequest a slice of the account’s data
length: <usize>- number of bytes to returnoffset: <usize>- byte offset from which to start reading
string optionalEncoding format for Account data
- Default: not specified
base58base64base64+zstdjsonParsed
Data Slicing Note
Data slicing is only available forbase58, base64, or base64+zstd encodings.Result Details
The result is an RpcResponse JSON object withvalue as an array of account objects:
-
pubkey: <string>- Account Pubkey as a base-58 encoded string
- Uniquely identifies the token account
-
account: <object>- Detailed account information:
lamports: <u64>- Number of lamports in the accountowner: <string>- Pubkey of the program owning the accountdata: <object>- Token state dataexecutable: <bool>- Indicates if the account contains a programrentEpoch: <u64>- Epoch when rent is next duespace: <u64>- Size of the account data
- Detailed account information:
Additional Notes
- When using
jsonParsedencoding, expect a Token Balances Structure tokenAmountprovides detailed token balance information- Optional
delegatedAmountmay be present in the parsed data