use solana_program::pubkey::Pubkey;
use steel::*;
#[repr(u8)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
pub enum EscrowInstruction {
FundPayment = 0, ReleasePayment = 1, RefundPayment = 2, ClosePayment = 3, DisputePayment = 4, ResolveDispute = 5, ExtendPaymentTTL = 6, ConfirmFulfillment = 7, AppealArbitration = 8,
Initialize = 100,
UpdateAuthority = 101,
UpdateConfig = 102,
OpenEscrow = 103,
PauseEscrow = 104,
UpdateEscrowSettings = 105,
CloseEscrow = 106,
ArbitratePayment = 107, WithdrawFees = 108, }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Initialize {
pub fee_bps: [u8; 2], pub _padding: [u8; 6], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct UpdateAuthority {
pub new_authority: Pubkey,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct FundPayment {
pub seller: Pubkey, pub mint: Pubkey, pub amount: [u8; 8], pub ttl_seconds: [u8; 8], pub reference: Pubkey, pub payment_uid: [u8; 32], pub order_num: [u8; 32], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ReleasePayment {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct RefundPayment {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ClosePayment {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct WithdrawFees {
pub amount: [u8; 8], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct DisputePayment {
pub reason: u8, pub description: [u8; 64], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ResolveDispute {
pub buyer_amount: [u8; 8], pub seller_amount: [u8; 8], pub decision: u8, pub _padding: [u8; 7], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ExtendPaymentTTL {
pub additional_seconds: [u8; 8], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ArbitratePayment {
pub buyer_amount: [u8; 8], pub seller_amount: [u8; 8], pub decision: u8, pub reason: u8, pub description: [u8; 64], pub _padding: [u8; 6], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct CloseEscrow {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct UpdateEscrowSettings {
pub min_payment_amount: [u8; 8], pub max_payment_amount: [u8; 8], pub new_fee_bps: [u8; 2], pub _padding: [u8; 6], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct PauseEscrow {
pub pause: u8, }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct UpdateConfig {
pub appeal_window_seconds: [u8; 8], pub closure_delay_seconds: [u8; 8], pub max_appeals: u8, pub _padding: [u8; 7], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ConfirmFulfillment {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct AppealArbitration {
pub description: [u8; 64], pub reason: u8, pub _padding: [u8; 7], }
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct OpenEscrow {
pub min_payment_amount: [u8; 8], pub max_payment_amount: [u8; 8], pub fee_bps: [u8; 2], pub _padding: [u8; 6], }
instruction!(EscrowInstruction, FundPayment);
instruction!(EscrowInstruction, ReleasePayment);
instruction!(EscrowInstruction, RefundPayment);
instruction!(EscrowInstruction, ClosePayment);
instruction!(EscrowInstruction, DisputePayment);
instruction!(EscrowInstruction, ResolveDispute);
instruction!(EscrowInstruction, ExtendPaymentTTL);
instruction!(EscrowInstruction, ConfirmFulfillment);
instruction!(EscrowInstruction, AppealArbitration);
instruction!(EscrowInstruction, Initialize);
instruction!(EscrowInstruction, OpenEscrow);
instruction!(EscrowInstruction, UpdateAuthority);
instruction!(EscrowInstruction, WithdrawFees);
instruction!(EscrowInstruction, ArbitratePayment);
instruction!(EscrowInstruction, CloseEscrow);
instruction!(EscrowInstruction, UpdateEscrowSettings);
instruction!(EscrowInstruction, PauseEscrow);
instruction!(EscrowInstruction, UpdateConfig);