mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-16 10:28:05 +00:00
feat(event_parser): add requires_inner_instruction field to skip incomplete events
- Add requires_inner_instruction field to GenericEventParseConfig - Skip events that require but lack inner instruction data during processing - Set PumpFun migrate events to require inner instructions (prevents parsing failed migrations)
This commit is contained in:
@@ -40,6 +40,7 @@ impl PumpFunEventParser {
|
||||
event_type: EventType::PumpFunCreateToken,
|
||||
inner_instruction_parser: Some(Self::parse_create_token_inner_instruction),
|
||||
instruction_parser: Some(Self::parse_create_token_instruction),
|
||||
requires_inner_instruction: false,
|
||||
},
|
||||
GenericEventParseConfig {
|
||||
program_id: PUMPFUN_PROGRAM_ID,
|
||||
@@ -49,6 +50,7 @@ impl PumpFunEventParser {
|
||||
event_type: EventType::PumpFunBuy,
|
||||
inner_instruction_parser: Some(Self::parse_trade_inner_instruction),
|
||||
instruction_parser: Some(Self::parse_buy_instruction),
|
||||
requires_inner_instruction: false,
|
||||
},
|
||||
GenericEventParseConfig {
|
||||
program_id: PUMPFUN_PROGRAM_ID,
|
||||
@@ -58,6 +60,7 @@ impl PumpFunEventParser {
|
||||
event_type: EventType::PumpFunSell,
|
||||
inner_instruction_parser: Some(Self::parse_trade_inner_instruction),
|
||||
instruction_parser: Some(Self::parse_sell_instruction),
|
||||
requires_inner_instruction: false,
|
||||
},
|
||||
GenericEventParseConfig {
|
||||
program_id: PUMPFUN_PROGRAM_ID,
|
||||
@@ -67,6 +70,8 @@ impl PumpFunEventParser {
|
||||
event_type: EventType::PumpFunMigrate,
|
||||
inner_instruction_parser: Some(Self::parse_migrate_inner_instruction),
|
||||
instruction_parser: Some(Self::parse_migrate_instruction),
|
||||
// Failed migrations lack inner instruction data (typically "Bonding curve already migrated")
|
||||
requires_inner_instruction: true,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user