Skip to main content

ore_stake_api/
instruction.rs

1use steel::*;
2
3#[repr(u8)]
4#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
5pub enum OreStakeInstruction {
6    // Misc
7    Log = 0,
8    Initialize = 1,
9    Distribute = 2,
10
11    // Staker
12    Deposit = 10,
13    Withdraw = 11,
14    ClaimYield = 12,
15    CompoundYield = 13,
16
17    // Migration
18    MigrateStake = 20,
19    MigrateTreasury = 21,
20}
21
22#[repr(C)]
23#[derive(Clone, Copy, Debug, Pod, Zeroable)]
24pub struct Log {}
25
26#[repr(C)]
27#[derive(Clone, Copy, Debug, Pod, Zeroable)]
28pub struct Deposit {
29    pub amount: [u8; 8],
30    pub compound_fee: [u8; 8],
31}
32
33#[repr(C)]
34#[derive(Clone, Copy, Debug, Pod, Zeroable)]
35pub struct Withdraw {
36    pub amount: [u8; 8],
37}
38
39#[repr(C)]
40#[derive(Clone, Copy, Debug, Pod, Zeroable)]
41pub struct ClaimYield {
42    pub amount: [u8; 8],
43}
44
45#[repr(C)]
46#[derive(Clone, Copy, Debug, Pod, Zeroable)]
47pub struct CompoundYield {}
48
49#[repr(C)]
50#[derive(Clone, Copy, Debug, Pod, Zeroable)]
51pub struct Distribute {
52    pub amount: [u8; 8],
53}
54
55#[repr(C)]
56#[derive(Clone, Copy, Debug, Pod, Zeroable)]
57pub struct Initialize {}
58
59#[repr(C)]
60#[derive(Clone, Copy, Debug, Pod, Zeroable)]
61pub struct MigrateStake {}
62
63#[repr(C)]
64#[derive(Clone, Copy, Debug, Pod, Zeroable)]
65pub struct MigrateTreasury {}
66
67instruction!(OreStakeInstruction, Log);
68instruction!(OreStakeInstruction, Initialize);
69instruction!(OreStakeInstruction, Distribute);
70instruction!(OreStakeInstruction, Deposit);
71instruction!(OreStakeInstruction, Withdraw);
72instruction!(OreStakeInstruction, ClaimYield);
73instruction!(OreStakeInstruction, CompoundYield);
74instruction!(OreStakeInstruction, MigrateStake);
75instruction!(OreStakeInstruction, MigrateTreasury);