r402_evm/lib.rs
1#![cfg_attr(docsrs, feature(doc_cfg))]
2
3//! EIP-155 (EVM) chain support for the x402 payment protocol.
4//!
5//! This crate provides implementations of the x402 payment protocol for EVM chains
6//! with the "exact" payment scheme based on ERC-3009 `transferWithAuthorization`.
7//!
8//! # Features
9//!
10//! - **CAIP-2 Addressing**: Uses CAIP-2 chain IDs (e.g., `eip155:8453`) for chain identification
11//! - **ERC-3009 Payments**: Gasless token transfers using `transferWithAuthorization`
12//! - **Smart Wallet Support**: EIP-1271 for deployed wallets, EIP-6492 for counterfactual wallets
13//! - **Multiple Signers**: Round-robin signer selection for load distribution
14//! - **Nonce Management**: Automatic nonce tracking with pending transaction awareness
15//!
16//! # Architecture
17//!
18//! The crate is organized into several modules:
19//!
20//! - [`chain`] - Core EVM chain types, providers, and configuration
21//! - [`exact`] - EIP-155 "exact" payment scheme
22//!
23//! # Feature Flags
24//!
25//! - `server` - Server-side price tag generation
26//! - `client` - Client-side payment signing
27//! - `facilitator` - Facilitator-side payment verification and settlement
28//! - `telemetry` - `OpenTelemetry` tracing support
29//!
30pub mod chain;
31pub mod exact;
32
33mod networks;
34pub use exact::Eip155Exact;
35#[cfg(feature = "client")]
36pub use exact::client::{Eip155ExactClient, Eip155ExactClientBuilder, Permit2Approver};
37pub use networks::*;