Skip to main content

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    #[deprecated(since = "3.8.15", note = "Rolled into checkpoint")]
16    ReloadSOL = 21,
17
18    // Admin
19    Buyback = 13,
20    Bury = 24,
21    Wrap = 14,
22    SetAdmin = 15,
23    NewVar = 19,
24    Liq = 25,
25}
26
27#[repr(C)]
28#[derive(Clone, Copy, Debug, Pod, Zeroable)]
29pub struct Automate {
30    pub amount: [u8; 8],
31    pub deposit: [u8; 8],
32    pub fee: [u8; 8],
33    pub mask: [u8; 8],
34    pub strategy: u8,
35    pub reload: [u8; 8],
36}
37
38#[repr(C)]
39#[derive(Clone, Copy, Debug, Pod, Zeroable)]
40pub struct ClaimSOL {}
41
42#[repr(C)]
43#[derive(Clone, Copy, Debug, Pod, Zeroable)]
44pub struct ClaimORE {
45    pub bps: [u8; 8],
46}
47
48#[repr(C)]
49#[derive(Clone, Copy, Debug, Pod, Zeroable)]
50pub struct Deploy {
51    pub amount: [u8; 8],
52    pub squares: [u8; 4],
53}
54
55#[repr(C)]
56#[derive(Clone, Copy, Debug, Pod, Zeroable)]
57pub struct Log {}
58
59#[repr(C)]
60#[derive(Clone, Copy, Debug, Pod, Zeroable)]
61pub struct Reset {}
62
63#[repr(C)]
64#[derive(Clone, Copy, Debug, Pod, Zeroable)]
65pub struct SetAdmin {
66    pub admin: [u8; 32],
67}
68
69#[repr(C)]
70#[derive(Clone, Copy, Debug, Pod, Zeroable)]
71pub struct SetFeeCollector {
72    pub fee_collector: [u8; 32],
73}
74
75#[repr(C)]
76#[derive(Clone, Copy, Debug, Pod, Zeroable)]
77pub struct SetFeeRate {
78    pub fee_rate: [u8; 8],
79}
80
81#[repr(C)]
82#[derive(Clone, Copy, Debug, Pod, Zeroable)]
83pub struct Wrap {
84    pub amount: [u8; 8],
85}
86
87#[repr(C)]
88#[derive(Clone, Copy, Debug, Pod, Zeroable)]
89pub struct Buyback {}
90
91#[repr(C)]
92#[derive(Clone, Copy, Debug, Pod, Zeroable)]
93pub struct Bury {
94    pub amount: [u8; 8],
95}
96
97#[deprecated(since = "3.8.15", note = "Rolled into checkpoint")]
98#[repr(C)]
99#[derive(Clone, Copy, Debug, Pod, Zeroable)]
100pub struct ReloadSOL {}
101
102#[repr(C)]
103#[derive(Clone, Copy, Debug, Pod, Zeroable)]
104pub struct Checkpoint {}
105
106#[repr(C)]
107#[derive(Clone, Copy, Debug, Pod, Zeroable)]
108pub struct Close {}
109
110#[repr(C)]
111#[derive(Clone, Copy, Debug, Pod, Zeroable)]
112pub struct NewVar {
113    pub id: [u8; 8],
114    pub commit: [u8; 32],
115    pub samples: [u8; 8],
116}
117
118#[repr(C)]
119#[derive(Clone, Copy, Debug, Pod, Zeroable)]
120pub struct SetAdminFee {
121    pub admin_fee: [u8; 8],
122}
123
124#[repr(C)]
125#[derive(Clone, Copy, Debug, Pod, Zeroable)]
126pub struct SetSwapProgram {}
127
128#[repr(C)]
129#[derive(Clone, Copy, Debug, Pod, Zeroable)]
130pub struct SetVarAddress {}
131
132instruction!(OreInstruction, Automate);
133instruction!(OreInstruction, Close);
134instruction!(OreInstruction, Checkpoint);
135instruction!(OreInstruction, ClaimSOL);
136instruction!(OreInstruction, ClaimORE);
137instruction!(OreInstruction, ReloadSOL);
138instruction!(OreInstruction, Deploy);
139instruction!(OreInstruction, Log);
140instruction!(OreInstruction, Wrap);
141instruction!(OreInstruction, Buyback);
142instruction!(OreInstruction, Bury);
143instruction!(OreInstruction, Reset);
144instruction!(OreInstruction, SetAdmin);
145instruction!(OreInstruction, NewVar);