get Token Accounts By Delegate
Returns every token account that has approved a given delegate, filtered to one mint or token program.
getTokenAccountsByDelegate returns the SPL Token and Token-2022 accounts whose owner has approved the given address as delegate, narrowed by either a mint or a programId.
Answers come from a delegate index. Each account is then read from the node at the requested commitment, so the returned data is current at context.slot.
Parameters
params is a JSON array, with values in this order: delegate, filter, config.
Delegate address the token accounts have approved, base-58 encoded.
Exactly one of mint or programId. The two are mutually exclusive.
Show one ofOne of
Show propertiesProperties
Restricts results to token accounts for this mint, base-58 encoded.
Show propertiesProperties
Restricts results to token accounts owned by this token program, base-58 encoded: the SPL Token program or Token-2022.
Optional configuration.
Show propertiesProperties
Bank state to read the accounts from.
finalizedconfirmedprocessedHow to encode each account's data. The default binary and base58 allow at most 128 bytes of data, and a token account is 165 bytes or more, so use base64 or jsonParsed.
base64base64+zstdjsonParsedbase58binaryReturns only a byte range of each account's data. Not valid with jsonParsed.
Show propertiesProperties
Byte offset to start reading from.
Number of bytes to return.
Minimum slot the node must have processed before answering.
Result
Matching token accounts, wrapped with context.
Show propertiesProperties
Show propertiesProperties
Show each itemEach item
Token account address, base-58 encoded.
Show propertiesProperties
The token program that owns this account (not the wallet that controls its tokens).
Same shape as getAccountInfo. With jsonParsed, data.parsed.info includes mint, owner (the wallet), state and tokenAmount.
Notes
- Included in the Blade Runner plan (2/s per key) and the Nexus plan (5/s per key), in every region.
- A delegate with more than 150,000 token accounts in total, across the SPL Token and Token-2022 programs, gets code
-32012anddelegate has more than 150000 token accounts; getTokenAccountsByDelegate is limited to 150000. The limit applies before themintorprogramIdfilter, so nothing is returned for such a delegate. - A delegate with no matching token account returns an empty
valuearray, not an error. - With
jsonParsed,data.parsed.infoincludesdelegateanddelegatedAmount. A Token-2022 account hasprogramset tospl-token-2022and lists itsextensions. - Rows are ordered by the raw 32 bytes of the token account address. This is not the alphabetical order of the base-58 strings.
- Errors with code
-32602(HTTP200):Invalid param: unrecognized Token program idwhenprogramIdis not a token program;Invalid param: Token mint could not be unpackedwhen themintaddress is not a mint. - Free and Operator plan keys get HTTP
403withgetTokenAccountsByDelegate requires higher tier. Over the per-second rate, the response is the standard rate-limit429. See Errors. - HTTP
503with code-32005andgetTokenAccountsByDelegate is temporarily unavailable; retry shortly, or code-32005withNode is behind by <n> slots: the delegate index cannot answer at that moment. The condition is temporary.