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.
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:
// 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() }));
Choose Your SDK
npm TypeScript
Use with @x402/express, @x402/hono, or @x402/core. Includes viem utilities for Prism.
pypi Python
Use with the x402 Python SDK. Includes web3.py utilities for Prism.
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:
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:
- One-time approval to the Prism contract (requires gas)
- All subsequent payments are gasless via EIP-712 signatures
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.