carbon_solayer_restaking_program_decoder/accounts/
restaking_pool.rs1use solana_pubkey::Pubkey;
3
4#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5#[derive(Debug, Clone, borsh::BorshSerialize, borsh::BorshDeserialize, PartialEq)]
6pub struct RestakingPool {
7 pub lst_mint: Pubkey,
8 pub rst_mint: Pubkey,
9 pub bump: u8,
10}
11
12impl RestakingPool {
13 pub fn decode(data: &[u8]) -> Option<Self> {
14 if data.len() < 8 {
15 return None;
16 }
17 let discriminator = &data[0..8];
18 if discriminator != [12, 5, 100, 143, 125, 94, 26, 214] {
19 return None;
20 }
21
22 let mut data_slice = data;
23
24 data_slice = &data_slice[8..];
25
26 borsh::BorshDeserialize::deserialize(&mut data_slice).ok()
27 }
28}