Solana
Solana
Solana
Free tier covers personal projects. Pay-as-you-go scales without a card.
On Solana, where SOL is the native token and SPL programs own each holder's token data accounts, getTokenAccountsByDelegate returns the token accounts where a given delegate is approved to move funds. An SPL approve instruction lets an owner grant another address (a program, an AMM like Raydium, or a counterparty) a spending allowance over a token account; this method finds every such account tied to one delegate. Post a JSON-RPC 2.0 request with positional params to https://solana.therpc.io/YOUR_API_KEY to receive an array of { pubkey, account } entries for that delegate.
revoke.| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | delegate | string | Yes | Base-58 delegate address. |
| 2 | filter | object | Yes | Either { mint } or { programId } — exactly one. |
| 3 | config | object | No | Options: commitment, encoding, dataSlice, minContextSlot. |
| Type | Description |
|---|---|
| object | RpcResponse wrapping an array of { pubkey, account }. |
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
{ mint } or { programId }, never both and never an empty object — otherwise the node returns an Invalid params (-32602) error.encoding: "jsonParsed" in the config to get readable token amounts and delegate fields back in the account data; the default base64 encoding returns opaque bytes you would have to decode yourself.