Skip to main content

sol_parser_sdk/core/
mod.rs

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