mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-07 22:27:44 +00:00
17 lines
427 B
Rust
17 lines
427 B
Rust
use crate::error::ClientResult;
|
|
use crate::instruction::logs_filters::{LogFilter, DexInstruction};
|
|
|
|
pub async fn process_logs<F>(
|
|
signature: &str,
|
|
logs: Vec<String>,
|
|
callback: F,
|
|
) -> ClientResult<()>
|
|
where
|
|
F: Fn(&str, DexInstruction) + Send + Sync,
|
|
{
|
|
let instructions = LogFilter::parse_instruction(&logs)?;
|
|
for instruction in instructions {
|
|
callback(signature, instruction);
|
|
}
|
|
Ok(())
|
|
} |