diff --git a/Cargo.toml b/Cargo.toml index f81bbb5..4fd2510 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "solana-streamer-sdk" -version = "1.4.4" +version = "1.4.5" edition = "2021" authors = ["William ", "sgxiang ", "wei <1415121722@qq.com>"] repository = "https://github.com/0xfnzero/solana-streamer" @@ -15,14 +15,14 @@ crate-type = ["cdylib", "rlib"] [features] default = ["sdk-parse-borsh"] sdk-parse-borsh = ["sol-parser-sdk/parse-borsh"] -# If both parser backend features are enabled, sol-parser-sdk 0.4.9+ uses zero-copy. +# If both parser backend features are enabled, sol-parser-sdk 0.4.10+ uses zero-copy. sdk-parse-zero-copy = ["sol-parser-sdk/parse-zero-copy"] sdk-perf-stats = ["sol-parser-sdk/perf-stats"] sdk-ultra-perf = ["sol-parser-sdk/ultra-perf"] [dependencies] # Keep the streamer facade in lockstep with the sibling SDK while both crates evolve together. -sol-parser-sdk = { version = "0.4.9", default-features = false } +sol-parser-sdk = { version = "0.4.10", default-features = false } solana-sdk = "3.0.0" solana-client = "3.1.12" solana-transaction-status = "3.1.12" diff --git a/README.md b/README.md index 802f70d..8e53e29 100755 --- a/README.md +++ b/README.md @@ -123,33 +123,33 @@ Add the dependency to your `Cargo.toml`: ```toml # Add to your Cargo.toml -solana-streamer-sdk = { path = "./solana-streamer", version = "1.4.4" } +solana-streamer-sdk = { path = "./solana-streamer", version = "1.4.5" } ``` ### Use crates.io ```toml # Add to your Cargo.toml -solana-streamer-sdk = "1.4.4" +solana-streamer-sdk = "1.4.5" ``` Parser backend features: ```toml # Default: sol-parser-sdk parse-borsh backend -solana-streamer-sdk = "1.4.4" +solana-streamer-sdk = "1.4.5" # Zero-copy parser backend for latency-sensitive bots -solana-streamer-sdk = { version = "1.4.4", default-features = false, features = ["sdk-parse-zero-copy"] } +solana-streamer-sdk = { version = "1.4.5", default-features = false, features = ["sdk-parse-zero-copy"] } ``` -If both `sdk-parse-borsh` and `sdk-parse-zero-copy` are enabled, `sol-parser-sdk 0.4.9+` uses the zero-copy backend. +If both `sdk-parse-borsh` and `sdk-parse-zero-copy` are enabled, `sol-parser-sdk 0.4.10+` uses the zero-copy backend. ## 🔄 Migration Guide -### Upgrading to v1.4.4 +### Upgrading to v1.4.5 -Version 1.4.4 uses `sol-parser-sdk 0.4.9` from crates.io for all supported protocol parsing across Yellowstone gRPC, ShredStream, RPC transaction parsing, and account parsing while preserving the existing subscription and callback API. Existing bots can usually upgrade by changing only the crate version. +Version 1.4.5 uses `sol-parser-sdk 0.4.10` from crates.io and preserves PumpFun instruction args (`amount`, `max_sol_cost`, `min_sol_output`) across Yellowstone gRPC, ShredStream, RPC transaction parsing, and account parsing while preserving the existing subscription and callback API. Existing bots can usually upgrade by changing only the crate version. New optional capabilities: diff --git a/README_CN.md b/README_CN.md index 7dbc89a..45bd5a8 100644 --- a/README_CN.md +++ b/README_CN.md @@ -122,33 +122,33 @@ git clone https://github.com/0xfnzero/solana-streamer ```toml # 添加到您的 Cargo.toml -solana-streamer-sdk = { path = "./solana-streamer", version = "1.4.4" } +solana-streamer-sdk = { path = "./solana-streamer", version = "1.4.5" } ``` ### 使用 crates.io ```toml # 添加到您的 Cargo.toml -solana-streamer-sdk = "1.4.4" +solana-streamer-sdk = "1.4.5" ``` 解析后端 feature: ```toml # 默认:sol-parser-sdk parse-borsh 后端 -solana-streamer-sdk = "1.4.4" +solana-streamer-sdk = "1.4.5" # 面向低延迟 Bot 的 zero-copy 解析后端 -solana-streamer-sdk = { version = "1.4.4", default-features = false, features = ["sdk-parse-zero-copy"] } +solana-streamer-sdk = { version = "1.4.5", default-features = false, features = ["sdk-parse-zero-copy"] } ``` -如果同时启用 `sdk-parse-borsh` 和 `sdk-parse-zero-copy`,`sol-parser-sdk 0.4.9+` 会优先使用 zero-copy 后端。 +如果同时启用 `sdk-parse-borsh` 和 `sdk-parse-zero-copy`,`sol-parser-sdk 0.4.10+` 会优先使用 zero-copy 后端。 ## 🔄 迁移指南 -### 升级到 v1.4.4 +### 升级到 v1.4.5 -v1.4.4 使用 crates.io 上的 `sol-parser-sdk 0.4.9` 处理 Yellowstone gRPC、ShredStream、RPC 交易解析和账户解析中的所有当前支持协议,同时保留已有订阅和回调 API。大多数 Bot 只需要修改 crate 版本即可升级。 +v1.4.5 使用 crates.io 上的 `sol-parser-sdk 0.4.10`,并在 Yellowstone gRPC、ShredStream、RPC 交易解析和账户解析中保留 PumpFun 指令参数 `amount`、`max_sol_cost`、`min_sol_output`,同时保留已有订阅和回调 API。大多数 Bot 只需要修改 crate 版本即可升级。 新增可选能力: diff --git a/src/streaming/parser_sdk_bridge/mod.rs b/src/streaming/parser_sdk_bridge/mod.rs index 29d273e..9de4fac 100644 --- a/src/streaming/parser_sdk_bridge/mod.rs +++ b/src/streaming/parser_sdk_bridge/mod.rs @@ -62,6 +62,9 @@ mod tests { t.user = Pubkey::new_unique(); t.sol_amount = 100; t.token_amount = 200; + t.amount = 200; + t.max_sol_cost = 150; + t.min_sol_output = 0; t.is_buy = true; let ev = convert_parser_event(PbDexEvent::PumpFunTrade(t), None, 999).expect("convert"); @@ -71,6 +74,9 @@ mod tests { assert_eq!(st.metadata.recv_us, 999); assert_eq!(st.sol_amount, 100); assert_eq!(st.token_amount, 200); + assert_eq!(st.amount, 200); + assert_eq!(st.max_sol_cost, 150); + assert_eq!(st.min_sol_output, 0); assert!(st.is_buy); } _ => panic!("expected PumpFunTradeEvent"), diff --git a/src/streaming/parser_sdk_bridge/pump_pumpswap.rs b/src/streaming/parser_sdk_bridge/pump_pumpswap.rs index b656474..3409251 100644 --- a/src/streaming/parser_sdk_bridge/pump_pumpswap.rs +++ b/src/streaming/parser_sdk_bridge/pump_pumpswap.rs @@ -556,6 +556,9 @@ pub(crate) fn pumpfun_trade_from_parser_with_event_type( cashback_fee_basis_points: t.cashback_fee_basis_points, cashback: t.cashback, is_cashback_coin: t.is_cashback_coin, + amount: t.amount, + max_sol_cost: t.max_sol_cost, + min_sol_output: t.min_sol_output, ..Default::default() }; DexEvent::PumpFunTradeEvent(st)