Demo environment. Wallet balances and swap quotes are real; no card is issued and no funds leave your wallet.
PumpPay

Developer documentation

How PumpPay moves value from a Solana wallet to a card — and the internal API the app is built on.

Architecture

  • Next.js app (UI + API routes) with Postgres. All provider and RPC keys stay server-side.
  • Wallet Standard connection; Sign-In With Solana message → httpOnly session cookie.
  • Jupiter for quotes and swap instructions; Solana RPC for balances, simulation and confirmation.
  • Card provider adapter (Vibed Cards) behind a CardProvider interface; a clearly labelled demo adapter runs until live credentials exist.
  • Double-entry ledger in micro-USD integers, durable jobs table, append-only audit log, daily reconciliation.

Funding flow

1. POST /api/cards/create | /api/cards/:id/fund   → provider POST /payments → pay_address + exact USDC amount
2. POST /api/swap/quote   { intentId }             → Jupiter ExactOut quote for exactly that USDC
3. POST /api/swap/build   { quoteId }              → ONE v0 tx: swap → provider's USDC account + memo pumppay:<intent>
                                                     (simulated server-side; message bytes hashed)
4. wallet.signTransaction(tx)                       → user reviews and signs
5. POST /api/swap/confirm { quoteId, signedTx }     → bytes must match what we built, then broadcast
6. worker: confirm_swap → poll_payment / webhook    → provider marks paid → card issued / topped up
7. completeIntent                                   → ledger journal, fee record, referral accrual, card sync

Because the swap and the payment are in the same transaction, a failure reverts both. The memo ties the on-chain payment to the request, and the confirm step checks it.

Intent states

created → awaiting_signature → swap_submitted → swap_confirmed → provider_pending → completed
                         ↘ expired          ↘ failed          ↘ manual_review / refund_pending → refunded

Internal API

All routes return JSON; errors use { error: { code, message } }. State-changing routes require a same-origin request and a valid session.

POST /api/auth/challenge      { address, purpose }       → SIWS message + nonce
POST /api/auth/verify         { address, nonce, signature }
GET  /api/auth/me
GET  /api/wallet/portfolio    ?wallet=                     → holdings + executable spendable estimate
GET  /api/tokens/supported    GET /api/tokens/check?mint=
POST /api/cards/create        { initialAmountUsd, inputMint, idempotencyKey }
POST /api/cards/:id/fund      { amountUsd, inputMint, idempotencyKey }
POST /api/cards/:id/reveal    { nonce, signature }         → card data, never stored, no-store
POST /api/cards/:id/freeze    /unfreeze   /wallet-code   GET /codes
GET  /api/payments/:id        ?refresh=1
GET  /api/transactions        ?format=csv
POST /api/webhooks/card-provider                           → HMAC-SHA256 verified, deduplicated

Webhooks

Provider events are verified with an HMAC-SHA256 signature over the raw body, stored once by event ID, and then the payment is re-fetched from the provider API before any state change — so a forged, replayed or out-of-order webhook cannot move funds.

Spendable balance

For each eligible holding we request a real quote to USDC, shrink the size until price impact is under the limit, and subtract provider and PumpPay fees and network costs. Protected, ineligible and illiquid tokens count as zero. This is the amount you could actually load right now, not the market value.