feat: PumpSwap/PumpFun improvements, align with pump-public-docs, sync IDL
- Re-apply PumpSwap pool lookup, lib/utils/seed changes (no Fastlane) - pump-public-docs: Mayhem fee recipient at index 11 use WSOL ATA; random mayhem fee recipients (PumpSwap + PumpFun); Pool decode 244 bytes - Sync idl (pump.json, pump_amm.json, pump_fees.json) from pump-fun/pump-public-docs Made-with: Cursor
This commit is contained in:
@@ -31,6 +31,23 @@ impl TradingClient {
|
||||
trading::common::utils::get_token_balance(&self.infrastructure.rpc, &self.payer.pubkey(), mint).await
|
||||
}
|
||||
|
||||
/// 使用与交易一致的 ATA 推导(含 seed 优化)查询 payer 某 mint 的余额;卖出前查余额应使用此接口并传入池的 base_token_program,否则若使用 seed ATA 会查错账户。
|
||||
#[inline]
|
||||
pub async fn get_payer_token_balance_with_program(
|
||||
&self,
|
||||
mint: &Pubkey,
|
||||
token_program: &Pubkey,
|
||||
) -> Result<u64, anyhow::Error> {
|
||||
trading::common::utils::get_token_balance_with_options(
|
||||
&self.infrastructure.rpc,
|
||||
&self.payer.pubkey(),
|
||||
mint,
|
||||
token_program,
|
||||
self.use_seed_optimize,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_payer_pubkey(&self) -> Pubkey {
|
||||
self.payer.pubkey()
|
||||
|
||||
Reference in New Issue
Block a user