tx_matches
Run right before signing a transfer your agent built from a request like "send 5 USDC to X". Confirms it moves exactly that token, amount and recipient and nothing else. Catches made-up amounts, wrong decimals and sneaked-in steps. Compares the transaction with what you asked for, field by field (token, exact amount, recipient, sender), flags every step that isn't part of the transfer, and checks the dry-run balances so money moved any other way is caught. Inputs: tx: The transaction, base64-encoded. Signed or not. Legacy and v0 both work. expected.token: The token that should be sent. expected.amount: How much should be sent, in normal units. "5" means 5 USDC. expected.to: The wallet that should get it (the person, not their token account). expected.from (optional): The wallet that should pay. Default: the transaction's fee payer. network (optional): Which Solana network to read. Default "mainnet-beta" (real money). Cost: 25 free calls a day, then $0.02 USDC per call (x402). Full field-by-field docs: GET /api/tools/tx_matches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tx | Yes | The transaction, base64-encoded. Signed or not. Legacy and v0 both work. From your wallet SDK before signing: Buffer.from(tx.serialize({ requireAllSignatures: false })).toString('base64'). Or the swap transaction an aggregator API gave you. | |
| network | No | Which Solana network to read. Default "mainnet-beta" (real money). Leave it out for mainnet. Use "devnet" only for test wallets. | mainnet-beta |
| expected | Yes | token: The token that should be sent. amount: How much should be sent, in normal units. "5" means 5 USDC. to: The wallet that should get it (the person, not their token account). from: The wallet that should pay. Default: the transaction's fee payer. |