Release solana-streamer-sdk v1.4.6

This commit is contained in:
0xfnzero
2026-05-18 01:53:25 +08:00
parent b60838a840
commit ea0f9b9145
9 changed files with 315 additions and 26 deletions
+37
View File
@@ -65,6 +65,24 @@ mod tests {
t.amount = 200;
t.max_sol_cost = 150;
t.min_sol_output = 0;
t.spendable_sol_in = 11;
t.spendable_quote_in = 12;
t.min_tokens_out = 13;
t.is_created_buy = true;
t.global = Pubkey::new_unique();
t.bonding_curve_v2 = Pubkey::new_unique();
t.associated_user = Pubkey::new_unique();
t.system_program = Pubkey::new_unique();
t.event_authority = Pubkey::new_unique();
t.program = Pubkey::new_unique();
t.global_volume_accumulator = Pubkey::new_unique();
t.user_volume_accumulator = Pubkey::new_unique();
t.fee_config = Pubkey::new_unique();
t.fee_program = Pubkey::new_unique();
t.quote_mint = Pubkey::new_unique();
t.quote_amount = 14;
t.virtual_quote_reserves = 15;
t.real_quote_reserves = 16;
t.is_buy = true;
let ev = convert_parser_event(PbDexEvent::PumpFunTrade(t), None, 999).expect("convert");
@@ -77,6 +95,25 @@ mod tests {
assert_eq!(st.amount, 200);
assert_eq!(st.max_sol_cost, 150);
assert_eq!(st.min_sol_output, 0);
assert_eq!(st.spendable_sol_in, 11);
assert_eq!(st.spendable_quote_in, 12);
assert_eq!(st.min_tokens_out, 13);
assert!(st.is_created_buy);
assert!(st.is_dev_create_token_trade);
assert_ne!(st.global, Pubkey::default());
assert_ne!(st.bonding_curve_v2, Pubkey::default());
assert_ne!(st.associated_user, Pubkey::default());
assert_ne!(st.system_program, Pubkey::default());
assert_ne!(st.event_authority, Pubkey::default());
assert_ne!(st.program, Pubkey::default());
assert_ne!(st.global_volume_accumulator, Pubkey::default());
assert_ne!(st.user_volume_accumulator, Pubkey::default());
assert_ne!(st.fee_config, Pubkey::default());
assert_ne!(st.fee_program, Pubkey::default());
assert_ne!(st.quote_mint, Pubkey::default());
assert_eq!(st.quote_amount, 14);
assert_eq!(st.virtual_quote_reserves, 15);
assert_eq!(st.real_quote_reserves, 16);
assert!(st.is_buy);
}
_ => panic!("expected PumpFunTradeEvent"),
@@ -379,6 +379,9 @@ pub(crate) fn pumpswap_buy_full_from_parser(
coin_creator_vault_authority: b.coin_creator_vault_authority,
base_token_program: b.base_token_program,
quote_token_program: b.quote_token_program,
pool_v2: b.pool_v2,
fee_recipient: b.fee_recipient,
fee_recipient_quote_token_account: b.fee_recipient_quote_token_account,
}
}
@@ -422,6 +425,9 @@ pub(crate) fn pumpswap_sell_full_from_parser(
coin_creator_vault_authority: s.coin_creator_vault_authority,
base_token_program: s.base_token_program,
quote_token_program: s.quote_token_program,
pool_v2: s.pool_v2,
fee_recipient: s.fee_recipient,
fee_recipient_quote_token_account: s.fee_recipient_quote_token_account,
}
}
@@ -546,19 +552,51 @@ pub(crate) fn pumpfun_trade_from_parser_with_event_type(
total_claimed_tokens: t.total_claimed_tokens,
current_sol_volume: t.current_sol_volume,
last_update_timestamp: t.last_update_timestamp,
global: t.global,
bonding_curve: t.bonding_curve,
bonding_curve_v2: t.bonding_curve_v2,
associated_bonding_curve: t.associated_bonding_curve,
associated_user: t.associated_user,
system_program: t.system_program,
token_program: t.token_program,
quote_token_program: t.quote_token_program,
associated_token_program: t.associated_token_program,
creator_vault: t.creator_vault,
associated_quote_fee_recipient: t.associated_quote_fee_recipient,
buyback_fee_recipient: t.buyback_fee_recipient,
associated_quote_buyback_fee_recipient: t.associated_quote_buyback_fee_recipient,
associated_quote_bonding_curve: t.associated_quote_bonding_curve,
associated_quote_user: t.associated_quote_user,
associated_creator_vault: t.associated_creator_vault,
sharing_config: t.sharing_config,
event_authority: t.event_authority,
program: t.program,
global_volume_accumulator: t.global_volume_accumulator,
user_volume_accumulator: t.user_volume_accumulator,
associated_user_volume_accumulator: t.associated_user_volume_accumulator,
fee_config: t.fee_config,
fee_program: t.fee_program,
account: t.account,
ix_name: t.ix_name,
mayhem_mode: t.mayhem_mode,
cashback_fee_basis_points: t.cashback_fee_basis_points,
cashback: t.cashback,
buyback_fee_basis_points: t.buyback_fee_basis_points,
buyback_fee: t.buyback_fee,
shareholders: t.shareholders.into_iter().map(pump_fees_shareholder_from_parser).collect(),
quote_mint: t.quote_mint,
quote_amount: t.quote_amount,
virtual_quote_reserves: t.virtual_quote_reserves,
real_quote_reserves: t.real_quote_reserves,
is_cashback_coin: t.is_cashback_coin,
is_created_buy: t.is_created_buy,
is_dev_create_token_trade: t.is_created_buy,
amount: t.amount,
max_sol_cost: t.max_sol_cost,
min_sol_output: t.min_sol_output,
spendable_sol_in: t.spendable_sol_in,
spendable_quote_in: t.spendable_quote_in,
min_tokens_out: t.min_tokens_out,
..Default::default()
};
DexEvent::PumpFunTradeEvent(st)