mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-23 22:08:05 +00:00
17 lines
426 B
Rust
17 lines
426 B
Rust
use crate::error::ClientResult;
|
|||
|
|
use crate::instruction::logs_filter::{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(())
|
||
|
|
}
|