1use steel::*;
2
3#[repr(u8)]
4#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
5#[rustfmt::skip]
6pub enum BoostInstruction {
7 Claim = 0,
9 Deposit = 1,
10 Open = 2,
11 Rebase = 3,
12 Register = 4,
13 Rotate = 5,
14 Withdraw = 6,
15
16 Activate = 100,
18 Deactivate = 101,
19 Initialize = 102,
20 New = 103,
21 UpdateAdmin = 104,
22 UpdateBoost = 105,
23
24 Migrate = 200,
26}
27
28impl BoostInstruction {
29 pub fn to_vec(&self) -> Vec<u8> {
30 vec![*self as u8]
31 }
32}
33
34#[repr(C)]
35#[derive(Clone, Copy, Debug, Pod, Zeroable)]
36pub struct Activate {}
37
38#[repr(C)]
39#[derive(Clone, Copy, Debug, Pod, Zeroable)]
40pub struct Claim {
41 pub amount: [u8; 8],
42}
43
44#[repr(C)]
45#[derive(Clone, Copy, Debug, Pod, Zeroable)]
46pub struct Deactivate {}
47
48#[repr(C)]
49#[derive(Clone, Copy, Debug, Pod, Zeroable)]
50pub struct Deposit {
51 pub amount: [u8; 8],
52}
53
54#[repr(C)]
55#[derive(Clone, Copy, Debug, Pod, Zeroable)]
56pub struct Initialize {}
57
58#[repr(C)]
59#[derive(Clone, Copy, Debug, Pod, Zeroable)]
60pub struct New {
61 pub expires_at: [u8; 8],
62 pub multiplier: [u8; 8],
63}
64
65#[repr(C)]
66#[derive(Clone, Copy, Debug, Pod, Zeroable)]
67pub struct Open {}
68
69#[repr(C)]
70#[derive(Clone, Copy, Debug, Pod, Zeroable)]
71pub struct Rebase {}
72
73#[repr(C)]
74#[derive(Clone, Copy, Debug, Pod, Zeroable)]
75pub struct Register {}
76
77#[repr(C)]
78#[derive(Clone, Copy, Debug, Pod, Zeroable)]
79pub struct Rotate {}
80
81#[repr(C)]
82#[derive(Clone, Copy, Debug, Pod, Zeroable)]
83pub struct UpdateAdmin {
84 pub new_admin: Pubkey,
85}
86
87#[repr(C)]
88#[derive(Clone, Copy, Debug, Pod, Zeroable)]
89pub struct UpdateBoost {
90 pub expires_at: [u8; 8],
91 pub multiplier: [u8; 8],
92}
93
94#[repr(C)]
95#[derive(Clone, Copy, Debug, Pod, Zeroable)]
96pub struct Withdraw {
97 pub amount: [u8; 8],
98}
99
100#[repr(C)]
101#[derive(Clone, Copy, Debug, Pod, Zeroable)]
102pub struct Migrate {}
103
104instruction!(BoostInstruction, Activate);
105instruction!(BoostInstruction, Claim);
106instruction!(BoostInstruction, Deactivate);
107instruction!(BoostInstruction, Deposit);
108instruction!(BoostInstruction, Initialize);
109instruction!(BoostInstruction, New);
110instruction!(BoostInstruction, Open);
111instruction!(BoostInstruction, Rebase);
112instruction!(BoostInstruction, Register);
113instruction!(BoostInstruction, Rotate);
114instruction!(BoostInstruction, UpdateAdmin);
115instruction!(BoostInstruction, UpdateBoost);
116instruction!(BoostInstruction, Withdraw);
117instruction!(BoostInstruction, Migrate);