Documentation

Primer x402 SDK v1.1.0

Ecosystem toolkit for x402 payments. Use the official x402 SDK with Primer infrastructure: our facilitator, additional networks, Prism ERC-20 settlement, and more.

Breaking changes from v0.x. Version 1.0.0 is a companion package to the official x402 SDK, not a standalone implementation. If you're migrating from v0.x, see deprecated documentation for the old API reference.

What's New in v1.0.0

The Primer SDK is now a lightweight companion to the official x402 SDK:

Feature Description
Primer Facilitator Pre-configured client for x402.primer.systems
SKALE Networks Chain identifiers and RPC URLs
Robinhood Chain Chain identifiers and RPC URLs
Prism Settlement EIP-712 signed payloads for any ERC-20 token
Project Scaffolding CLI to create Bittensor/Chutes AI proxies

Architecture

Use the official x402 packages for core functionality, and the Primer SDK for infrastructure:

typescript
// Official x402 SDK for middleware and payment handling
import { paymentMiddleware } from '@x402/express';

// Primer SDK for facilitator and infrastructure
import { primerFacilitator } from '@primersystems/x402';

app.use(paymentMiddleware(routes, { facilitator: primerFacilitator() }));
Official x402 SDK. For payer/payee middleware, HTTP client wrappers, and core protocol functionality, see the official x402 SDK documentation.

Choose Your SDK

Supported Networks

The Primer facilitator supports these networks via CAIP-2 identifiers:

Network CAIP-2 ID Notes
Base eip155:8453 Production
Base Sepolia eip155:84532 Testnet
SKALE Base eip155:1187947933
SKALE Base Sepolia eip155:324705682 Testnet
Robinhood Chain eip155:4663 Production
Robinhood Chain Testnet eip155:46630 Testnet

Network constants are exported from the SDK:

typescript
import { skaleNetworks, robinhoodNetworks } from '@primersystems/x402';

console.log(skaleNetworks.base);        // "eip155:1187947933"
console.log(robinhoodNetworks.mainnet); // "eip155:4663"

Token Support

EIP-3009 Tokens (USDC, EURC, USDG)

Native gasless transfers via transferWithAuthorization. The payer signs, the facilitator executes. Handled automatically by the x402 protocol.

Standard ERC-20 Tokens (via Prism)

Primer's Prism contract enables gasless payments for any ERC-20 token:

  1. One-time approval to the Prism contract (requires gas)
  2. All subsequent payments are gasless via EIP-712 signatures
typescript
import { createPrismPayload, PRISM_CONTRACT_ADDRESS } from '@primersystems/x402';

// Create a signed payment payload for any ERC-20
const payload = await createPrismPayload(walletClient, publicClient, {
  token: '0x...',     // ERC-20 token address
  to: '0x...',        // recipient
  value: 1000000n,   // amount in smallest unit
}, 'eip155:8453');

See the language-specific SDK pages for full Prism documentation.