use anchor_lang::prelude::*;

declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");

#[macro_export]
macro_rules! stablebond_emit {
    ($e:expr) => {
        msg!("stablebond-log");
        emit!($e);
    };
}

#[program]
pub mod stablebond_logs {}

#[derive(Debug)]
pub enum Event {
    InitializeBond(InitializeBondEvent),
    InitializeIssuance(InitializeIssuanceEvent),
    StartIssuance(StartIssuanceEvent),
}

#[derive(Debug)]
#[event]
pub struct InitializeIssuanceEvent {
    pub address: Pubkey,
    pub bond_address: Pubkey,
    pub estimated_start_datetime: i64,
    pub interest_rate_bps: i16,
    pub liquidity: u64,
    pub issuance_number: u64,
}

#[derive(Debug)]
#[event]
pub struct InitializeBondEvent {
    pub address: Pubkey,
    pub mint: Pubkey,
}

#[derive(Debug)]
#[event]
pub struct StartIssuanceEvent {
    pub address: Pubkey,
    pub actual_start_datetime: i64,
    pub actual_end_datetime: i64,
    pub starting_token_amount: u64,
    pub ending_token_amount: u64,
}
