use steel::*;
#[derive(Debug, Error, Clone, Copy, PartialEq, Eq, IntoPrimitive)]
#[repr(u32)]
pub enum EscrowError {
#[error("The authority is invalid")]
InvalidAuthority = 0,
#[error("The authority is unchanged")]
AuthorityUnchanged = 1,
#[error("Only the authority can perform this action")]
Unauthorized = 2,
#[error("Authority transfer delay period has not elapsed")]
AuthorityTransferTooEarly = 3,
#[error("Payment is not in the correct state for this operation")]
InvalidPaymentState = 10,
#[error("Payment has already expired")]
PaymentExpired = 11,
#[error("Payment is not funded")]
PaymentNotFunded = 12,
#[error("Escrow is paused")]
EscrowPaused = 20,
#[error("Escrow has non-zero balance")]
EscrowHasBalance = 21,
#[error("Escrow has non-zero fee balance")]
EscrowHasFeeBalance = 22,
#[error("Invalid escrow settings")]
InvalidEscrowSettings = 23,
#[error("Fee basis points too high")]
FeeTooHigh = 24,
#[error("Minimum payment amount must be greater than zero")]
InvalidMinPaymentAmount = 25,
#[error("Maximum payment amount must be greater than minimum")]
InvalidMaxPaymentAmount = 26,
#[error("Amount exceeds maximum payment limit")]
AmountExceedsLimit = 30,
#[error("Amount below minimum payment limit")]
AmountBelowLimit = 31,
#[error("Insufficient funds")]
InsufficientFunds = 32,
#[error("Insufficient storage balance for SOL operations")]
InsufficientStorageBalance = 33,
#[error("Payout would be zero after fees and oracle tip")]
ZeroPayout = 34,
#[error("Invalid TTL extension")]
InvalidTTLExtension = 40,
#[error("TTL extension too large")]
TTLExtensionTooLarge = 41,
#[error("Payment cannot be canceled after expiration")]
CannotCancelExpiredPayment = 42,
#[error("Cannot refund a fulfilled payment")]
CannotRefundFulfilledPayment = 43,
#[error("Cannot refund a payment after delivery is submitted")]
CannotRefundDeliveredPayment = 44,
#[error("Cannot refund a delivered expired payment")]
CannotRefundDeliveredExpiredPayment = 45,
#[error("Refund cooldown period is still active")]
RefundCooldownPeriodActive = 46,
#[error("Cannot release an undelivered expired payment")]
CannotReleaseUndeliveredExpiredPayment = 47,
#[error("Cannot confirm oracle before delivery is submitted")]
DeliveryNotSubmitted = 48,
#[error("Delivery submitted too late: oracle needs minimum evaluation window before expiry")]
DeliveryTooLateForOracle = 49,
#[error("Invalid account provided")]
InvalidAccount = 50,
#[error("Account is not writable")]
AccountNotWritable = 51,
#[error("Account is not signer")]
AccountNotSigner = 52,
#[error("Account is not empty")]
AccountNotEmpty = 53,
#[error("Account is empty")]
AccountEmpty = 54,
#[error("Invalid token account")]
InvalidTokenAccount = 60,
#[error("Token transfer failed")]
TokenTransferFailed = 61,
#[error("Token account close failed")]
TokenAccountCloseFailed = 62,
#[error("Invalid program ID")]
InvalidProgramId = 70,
#[error("Invalid instruction data")]
InvalidInstructionData = 71,
#[error("Account not found")]
AccountNotFound = 72,
#[error("Not enough account keys")]
NotEnoughAccountKeys = 73,
#[error("Missing required field")]
MissingRequiredField = 74,
#[error("Cannot close active payment")]
CannotCloseActivePayment = 75,
#[error("Too early to close payment")]
TooEarlyToClose = 76,
#[error("Insufficient token balance in escrow account")]
InsufficientTokenBalance = 80,
#[error("Insufficient liquidity for this operation")]
InsufficientLiquidity = 81,
#[error("Fee balance exceeds actual token balance")]
FeeBalanceExceedsBalance = 82,
#[error("Unsupported Token-2022 mint extension")]
UnsupportedTokenExtension = 83,
}
error!(EscrowError);