HTTP/1.1 402 PAYMENT REQUIRED agent402.base.eth · BASE · SOLANA · POLYGON · ARBITRUM · ROBINHOOD · USDC · USDG

Agent wallet readiness check

One call answers 'can this wallet pay right now?' — USDC balances on Base AND Solana, live Base gas, and a ready-to-share Coinbase Onramp funding link if it's running dry.

When to use this pack

An agent (or the human operating it) is about to start a paid work session and needs to know the wallet is actually ready: does it hold USDC on the chains it pays on, what's gas doing, and — if the balance is low — where does a human top it up with a card? Checking each of those separately means three tools and a docs page; this pack returns the whole preflight in one envelope. Run it at session start, before a batch job, or on a schedule as a balance monitor.

Tools in this pack

Workflow

  1. Call wallet-balances with {address, network: "base"} — returns every indexed ERC-20 + native balance. Find the USDC row (contract 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913) and read its amount: this is the wallet's x402 spending power on Base.
  2. If the agent also pays on Solana, call wallet-balances again with {address: <the Solana address>, network: "solana"} — same envelope, SPL balances, USDC mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v. (x402 settlement is gasless via EIP-3009 / sponsored transactions, so USDC is the only balance that matters — no ETH or SOL required.)
  3. Call gas-snapshot with {network: "base"} for slow/standard/fast gas. The agent never pays gas on x402 buys, but gas context tells you whether any NON-x402 onchain action you're planning (a manual transfer, a contract call) is cheap right now.
  4. If the USDC balance is below your working budget, call onramp-link with {address, network: "base", amount: "<usd>"} — it mints a single-use Coinbase Onramp URL a human can open to fund the wallet with a card or Apple Pay. Include the URL in your report; it expires unvisited, so minting it costs nothing but the call.
  5. Assemble the verdict: { ready: usdcBase >= budget, balances: { base, solana }, gas, fundingLink } — 'ready' should be computed against the session budget the caller stated, not a fixed threshold.

Run it in Claude

claude mcp add agent402 -s user -- npx -y agent402-mcp@latest

Then paste this prompt into Claude:

Run a wallet readiness preflight for 0xaBF4FAbd7c416fB67202E5f9002389Fc75e2a9D0 (Solana: J7aN3PLJnTCF5qpEnvJHJsnCjcGuqC2rYtEM8Gv3xwg) using Agent402. (1) wallet-balances {address, network: "base"} — find the USDC row and note the amount. (2) wallet-balances {address: <the Solana address>, network: "solana"} — the SPL USDC amount. (3) gas-snapshot {network: "base"} — note standard gas. (4) If USDC < $5, onramp-link {address, network: "base", amount: "10"} and include the funding URL. Return {ready, usdcBase, usdcSolana, gas, fundingLink?} with ready = (usdcBase + usdcSolana) >= 5.

← All skill packs