From 49acf2d7f78308b4e3e699db6d0fa5b1f33e1b07 Mon Sep 17 00:00:00 2001 From: ysq Date: Tue, 5 Aug 2025 18:28:13 +0800 Subject: [PATCH] feat: upgrade dependencies and bump to v0.2.15 --- Cargo.toml | 36 ++++++++++++++++++------------------ README.md | 4 ++-- README_CN.md | 4 ++-- src/protos/convert.rs | 6 +++--- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3dfc823..c2c3c39 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sol-trade-sdk" -version = "0.2.14" +version = "0.2.15" edition = "2021" authors = ["William ", "sgxiang ", "wei <1415121722@qq.com>"] repository = "https://github.com/0xfnzero/sol-trade-sdk" @@ -13,22 +13,22 @@ readme = "README.md" crate-type = ["cdylib", "rlib"] [dependencies] -solana-streamer-sdk = "0.1.9" -solana-sdk = "2.1.16" -solana-client = "2.1.16" -solana-program = "2.1.16" -solana-rpc-client = "2.1.16" -solana-rpc-client-api = "2.1.16" -solana-transaction-status = "2.1.16" -solana-account-decoder = "2.1.16" -solana-hash = "2.1.16" -solana-entry = "2.1.16" -solana-rpc-client-nonce-utils = "2.1.16" -solana-perf = "2.1.16" -solana-metrics = "2.1.16" +solana-streamer-sdk = "0.1.11" +solana-sdk = "2.3.0" +solana-client = "2.3.6" +solana-program = "2.3.0" +solana-rpc-client = "2.3.6" +solana-rpc-client-api = "2.3.6" +solana-transaction-status = "2.3.6" +solana-account-decoder = "2.3.6" +solana-hash = "2.3.0" +solana-entry = "2.3.6" +solana-rpc-client-nonce-utils = "2.3.6" +solana-perf = "2.3.6" +solana-metrics = "2.3.6" spl-token = "8.0.0" spl-token-2022 = { version = "8.0.0", features = ["no-entrypoint"] } -spl-associated-token-account = "6.0.0" +spl-associated-token-account = "7.0.0" borsh = { version = "1.5.3", features = ["derive"] } isahc = "1.7.2" serde = { version = "1.0.215", features = ["derive"] } @@ -40,8 +40,8 @@ bs58 = "0.5.1" rand = "0.9.0" bincode = "1.3.3" anyhow = "1.0.90" -yellowstone-grpc-client = { version = "6.0.0" } -yellowstone-grpc-proto = { version = "6.0.0" } +yellowstone-grpc-client = { version = "8.0.0" } +yellowstone-grpc-proto = { version = "8.0.0" } reqwest = { version = "0.12.12", features = ["json", "multipart"] } tokio = { version = "1.42.0" , features = ["full", "rt-multi-thread"]} tonic = { version = "0.12.3", features = ["tls", "tls-roots", "tls-webpki-roots"] } @@ -66,6 +66,6 @@ hex = "0.4.3" bytemuck = { version = "1.4.0" } arrayref = "0.3.6" borsh-derive = "1.5.5" -indicatif = "0.17.11" +indicatif = "0.18.0" pumpfun_program = { version = "4.3.0", package = "pumpfun" } solana-system-interface = "1.0.0" diff --git a/README.md b/README.md index 3d172e4..ece33ea 100755 --- a/README.md +++ b/README.md @@ -31,14 +31,14 @@ Add the dependency to your `Cargo.toml`: ```toml # Add to your Cargo.toml -sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.2.14" } +sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.2.15" } ``` ### Use crates.io ```toml # Add to your Cargo.toml -sol-trade-sdk = "0.2.14" +sol-trade-sdk = "0.2.15" ``` ## Usage Examples diff --git a/README_CN.md b/README_CN.md index fae21c1..84ae0fc 100755 --- a/README_CN.md +++ b/README_CN.md @@ -31,14 +31,14 @@ git clone https://github.com/0xfnzero/sol-trade-sdk ```toml # 添加到您的 Cargo.toml -sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.2.14" } +sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.2.15" } ``` ### 使用 crates.io ```toml # 添加到您的 Cargo.toml -sol-trade-sdk = "0.2.14" +sol-trade-sdk = "0.2.15" ``` ## 使用示例 diff --git a/src/protos/convert.rs b/src/protos/convert.rs index c0e9e1b..e975ee6 100755 --- a/src/protos/convert.rs +++ b/src/protos/convert.rs @@ -21,7 +21,7 @@ use crate::protos::{ /// Converts a Solana packet to a protobuf packet /// NOTE: the packet.data() function will filter packets marked for discard -pub fn packet_to_proto_packet(p: &Packet) -> Option { +pub fn packet_to_proto_packet(p: &solana_perf::packet::PacketRef<'_>) -> Option { Some(ProtoPacket { data: p.data(..)?.to_vec(), meta: Some(ProtoMeta { @@ -46,8 +46,8 @@ pub fn packet_batches_to_proto_packets( ) -> impl Iterator + '_ { batches .iter() - .flat_map(|b| b.iter().filter_map(packet_to_proto_packet)) -} + .flat_map(|b| b.iter().filter_map(|p| packet_to_proto_packet(&p))) + } /// converts from a protobuf packet to packet pub fn proto_packet_to_packet(p: &ProtoPacket) -> Packet {