mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-13 17:08:05 +00:00
feat: upgrade to v0.3.1 with enhanced PumpFun event parser
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "solana-streamer-sdk"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
edition = "2021"
|
||||
authors = ["William <byteblock6@gmail.com>", "sgxiang <sgxiang@gmail.com>", "wei <1415121722@qq.com>"]
|
||||
repository = "https://github.com/0xfnzero/solana-streamer"
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
-2
@@ -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"
|
||||
```
|
||||
|
||||
## 使用示例
|
||||
|
||||
@@ -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)]
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user