Skip to main content

ore_stake_api/
event.rs

1use serde::{Deserialize, Serialize};
2use steel::*;
3
4pub enum OreStakeEvent {
5    Claim = 0,
6    Deposit = 1,
7    Distribute = 2,
8    Withdraw = 3,
9}
10
11#[repr(C)]
12#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
13pub struct ClaimEvent {
14    /// The event discriminator.
15    pub disc: u64,
16
17    /// The authority of the staker claiming.
18    pub authority: Pubkey,
19
20    /// The amount of ORE claimed.
21    pub amount: u64,
22
23    /// The timestamp of the event.
24    pub ts: i64,
25}
26
27#[repr(C)]
28#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
29pub struct DepositEvent {
30    /// The event discriminator.
31    pub disc: u64,
32
33    /// The authority of the staker depositing.
34    pub authority: Pubkey,
35
36    /// The amount of ORE deposited.
37    pub amount: u64,
38
39    /// The timestamp of the event.
40    pub ts: i64,
41}
42
43#[repr(C)]
44#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
45pub struct DistributeEvent {
46    /// The event discriminator.
47    pub disc: u64,
48
49    /// The amount of ORE distributed to stakers.
50    pub amount: u64,
51
52    /// The total amount of ORE staked at the time of distribution.
53    pub total_staked: u64,
54
55    /// The timestamp of the event.
56    pub ts: i64,
57}
58
59#[repr(C)]
60#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable, Serialize, Deserialize)]
61pub struct WithdrawEvent {
62    /// The event discriminator.
63    pub disc: u64,
64
65    /// The authority of the staker withdrawing.
66    pub authority: Pubkey,
67
68    /// The amount of ORE withdrawn.
69    pub amount: u64,
70
71    /// The timestamp of the event.
72    pub ts: i64,
73}
74
75event!(ClaimEvent);
76event!(DepositEvent);
77event!(DistributeEvent);
78event!(WithdrawEvent);