#[macro_use]
extern crate version;
pub mod errors;
pub mod state;
mod instructions;
use anchor_lang::prelude::*;
use clockwork_utils::{
thread::{SerializableInstruction, Trigger},
CrateInfo,
};
use instructions::*;
use state::*;
declare_id!("CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh");
#[program]
pub mod thread_program {
use super::*;
pub fn get_crate_info(ctx: Context<GetCrateInfo>) -> Result<CrateInfo> {
get_crate_info::handler(ctx)
}
pub fn thread_exec(ctx: Context<ThreadExec>) -> Result<()> {
thread_exec::handler(ctx)
}
pub fn thread_create(
ctx: Context<ThreadCreate>,
amount: u64,
id: Vec<u8>,
instructions: Vec<SerializableInstruction>,
trigger: Trigger,
) -> Result<()> {
thread_create::handler(ctx, amount, id, instructions, trigger)
}
pub fn thread_delete(ctx: Context<ThreadDelete>) -> Result<()> {
thread_delete::handler(ctx)
}
pub fn thread_instruction_add(
ctx: Context<ThreadInstructionAdd>,
instruction: SerializableInstruction,
) -> Result<()> {
thread_instruction_add::handler(ctx, instruction)
}
pub fn thread_instruction_remove(
ctx: Context<ThreadInstructionRemove>,
index: u64,
) -> Result<()> {
thread_instruction_remove::handler(ctx, index)
}
pub fn thread_kickoff(ctx: Context<ThreadKickoff>) -> Result<()> {
thread_kickoff::handler(ctx)
}
pub fn thread_pause(ctx: Context<ThreadPause>) -> Result<()> {
thread_pause::handler(ctx)
}
pub fn thread_resume(ctx: Context<ThreadResume>) -> Result<()> {
thread_resume::handler(ctx)
}
pub fn thread_reset(ctx: Context<ThreadReset>) -> Result<()> {
thread_reset::handler(ctx)
}
pub fn thread_update(ctx: Context<ThreadUpdate>, settings: ThreadSettings) -> Result<()> {
thread_update::handler(ctx, settings)
}
pub fn thread_withdraw(ctx: Context<ThreadWithdraw>, amount: u64) -> Result<()> {
thread_withdraw::handler(ctx, amount)
}
}