sol_shred_sdk/parser/mod.rs
1//! Transaction-level event parsers.
2
3mod pumpfun;
4
5use solana_sdk::transaction::VersionedTransaction;
6
7use crate::common::AnyResult;
8
9pub use pumpfun::{PumpfunEventParser, PumpfunParserConfig};
10
11/// Parser plug-in used by raw shred ingestion.
12///
13/// `sol-shred-sdk` owns shred networking/reassembly. Higher-level crates can
14/// implement this trait for their own event enum without reimplementing raw
15/// shred decoding.
16pub trait TransactionEventParser {
17 type Event: Send + 'static;
18
19 fn parse_transaction_events<F>(
20 &mut self,
21 transaction: &VersionedTransaction,
22 slot: u64,
23 tx_index: u64,
24 recv_us: i64,
25 emit: F,
26 ) -> AnyResult<usize>
27 where
28 F: FnMut(Self::Event);
29}