Revert "feat:check if the account exists before selling"
This reverts commit fa941174c2.
This commit is contained in:
@@ -110,16 +110,6 @@ impl InstructionBuilder for PumpFunInstructionBuilder {
|
|||||||
let creator_vault_pda = get_creator_vault_pda(¶ms.creator).unwrap();
|
let creator_vault_pda = get_creator_vault_pda(¶ms.creator).unwrap();
|
||||||
let ata = get_associated_token_address(¶ms.payer.pubkey(), ¶ms.mint);
|
let ata = get_associated_token_address(¶ms.payer.pubkey(), ¶ms.mint);
|
||||||
|
|
||||||
// 检查账户是否存在
|
|
||||||
if let Some(rpc) = ¶ms.rpc {
|
|
||||||
let account_info = rpc.get_account(&ata).await;
|
|
||||||
if account_info.is_err() {
|
|
||||||
return Err(anyhow!("account not exists"));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return Err(anyhow!("RPC client is required to check account existence"));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取代币余额
|
// 获取代币余额
|
||||||
let balance_u64 = if let Some(rpc) = ¶ms.rpc {
|
let balance_u64 = if let Some(rpc) = ¶ms.rpc {
|
||||||
let balance = rpc.get_token_account_balance(&ata).await?;
|
let balance = rpc.get_token_account_balance(&ata).await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user