Skip to main content

Crate r402_client

Crate r402_client 

Source
Expand description

Buyer register, select, and spendControls for the x402 payment protocol.

Structs§

CreatedPayment
Result of successful payment creation (transport-agnostic).
DefaultAssetInfo
USD-pegged default asset used for money strings and client spend caps.
FirstMatch
PaymentSelector that returns the first candidate.
MaxAmount
PaymentSelector that rejects candidates whose amount exceeds the budget.
MaxAmountPolicy
Keeps only candidates whose amount is at most the configured bound.
NetworkPolicy
Keeps only candidates whose chain matches one of the patterns.
PaymentCandidate
One payment option produced by SchemeClient::accept.
PaymentClient
Buyer payment client.
PaymentCreationContext
Context for payment-creation hooks.
PaymentResponseContext
Context delivered after a paid request completes.
PaymentResponseResult
Result of ClientHooks::on_payment_response.
PreferChain
PaymentSelector that prefers chains matching one of the given patterns.
SchemePolicy
Keeps only candidates whose scheme name is in the allow-list.
SpendControlAsset
Opt-in asset for AllowedAssets::List.
SpendControls
Client spend controls enforced before policies.

Enums§

AllowedAssets
Opt-in non-default assets for SpendControls.
FailureRecovery
Outcome returned by “on failure” hooks.
HookDecision
Decision returned by “before” hooks to control whether the operation proceeds.
MaxAmountPerPayment
Per-payment USD cap on assets find_default_asset recognizes.

Traits§

ClientExtension
Client-side extension. Copy of the crate::ClientHooks / DynClientExtension split: RPITIT is not object-safe, so stored values are DynClientExtension.
ClientHooks
Lifecycle hooks for the payment client.
DynClientExtension
Object-safe erasure of ClientExtension.
DynClientHooks
Object-safe erasure of ClientHooks.
PaymentCandidateSigner
Object-safe signer carried by each PaymentCandidate.
PaymentPolicy
Filter applied to the candidate list before selection.
PaymentSelector
Selector that picks the best candidate from a slice.
SchemeClient
Buyer-side scheme: emit candidates from a 402 challenge.

Type Aliases§

BoxFuture
Boxed future used by DynClientHooks.