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);
}
Client(AI Agent)|Server(X402 Gateway)|Facilitator|Onchain(Factory Contract)