Skip to main content

roshi_interface/instructions/
args.rs

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