firelaunch_io_firelaunch_client/generated/accounts/
curve_native_pool.rs

1//! This code was AUTOGENERATED using the kinobi library.
2//! Please DO NOT EDIT THIS FILE, instead use visitors
3//! to add features, then rerun kinobi to update it.
4//!
5//! <https://github.com/kinobi-so/kinobi>
6//!
7
8use borsh::BorshDeserialize;
9use borsh::BorshSerialize;
10
11#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
12#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
13pub struct CurveNativePool {
14    pub discriminator: [u8; 8],
15    pub bump: u8,
16}
17
18impl CurveNativePool {
19    pub const LEN: usize = 9;
20
21    #[inline(always)]
22    pub fn from_bytes(data: &[u8]) -> Result<Self, std::io::Error> {
23        let mut data = data;
24        Self::deserialize(&mut data)
25    }
26}
27
28impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for CurveNativePool {
29    type Error = std::io::Error;
30
31    fn try_from(
32        account_info: &solana_program::account_info::AccountInfo<'a>,
33    ) -> Result<Self, Self::Error> {
34        let mut data: &[u8] = &(*account_info.data).borrow();
35        Self::deserialize(&mut data)
36    }
37}
38
39#[cfg(feature = "anchor")]
40impl anchor_lang::AccountDeserialize for CurveNativePool {
41    fn try_deserialize_unchecked(buf: &mut &[u8]) -> anchor_lang::Result<Self> {
42        Ok(Self::deserialize(buf)?)
43    }
44}
45
46#[cfg(feature = "anchor")]
47impl anchor_lang::AccountSerialize for CurveNativePool {}
48
49#[cfg(feature = "anchor")]
50impl anchor_lang::Owner for CurveNativePool {
51    fn owner() -> Pubkey {
52        crate::FIRELAUNCH_ID
53    }
54}
55
56#[cfg(feature = "anchor-idl-build")]
57impl anchor_lang::IdlBuild for CurveNativePool {}
58
59#[cfg(feature = "anchor-idl-build")]
60impl anchor_lang::Discriminator for CurveNativePool {
61    const DISCRIMINATOR: [u8; 8] = [0; 8];
62}