commerce_program_client/generated/errors/
commerce_program.rs1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum CommerceProgramError {
13 #[error("Incorrect mint provided")]
15 InvalidMint = 0x0,
16 #[error("Invalid payment status for the operation")]
18 InvalidPaymentStatus = 0x1,
19 #[error("Insufficient settlement amount")]
21 InsufficientSettlementAmount = 0x2,
22 #[error("Settlement attempted too early")]
24 SettlementTooEarly = 0x3,
25 #[error("Refund amount exceeds policy limit")]
27 RefundAmountExceedsPolicyLimit = 0x4,
28 #[error("Refund window expired")]
30 RefundWindowExpired = 0x5,
31 #[error("Invalid event authority")]
33 InvalidEventAuthority = 0x6,
34 #[error("Invalid ATA")]
36 InvalidAta = 0x7,
37 #[error("Payment close window not reached")]
39 PaymentCloseWindowNotReached = 0x8,
40 #[error("Merchant owner does not match expected owner")]
42 MerchantOwnerMismatch = 0x9,
43 #[error("Merchant PDA is invalid")]
45 MerchantInvalidPda = 0xA,
46 #[error("Operator owner does not match expected owner")]
48 OperatorOwnerMismatch = 0xB,
49 #[error("Operator PDA is invalid")]
51 OperatorInvalidPda = 0xC,
52 #[error("Operator does not match config operator")]
54 OperatorMismatch = 0xD,
55 #[error("Merchant does not match config merchant")]
57 MerchantMismatch = 0xE,
58 #[error("Order ID is invalid or already used")]
60 OrderIdInvalid = 0xF,
61 #[error("MerchantOperatorConfig PDA is invalid")]
63 MerchantOperatorConfigInvalidPda = 0x10,
64 #[error("Accepted currencies is empty")]
66 AcceptedCurrenciesEmpty = 0x11,
67 #[error("Duplicate mint in accepted currencies")]
69 DuplicateMint = 0x12,
70}
71
72impl From<CommerceProgramError> for solana_program_error::ProgramError {
73 fn from(e: CommerceProgramError) -> Self {
74 solana_program_error::ProgramError::Custom(e as u32)
75 }
76}
77