solana_tx_decoding/instruction/pumpfun/
is_pumpfun_event_instruction.rs1use solana_central::constants::PUMP_CONSTANTS;
2use solana_central::Instruction;
3
4pub fn is_pumpfun_event_instruction(instruction: &Instruction) -> bool {
8 if instruction.data.len() < 100 {
10 return false;
11 }
12 for i in 0..PUMP_CONSTANTS.bonding_curve_event_discriminator.len() {
14 if instruction.data[i] != PUMP_CONSTANTS.bonding_curve_event_discriminator[i] {
15 return false;
16 }
17 }
18 if instruction.tx_account_keys[instruction.program_id_index as usize] != PUMP_CONSTANTS.bonding_curve_program {
20 return false;
21 }
22 if instruction.accounts.len() < 1
24 || instruction.tx_account_keys[instruction.accounts[0] as usize] != PUMP_CONSTANTS.bonding_curve_event_authority
25 {
26 return false;
27 }
28 true
30}