escrow-api 0.2.1

Signer-Payer Payment Escrow Program
Documentation
use super::EscrowAccount;
use steel::*;

#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Payment {
    pub payment_uid: [u8; 32], // 32 bytes - payment unique identifier from payment engine
    pub escrow: Pubkey,        // 32 bytes
    pub buyer: Pubkey,         // 32 bytes
    pub seller: Pubkey,        // 32 bytes
    pub mint: Pubkey,          // 32 bytes
    pub amount: u64,           // 8 bytes
    pub created_at: i64,       // 8 bytes
    pub expires_at: i64,       // 8 bytes
    pub closed_at: i64,        // 8 bytes - when payment can be closed (0 = not scheduled)
    pub reference: Pubkey,     // 32 bytes - solana pay protocol reference
    pub order_num: [u8; 32],   // 32 bytes - order number from off-chain order system
    pub oracle_authority: Pubkey, // 32 bytes - oracle authority (Pubkey::default() for "None")
    pub arbitration_deadline: i64, // 8 bytes - when arbitration auto-resolves (0 = not set)
    pub oracle_confirmed: u8,  // 1 byte - oracle confirmation flag
    pub state: u8,             // 1 byte
    pub is_fulfilled: u8,      // 1 byte - buyer confirmation flag
    pub appeal_count: u8,      // 1 byte - number of appeals (max 1)
    // Removed: id (8 bytes) - payment_uid is now the identifier
    // Removed: bank (32 bytes) - derivable from PDA seeds
    // Total: 32+32+32+8+8+8+8+32+32+32+32+8+1+1+1+1 = 268 bytes, need 4 bytes padding for 272-byte alignment
    pub _padding: [u8; 4], // 4 bytes padding for 272-byte alignment
}

account!(EscrowAccount, Payment);