Expand description
Algorand chain support for the x402 payment protocol.
This crate implements the x402 "exact" scheme for Algorand: the buyer
builds an atomic transaction group containing an ASA transfer and an
optional facilitator-sponsored 0-amount payment that covers the group
fee via fee pooling.
§Features
- CAIP-2 Addressing:
algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73kandalgorand:SGO1GKSzyE7IEPItTxCByw9x8FmnrCDe - ASA Payments: exact transfer of a token (USDC by default)
- Fee pooling: optional 0-amount fee-payer transaction
- In-process facilitator: algod REST verify and settle
§Feature Flags
server— server-side price tag generationclient— client-side group construction and signingfacilitator— facilitator-side payment verification and settlementtelemetry—tracinginstrumentation
Re-exports§
pub use chain::AlgodClient;clientorfacilitatorpub use chain::AlgorandChainProvider;facilitatorpub use chain::AlgorandSigner;clientorfacilitatorpub use exact::AlgorandExact;pub use exact::client::AlgorandExactClient;client
Modules§
Structs§
- USDC
- Ergonomic accessors for USDC token deployments on well-known Algorand chains.
Constants§
- DEFAULT_
TOKEN_ DECIMALS - Default USDC decimal precision.
- DEFAULT_
VALIDITY_ ROUNDS - Default first/last-valid window in rounds (
last_round + this). - DEFAULT_
WAIT_ ROUNDS - Default number of rounds to wait for confirmation after broadcast.
- MAX_
REASONABLE_ FEE_ PER_ TXN - Per-transaction fee cap used to bound facilitator fee-payer spend (µAlgo).
- MAX_
TRANSACTION_ GROUP_ SIZE - Maximum number of top-level transactions in an Algorand atomic group.
- USDC_
MAINNET_ ASA_ ID - Mainnet USDC ASA id.
- USDC_
TESTNET_ ASA_ ID - Testnet USDC ASA id.
Statics§
- ALGORAND_
NETWORKS - Well-known Algorand networks with their names and CAIP-2 identifiers.
Functions§
- max_
reasonable_ group_ fee - Maximum acceptable fee-payer fee for a group of
group_sizetransactions. - usdc_
algorand_ deployment - Returns the USDC deployment for a specific Algorand chain, if known.
- usdc_
algorand_ deployments - Returns all known USDC deployments on Algorand chains.