roshi_interface/instructions/
args.rs1use crate::{action::Ops, oracle::OracleConfig};
2use wincode::{SchemaRead, SchemaWrite};
3
4#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
5pub struct InitializeProgramArgs {
6 pub authority: [u8; 32],
7}
8
9#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
10pub struct InitializeVaultArgs {
11 pub tag: [u8; 32],
12 pub tag_len: u8,
13 pub admin: [u8; 32],
14 pub strategist: [u8; 32],
15 pub nav_authority: [u8; 32],
16 pub withdrawal_authority: [u8; 32],
17 pub base_mint: [u8; 32],
18 pub base_decimals: u8,
19 pub base_oracle: OracleConfig,
20 pub deposit_sub_account: u8,
21 pub withdraw_sub_account: u8,
22 pub fee_collector: [u8; 32],
23 pub performance_fee_bps: u16,
24 pub withdrawal_buffer_bps: u16,
25 pub private: bool,
26 pub access_merkle_root: [u8; 32],
27}
28
29#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
30pub struct AuthorizeActionArgs {
31 pub action_hash: [u8; 32],
32 pub ops: Ops,
33}
34
35#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
36pub struct RevokeActionArgs {
37 pub action_hash: [u8; 32],
38}
39
40#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
41pub struct ManageArgs {
42 pub sub_account: u8,
43 pub program_id: [u8; 32],
44 pub accounts_start: u8,
45 pub accounts_len: u8,
46 pub ix_data: Vec<u8>,
47}
48
49#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
50pub struct ManageBatchArgs {
51 pub actions: Vec<ManageArgs>,
52}
53
54#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
55pub struct DepositArgs {
56 pub asset_mint: [u8; 32],
57 pub amount: u64,
58 pub min_shares_out: u64,
59 pub access_proof: Vec<[u8; 32]>,
60}
61
62#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
63pub struct RedeemArgs {
64 pub recipient_token_account: [u8; 32],
65 pub ticket_index: u8,
66 pub shares: u64,
67}
68
69#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
70pub struct CancelRedeemArgs {
71 pub min_shares_out: u64,
72}
73
74#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
75pub struct ProcessWithdrawalsArgs;
76
77#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
78pub struct CollectFeesArgs {
79 pub sub_account: u8,
80 pub amount: u64,
81}
82
83#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
84pub struct ReportNavArgs {
85 pub total_assets: u64,
86 pub report_hash: [u8; 32],
87}
88
89#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
90pub struct UpdateVaultConfigArgs {
91 pub fee_collector: [u8; 32],
92 pub deposit_sub_account: u8,
93 pub withdraw_sub_account: u8,
94 pub base_oracle: OracleConfig,
95 pub performance_fee_bps: u16,
96 pub withdrawal_buffer_bps: u16,
97}
98
99#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
100pub struct InitializeAssetArgs {
101 pub asset_mint: [u8; 32],
102 pub oracle: OracleConfig,
103 pub asset_decimals: u8,
104 pub enabled: bool,
105}
106
107#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
108pub struct UpdateAssetArgs {
109 pub oracle: OracleConfig,
110 pub enabled: bool,
111}
112
113#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
114pub struct SetPauseFlagsArgs {
115 pub deposits_paused: bool,
116 pub withdrawals_paused: bool,
117 pub manage_paused: bool,
118}
119
120#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
121pub struct SetVaultAccessArgs {
122 pub private: bool,
123 pub access_merkle_root: [u8; 32],
124}
125
126#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
127pub struct TransferProgramAuthorityArgs {
128 pub new_authority: [u8; 32],
129}
130
131#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
132pub struct TransferVaultAuthorityArgs {
133 pub new_authority: [u8; 32],
134}
135
136#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
137pub struct SetStrategistArgs {
138 pub strategist: [u8; 32],
139}
140
141#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
142pub struct SetNavAuthorityArgs {
143 pub nav_authority: [u8; 32],
144}
145
146#[derive(codama_macros::CodamaType, SchemaWrite, SchemaRead)]
147pub struct SetWithdrawalAuthorityArgs {
148 pub withdrawal_authority: [u8; 32],
149}