Packages
The SDK is organized into five packages, each designed for a specific role in the payment ecosystem:@x402r/core
Shared types, ABIs, network config, deploy utilities, and condition builders.
@x402r/client
SDK for payers to request refunds, freeze payments, and manage escrow.
@x402r/merchant
SDK for merchants to release payments, charge, and handle refunds.
@x402r/arbiter
SDK for arbiters to resolve disputes, manage registry, and automate decisions with AI.
@x402r/helpers
Framework-agnostic helper to mark x402 payment options as refundable with escrow configuration.
Key Features
Type-safe contract interactions
Type-safe contract interactions
Built on viem for fully typed interactions with X402r smart contracts. All ABIs are exported with complete TypeScript types.
Event subscriptions
Event subscriptions
Real-time event watching for payment state changes, refund requests, and freeze events across all packages.
AI-ready arbiter SDK
AI-ready arbiter SDK
Built-in hooks for integrating AI models into dispute resolution workflows with structured evaluation contexts.
One-command deployment
One-command deployment
deployMarketplaceOperator() deploys all necessary contracts (operator, escrow period, freeze, conditions) in a single call.Arbiter registry
Arbiter registry
On-chain registry for arbiters to register, update metadata, and be discovered by merchants and clients.
Architecture
Network Support
| Network | Chain ID | Status |
|---|---|---|
| Base Sepolia | 84532 | Supported |
| Base Mainnet | 8453 | Supported |
