feat: pass is_cashback_coin from events; PumpFun examples use sol-parser-sdk only

- PumpFunParams/BondingCurve: from_trade/from_dev_trade take is_cashback_coin parameter
- pumpfun_copy_trading and pumpfun_sniper_trading use sol-parser-sdk for gRPC, pass e.is_cashback_coin
- address_lookup/nonce_cache call sites updated; README EN/CN Cashback and example notes

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Wood
2026-02-19 01:34:12 +08:00
co-authored by Cursor
parent 9a8e3ffb2d
commit c27e479659
10 changed files with 276 additions and 237 deletions
+8 -2
View File
@@ -65,6 +65,8 @@ pub struct BondingCurveAccount {
}
impl BondingCurveAccount {
/// When building from event/parser data (e.g. sol-parser-sdk), pass the token's cashback flag
/// so that sell instructions include the correct remaining accounts. From RPC use `from_mint_by_rpc` instead.
pub fn from_dev_trade(
bonding_curve: Pubkey,
mint: &Pubkey,
@@ -72,6 +74,7 @@ impl BondingCurveAccount {
dev_sol_amount: u64,
creator: Pubkey,
is_mayhem_mode: bool,
is_cashback_coin: bool,
) -> Self {
let account = if bonding_curve != Pubkey::default() {
bonding_curve
@@ -89,10 +92,12 @@ impl BondingCurveAccount {
complete: false,
creator: creator,
is_mayhem_mode: is_mayhem_mode,
is_cashback_coin: false,
is_cashback_coin,
}
}
/// When building from event/parser data (e.g. sol-parser-sdk), pass the token's cashback flag
/// so that sell instructions include the correct remaining accounts. From RPC use `from_mint_by_rpc` instead.
pub fn from_trade(
bonding_curve: Pubkey,
mint: Pubkey,
@@ -102,6 +107,7 @@ impl BondingCurveAccount {
real_token_reserves: u64,
real_sol_reserves: u64,
is_mayhem_mode: bool,
is_cashback_coin: bool,
) -> Self {
let account = if bonding_curve != Pubkey::default() {
bonding_curve
@@ -119,7 +125,7 @@ impl BondingCurveAccount {
complete: false,
creator: creator,
is_mayhem_mode: is_mayhem_mode,
is_cashback_coin: false,
is_cashback_coin,
}
}