x402 Suite · USDC on Base or Solana

Hold your place. Keep the claim.

A self-hosted live waitlist for walk-in lists, counters and service desks. Seeing the wait is free; $0.01 holds your place and hands back a signed position token and a signed refund claim that matures automatically if you are never served. Checking your position afterwards is free, forever. Pay in USDC on Base or Solana — your client picks the rail.

git clone https://github.com/nirholas/x402-queue cd x402-queue && npm install npm run dev # runs out of the box, both rails live

Pricing

RoutePriceThe artifact you get back
GET /queuesfreeEvery queue with its live length, estimated wait, capacity and whether it is accepting joins
GET /queues/:idfreeLive board for one queue — everyone in order, anonymised to an initial
POST /join$0.01 (refundable){ticketId, token, position, ahead, eta, refundClaim, positionUrl, signature}
GET /position/:tokenfreeLive position, ETA, serve status and refund status. Pollable — you paid for the place, not the look
POST /claim/:tokenfreeSigned refund record. Idempotent, authenticated by the token itself
POST /leave/:tokenfreeGive up your place; the hold is returned and the queue closes up behind you

Every paid route returns the thing you bought in the 200 body. No pay-now-deliver-later.

How a paid call works

1 · Request

POST /join with no payment. Server replies 402 with an accepts[] holding both rails — amount, token address and recipient on Base and on Solana.

2 · Pay (your pick)

Base: sign an EIP-3009 USDC authorization. Solana: sign an SPL transferChecked. Retry with the X-PAYMENT header; that rail's facilitator verifies and settles on the chain you chose.

3 · Artifact

200 with the signed token and refund claim in the body and a settlement receipt in X-PAYMENT-RESPONSE, naming the rail. Settlement only runs on success.

Two rails, one price

USDC on Base (EVM)

network
base-sepolia (default) · base
asset
0x036CbD53842c5426634e7929541eC2318f3dCF7e
payTo
0x40252CFDF8B20Ed757D61ff157719F33Ec332402
signature
EIP-3009 transferWithAuthorization
facilitator
https://x402.org/facilitator

USDC on Solana (SVM)

network
solana (default) · solana-devnet
asset
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
payTo
WwwuGbqHrwF5RG89KhUbmRWEvjnRH9k5kVM5p7T3WwW
signature
SPL transferChecked (serialized tx)
facilitator
https://facilitator.payai.network

Quickstart — agent side

import { wrapFetchWithPayment } from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";

const payFetch = wrapFetchWithPayment(fetch, privateKeyToAccount(PRIVATE_KEY));

// seeing the wait is free — no wallet needed
const { queues } = await fetch("http://localhost:4025/queues").then(r => r.json());
const q = queues.find(x => x.acceptingJoins && x.estimatedWaitMinutes < 30);

// $0.01: hold the place, get the token + refund claim back immediately
const ticket = await payFetch("http://localhost:4025/join", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ queue: q.id, name: "Agent Ada", party: 2 }),
}).then(r => r.json());

console.log(ticket.position, ticket.eta.minutes, ticket.refundClaim.claimableAfter);

// checking is free — poll it as often as you like
const pos = await fetch(ticket.positionUrl).then(r => r.json());
console.log(pos.status, pos.position, pos.refund.due);

Explore

Human checkout demo

Live-board flow with the drop-in payment modal — watch the wait for free, join with Phantom (Solana) or MetaMask (Base), and the position ticks down on screen.

public/index.html →

For AI agents

skill.md + .well-known/x402 discovery, MCP tool wrapper for Claude, listing on x402scan / Bazaar.

agents.md →

API reference

Every endpoint with params, prices, schemas, and error cases. OpenAPI 3.1 included.

api.md →

Raw wire flow

The exact 402 → pay → 200 exchange in curl, header by header.

examples/curl.md →