getTokenAccountsByOwner
All the specifications for getTokenAccountsByOwner RPC Method on Solana
Returns all SPL Token accounts by token owner.
Parameters required for this RPC call
The pubkey of account delegate to query, as base-58 encoded string.
A JSON object with one of the following fields:
mint: Pubkey of the specific token Mint to limit accounts to, as base-58 encoded string; or
programId: Pubkey of the Token program that owns the accounts, as base-58 encoded string
configuration : This contains the following parameters, all are optional fields.
commitment: The commitment describes how finalized a block is at that point in time. Commitment levels processed, confirmed and finalized are supported, defaults to finalized.
dataSlice: Request a slice of the account's data.
length: <usize>
- number of bytes to returnoffset: <usize>
- byte offset from which to start reading
minContextSlot: The minimum slot that the request can be evaluated at.
encoding: Encoding format for each returned transaction. The supported options are json, jsonParsed, base58 and base64. You can know more about Parsed responses more on Solana docs.
curl https://rpc.shyft.to?api_key=YOUR-API-KEY -s -X \
POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTokenAccountsByOwner",
"params": [
"A1TMhSGzQxMr1TboBKtgixKz1sS6REASMxPo1qsyTSJd",
{
"programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
},
{
"commitment": "finalized",
"encoding": "jsonParsed"
}
]
}
'
Last updated
Was this helpful?