curl --request POST \
--url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "getTokenAccountsByOwner",
"params": [
"CEXq1uy9y15PL2Wb4vDQwQfcJakBGjaAjeuR2nKLj8dk",
{
"mint": "8wXtPeU6557ETkp9WHFY1n1EcU6NxDvbAggHGsMYiHsB"
},
{
"encoding": "jsonParsed"
}
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}curl --request POST \
--url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "getTokenAccountsByOwner",
"params": [
"CEXq1uy9y15PL2Wb4vDQwQfcJakBGjaAjeuR2nKLj8dk",
{
"mint": "8wXtPeU6557ETkp9WHFY1n1EcU6NxDvbAggHGsMYiHsB"
},
{
"encoding": "jsonParsed"
}
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}getTokenAccountsByOwner method retrieves a list of accounts owned by a specified wallet, filtered by their associated token.
This method is useful for identifying all accounts associated with a particular owner and a specific token, allowing for a comprehensive view of token distribution and ownership.
delegatePubkey — the base-58 encoded string representing the public key of the account delegate to query.filters — a JSON object with one of the following fields:
mint — the base-58 encoded string of the specific token Mint to limit accounts to.programId — the base-58 encoded string of the Token program that owns the accounts.config (optional) — configuration object containing the following fields:
commitment (optional) — the level of commitment desired for the query.minContextSlot (optional) — te minimum slot that the request can be evaluated at.dataSlice (optional) — request a slice of the account’s data, specifying length (number of bytes to return) and offset (byte offset from which to start reading).encoding (optional) — the format of the returned account data. Possible values are base58, base64, base64+zstd, or jsonParsed.value — an array of JSON objects, each containing:
pubkey — the account Pubkey as a base-58 encoded string.account— a JSON object with subfields:
lamports — number of lamports assigned to this account, as a u64.owner — base-58 encoded Pubkey of the program to which this account has been assigned.data — token state data associated with the account as encoded binary data or in JSON format.executable — boolean indicating if the account contains a program (and is strictly read-only).rentEpoch — the epoch at which this account will next owe rent, as a u64.size — the data size of the account.getTokenAccountsByOwner is for wallet interfaces or financial tracking applications to list all accounts associated with a particular owner and token type. This can be especially useful for assessing the distribution of tokens across different accounts and for transaction history analysis.Was this page helpful?