diff --git a/Cargo.toml b/Cargo.toml index a73090f..c78ac55 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "solana-streamer-sdk" -version = "0.3.0" +version = "0.3.1" edition = "2021" authors = ["William ", "sgxiang ", "wei <1415121722@qq.com>"] repository = "https://github.com/0xfnzero/solana-streamer" diff --git a/README.md b/README.md index ec72e36..d541891 100755 --- a/README.md +++ b/README.md @@ -44,14 +44,14 @@ Add the dependency to your `Cargo.toml`: ```toml # Add to your Cargo.toml -solana-streamer-sdk = { path = "./solana-streamer", version = "0.3.0" } +solana-streamer-sdk = { path = "./solana-streamer", version = "0.3.1" } ``` ### Use crates.io ```toml # Add to your Cargo.toml -solana-streamer-sdk = "0.3.0" +solana-streamer-sdk = "0.3.1" ``` ## Usage Examples diff --git a/README_CN.md b/README_CN.md index 7fde389..c5be0de 100644 --- a/README_CN.md +++ b/README_CN.md @@ -44,14 +44,14 @@ git clone https://github.com/0xfnzero/solana-streamer ```toml # 添加到您的 Cargo.toml -solana-streamer-sdk = { path = "./solana-streamer", version = "0.3.0" } +solana-streamer-sdk = { path = "./solana-streamer", version = "0.3.1" } ``` ### 使用 crates.io ```toml # 添加到您的 Cargo.toml -solana-streamer-sdk = "0.3.0" +solana-streamer-sdk = "0.3.1" ``` ## 使用示例 diff --git a/src/streaming/event_parser/protocols/pumpfun/events.rs b/src/streaming/event_parser/protocols/pumpfun/events.rs index 14ab0bc..11f33a1 100755 --- a/src/streaming/event_parser/protocols/pumpfun/events.rs +++ b/src/streaming/event_parser/protocols/pumpfun/events.rs @@ -66,14 +66,7 @@ pub struct PumpFunTradeEvent { pub total_claimed_tokens: u64, pub current_sol_volume: u64, pub last_update_timestamp: i64, - #[borsh(skip)] - pub bonding_curve: Pubkey, - #[borsh(skip)] - pub associated_bonding_curve: Pubkey, - #[borsh(skip)] - pub associated_user: Pubkey, - #[borsh(skip)] - pub creator_vault: Pubkey, + #[borsh(skip)] pub max_sol_cost: u64, #[borsh(skip)] @@ -84,6 +77,31 @@ pub struct PumpFunTradeEvent { pub is_bot: bool, #[borsh(skip)] pub is_dev_create_token_trade: bool, // 是否是dev创建token的交易 + + #[borsh(skip)] + pub global: Pubkey, + // #[borsh(skip)] + // pub fee_recipient: Pubkey, + // #[borsh(skip)] + // pub mint: Pubkey, + #[borsh(skip)] + pub bonding_curve: Pubkey, + #[borsh(skip)] + pub associated_bonding_curve: Pubkey, + #[borsh(skip)] + pub associated_user: Pubkey, + // #[borsh(skip)] + // pub user: Pubkey, + #[borsh(skip)] + pub system_program: Pubkey, + #[borsh(skip)] + pub token_program: Pubkey, + #[borsh(skip)] + pub creator_vault: Pubkey, + #[borsh(skip)] + pub event_authority: Pubkey, + #[borsh(skip)] + pub program: Pubkey, #[borsh(skip)] pub global_volume_accumulator: Pubkey, #[borsh(skip)] diff --git a/src/streaming/event_parser/protocols/pumpfun/parser.rs b/src/streaming/event_parser/protocols/pumpfun/parser.rs index 2589897..7a4e399 100755 --- a/src/streaming/event_parser/protocols/pumpfun/parser.rs +++ b/src/streaming/event_parser/protocols/pumpfun/parser.rs @@ -183,13 +183,18 @@ impl PumpFunEventParser { metadata.set_id(format!("{}-{}-{}-{}", metadata.signature, accounts[2], accounts[6], true)); Some(Box::new(PumpFunTradeEvent { metadata, + global: accounts[0], fee_recipient: accounts[1], mint: accounts[2], bonding_curve: accounts[3], associated_bonding_curve: accounts[4], associated_user: accounts[5], user: accounts[6], + system_program: accounts[7], + token_program: accounts[8], creator_vault: accounts[9], + event_authority: accounts[10], + program: accounts[11], global_volume_accumulator: accounts[12], user_volume_accumulator: accounts[13], max_sol_cost, @@ -215,13 +220,20 @@ impl PumpFunEventParser { .set_id(format!("{}-{}-{}-{}", metadata.signature, accounts[2], accounts[6], false)); Some(Box::new(PumpFunTradeEvent { metadata, + global: accounts[0], fee_recipient: accounts[1], mint: accounts[2], bonding_curve: accounts[3], associated_bonding_curve: accounts[4], associated_user: accounts[5], user: accounts[6], - creator_vault: accounts[9], + system_program: accounts[7], + creator_vault: accounts[8], + token_program: accounts[9], + event_authority: accounts[10], + program: accounts[11], + global_volume_accumulator: *accounts.get(12).unwrap_or(&Pubkey::default()), + user_volume_accumulator: *accounts.get(13).unwrap_or(&Pubkey::default()), min_sol_output, amount, is_buy: false,