Expand description
Aptos chain support for the x402 payment protocol.
This crate implements the x402 "exact" scheme for Aptos: the buyer
signs a 0x1::primary_fungible_store::transfer of a fungible asset, and
a facilitator fee payer submits it after aptos-sdk 0.6 preflight.
§Features
- CAIP-2 Addressing:
aptos:1(mainnet) andaptos:2(testnet) - Fungible Asset payments: exact
primary_fungible_store::transfer - Fee-payer sponsorship:
extra.feePayeris copied from/supported - In-process facilitator: verify and settle via
aptos-sdk0.6.0
§Feature Flags
server— server-side price tag generationclient— client-side transfer signingfacilitator— facilitator-side payment verification and settlementtelemetry—tracinginstrumentation
Re-exports§
pub use chain::AptosChainProvider;facilitatorpub use chain::AptosFeePayer;facilitatorpub use chain::DecodedAptosPayload;clientorfacilitatorpub use chain::SimpleTransaction;clientorfacilitatorpub use chain::decode_aptos_payload;clientorfacilitatorpub use chain::encode_aptos_payload;clientorfacilitatorpub use exact::AptosExact;pub use exact::client::AptosExactClient;clientpub use exact::client::AptosSigner;clientpub use exact::facilitator::AptosExactFacilitator;facilitatorpub use exact::facilitator::AptosExactFacilitatorConfig;facilitator
Modules§
Structs§
- USDC
- Ergonomic accessors for USDC token deployments on well-known Aptos chains.
Constants§
- DEFAULT_
CLIENT_ MAX_ GAS - Client
max_gas_amount— Aptos SDK simple-tx default, underMAX_GAS_AMOUNT. - DEFAULT_
GAS_ UNIT_ PRICE - Client
gas_unit_pricewhen estimate is unavailable. - DEFAULT_
TOKEN_ DECIMALS - Default USDC decimal precision.
- EXPIRATION_
BUFFER_ SECONDS - Verify rejects expirations closer than this many seconds.
- FUNGIBLE_
ASSET_ METADATA - Type argument on both transfer entry functions.
- FUNGIBLE_
ASSET_ TRANSFER 0x1::fungible_asset::transfer(also accepted at verify).- MAX_
GAS_ AMOUNT - Sponsored-transaction cap on
max_gas_amount(@x402/aptosMAX_GAS_AMOUNT). - MAX_
GAS_ UNIT_ PRICE - Sponsored-transaction cap on
gas_unit_priceoctas (MAX_GAS_UNIT_PRICE). - PRIMARY_
FUNGIBLE_ STORE_ TRANSFER 0x1::primary_fungible_store::transfer(client-built path).
Statics§
- APTOS_
NETWORKS - Well-known Aptos networks with their names and CAIP-2 identifiers.
Functions§
- usdc_
aptos_ deployment - Returns the USDC deployment for a specific Aptos chain, if known.
- usdc_
aptos_ deployments - Returns all known USDC deployments on Aptos chains.