Expand description
Buyer register, select, and spendControls for the x402 payment protocol.
Structs§
- Created
Payment - Result of successful payment creation (transport-agnostic).
- Default
Asset Info - USD-pegged default asset used for money strings and client spend caps.
- First
Match PaymentSelectorthat returns the first candidate.- MaxAmount
PaymentSelectorthat rejects candidates whose amount exceeds the budget.- MaxAmount
Policy - Keeps only candidates whose amount is at most the configured bound.
- Network
Policy - Keeps only candidates whose chain matches one of the patterns.
- Payment
Candidate - One payment option produced by
SchemeClient::accept. - Payment
Client - Buyer payment client.
- Payment
Creation Context - Context for payment-creation hooks.
- Payment
Response Context - Context delivered after a paid request completes.
- Payment
Response Result - Result of
ClientHooks::on_payment_response. - Prefer
Chain PaymentSelectorthat prefers chains matching one of the given patterns.- Scheme
Policy - Keeps only candidates whose scheme name is in the allow-list.
- Spend
Control Asset - Opt-in asset for
AllowedAssets::List. - Spend
Controls - Client spend controls enforced before policies.
Enums§
- Allowed
Assets - Opt-in non-default assets for
SpendControls. - Failure
Recovery - Outcome returned by “on failure” hooks.
- Hook
Decision - Decision returned by “before” hooks to control whether the operation proceeds.
- MaxAmount
PerPayment - Per-payment USD cap on assets
find_default_assetrecognizes.
Traits§
- Client
Extension - Client-side extension. Copy of the
crate::ClientHooks/DynClientExtensionsplit: RPITIT is not object-safe, so stored values areDynClientExtension. - Client
Hooks - Lifecycle hooks for the payment client.
- DynClient
Extension - Object-safe erasure of
ClientExtension. - DynClient
Hooks - Object-safe erasure of
ClientHooks. - Payment
Candidate Signer - Object-safe signer carried by each
PaymentCandidate. - Payment
Policy - Filter applied to the candidate list before selection.
- Payment
Selector - Selector that picks the best candidate from a slice.
- Scheme
Client - Buyer-side scheme: emit candidates from a 402 challenge.
Type Aliases§
- BoxFuture
- Boxed future used by
DynClientHooks.