#[non_exhaustive]pub enum VerificationError {
Show 22 variants
InvalidFormat(String),
InvalidPaymentAmount,
Early,
Expired,
ChainIdMismatch,
RecipientMismatch,
AssetMismatch,
InsufficientFunds,
Permit2AllowanceRequired,
InvalidSignature(String),
SimulationFailed(String),
UnsupportedChain,
UnsupportedScheme,
AcceptedRequirementsMismatch,
NonceAlreadyUsed,
DuplicateSettlement,
MemoMismatch,
MemoInstructionCountInvalid {
count: usize,
},
SettlementAmountExceedsPermitted {
requested: String,
authorised: String,
},
UptoFacilitatorMismatch {
witness: String,
},
UptoUnauthorizedFacilitator,
UptoAmountExceedsPermitted,
}Expand description
Verification-phase failures.
Returned when payload parsing, signature verification, or pre-settlement on-chain checks reject the request.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidFormat(String)
The payload JSON / binary format could not be parsed.
InvalidPaymentAmount
The payment amount is below the required amount.
For SVM exact, overpayment (actual >= required) is allowed per
scheme_exact_svm.md §1.4; only underpayment maps here.
Early
The payment authorization is not yet valid.
Expired
The payment authorization has expired.
ChainIdMismatch
The chain ID does not match requirements.
RecipientMismatch
The payment recipient does not match requirements.
AssetMismatch
The token asset does not match requirements.
InsufficientFunds
On-chain balance is insufficient.
Permit2AllowanceRequired
Permit2 allowance is insufficient.
Clients receiving this should call approve on the token contract
pointing at the Permit2 address and retry. HTTP transports map this
to 412 Precondition Failed.
InvalidSignature(String)
The payment signature is invalid.
SimulationFailed(String)
Pre-settlement simulation failed.
UnsupportedChain
The chain is not supported by this facilitator.
UnsupportedScheme
The scheme is not supported by this facilitator.
AcceptedRequirementsMismatch
Accepted details diverge from declared requirements.
NonceAlreadyUsed
EIP-3009 nonce already consumed on-chain.
DuplicateSettlement
Attempted to settle a transaction whose payload was already processed.
MemoMismatch
Memo data does not match extra.memo.
MemoInstructionCountInvalid
Invalid number of memo instructions (spec requires exactly one).
SettlementAmountExceedsPermitted
Resource server requested a settlement amount exceeding the signed maximum authorisation (upto scheme).
Maps to ErrorReason::InvalidUptoEvmPayloadSettlementExceedsAmount
on the wire, which serialises as
invalid_upto_evm_payload_settlement_exceeds_amount per x402 v2 spec.
Fields
Maximum amount signed by the buyer.
UptoFacilitatorMismatch
witness.facilitator does not match any address known to the
facilitator (upto scheme).
Buyer either signed with a stale paymentRequirements.extra.facilitatorAddress
or attempted to bind the payment to a different facilitator instance.
Maps to ErrorReason::UptoFacilitatorMismatch.
On-chain proxy reverted with UnauthorizedFacilitator because the
settle transaction was submitted from an address other than
witness.facilitator (upto scheme).
Maps to ErrorReason::UptoUnauthorizedFacilitator.
UptoAmountExceedsPermitted
On-chain proxy reverted with AmountExceedsPermitted (upto scheme).
Defence-in-depth signal: the off-chain pipeline should have caught
this before submission.
Maps to ErrorReason::UptoAmountExceedsPermitted.
Trait Implementations§
Source§impl AsPaymentProblem for VerificationError
impl AsPaymentProblem for VerificationError
Source§fn as_payment_problem(&self) -> PaymentProblem
fn as_payment_problem(&self) -> PaymentProblem
Source§impl Debug for VerificationError
impl Debug for VerificationError
Source§impl Display for VerificationError
impl Display for VerificationError
Source§impl Error for VerificationError
impl Error for VerificationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for VerificationError
impl From<Error> for VerificationError
Source§impl From<VerificationError> for FacilitatorError
impl From<VerificationError> for FacilitatorError
Source§fn from(source: VerificationError) -> Self
fn from(source: VerificationError) -> Self
Auto Trait Implementations§
impl Freeze for VerificationError
impl RefUnwindSafe for VerificationError
impl Send for VerificationError
impl Sync for VerificationError
impl Unpin for VerificationError
impl UnsafeUnpin for VerificationError
impl UnwindSafe for VerificationError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more