ore_api/
instruction.rs

1use steel::*;
2
3#[repr(u8)]
4#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
5pub enum OreInstruction {
6    // Miner
7    Automate = 0,
8    Checkpoint = 2,
9    ClaimSOL = 3,
10    ClaimORE = 4,
11    Close = 5,
12    Deploy = 6,
13    Log = 8,
14    Reset = 9,
15    ReloadSOL = 21,
16
17    // Staker
18    Deposit = 10,
19    Withdraw = 11,
20    ClaimYield = 12,
21
22    // Admin
23    Bury = 13,
24    Bury2 = 24,
25    Wrap = 14,
26    SetAdmin = 15,
27    SetFeeCollector = 16,
28    SetSwapProgram = 17,
29    SetVarAddress = 18,
30    NewVar = 19,
31    SetAdminFee = 20,
32    MigrateAutomation = 22,
33    AdminExecute = 23,
34    Liq = 25,
35}
36
37#[repr(C)]
38#[derive(Clone, Copy, Debug, Pod, Zeroable)]
39pub struct Automate {
40    pub amount: [u8; 8],
41    pub deposit: [u8; 8],
42    pub fee: [u8; 8],
43    pub mask: [u8; 8],
44    pub strategy: u8,
45    pub reload: [u8; 8],
46}
47
48#[repr(C)]
49#[derive(Clone, Copy, Debug, Pod, Zeroable)]
50pub struct ClaimSOL {}
51
52#[repr(C)]
53#[derive(Clone, Copy, Debug, Pod, Zeroable)]
54pub struct ClaimORE {}
55
56#[repr(C)]
57#[derive(Clone, Copy, Debug, Pod, Zeroable)]
58pub struct Deploy {
59    pub amount: [u8; 8],
60    pub squares: [u8; 4],
61}
62
63#[repr(C)]
64#[derive(Clone, Copy, Debug, Pod, Zeroable)]
65pub struct Log {}
66
67#[repr(C)]
68#[derive(Clone, Copy, Debug, Pod, Zeroable)]
69pub struct Reset {}
70
71#[repr(C)]
72#[derive(Clone, Copy, Debug, Pod, Zeroable)]
73pub struct Mine {
74    pub nonce: [u8; 8],
75}
76
77#[repr(C)]
78#[derive(Clone, Copy, Debug, Pod, Zeroable)]
79pub struct Swap {
80    pub amount: [u8; 8],
81    pub direction: u8,
82    pub precision: u8,
83    pub seed: [u8; 32],
84}
85
86#[repr(C)]
87#[derive(Clone, Copy, Debug, Pod, Zeroable)]
88pub struct Uncommit {
89    pub amount: [u8; 8],
90}
91
92#[repr(C)]
93#[derive(Clone, Copy, Debug, Pod, Zeroable)]
94pub struct SetAdmin {
95    pub admin: [u8; 32],
96}
97
98#[repr(C)]
99#[derive(Clone, Copy, Debug, Pod, Zeroable)]
100pub struct SetFeeCollector {
101    pub fee_collector: [u8; 32],
102}
103
104#[repr(C)]
105#[derive(Clone, Copy, Debug, Pod, Zeroable)]
106pub struct SetFeeRate {
107    pub fee_rate: [u8; 8],
108}
109
110#[repr(C)]
111#[derive(Clone, Copy, Debug, Pod, Zeroable)]
112pub struct Wrap {}
113
114#[repr(C)]
115#[derive(Clone, Copy, Debug, Pod, Zeroable)]
116pub struct Bury {}
117
118#[repr(C)]
119#[derive(Clone, Copy, Debug, Pod, Zeroable)]
120pub struct Bury2 {
121    pub amount: [u8; 8],
122}
123
124#[repr(C)]
125#[derive(Clone, Copy, Debug, Pod, Zeroable)]
126pub struct ReloadSOL {}
127
128#[repr(C)]
129#[derive(Clone, Copy, Debug, Pod, Zeroable)]
130pub struct Deposit {
131    pub amount: [u8; 8],
132}
133
134#[repr(C)]
135#[derive(Clone, Copy, Debug, Pod, Zeroable)]
136pub struct Withdraw {
137    pub amount: [u8; 8],
138}
139
140#[repr(C)]
141#[derive(Clone, Copy, Debug, Pod, Zeroable)]
142pub struct ClaimYield {
143    pub amount: [u8; 8],
144}
145
146#[repr(C)]
147#[derive(Clone, Copy, Debug, Pod, Zeroable)]
148pub struct Checkpoint {}
149
150#[repr(C)]
151#[derive(Clone, Copy, Debug, Pod, Zeroable)]
152pub struct Close {}
153
154#[repr(C)]
155#[derive(Clone, Copy, Debug, Pod, Zeroable)]
156pub struct NewVar {
157    pub id: [u8; 8],
158    pub commit: [u8; 32],
159    pub samples: [u8; 8],
160}
161
162#[repr(C)]
163#[derive(Clone, Copy, Debug, Pod, Zeroable)]
164pub struct SetAdminFee {
165    pub admin_fee: [u8; 8],
166}
167
168#[repr(C)]
169#[derive(Clone, Copy, Debug, Pod, Zeroable)]
170pub struct SetSwapProgram {}
171
172#[repr(C)]
173#[derive(Clone, Copy, Debug, Pod, Zeroable)]
174pub struct SetVarAddress {}
175
176#[repr(C)]
177#[derive(Clone, Copy, Debug, Pod, Zeroable)]
178pub struct MigrateAutomation {}
179
180#[repr(C)]
181#[derive(Clone, Copy, Debug, Pod, Zeroable)]
182pub struct AdminExecute {}
183
184#[repr(C)]
185#[derive(Clone, Copy, Debug, Pod, Zeroable)]
186pub struct Liq {}
187
188instruction!(OreInstruction, Automate);
189instruction!(OreInstruction, Close);
190instruction!(OreInstruction, Checkpoint);
191instruction!(OreInstruction, ClaimSOL);
192instruction!(OreInstruction, ClaimORE);
193instruction!(OreInstruction, ReloadSOL);
194instruction!(OreInstruction, Deploy);
195instruction!(OreInstruction, Log);
196instruction!(OreInstruction, Wrap);
197instruction!(OreInstruction, Bury);
198instruction!(OreInstruction, Bury2);
199instruction!(OreInstruction, Reset);
200instruction!(OreInstruction, SetAdmin);
201instruction!(OreInstruction, SetFeeCollector);
202instruction!(OreInstruction, Deposit);
203instruction!(OreInstruction, Withdraw);
204instruction!(OreInstruction, ClaimYield);
205instruction!(OreInstruction, NewVar);
206instruction!(OreInstruction, SetAdminFee);
207instruction!(OreInstruction, SetSwapProgram);
208instruction!(OreInstruction, SetVarAddress);
209instruction!(OreInstruction, MigrateAutomation);
210instruction!(OreInstruction, AdminExecute);
211instruction!(OreInstruction, Liq);