Skip to main content

sol_parser_sdk/
lib.rs

1#![allow(clippy::too_many_arguments)]
2
3// 核心模块 - 扁平化结构
4pub mod accounts; // 账户解析器
5pub mod common;
6pub mod core;
7pub mod instr; // 指令解析器
8pub mod logs; // 日志解析器
9pub mod utils;
10pub mod warmup; // 预热模块
11
12// gRPC 模块 - 支持gRPC订阅和过滤
13pub mod grpc;
14
15// ShredStream 模块 - 支持 Jito ShredStream 订阅
16pub mod shredstream;
17
18// RPC 解析模块 - 支持直接从RPC解析交易
19pub mod rpc_parser;
20
21// 兼容性别名
22pub mod parser {
23    pub use crate::core::*;
24}
25
26// 重新导出主要API - 简化的单一入口解析器
27pub use core::{
28    parse_logs_only,
29    parse_logs_streaming,
30    // 主要解析函数
31    parse_transaction_events,
32    // 流式解析函数
33    parse_transaction_events_streaming,
34    parse_transaction_with_listener,
35    parse_transaction_with_streaming_listener,
36    // 事件类型
37    DexEvent,
38    // 事件监听器
39    EventListener,
40    EventMetadata,
41    ParsedEvent,
42    StreamingEventListener,
43};
44
45// 导出预热函数
46pub use warmup::warmup_parser;
47
48// 导出 RPC 解析函数
49pub use rpc_parser::{
50    convert_rpc_to_grpc, parse_rpc_transaction, parse_transaction_from_rpc, ParseError,
51};
52
53// 账户 / RPC 工具(非 DEX 业务)
54pub use accounts::{rpc_resolve_user_wallet_pubkey, user_wallet_pubkey_for_onchain_account};