fix(pumpswap): Align GlobalConfig and Pool structures with IDL

- Remove non-existent fields from GlobalConfig: whitelist_pda, reserved_fee_recipient, mayhem_mode_enabled
- Remove non-existent field from Pool: is_mayhem_mode
- Adjust calculated sizes: GlobalConfig (345 bytes) and Pool (235 bytes)

These fields belong to PumpFun, not PumpSwap, and were causing deserialization errors.
This commit is contained in:
Estereg
2025-12-17 20:45:57 -03:00
parent e1c537554e
commit 58e4926cd8
@@ -20,12 +20,9 @@ pub struct GlobalConfig {
pub protocol_fee_recipients: [Pubkey; 8],
pub coin_creator_fee_basis_points: u64,
pub admin_set_coin_creator_authority: Pubkey,
pub whitelist_pda: Pubkey,
pub reserved_fee_recipient: Pubkey,
pub mayhem_mode_enabled: bool,
}
pub const GLOBAL_CONFIG_SIZE: usize = 32 + 8 + 8 + 1 + 32 * 8 + 8 + 32 + 32 + 32 + 1;
pub const GLOBAL_CONFIG_SIZE: usize = 32 + 8 + 8 + 1 + 32 * 8 + 8 + 32;
pub fn global_config_decode(data: &[u8]) -> Option<GlobalConfig> {
if data.len() < GLOBAL_CONFIG_SIZE {
@@ -70,10 +67,9 @@ pub struct Pool {
pub pool_quote_token_account: Pubkey,
pub lp_supply: u64,
pub coin_creator: Pubkey,
pub is_mayhem_mode: bool,
}
pub const POOL_SIZE: usize = 1 + 2 + 32 * 6 + 8 + 32 + 1;
pub const POOL_SIZE: usize = 1 + 2 + 32 * 6 + 8 + 32;
pub fn pool_decode(data: &[u8]) -> Option<Pool> {
if data.len() < POOL_SIZE {