Expand description
EIP-155 (EVM) chain support for the x402 payment protocol.
This crate provides implementations of the x402 payment protocol for EVM chains
with the “exact” payment scheme based on ERC-3009 transferWithAuthorization.
§Features
- CAIP-2 Addressing: Uses CAIP-2 chain IDs (e.g.,
eip155:8453) for chain identification - ERC-3009 Payments: Gasless token transfers using
transferWithAuthorization - Smart Wallet Support: EIP-1271 for deployed wallets, EIP-6492 for counterfactual wallets
- Multiple Signers: Round-robin signer selection for load distribution
- Nonce Management: Automatic nonce tracking with pending transaction awareness
§Architecture
The crate is organized into several modules:
§Feature Flags
server- Server-side price tag generationclient- Client-side payment signingfacilitator- Facilitator-side payment verification and settlementtelemetry-OpenTelemetrytracing support
Re-exports§
pub use exact::Eip155Exact;pub use exact::client::Eip155ExactClient;clientpub use exact::client::Eip155ExactClientBuilder;clientpub use exact::client::Permit2Approver;client
Modules§
- chain
- EVM chain support for x402 payments via EIP-155.
- exact
- EIP-155 “exact” payment scheme implementation.
Structs§
- USDC
- Ergonomic accessors for USDC token deployments on well-known EVM chains.
- USDM
- Ergonomic accessors for USDM (
MegaUSD) token deployments on EVM chains.
Statics§
- EVM_
NETWORKS - Well-known EVM (EIP-155) networks with their names and CAIP-2 identifiers.
Functions§
- usdc_
evm_ deployment - Returns the USDC deployment for a specific EVM chain, if known.
- usdc_
evm_ deployments - Returns all known USDC deployments on EVM chains.
- usdm_
evm_ deployment - Returns the USDM deployment for a specific EVM chain, if known.
- usdm_
evm_ deployments - Returns all known USDM deployments on EVM chains.