entropy_api/state/
mod.rs

1mod var;
2
3pub use var::*;
4
5use steel::*;
6
7use crate::consts::*;
8
9#[repr(u8)]
10#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
11pub enum EntropyAccount {
12    Var = 0,
13}
14
15/// Fetch PDA of the var account.
16pub fn var_pda(authority: Pubkey, id: u64) -> (Pubkey, u8) {
17    Pubkey::find_program_address(
18        &[VAR, &authority.to_bytes(), &id.to_le_bytes()],
19        &crate::id(),
20    )
21}