Skip to main content
The X402r SDK provides a complete TypeScript implementation for integrating with the X402r refundable payments protocol. It enables clients, merchants, and arbiters to interact with smart contracts for payment authorization, escrow management, and dispute resolution.

Packages

The SDK is organized into five packages, each designed for a specific role in the payment ecosystem:

@x402r/helpers

Framework-agnostic helper to mark x402 payment options as refundable with escrow configuration.

Key Features

Built on viem for fully typed interactions with X402r smart contracts. All ABIs are exported with complete TypeScript types.
Real-time event watching for payment state changes, refund requests, and freeze events across all packages.
Built-in hooks for integrating AI models into dispute resolution workflows with structured evaluation contexts.
deployMarketplaceOperator() deploys all necessary contracts (operator, escrow period, freeze, conditions) in a single call.
On-chain registry for arbiters to register, update metadata, and be discovered by merchants and clients.

Architecture

Network Support

NetworkChain IDStatus
Base Sepolia84532Supported
Base Mainnet8453Supported

Next Steps