Skip to main content

sol_parser_sdk/core/
mod.rs

1//! Solana DEX 事件解析器核心模块
2//!
3//! 提供纯函数式的 DEX 事件解析能力,支持:
4//! - PumpFun、Bonk、PumpSwap、Raydium CLMM/CPMM
5//! - 指令+日志数据的智能合并
6//! - 零拷贝、高性能解析
7//! - 统一的事件格式
8
9// 核心模块
10pub mod events;             // 事件定义
11pub mod unified_parser;     // 统一解析器 - 单一入口
12pub mod account_dispatcher; // 账户填充调度器 - 主入口,路由到各协议
13pub mod account_fillers;    // 账户填充器实现 - 按协议拆分的具体实现
14pub mod common_filler;
15pub mod merger;             // 事件合并器 - instruction + inner instruction
16pub mod clock;              // 高性能时钟 - 微秒级时间戳获取
17pub mod cache;              // 解析器缓存 - 减少内存分配
18
19// 主要导出 - 核心事件处理功能
20pub use events::*;
21pub use unified_parser::{
22    parse_transaction_events, parse_logs_only, parse_transaction_with_listener, EventListener,
23    parse_transaction_events_streaming, parse_logs_streaming, parse_transaction_with_streaming_listener, StreamingEventListener
24};
25pub use clock::{now_micros, elapsed_micros_since, now_nanos};
26pub use cache::{build_account_pubkeys_with_cache, AccountPubkeyCache};
27
28pub use crate::accounts::{
29    parse_token_account, parse_nonce_account, AccountData,
30    is_nonce_account,
31    parse_account_unified,
32};
33
34// 兼容性类型
35pub type ParsedEvent = DexEvent;