scan_wallet
Scan a Solana wallet to identify empty token accounts with reclaimable SOL. Returns count of closeable accounts and estimated recoverable SOL without requiring private keys.
Instructions
Scan a Solana wallet for reclaimable SOL locked in empty token accounts. Returns count of closeable accounts and estimated SOL recoverable. Free, read-only — no private key needed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet | Yes | Solana wallet address (base58) |
Implementation Reference
- dist/services/api.js:38-81 (handler)The 'scanWallet' function performs the actual backend API call to '/api/checkTokenAccounts' and processes the result to identify reclaimable SOL from token accounts.
export async function scanWallet(walletAddress) { const data = await apiPost('/api/checkTokenAccounts', { walletAddresses: [walletAddress], }); if (!data.success) { return { success: false, totalAccounts: 0, totalSolRecoverable: 0, tokenAccounts: [], burnAccounts: [], error: data.error || 'Scan failed', }; } // API returns { wallets: [{ address, emptyAccounts, potentialReward, accounts: [...] }] } const wallets = data.wallets || []; const wallet = wallets[0] || {}; const accounts = wallet.accounts || []; const tokenAccounts = accounts .filter(a => !a.hasBalance || Number(a.balance || 0) === 0) .map(a => ({ pubkey: String(a.pubkey || a.address || ''), mint: String(a.mint || ''), amount: 0, rentLamports: 2039280, })); const burnAccounts = accounts .filter(a => a.hasBalance && Number(a.balance || 0) > 0) .map(a => ({ pubkey: String(a.pubkey || a.address || ''), mint: String(a.mint || ''), amount: Number(a.balance || 0), rentLamports: 2039280, })); const totalAccounts = tokenAccounts.length + burnAccounts.length; const totalSolRecoverable = Number(wallet.potentialReward || 0) || totalAccounts * 0.00204; return { success: true, totalAccounts, totalSolRecoverable, tokenAccounts, burnAccounts, }; }