--- name: wallet-trades description: Read a Solana wallet's most recent transactions and turn each into plain balance changes - which tokens went in and out, whether it was a swap, a buy, a send or a receive, with time and fee. Use when the user asks what a wallet has been trading, buying or selling lately. Read-only; needs only the public address. --- # Wallet recent trades Free and read-only. Uses the public Solana RPC. Only a public address is needed: never ask the user for a private key or seed phrase, and refuse if one is offered. ## Run ```bash node scripts/trades.mjs # last 10 transactions node scripts/trades.mjs --limit 20 # up to 20 ``` Optional: set `SOLANA_RPC_URL` to your own RPC. The public RPC is rate-limited, so the script waits between calls and a run of 20 takes several seconds. ## Output JSON on stdout: `{ wallet, count, swaps, transactions: [ { signature, time, kind, changes: [ { mint, delta } ], feeSol, failed } ] }`. - `kind` is `swap` (something in and something out), `received`, `sent` or `other`. - `mint` is `SOL` for native and wrapped SOL, otherwise the token mint address. - `delta` is in whole tokens: negative left the wallet, positive came in. ## Notes for the agent - To name the tokens, look up each mint (for example with the `dexscreener-token` skill). - Link a transaction as `https://solscan.io/tx/`. - Failed transactions are included with `failed: true`; leave them out of trade summaries.