ore_pool_api/
instruction.rs

1use steel::*;
2
3#[repr(u8)]
4#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
5pub enum PoolInstruction {
6    // User
7    Claim = 0,
8    Join = 1,
9    #[deprecated(
10        since = "0.3.0",
11        note = "Staking has moved to the global boost program"
12    )]
13    OpenShare = 2,
14    #[deprecated(
15        since = "0.3.0",
16        note = "Staking has moved to the global boost program"
17    )]
18    Stake = 3,
19    Unstake = 4,
20
21    // Operator
22    Attribute = 100,
23    #[deprecated(
24        since = "0.3.0",
25        note = "Staking has moved to the global boost program"
26    )]
27    Commit = 101,
28    Launch = 102,
29    #[deprecated(
30        since = "0.3.0",
31        note = "Staking has moved to the global boost program"
32    )]
33    OpenStake = 103,
34    Submit = 104,
35
36    // Migration
37    MigratePool = 200,
38    MigrateMemberBalance = 201,
39    QuickMigrate = 202,
40}
41
42#[repr(C)]
43#[derive(Clone, Copy, Debug, Pod, Zeroable)]
44pub struct Attribute {
45    pub total_balance: [u8; 8],
46}
47
48#[repr(C)]
49#[derive(Clone, Copy, Debug, Pod, Zeroable)]
50pub struct Claim {
51    pub amount: [u8; 8],
52    #[deprecated(since = "0.1.3", note = "Bumps are no longer required")]
53    pub pool_bump: u8,
54}
55
56#[deprecated(
57    since = "0.3.0",
58    note = "Staking has moved to the global boost program"
59)]
60#[repr(C)]
61#[derive(Clone, Copy, Debug, Pod, Zeroable)]
62pub struct Commit {}
63
64#[repr(C)]
65#[derive(Clone, Copy, Debug, Pod, Zeroable)]
66pub struct Launch {
67    #[deprecated(since = "0.1.3", note = "Bumps are no longer required")]
68    pub pool_bump: u8,
69    #[deprecated(since = "0.1.3", note = "Bumps are no longer required")]
70    pub proof_bump: u8,
71    pub url: [u8; 128],
72}
73
74#[deprecated(
75    since = "0.3.0",
76    note = "Staking has moved to the global boost program"
77)]
78#[repr(C)]
79#[derive(Clone, Copy, Debug, Pod, Zeroable)]
80pub struct OpenShare {
81    pub share_bump: u8,
82}
83
84#[deprecated(
85    since = "0.3.0",
86    note = "Staking has moved to the global boost program"
87)]
88#[repr(C)]
89#[derive(Clone, Copy, Debug, Pod, Zeroable)]
90pub struct OpenStake {}
91
92#[repr(C)]
93#[derive(Clone, Copy, Debug, Pod, Zeroable)]
94pub struct Join {
95    #[deprecated(since = "0.1.3", note = "Bumps are no longer required")]
96    pub member_bump: u8,
97}
98
99#[deprecated(
100    since = "0.3.0",
101    note = "Staking has moved to the global boost program"
102)]
103#[repr(C)]
104#[derive(Clone, Copy, Debug, Pod, Zeroable)]
105pub struct Stake {
106    pub amount: [u8; 8],
107}
108
109#[repr(C)]
110#[derive(Clone, Copy, Debug, Pod, Zeroable)]
111pub struct Submit {
112    pub attestation: [u8; 32],
113    pub digest: [u8; 16],
114    pub nonce: [u8; 8],
115}
116
117#[repr(C)]
118#[derive(Clone, Copy, Debug, Pod, Zeroable)]
119pub struct Unstake {
120    pub amount: [u8; 8],
121}
122
123instruction!(PoolInstruction, Attribute);
124instruction!(PoolInstruction, Claim);
125instruction!(PoolInstruction, Commit);
126instruction!(PoolInstruction, Launch);
127instruction!(PoolInstruction, OpenShare);
128instruction!(PoolInstruction, OpenStake);
129instruction!(PoolInstruction, Join);
130instruction!(PoolInstruction, Stake);
131instruction!(PoolInstruction, Submit);
132instruction!(PoolInstruction, Unstake);