Desktop Only

This application is optimized for desktop browsers. Please open it on a device with a screen width of at least 1024px.

x402 Mantle SDK Documentation

SDK for gasless x402 payments on Mantle blockchain using USDC (EIP-3009). Protect your APIs with crypto payments — users sign, facilitator pays gas.

Current limitation: The SDK supports only USDC on Mantle Mainnet. This is due to EIP-3009 requirements for gasless payments — USDC is currently the only token on Mantle implementing this standard.

What is x402?

x402 is a payment protocol based on the HTTP 402 "Payment Required" status code. When a client requests a paid resource without payment, the server returns 402 with payment requirements. The client then signs a payment authorization and retries.

Key benefits:

  • Gasless for users - Users only sign a message, the facilitator pays gas
  • Instant payments - USDC transfers settle in seconds
  • Simple integration - Just add middleware to your API routes
  • Real-time analytics - Track all payments in your dashboard

How It Works

  1. Request — Client calls your API without payment
  2. 402 Response — Server returns payment requirements
  3. Sign — User signs authorization in wallet (gasless)
  4. Settle — Client sends authorization to facilitator
  5. Execute — Facilitator transfers USDC on-chain
  6. Retry — Client retries request with payment proof
  7. Verify — Server confirms payment with facilitator
  8. Content — API returns the response

Quick Links

Getting Started

SDK Documentation

Infrastructure

Reference

  • API Reference - TypeScript types and endpoints
  • Examples - Complete working examples
  • FAQ - Common questions and troubleshooting

Resources

  • AI Prompt - Integration prompt for AI assistants

Supported Frameworks

Server:

  • Express.js
  • Next.js (App Router)
  • Hono
  • Cloudflare Workers
  • Deno
  • Bun

Client:

  • React (hooks)
  • Vanilla JavaScript
  • Any framework with fetch API

Network Information

PropertyValue
ChainMantle Mainnet
Chain ID5000
CurrencyUSDC
USDC Address0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9
Decimals6

Supported Tokens

Currently, the SDK supports USDC only for gasless payments.

Why only USDC?

Gasless payments require tokens that implement EIP-3009 (transferWithAuthorization). This standard allows users to sign payment authorizations off-chain while the facilitator submits transactions and pays gas.

On Mantle mainnet, USDC is the only token implementing EIP-3009. As other tokens adopt this standard, we will add support for them.

TokenEIP-3009Status
USDCYesSupported
USDTNoNot available
DAINoNot available
OtherPending adoption