Swift Bot Labs

Solana transaction receipt, as JSON

One call, one signature in, one plain receipt out: what was swapped, sent or received, every fee (base, priority, app, tip), per-signer balance changes, the programs involved and the failure reason when a transaction failed. Every number is derived from the chain data of getTransaction; token metadata only supplies names. The same engine powers the free page at swiftbotlab.github.io/solscan-receipt-redesign/tx.html.

x402 v2USDC on Base (eip155:8453)no account, no API keyfailed lookups are free

$0.02 per receipt, paid per call with x402. Pay-to 0x2481E29895b43e87e547a50fB0BB5aa1E70585EB.

Endpoints

RouteWhat
GET /receipt?sig=<signature>Paid. The receipt for one transaction.
POST /receipt {"signature": "..."}Paid. Same, signature in the body.
GET /healthFree. Liveness and the current price.
GET /openapi.json · GET /.well-known/x402Free. Machine-readable description for x402 clients and catalogs.

How paying works

Call /receipt with no payment and you get 402 Payment Required with a PAYMENT-REQUIRED header (base64 JSON, also mirrored in the body) that names the price, the asset and the pay-to address. An x402 client signs a USDC transferWithAuthorization for exactly that amount, retries with it in PAYMENT-SIGNATURE, and gets the receipt with the settlement in PAYMENT-RESPONSE. Gas is sponsored by the facilitator; the payer wallet only needs USDC.

# 1. see the quote (free)
curl -i "https://x402-receipt.swiftbotlab.workers.dev/receipt?sig=2suHQxPLU18D1jq28ZVPJdu5CQgQQbBnDCban56hQUo9vod7YFMBboy1yVkRVhNDFd6UosfdZqTcweupqyRKmiwC"
# -> HTTP/2 402, PAYMENT-REQUIRED: eyJ4NDAyVmVyc2lvbiI6Miwi...

# 2. pay and fetch with any x402 v2 client, e.g. @x402/fetch + @x402/evm (Node):
#    const fetchWithPayment = wrapFetchWithPayment(fetch, client);   // client = your wallet signer
#    const res = await fetchWithPayment("https://x402-receipt.swiftbotlab.workers.dev/receipt?sig=...");
#    const receipt = await res.json();                 // res.headers.get("PAYMENT-RESPONSE") = settlement

What comes back

{
  "ok": true, "signature": "...", "mode": "swap",          // swap | transfer | reduced | failed
  "finalized": true,
  "receipt": { "mode": "swap", "story": {...}, "cost": {...}, "perSigner": [...], "programs": [...], "reasons": [...] },
  "source": { "rpc": "https://solana-rpc.publicnode.com", "explorer": "https://solscan.io/tx/...", "ui": "https://swiftbotlab.github.io/solscan-receipt-redesign/tx.html?sig=..." },
  "payment": { "status": "settled", "network": "eip155:8453", "transaction": "0x...", "payer": "0x..." }
}

mode: swap (given/got/fees/also-sent), transfer (sends with recipients), reduced (exact balance changes, fee and programs, with the reasons why no story is told), failed (the error, the program that raised it, the fee still paid). The engine never guesses a story: when the data is ambiguous it drops to reduced and says why.

Rules

Source and tests of the receipt engine: github.com/swiftbotlab/solscan-receipt-redesign. API version 0.1.0.