Revert "feat: Fastlane SWQoS, PumpSwap pool lookup and init robustness"
This reverts commit 1142829394.
This commit is contained in:
@@ -2,11 +2,7 @@ use solana_sdk::{pubkey::Pubkey, signature::Keypair, signer::Signer, transaction
|
||||
use solana_system_interface::instruction::transfer;
|
||||
|
||||
use crate::common::{
|
||||
fast_fn::{
|
||||
get_associated_token_address_with_program_id_fast,
|
||||
get_associated_token_address_with_program_id_fast_use_seed,
|
||||
},
|
||||
spl_token::close_account,
|
||||
fast_fn::get_associated_token_address_with_program_id_fast, spl_token::close_account,
|
||||
SolanaRpcClient,
|
||||
};
|
||||
use anyhow::anyhow;
|
||||
@@ -40,30 +36,10 @@ pub async fn get_token_balance(
|
||||
payer: &Pubkey,
|
||||
mint: &Pubkey,
|
||||
) -> Result<u64, anyhow::Error> {
|
||||
get_token_balance_with_options(
|
||||
rpc,
|
||||
let ata = crate::common::fast_fn::get_associated_token_address_with_program_id_fast(
|
||||
payer,
|
||||
mint,
|
||||
&crate::constants::TOKEN_PROGRAM,
|
||||
false,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
/// 使用与交易指令一致的 ATA 推导(可选 seed)查询余额;卖出/余额查询应与买入使用同一 ATA 地址。
|
||||
#[inline]
|
||||
pub async fn get_token_balance_with_options(
|
||||
rpc: &SolanaRpcClient,
|
||||
payer: &Pubkey,
|
||||
mint: &Pubkey,
|
||||
token_program: &Pubkey,
|
||||
use_seed: bool,
|
||||
) -> Result<u64, anyhow::Error> {
|
||||
let ata = get_associated_token_address_with_program_id_fast_use_seed(
|
||||
payer,
|
||||
mint,
|
||||
token_program,
|
||||
use_seed,
|
||||
);
|
||||
let balance = rpc.get_token_account_balance(&ata).await?;
|
||||
let balance_u64 =
|
||||
|
||||
Reference in New Issue
Block a user