chainpeek: list a wallet's live token approvals (ERC-20 and Permit2) with revoke transactions
audit_token_approvalsList a wallet's live ERC-20 and Permit2 token approvals, flag risky or stale spenders, and return unsigned revoke transactions to set allowances to zero.
Instructions
chainpeek: List a wallet's live token approvals and get revoke transactions. For tokens already pulled out use check_wallet_drain; for one allowance use get_allowance. Returns the live ERC-20 and Permit2 allowances of wallet: amount, unlimited, spender code (key-controlled, contract, new contract), newest approval and pull, stale, flags with evidence, and revoke, the unsigned transaction that sets it to 0. Candidates: approval events in the latest 6,000 blocks, Permit2, and spenders. High: unlimited to a key-controlled account. Medium: limited to one, or unlimited to a contract with no code 30 days ago. Low: other unlimited or stale. Older approvals are found only via spenders or Permit2. Bad input is a 422, a failed read a 502 (neither charged). Nothing is signed or sent. Typically 3-15 s. Price: USD 0.005. Free: 10 chain reads per IP per UTC day. Docs: https://tanod.dev/learn/token-approval-audit-api.html
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | base or ethereum (the chains with built-in USDC and USDT here). | |
| tokens | No | Up to 50 token contracts to audit. Default: USDC, USDT and up to 18 tokens the wallet has sent (from its transfer history). | |
| wallet | Yes | The wallet whose approvals are audited (0x + 40 hex). | |
| spenders | No | Up to 50 spender addresses whose ERC-20 and Permit2 allowances are read directly on every audited token, however old (tokens x spenders at most 200). The full-coverage path for spenders you know. | |
| stale_days | No | An allowance is stale when the spender pulled nothing from the wallet in this many days (1-3,650; default 90). | |
| lookback_blocks | No | Latest blocks scanned for approval events (0-6,000; default 6,000, about 3.3 hours on Base and 20 hours on Ethereum). 0 scans nothing and checks `spenders` and Permit2 only. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| risk | No | ||
| block | No | ||
| chain | No | ||
| error | No | Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object. | |
| rules | No | ||
| limits | No | ||
| tokens | No | ||
| wallet | No | ||
| checked | No | ||
| history | No | ||
| reasons | No | ||
| rpc_calls | No | ||
| allowances | No | ||
| stale_days | No | ||
| block_timestamp | No | ||
| allowances_total | No |