squads_v3_sdk/
lib.rs

1pub use squads_mpl::errors;
2pub use squads_mpl::ID;
3pub use squads_mpl::program::SquadsMpl;
4
5
6pub mod state {
7    pub use squads_mpl::state::{
8       IncomingInstruction, MsTransaction, MsAccountMeta, Ms, MsTransactionStatus 
9    };
10}
11
12pub mod cpi {
13    use anchor_lang::prelude::{CpiContext, Result, Pubkey};
14
15    pub use squads_mpl::cpi::accounts::{
16        ActivateTransaction, VoteTransaction, AddInstruction,CancelTransaction, Create, CreateTransaction, ExecuteInstruction, MsAuth, MsAuthRealloc, ExecuteTransaction
17    };
18    
19    pub fn create_multisig<'info>(
20        ctx: CpiContext<'_, '_, '_, 'info, Create<'info>>,
21        creator: Pubkey,
22        threshold: u16,
23        members: Vec<Pubkey>,
24        name: String,
25    ) -> Result<()> {
26        squads_mpl::cpi::create(ctx, threshold, creator, members, name)
27    }
28
29    pub fn create_transaction<'info>(
30        ctx: CpiContext<'_, '_, '_, 'info, CreateTransaction<'info>>,
31        authority_index: u32,
32    ) -> Result<()> {
33        squads_mpl::cpi::create_transaction(ctx, authority_index)
34    }
35
36    pub fn activate_transaction<'info>(
37        ctx: CpiContext<'_, '_, '_, 'info, ActivateTransaction<'info>>,
38    ) -> Result<()> {
39        squads_mpl::cpi::activate_transaction(ctx)
40    }
41
42    pub fn cancel_transaction<'info>(
43        ctx: CpiContext<'_, '_, '_, 'info, CancelTransaction<'info>>,
44    ) -> Result<()> {
45        squads_mpl::cpi::cancel_transaction(ctx)
46    }
47
48    pub fn execute_instruction<'info>(
49        ctx: CpiContext<'_, '_, '_, 'info, ExecuteInstruction<'info>>,
50    ) -> Result<()> {
51        squads_mpl::cpi::execute_instruction(ctx)
52    }
53
54    pub fn add_instruction<'info>(
55        ctx: CpiContext<'_, '_, '_, 'info, AddInstruction<'info>>,
56        incoming_instruction: crate::state::IncomingInstruction,
57    ) -> Result<()> {
58        squads_mpl::cpi::add_instruction(ctx, incoming_instruction)
59    }
60
61
62    pub fn approve_transaction<'info>(
63        ctx: CpiContext<'_, '_, '_, 'info, VoteTransaction<'info>>,
64    ) -> Result<()> {
65        squads_mpl::cpi::approve_transaction(ctx)
66    }
67
68    pub fn reject_transaction<'info>(
69        ctx: CpiContext<'_, '_, '_, 'info, VoteTransaction<'info>>,
70    ) -> Result<()> {
71        squads_mpl::cpi::reject_transaction(ctx)
72    }
73
74    pub fn add_authority<'info>(
75        ctx: CpiContext<'_, '_, '_, 'info, MsAuth<'info>>,
76    ) -> Result<()> {
77        squads_mpl::cpi::add_authority(ctx)
78    }
79
80    pub fn add_member<'info>(
81        ctx: CpiContext<'_, '_, '_, 'info, MsAuthRealloc<'info>>,
82        new_member: Pubkey,
83    ) -> Result<()> {
84        squads_mpl::cpi::add_member(ctx, new_member)
85    }
86
87    pub fn add_member_and_change_threshold<'info>(
88        ctx: CpiContext<'_, '_, '_, 'info, MsAuthRealloc<'info>>,
89        new_member: Pubkey,
90        new_threshold: u16,
91    ) -> Result<()> {
92        squads_mpl::cpi::add_member_and_change_threshold(ctx, new_member, new_threshold)
93    }
94
95    pub fn change_threshold<'info>(
96        ctx: CpiContext<'_, '_, '_, 'info, MsAuth<'info>>,
97        new_threshold: u16,
98    ) -> Result<()> {
99        squads_mpl::cpi::change_threshold(ctx, new_threshold)
100    }
101
102    pub fn execute_transaction<'info>(
103        ctx: CpiContext<'_, '_, '_, 'info, ExecuteTransaction<'info>>,
104        account_list: Vec<u8>,
105    ) -> Result<()> {
106        squads_mpl::cpi::execute_transaction(ctx, account_list)
107    }
108
109    pub fn remove_member<'info>(
110        ctx: CpiContext<'_, '_, '_, 'info, MsAuth<'info>>,
111        member: Pubkey,
112    ) -> Result<()> {
113        squads_mpl::cpi::remove_member(ctx, member)
114    }
115
116    pub fn remove_member_and_change_threshold<'info>(
117        ctx: CpiContext<'_, '_, '_, 'info, MsAuth<'info>>,
118        member: Pubkey,
119        new_threshold: u16,
120    ) -> Result<()> {
121        squads_mpl::cpi::remove_member_and_change_threshold(ctx, member, new_threshold)
122    }
123
124}