Skip to main content

pump_rust_client/
state.rs

1use crate::account_wrapper::AccountWrapper;
2
3// `SharingConfig` is re-exported unwrapped because the IDL-generated struct
4// does not derive `Default`, so it cannot satisfy `AccountWrapper`'s
5// `AccountDeserialize` bound. Same for `pump_amm::SharingConfig` below.
6pub use crate::pump::accounts::SharingConfig;
7pub(crate) use crate::pump::accounts::{
8    BondingCurve as BondingCurveFromIdl, FeeConfig as FeeConfigFromIdl, Global as GlobalFromIdl,
9    GlobalVolumeAccumulator as GlobalVolumeAccumulatorFromIdl,
10    UserVolumeAccumulator as UserVolumeAccumulatorFromIdl,
11};
12
13pub type BondingCurve = AccountWrapper<BondingCurveFromIdl>;
14pub type FeeConfig = AccountWrapper<FeeConfigFromIdl>;
15pub type Global = AccountWrapper<GlobalFromIdl>;
16pub type GlobalVolumeAccumulator = AccountWrapper<GlobalVolumeAccumulatorFromIdl>;
17pub type UserVolumeAccumulator = AccountWrapper<UserVolumeAccumulatorFromIdl>;
18
19pub mod pump_amm {
20    use crate::account_wrapper::AccountWrapper;
21
22    pub(crate) use crate::pump_amm::accounts::{
23        GlobalConfig as GlobalConfigFromIdl,
24        GlobalVolumeAccumulator as GlobalVolumeAccumulatorFromIdl, Pool as PoolFromIdl,
25        UserVolumeAccumulator as UserVolumeAccumulatorFromIdl,
26    };
27
28    pub type GlobalConfig = AccountWrapper<GlobalConfigFromIdl>;
29    pub type GlobalVolumeAccumulator = AccountWrapper<GlobalVolumeAccumulatorFromIdl>;
30    pub type Pool = AccountWrapper<PoolFromIdl>;
31    pub type UserVolumeAccumulator = AccountWrapper<UserVolumeAccumulatorFromIdl>;
32}
33
34pub mod pump_agent_payments {
35    use crate::account_wrapper::AccountWrapper;
36
37    pub(crate) use crate::pump_agent_payments::accounts::{
38        GlobalConfig as GlobalConfigFromIdl,
39        TokenAgentPaymentInCurrency as TokenAgentPaymentInCurrencyIdl,
40        TokenAgentPayments as TokenAgentPaymentsIdl,
41    };
42
43    pub type GlobalConfig = AccountWrapper<GlobalConfigFromIdl>;
44    pub type TokenAgentPaymentInCurrency = AccountWrapper<TokenAgentPaymentInCurrencyIdl>;
45    pub type TokenAgentPayments = AccountWrapper<TokenAgentPaymentsIdl>;
46}