sablier_thread_program/
lib.rs1#[macro_use]
5extern crate version;
6
7pub mod constants;
8pub mod errors;
9pub mod state;
10
11mod instructions;
12
13use anchor_lang::prelude::*;
14use instructions::*;
15use sablier_utils::{
16 thread::{SerializableInstruction, Trigger},
17 CrateInfo,
18};
19use state::*;
20
21declare_id!("sabGLGXfBiUCkwtprPMtatG6tCNxhcWWs1hjQAvDqEE");
22
23#[program]
25pub mod thread_program {
26 use super::*;
27
28 pub fn get_crate_info(ctx: Context<GetCrateInfo>) -> Result<CrateInfo> {
30 get_crate_info::handler(ctx)
31 }
32
33 pub fn thread_exec(ctx: Context<ThreadExec>) -> Result<()> {
35 thread_exec::handler(ctx)
36 }
37
38 pub fn thread_create(
40 ctx: Context<ThreadCreate>,
41 amount: u64,
42 id: Vec<u8>,
43 domain: Option<Vec<u8>>,
44 instructions: Vec<SerializableInstruction>,
45 trigger: Trigger,
46 ) -> Result<()> {
47 thread_create::handler(ctx, amount, id, domain, instructions, trigger)
48 }
49
50 pub fn thread_delete(ctx: Context<ThreadDelete>) -> Result<()> {
52 thread_delete::handler(ctx)
53 }
54
55 pub fn thread_instruction_add(
57 ctx: Context<ThreadInstructionAdd>,
58 instruction: SerializableInstruction,
59 ) -> Result<()> {
60 thread_instruction_add::handler(ctx, instruction)
61 }
62
63 pub fn thread_instruction_remove(
65 ctx: Context<ThreadInstructionRemove>,
66 index: u64,
67 ) -> Result<()> {
68 thread_instruction_remove::handler(ctx, index)
69 }
70
71 pub fn thread_kickoff(ctx: Context<ThreadKickoff>) -> Result<()> {
73 thread_kickoff::handler(ctx)
74 }
75
76 pub fn thread_pause(ctx: Context<ThreadPause>) -> Result<()> {
78 thread_pause::handler(ctx)
79 }
80
81 pub fn thread_resume(ctx: Context<ThreadResume>) -> Result<()> {
83 thread_resume::handler(ctx)
84 }
85
86 pub fn thread_reset(ctx: Context<ThreadReset>) -> Result<()> {
88 thread_reset::handler(ctx)
89 }
90
91 pub fn thread_update(ctx: Context<ThreadUpdate>, settings: ThreadSettings) -> Result<()> {
93 thread_update::handler(ctx, settings)
94 }
95
96 pub fn thread_withdraw(ctx: Context<ThreadWithdraw>, amount: u64) -> Result<()> {
98 thread_withdraw::handler(ctx, amount)
99 }
100}