1mod treasury;
7mod user;
8
9pub use treasury::*;
10pub use user::*;
11
12use crate::consts::{TREASURY, USER_TICKET};
13
14use num_enum::{IntoPrimitive, TryFromPrimitive};
15use steel::*;
16
17#[repr(u8)]
18#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimitive)]
19pub enum StreakAccount {
20 Treasury = 1,
21 User = 2,
22}
23
24pub fn treasury_pda() -> (Pubkey, u8) {
25 Pubkey::find_program_address(&[TREASURY], &crate::ID)
26}
27
28pub fn user_pda(user: &Pubkey) -> (Pubkey, u8) {
30 Pubkey::find_program_address(&[USER_TICKET, user.as_ref()], &crate::ID)
31}