curl --request POST \
--url https://nd-326-444-187.p2pify.com/9de47db917d4f69168e3fed02217d15b \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "getTokenAccountsByDelegate",
"params": [
"4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
{
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
},
{
"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": "getTokenAccountsByDelegate",
"params": [
"4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
{
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
},
{
"encoding": "jsonParsed"
}
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}getTokenAccountsByDelegate method returns all SPL token accounts that have been delegated to a given account.
This method is useful for querying which token accounts a specific address has been granted spending authority over via the SPL token approve instruction.
pubkey (string, required) — the pubkey of the delegate account to query, as a base58 encoded string.filter (object, required) — filter results by token mint or program ID. One of:
mint (string) — the pubkey of the specific token mint to limit accounts to.programId (string) — the pubkey of the Token program that owns the accounts (TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA for SPL Token, TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb for Token-2022).config (object, optional) — configuration object containing:
encoding (string) — encoding for account data. Values: base58, base64, base64+zstd, jsonParsed. Default: base64. jsonParsed returns parsed JSON data for known token account structures.commitment (string) — the commitment level.result object with:
context — an object containing slot.value — an array of objects, each containing:
pubkey (string) — the token account address.account — an object with:
lamports (integer) — the account balance in lamports.owner (string) — the program that owns the account.data — the account data, encoded as requested. With jsonParsed, returns the parsed token account structure including mint, owner, tokenAmount, delegate, and delegatedAmount.executable (boolean) — whether the account is executable.rentEpoch (integer) — the epoch at which rent is next due.getTokenAccountsByDelegate is in DeFi protocols that use token delegation. For example, a lending protocol can query all token accounts delegated to its program to display a user’s approved spending limits, or an analytics tool can track delegation patterns across the network.Was this page helpful?