miracle-api 0.6.0

Miracle is a pay2e protocol for sovereign individuals living in Mirascape Horizon.
Documentation
use steel::*;

use super::MiracleAccount;

/// Snapshot data for the current epoch
/// This is the current equivalent of the HistoricalSnapshot structure
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
pub struct Snapshot {
    /// The seal merkle root of all historical payment merkle roots
    /// This is the root of the incremental seal merkle tree containing all payment roots
    pub seal_merkle_root: [u8; 32],

    /// Current epoch number.
    pub epoch: u64,

    /// Current epoch hash for tamper detection in the Epoch Hash Chain security solution
    /// Epoch 0: `hashv(b"MIRACLE_EPOCH_0_EXTREME_WAYS")`
    /// Epoch 1+: `hashv(previous_epoch_hash + current_epoch_number + current_payment_merkle_root)`
    /// Fallback: If previous epoch hash is missing, use genesis hash as fallback
    /// Empty Payment Support: Epoch numbers ensure uniqueness even with identical payment roots
    pub epoch_hash: [u8; 32],

    /// Timestamp when this epoch was created (oracle updates once per day)
    pub created_at: i64,

    /// Customer reward pool for this epoch
    pub customer_reward_pool: u64,

    /// Merchant reward pool for this epoch
    pub merchant_reward_pool: u64,

    /// Total customer participants in this epoch
    pub customer_participants: u32,

    /// Total merchant participants in this epoch
    pub merchant_participants: u32,

    /// Total customer activity in this epoch (for accurate reward calculation)
    pub total_customer_activity: u32,

    /// Total merchant activity in this epoch (for accurate reward calculation)
    pub total_merchant_activity: u32,
}

account!(MiracleAccount, Snapshot);