Skip to main content

Crate r402_xrpl

Crate r402_xrpl 

Source
Expand description

XRPL chain support for the x402 payment protocol.

This crate implements the x402 "exact" scheme for the XRP Ledger: the buyer signs a Payment transaction, and a facilitator submits the signed blob. The payer pays the network fee; facilitators do not sponsor fees.

§Features

  • CAIP-2 Addressing: xrpl:0 (mainnet), xrpl:1 (testnet), xrpl:2 (devnet)
  • XRP and IOU payments: native drops or issued-currency decimal values
  • Sequence or ticket sequencing: extra.assetTransferMethod
  • In-process facilitator: JSON-RPC verify and settle

§Feature Flags

  • server — server-side price tag generation
  • client — client-side payment signing
  • facilitator — facilitator-side payment verification and settlement
  • telemetrytracing instrumentation

Re-exports§

pub use chain::XrplChainProvider;facilitator
pub use chain::XrplJsonRpc;client or facilitator
pub use exact::XrplExact;
pub use exact::client::XrplExactClient;client
pub use exact::client::XrplSigner;client

Modules§

chain
XRPL chain support for x402 payments.
exact
XRPL "exact" payment scheme implementation.

Structs§

RLUSD
Ergonomic accessors for RLUSD issued currency.
XRP
Ergonomic accessors for native XRP.

Constants§

CANONICAL_SIGNING_PUB_KEY_LEN
Length of a canonical compressed secp256k1 or ed25519 signing public key.
DEFAULT_LEDGER_CLOSE_SECONDS
Default ledger close interval used to map maxTimeoutSeconds to ledgers.
DEFAULT_LEDGER_TOLERANCE
Extra ledgers added beyond the timeout conversion.
DEFAULT_MAX_FEE_DROPS
Default maximum transaction fee accepted by the facilitator, in drops.
LSF_DISABLE_MASTER
Account-root flag disabling the master key pair (lsfDisableMaster).
MAX_ACCOUNT_TICKETS
Maximum outstanding tickets an account can hold.
MAX_DESTINATION_TAG
Maximum destination tag (u32::MAX).
RLUSD_CURRENCY
RLUSD currency as 160-bit hex (ASCII "RLUSD" padded).
RLUSD_DECIMALS
Default RLUSD decimal precision.
RLUSD_MAINNET_ISSUER
Official Ripple RLUSD issuer on XRPL mainnet.
RLUSD_TESTNET_ISSUER
Official Ripple RLUSD issuer on XRPL testnet.
SETTLEMENT_TTL_MS
Settlement cache TTL floor in milliseconds.
TF_PARTIAL_PAYMENT
Partial-payment transaction flag (tfPartialPayment).
TRANSACTION_HASH_PREFIX
SHA-512Half prefix for a signed transaction hash (TXN\0).
XRP_DECIMALS
Native XRP decimal precision (drops).

Statics§

XRPL_NETWORKS
Well-known XRPL networks with their names and CAIP-2 identifiers.

Functions§

rlusd_deployment
Returns the RLUSD deployment for a specific XRPL chain, if known.
rlusd_deployments
Returns all known RLUSD deployments.
xrp_deployment
Returns the native XRP deployment for a specific XRPL chain.
xrp_deployments
Returns all known native XRP deployments.