An SPL token approval lets another address (a delegate) move up to a set amount out of one of your token accounts without asking you again. Approvals you forgot about are a common way wallets get drained. Wallet Doctor's /v1/approvals endpoint lists every token account on a wallet that currently has a delegate, for SPL Token and Token-2022, in one GET request your bot or agent can pay for itself.
On Solana, token balances live in token accounts. The SPL Token program's Approve instruction writes a delegate and a delegatedAmount onto one token account. Until the owner revokes it (or the allowance is used up), the delegate can transfer up to that amount. Wallet apps sometimes create approvals during swaps, staking or NFT listings. Most are harmless and short-lived; the ones to worry about are large allowances to addresses you don't recognise.
Unpaid, the endpoint answers 402 Payment Required with its price (this is the live response, trimmed):
curl -i "https://wallet-doctor-x402.m-zikriz.workers.dev/v1/approvals?wallet=YOUR_WALLET"
HTTP/2 402
payment-required: eyJ4NDAyVmVyc2lvbiI6Mi...
{"x402Version":2,
"accepts":[
{"scheme":"exact","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"500"},
{"scheme":"exact","network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","asset":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","amount":"500",
"extra":{"feePayer":"CjNFTjvBhbJJd2B5ePPMHRLx1ELZpa8dwQgGL727eKww"}}],
"error":"PAYMENT-SIGNATURE header is required"}
amount: "500" is USDC with 6 decimals: $0.0005 per check, on Base or Solana. An x402 v2 client signs the payment from your bot's wallet and retries. Payment is settled through the PayAI facilitator only if the lookup succeeds; if the Solana RPC fails, you are not charged.
With the official TypeScript client (@x402/fetch; use @x402/svm to pay from a Solana wallet instead):
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
const pay = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(privateKeyToAccount(process.env.BOT_KEY)) }],
});
const res = await pay("https://wallet-doctor-x402.m-zikriz.workers.dev/v1/approvals?wallet=YOUR_WALLET");
const report = await res.json();
if (report.result.approvals_count > 0) console.log(report.result.approvals);
Agents that speak MCP can call the same check as the approvals tool on https://manhourplan.com/wallet-doctor/mcp; unpaid calls return the payment requirements in the tool result.
The paid response wraps the result: {"ok":true,"service":"Wallet Doctor","path":"/v1/approvals","payment":{…},"result":{…}}. A wallet with no active delegates returns:
{"ok": true, "wallet": "YOUR_WALLET", "approvals_count": 0, "approvals": [], "source": "solana-rpc"}
Each entry in approvals has these fields:
| Field | Meaning |
|---|---|
token_account | The token account that carries the approval (this is what you revoke) |
mint | Which token it is |
delegate | The address allowed to move tokens |
delegated_amount | How much it may still move (UI amount, as a string) |
balance | Current balance of that token account |
program | spl-token or token-2022 |
Related endpoints on the same API: /v1/drain_forensics ($0.0025) returns the wallet's last 25 transactions with failed ones flagged plus the same delegate list, for triage after something went wrong; /v1/token_safety ($0.001) checks a mint's mint/freeze authority before you buy. Full table on the x402 wallet analysis API page.
If you run your own RPC access, you don't need us. The check is two getTokenAccountsByOwner calls (one per token program) with jsonParsed encoding, keeping accounts whose info.delegate is set:
curl -s https://api.mainnet-beta.solana.com -H 'content-type: application/json' -d '{
"jsonrpc":"2.0","id":1,"method":"getTokenAccountsByOwner",
"params":["YOUR_WALLET",{"programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"encoding":"jsonParsed"}]}'
# repeat with programId TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb (Token-2022)
Public endpoints rate-limit this method and some block cloud IPs, which is the main reason to pay a fraction of a cent for a hosted call from an agent that has a wallet but no RPC key.
Revoking is done by the token account's owner, with your own wallet (we never sign anything for you). With the Solana CLI tools: spl-token revoke <TOKEN_ACCOUNT>. Many wallet apps also offer a revoke or "token approvals" screen.