Solana wallet drain check API

Tokens left a Solana wallet and you don't know why? The first two questions are always the same: which transactions touched this wallet recently, and does any address still have permission to move its tokens. Wallet Doctor's /v1/drain_forensics endpoint answers both in one GET request: the last 25 transaction signatures with failed ones flagged, plus every active SPL token delegate (SPL Token and Token-2022).

Run it from your wallet app ($0.0025)Call it from codeDo it yourself for free
If funds are moving right now: nothing on this page stops a drain. Move what is left to a fresh wallet whose seed phrase has never been typed into a website, then investigate. If the cause is a leaked seed phrase or private key, revoking approvals will not help, because the attacker can sign as you. And be wary of anyone who contacts you offering to "recover" drained crypto; that is a well-known follow-up scam. We never ask for your seed phrase or signatures beyond the one payment.

What the check returns

FieldMeaning
recent_transactionsUp to 25 most recent signatures for the wallet, each with blockTime (Unix seconds) and status (ok or failed)
failed_countHow many of those failed. A burst of failed transactions can mean a bot racing you for the remaining balance
active_delegatesToken accounts that currently have a delegate: token_account, mint, delegate, delegated_amount, balance, program
noteA one-line reminder of what to do with the result

Example response (shape as served; values illustrative):

{"ok": true,
 "wallet": "YOUR_WALLET",
 "recent_transactions": [{"signature": "5h…", "blockTime": 1794496949, "status": "ok"}, …],
 "failed_count": 0,
 "active_delegates": [],
 "note": "Active delegates can move the delegated tokens; revoke any you do not recognise. Use txtrace on suspicious signatures."}

To dig into one suspicious signature, /v1/txtrace ($0.0005) returns its status, fee, SOL balance changes per account and the first 20 program log lines.

Reading the result

Call it from code

Unpaid, the endpoint answers 402 Payment Required with its price. Trimmed live response:

curl -i "https://manhourplan.com/wallet-doctor/v1/drain_forensics?wallet=YOUR_WALLET"

HTTP/2 402
{"x402Version":2,
 "accepts":[
  {"scheme":"exact","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","amount":"2500"},
  {"scheme":"exact","network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","asset":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","amount":"2500", …}],
 "error":"PAYMENT-SIGNATURE header is required"}

amount: "2500" is USDC with 6 decimals: $0.0025 per check, payable on Base or Solana. Payment settles through the PayAI facilitator only after the lookup succeeds; if the Solana RPC fails, you are not charged. With the official client:

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://manhourplan.com/wallet-doctor/v1/drain_forensics?wallet=YOUR_WALLET");
const { result } = await res.json();
console.log(result.failed_count, result.active_delegates);

MCP clients can call the same check as the drain_forensics tool on https://manhourplan.com/wallet-doctor/mcp. No wallet set up in code? The try page lets you pay for one call from Coinbase Wallet, MetaMask or Phantom; it shows the price before you sign.

Do it yourself for free

The check is one getSignaturesForAddress call plus the two getTokenAccountsByOwner calls from the approvals guide:

curl -s https://api.mainnet-beta.solana.com -H 'content-type: application/json' -d '{
 "jsonrpc":"2.0","id":1,"method":"getSignaturesForAddress","params":["YOUR_WALLET",{"limit":25}]}'

A block explorer (Solscan, Solana Explorer) shows the same history for free. The paid endpoint is for bots and agents that need it as one machine-readable call without an RPC key.

Scope, honestly: this is triage, not recovery. It reads public on-chain data at call time: the 25 most recent signatures (not full history, and no per-transaction token transfer breakdown) and the delegates that exist right now. It does not judge whether an address is malicious, cannot reverse transactions, and does not cover other programs' permissions such as staking or marketplace escrows.