1pub use sablier_thread_program::errors;
2pub use sablier_thread_program::program::ThreadProgram;
3pub use sablier_thread_program::ID;
4
5pub mod state {
6 pub use sablier_thread_program::state::{
7 ClockData, ExecContext, SerializableAccount, SerializableInstruction, Thread,
8 ThreadAccount, ThreadResponse, ThreadSettings, Trigger, TriggerContext,
9 };
10}
11
12pub mod utils {
13 pub use sablier_thread_program::state::Equality;
14 pub use sablier_thread_program::state::PAYER_PUBKEY;
15}
16
17pub mod cpi {
18 use anchor_lang::prelude::{CpiContext, Result};
19
20 pub use sablier_thread_program::cpi::accounts::{
21 ThreadCreate, ThreadDelete, ThreadPause, ThreadReset, ThreadResume, ThreadUpdate,
22 ThreadWithdraw,
23 };
24
25 pub fn thread_create<'info>(
26 ctx: CpiContext<'_, '_, '_, 'info, ThreadCreate<'info>>,
27 amount: u64,
28 id: Vec<u8>,
29 domain: Option<Vec<u8>>,
30 instructions: Vec<crate::state::SerializableInstruction>,
31 trigger: crate::state::Trigger,
32 ) -> Result<()> {
33 sablier_thread_program::cpi::thread_create(ctx, amount, id, domain, instructions, trigger)
34 }
35
36 pub fn thread_delete<'info>(
37 ctx: CpiContext<'_, '_, '_, 'info, ThreadDelete<'info>>,
38 ) -> Result<()> {
39 sablier_thread_program::cpi::thread_delete(ctx)
40 }
41
42 pub fn thread_pause<'info>(
43 ctx: CpiContext<'_, '_, '_, 'info, ThreadPause<'info>>,
44 ) -> Result<()> {
45 sablier_thread_program::cpi::thread_pause(ctx)
46 }
47
48 pub fn thread_resume<'info>(
49 ctx: CpiContext<'_, '_, '_, 'info, ThreadResume<'info>>,
50 ) -> Result<()> {
51 sablier_thread_program::cpi::thread_resume(ctx)
52 }
53
54 pub fn thread_reset<'info>(
55 ctx: CpiContext<'_, '_, '_, 'info, ThreadReset<'info>>,
56 ) -> Result<()> {
57 sablier_thread_program::cpi::thread_reset(ctx)
58 }
59
60 pub fn thread_update<'info>(
61 ctx: CpiContext<'_, '_, '_, 'info, ThreadUpdate<'info>>,
62 settings: crate::state::ThreadSettings,
63 ) -> Result<()> {
64 sablier_thread_program::cpi::thread_update(ctx, settings)
65 }
66
67 pub fn thread_withdraw<'info>(
68 ctx: CpiContext<'_, '_, '_, 'info, ThreadWithdraw<'info>>,
69 amount: u64,
70 ) -> Result<()> {
71 sablier_thread_program::cpi::thread_withdraw(ctx, amount)
72 }
73}