Files
solana-streamer/crates/pumpfun/src/instruction/logs_process.rs
T
2025-01-02 14:33:00 +08:00

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(())
}