mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-22 13:28:08 +00:00
feat: update PumpSwap event parser with token program fields
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "solana-streamer-sdk"
|
name = "solana-streamer-sdk"
|
||||||
version = "0.3.9"
|
version = "0.3.10"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
|
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
|
||||||
repository = "https://github.com/0xfnzero/solana-streamer"
|
repository = "https://github.com/0xfnzero/solana-streamer"
|
||||||
|
|||||||
@@ -45,14 +45,14 @@ Add the dependency to your `Cargo.toml`:
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# Add to your Cargo.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
|
### Use crates.io
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# Add to your Cargo.toml
|
# Add to your Cargo.toml
|
||||||
solana-streamer-sdk = "0.3.9"
|
solana-streamer-sdk = "0.3.10"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage Examples
|
## Usage Examples
|
||||||
|
|||||||
+2
-2
@@ -45,14 +45,14 @@ git clone https://github.com/0xfnzero/solana-streamer
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# 添加到您的 Cargo.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
|
### 使用 crates.io
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# 添加到您的 Cargo.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,
|
pub coin_creator_vault_ata: Pubkey,
|
||||||
#[borsh(skip)]
|
#[borsh(skip)]
|
||||||
pub coin_creator_vault_authority: Pubkey,
|
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;
|
pub const PUMP_SWAP_BUY_EVENT_LOG_SIZE: usize = 385;
|
||||||
@@ -130,6 +134,10 @@ pub struct PumpSwapSellEvent {
|
|||||||
pub coin_creator_vault_ata: Pubkey,
|
pub coin_creator_vault_ata: Pubkey,
|
||||||
#[borsh(skip)]
|
#[borsh(skip)]
|
||||||
pub coin_creator_vault_authority: Pubkey,
|
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;
|
pub const PUMP_SWAP_SELL_EVENT_LOG_SIZE: usize = 352;
|
||||||
|
|||||||
@@ -204,6 +204,8 @@ impl PumpSwapEventParser {
|
|||||||
pool_quote_token_account: accounts[8],
|
pool_quote_token_account: accounts[8],
|
||||||
protocol_fee_recipient: accounts[9],
|
protocol_fee_recipient: accounts[9],
|
||||||
protocol_fee_recipient_token_account: accounts[10],
|
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_ata: accounts.get(17).copied().unwrap_or_default(),
|
||||||
coin_creator_vault_authority: accounts.get(18).copied().unwrap_or_default(),
|
coin_creator_vault_authority: accounts.get(18).copied().unwrap_or_default(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
@@ -243,6 +245,8 @@ impl PumpSwapEventParser {
|
|||||||
pool_quote_token_account: accounts[8],
|
pool_quote_token_account: accounts[8],
|
||||||
protocol_fee_recipient: accounts[9],
|
protocol_fee_recipient: accounts[9],
|
||||||
protocol_fee_recipient_token_account: accounts[10],
|
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_ata: accounts.get(17).copied().unwrap_or_default(),
|
||||||
coin_creator_vault_authority: accounts.get(18).copied().unwrap_or_default(),
|
coin_creator_vault_authority: accounts.get(18).copied().unwrap_or_default(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
|
|||||||
Reference in New Issue
Block a user