diff --git a/Cargo.toml b/Cargo.toml index 33113ba..5c3e5db 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,6 @@ serde-big-array = "0.5.1" futures = "0.3.32" bincode = "1.3" anyhow = "1.0.102" -bs58 = "0.5.1" yellowstone-grpc-client = { version = "10.2.0" } yellowstone-grpc-proto = { version = "10.1.1" } tokio = { version = "1.50.0", features = ["full", "rt-multi-thread"]} diff --git a/src/streaming/event_parser/common/types.rs b/src/streaming/event_parser/common/types.rs index 700929e..f82f51e 100755 --- a/src/streaming/event_parser/common/types.rs +++ b/src/streaming/event_parser/common/types.rs @@ -2,7 +2,7 @@ use borsh::{BorshDeserialize, BorshSerialize}; use crossbeam_queue::ArrayQueue; use serde::{Deserialize, Serialize}; use solana_sdk::{pubkey::Pubkey, signature::Signature}; -use std::{borrow::Cow, fmt, str::FromStr, sync::Arc}; +use std::{borrow::Cow, fmt, sync::Arc}; use crate::streaming::event_parser::DexEvent; @@ -169,8 +169,6 @@ impl fmt::Display for EventType { } } - - #[derive( Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, BorshSerialize, BorshDeserialize, )] @@ -243,11 +241,11 @@ impl EventMetadata { } static SOL_MINT: std::sync::LazyLock = - std::sync::LazyLock::new(|| Pubkey::from_str("So11111111111111111111111111111111111111111").unwrap()); + std::sync::LazyLock::new(spl_token::native_mint::id); static SYSTEM_PROGRAMS: std::sync::LazyLock<[Pubkey; 3]> = std::sync::LazyLock::new(|| [ - Pubkey::from_str("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA").unwrap(), - Pubkey::from_str("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb").unwrap(), - Pubkey::from_str("11111111111111111111111111111111").unwrap(), + spl_token::id(), + spl_token_2022::id(), + solana_sdk::pubkey!("11111111111111111111111111111111"), ]); /// Trait abstracting over different inner-instruction types for swap data extraction diff --git a/src/streaming/event_parser/core/event_parser.rs b/src/streaming/event_parser/core/event_parser.rs index d7703a0..db3b436 100644 --- a/src/streaming/event_parser/core/event_parser.rs +++ b/src/streaming/event_parser/core/event_parser.rs @@ -85,7 +85,7 @@ impl EventParser { let recent_blockhash = if message.recent_blockhash.is_empty() { None } else { - Some(bs58::encode(&message.recent_blockhash).into_string()) + Some(solana_sdk::bs58::encode(&message.recent_blockhash).into_string()) }; Self::parse_instruction_events_from_grpc_transaction( protocols, diff --git a/src/streaming/shred_stream.rs b/src/streaming/shred_stream.rs index 6ff6b86..bff8f36 100755 --- a/src/streaming/shred_stream.rs +++ b/src/streaming/shred_stream.rs @@ -12,7 +12,7 @@ use crate::streaming::event_parser::{Protocol, DexEvent}; use crate::streaming::grpc::MetricsManager; use crate::streaming::shred::pool::factory; use log::error; -use solana_entry::entry::Entry; +use solana_entry::entry::Entry as SolanaEntry; use super::ShredStreamGrpc; @@ -49,7 +49,7 @@ impl ShredStreamGrpc { while let Some(message) = stream.next().await { match message { Ok(msg) => { - if let Ok(entries) = bincode::deserialize::>(&msg.entries) { + if let Ok(entries) = bincode::deserialize::>(&msg.entries) { for entry in entries { for (tx_index, transaction) in entry.transactions.iter().enumerate() { let transaction_with_slot =