sla-escrow-api 0.2.7

SLA-Escrow: Service Level Agreement Enforcer for AI Agents
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
    pub escrow: Pubkey,           // 32 bytes
    pub buyer: Pubkey,            // 32 bytes
    pub seller: Pubkey,           // 32 bytes
    pub mint: Pubkey,             // 32 bytes
    pub oracle_authority: Pubkey, // 32 bytes - oracle authority (Pubkey::default() for "None")
    pub sla_hash: [u8; 32],       // 32 bytes - hashed AI prompt / SLA requirements
    pub delivery_hash: [u8; 32],  // 32 bytes - hashed AI delivery payload
    pub amount: u64,              // 8 bytes
    pub min_fee_amount: u64,      // 8 bytes - snapshotted at funding time

    pub created_at: i64,              // 8 bytes
    pub expires_at: i64,              // 8 bytes
    pub closed_at: i64,               // 8 bytes
    pub delivery_timestamp: i64,      // 8 bytes
    pub closure_delay_seconds: i64,   // 8 bytes - snapshotted at funding time
    pub refund_cooldown_seconds: i64, // 8 bytes - snapshotted at funding time
    pub delivery_cutoff_seconds: i64, // 8 bytes - snapshotted at funding time
    pub resolution_reason: u16, // 2 bytes - oracle-supplied reason code (see ResolutionReason enum)
    pub fee_bps: u16,           // 2 bytes - snapshotted at funding time
    pub oracle_fee_bps: u16,    // 2 bytes - snapshotted at funding time
    pub state: u8,              // 1 byte  - 0: Funded, 1: Released, 2: Refunded
    pub resolution_state: u8,   // 1 byte  - 0: Pending, 1: Approved, 2: Rejected
}

account!(EscrowAccount, Payment);