x402Launch

Token launch platform powered by x402
— made for AI and beyond.

// x402: Define schema for token deployment
const schema = {
  x402Version: 1,
  accepts: [{
    scheme: "exact",
    network: "base",
    asset: USDC_RAW,
    payTo: RECEIVING_WALLET,
    maxAmountRequired: ONE_USDC,
    outputSchema: {
      input: {
        bodyFields: {
          name: { type: "string", required: true },
          symbol: { type: "string", required: true }
        }
      }
    }
  }]
};

// Handle x402scan payment request
async function handlePaymentRequest(request, env) {
  const xPayment = request.headers.get("X-PAYMENT");
  const body = await request.json();
  
  // Extract token name and symbol from x402scan request
  const name = (body.name || "").trim();
  const symbol = (body.symbol || "").trim();
  
  if (!name || !symbol) {
    return json({ error: "missing name or symbol" }, 400);
  }
  
  // Verify x402 payment, then deploy token
  // Deploy token with name and symbol
  return json({ ok: true, received: { name, symbol } }, 200);
}

How it works

Client(AI Agent)|Server(X402 Gateway)|Facilitator|Onchain(Factory Contract)

How it works — Swimlane Sequence Four swimlanes: Client, Server, Facilitator, Onchain, containing interaction steps [1]-[9]. Client (AI Agent) Server (X402 Gateway) Facilitator Onchain (Factory Contract) [1] POST /deploy — deploy intent only [2] 402 Payment Required — price/asset/RequestId [3] Payment completed → paymentProofId issued [4] Retry /deploy — X-PAYMENT: RequestId + ProofId [5] /verify — confirm payment valid & unspent [6] Verification passed [7] 200 OK: tx_template · EIP-712 typedData · fulfillmentId [8] Sign & submit from template/typedData; Factory deploys and emits event(s) [9] Callback or polling (optional): txHash/status