feat: update PumpSwap event parser with token program fields

This commit is contained in:
ysq
2025-08-24 23:14:51 +08:00
parent a1a453fe05
commit f87f3dd7f3
5 changed files with 17 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "solana-streamer-sdk"
version = "0.3.9"
version = "0.3.10"
edition = "2021"
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
repository = "https://github.com/0xfnzero/solana-streamer"
+2 -2
View File
@@ -45,14 +45,14 @@ Add the dependency to your `Cargo.toml`:
```toml
# Add to your Cargo.toml
solana-streamer-sdk = { path = "./solana-streamer", version = "0.3.9" }
solana-streamer-sdk = { path = "./solana-streamer", version = "0.3.10" }
```
### Use crates.io
```toml
# Add to your Cargo.toml
solana-streamer-sdk = "0.3.9"
solana-streamer-sdk = "0.3.10"
```
## Usage Examples
+2 -2
View File
@@ -45,14 +45,14 @@ git clone https://github.com/0xfnzero/solana-streamer
```toml
# 添加到您的 Cargo.toml
solana-streamer-sdk = { path = "./solana-streamer", version = "0.3.9" }
solana-streamer-sdk = { path = "./solana-streamer", version = "0.3.10" }
```
### 使用 crates.io
```toml
# 添加到您的 Cargo.toml
solana-streamer-sdk = "0.3.9"
solana-streamer-sdk = "0.3.10"
```
## 使用示例
@@ -51,6 +51,10 @@ pub struct PumpSwapBuyEvent {
pub coin_creator_vault_ata: Pubkey,
#[borsh(skip)]
pub coin_creator_vault_authority: Pubkey,
#[borsh(skip)]
pub base_token_program: Pubkey,
#[borsh(skip)]
pub quote_token_program: Pubkey,
}
pub const PUMP_SWAP_BUY_EVENT_LOG_SIZE: usize = 385;
@@ -130,6 +134,10 @@ pub struct PumpSwapSellEvent {
pub coin_creator_vault_ata: Pubkey,
#[borsh(skip)]
pub coin_creator_vault_authority: Pubkey,
#[borsh(skip)]
pub base_token_program: Pubkey,
#[borsh(skip)]
pub quote_token_program: Pubkey,
}
pub const PUMP_SWAP_SELL_EVENT_LOG_SIZE: usize = 352;
@@ -204,6 +204,8 @@ impl PumpSwapEventParser {
pool_quote_token_account: accounts[8],
protocol_fee_recipient: accounts[9],
protocol_fee_recipient_token_account: accounts[10],
base_token_program: accounts[11],
quote_token_program: accounts[12],
coin_creator_vault_ata: accounts.get(17).copied().unwrap_or_default(),
coin_creator_vault_authority: accounts.get(18).copied().unwrap_or_default(),
..Default::default()
@@ -243,6 +245,8 @@ impl PumpSwapEventParser {
pool_quote_token_account: accounts[8],
protocol_fee_recipient: accounts[9],
protocol_fee_recipient_token_account: accounts[10],
base_token_program: accounts[11],
quote_token_program: accounts[12],
coin_creator_vault_ata: accounts.get(17).copied().unwrap_or_default(),
coin_creator_vault_authority: accounts.get(18).copied().unwrap_or_default(),
..Default::default()