ProgramEvents

Program Events

Events emitted by the Veil program.

Config Events

ConfigInitialized

pub struct ConfigInitialized {
    pub governance: Pubkey,
    pub er_authority: Pubkey,
    pub whitelist_enabled: bool,
    pub allowed_mints: Vec<Pubkey>,
    pub max_recipients: u16,
    pub batch_timeout_secs: u64,
}

MintWhitelistUpdated

pub struct MintWhitelistUpdated {
    pub governance: Pubkey,
    pub whitelist_enabled: bool,
    pub allowed_mints: Vec<Pubkey>,
    pub timestamp: i64,
}

ProgramPaused

pub struct ProgramPaused {
    pub governance: Pubkey,
    pub timestamp: i64,
}

ProgramUnpaused

pub struct ProgramUnpaused {
    pub governance: Pubkey,
    pub timestamp: i64,
}

ErAuthorityUpdated

pub struct ErAuthorityUpdated {
    pub governance: Pubkey,
    pub old_er_authority: Pubkey,
    pub new_er_authority: Pubkey,
    pub timestamp: i64,
}

Vault Events

VaultInitialized

pub struct VaultInitialized {
    pub employer: Pubkey,
    pub vault: Pubkey,
    pub vault_ata: Pubkey,
    pub token_mint: Pubkey,
}

VaultDeposited

pub struct VaultDeposited {
    pub vault: Pubkey,
    pub employer: Pubkey,
    pub amount: u64,
    pub available: u64,
}

VaultWithdrawn

pub struct VaultWithdrawn {
    pub vault: Pubkey,
    pub employer: Pubkey,
    pub amount: u64,
    pub available: u64,
}

VaultDelegated

pub struct VaultDelegated {
    pub vault: Pubkey,
    pub er_authority: Pubkey,
    pub timestamp: i64,
}

VaultUndelegated

pub struct VaultUndelegated {
    pub vault: Pubkey,
    pub er_authority: Pubkey,
    pub timestamp: i64,
}

Schedule Events

ScheduleCreated

pub struct ScheduleCreated {
    pub employer: Pubkey,
    pub vault: Pubkey,
    pub schedule: Pubkey,
    pub reserved_amount: u64,
    pub interval_secs: u64,
    pub next_execution: i64,
}

ScheduleCancelled

pub struct ScheduleCancelled {
    pub employer: Pubkey,
    pub schedule: Pubkey,
    pub returned_amount: u64,
}

SchedulePaused

pub struct SchedulePaused {
    pub employer: Pubkey,
    pub schedule: Pubkey,
    pub timestamp: i64,
}

ScheduleResumed

pub struct ScheduleResumed {
    pub employer: Pubkey,
    pub schedule: Pubkey,
    pub timestamp: i64,
}

ScheduleUpdated

Emitted when a paused schedule is edited.

pub struct ScheduleUpdated {
    pub employer: Pubkey,
    pub schedule: Pubkey,
    pub reserved_amount: u64,
    pub per_execution_amount: u64,
    pub interval_secs: u64,
    pub next_execution: i64,
    pub total_recipients: u16,
    pub timestamp: i64,
}

ScheduleDelegated

pub struct ScheduleDelegated {
    pub schedule: Pubkey,
    pub timestamp: i64,
}

ScheduleUndelegated

pub struct ScheduleUndelegated {
    pub schedule: Pubkey,
    pub timestamp: i64,
}

Execution Events

PaymentClaimed

pub struct PaymentClaimed {
    pub schedule: Pubkey,
    pub recipient: Pubkey,
    pub amount: u64,
    pub leaf_index: u16,
    pub paid_count: u16,
}

StateCommitted

pub struct StateCommitted {
    pub account: Pubkey,
    pub timestamp: i64,
}

Listening to Events

const listener = program.addEventListener("PaymentClaimed", (event) => {
  console.log("Payment claimed:", event);
});