Skip to main content

r402_svm/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2
3//! Solana chain support for the x402 payment protocol.
4//!
5//! This crate provides implementations of the x402 payment protocol for Solana blockchain
6//! with the "exact" payment scheme based on SPL Token `transfer` instructions with
7//! pre-signed authorization.
8//!
9//! # Features
10//!
11//! - **CAIP-2 Addressing**: Uses CAIP-2 chain IDs for chain identification
12//! - **SPL Token Payments**: Token transfers using pre-signed transaction authorization
13//! - **Compute Budget Management**: Automatic compute unit limit and price configuration
14//! - **`WebSocket` Support**: Optional pubsub for faster transaction confirmation
15//! - **Balance Verification**: On-chain balance checks before settlement
16//!
17//! # Architecture
18//!
19//! The crate is organized into several modules:
20//!
21//! - [`chain`] - Core Solana chain types, providers, and configuration
22//! - [`exact`] - Solana "exact" payment scheme
23//!
24//! # Feature Flags
25//!
26//! - `server` - Server-side price tag generation
27//! - `client` - Client-side payment signing
28//! - `facilitator` - Facilitator-side payment verification and settlement
29//! - `telemetry` - `OpenTelemetry` tracing support
30//!
31pub mod chain;
32pub mod exact;
33
34mod networks;
35pub use exact::SolanaExact;
36#[cfg(feature = "client")]
37pub use exact::client::SolanaExactClient;
38pub use networks::*;