mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-16 18:38:05 +00:00
Route gRPC, ShredStream, and account parsing through sol-parser-sdk. Remove local protocol parsing implementations. Depend on sol-parser-sdk v0.4.8 from crates.io.
38 lines
1023 B
Rust
38 lines
1023 B
Rust
use crate::streaming::event_parser::{
|
|
common::EventMetadata, core::EventDispatcher, DexEvent, Protocol,
|
|
};
|
|
use solana_sdk::pubkey::Pubkey;
|
|
|
|
pub use sol_parser_sdk::instr::program_ids::PUMPFUN_PROGRAM_ID;
|
|
|
|
pub fn parse_pumpfun_instruction_data(
|
|
discriminator: &[u8],
|
|
data: &[u8],
|
|
accounts: &[Pubkey],
|
|
metadata: EventMetadata,
|
|
) -> Option<DexEvent> {
|
|
EventDispatcher::dispatch_instruction(
|
|
Protocol::PumpFun,
|
|
discriminator,
|
|
data,
|
|
accounts,
|
|
metadata,
|
|
)
|
|
}
|
|
|
|
pub fn parse_pumpfun_inner_instruction_data(
|
|
discriminator: &[u8],
|
|
data: &[u8],
|
|
metadata: EventMetadata,
|
|
) -> Option<DexEvent> {
|
|
EventDispatcher::dispatch_inner_instruction(Protocol::PumpFun, discriminator, data, metadata)
|
|
}
|
|
|
|
pub fn parse_pumpfun_account_data(
|
|
discriminator: &[u8],
|
|
account: &crate::streaming::grpc::AccountPretty,
|
|
metadata: EventMetadata,
|
|
) -> Option<DexEvent> {
|
|
EventDispatcher::dispatch_account(Protocol::PumpFun, discriminator, account, metadata)
|
|
}
|