Expand description
Stellar chain support for the x402 payment protocol.
This crate implements the x402 "exact" scheme for Stellar: the buyer
signs Soroban authorization entries for one SEP-41 transfer, and the
facilitator is the transaction source / fee sponsor.
§Features
- CAIP-2 Addressing:
stellar:pubnetandstellar:testnet - SEP-41 Payments: exact
transferof a Soroban token (USDC by default) - Auth-entry signing: the client never spends a sequence number
- In-process facilitator: RPC verify, rebuild, submit, and confirm
§Feature Flags
server— server-side price tag generationclient— client-side authorization-entry signingfacilitator— facilitator-side payment verification and settlementtelemetry—tracinginstrumentation
Re-exports§
pub use chain::StellarJsonRpc;clientorfacilitatorpub use chain::StellarChainProvider;facilitatorpub use chain::StellarFacilitatorError;facilitatorpub use chain::StellarRpc;clientorfacilitatorpub use chain::StellarRpcError;clientorfacilitatorpub use chain::StellarSigner;clientorfacilitatorpub use exact::StellarExact;pub use exact::client::StellarExactClient;client
Modules§
Structs§
- USDC
- Ergonomic accessors for USDC token deployments on well-known Stellar chains.
Constants§
- BASE_
FEE_ STROOPS - Inclusion buffer in stroops (
BASE_FEEin the official Stellar SDK). - DEFAULT_
ESTIMATED_ LEDGER_ SECONDS - Fallback ledger close time when Horizon is unavailable.
- DEFAULT_
MAX_ TRANSACTION_ FEE_ STROOPS - Safety ceiling for simulation-derived settlement fees (stroops).
- DEFAULT_
TIMEOUT_ SECONDS - Default
maxTimeoutSecondswhen the requirement omits it. - DEFAULT_
TOKEN_ DECIMALS - Default USDC decimal precision on Stellar (SEP-41).
- HORIZON_
LEDGERS_ SAMPLE_ SIZE - Number of recent Horizon ledgers sampled for close-time estimation.
- NULL_
ACCOUNT - Dummy source used by the client so only auth entries are signed.
- SIGNATURE_
EXPIRATION_ LEDGER_ TOLERANCE - Ledger-skew tolerance applied to auth-entry expiration.
- TRANSFER_
FUNCTION - SEP-41 transfer method name.
- USDC_
PUBNET_ ADDRESS - USDC contract on Stellar pubnet.
- USDC_
TESTNET_ ADDRESS - USDC contract on Stellar testnet.
Statics§
- STELLAR_
NETWORKS - Well-known Stellar networks with their names and CAIP-2 identifiers.
Functions§
- network_
id clientorfacilitator - SHA-256 of the network passphrase (Stellar network id).
- timeout_
ledgers ledgerTimeout = ceil(maxTimeoutSeconds / estimatedLedgerSeconds).- usdc_
stellar_ deployment - Returns the USDC deployment for a specific Stellar chain, if known.
- usdc_
stellar_ deployments - Returns all known USDC deployments on Stellar chains.