remove logs
This commit is contained in:
@@ -131,10 +131,6 @@ pub fn buy(
|
|||||||
args: Buy,
|
args: Buy,
|
||||||
) -> Instruction {
|
) -> Instruction {
|
||||||
let bonding_curve: Pubkey = PumpFun::get_bonding_curve_pda(mint).unwrap();
|
let bonding_curve: Pubkey = PumpFun::get_bonding_curve_pda(mint).unwrap();
|
||||||
|
|
||||||
println!("user_ata: {:?}", get_associated_token_address(&payer.pubkey(), mint));
|
|
||||||
println!("bonding_curve_ata: {:?}", get_associated_token_address(&bonding_curve, mint));
|
|
||||||
|
|
||||||
Instruction::new_with_bytes(
|
Instruction::new_with_bytes(
|
||||||
constants::accounts::PUMPFUN,
|
constants::accounts::PUMPFUN,
|
||||||
&args.data(),
|
&args.data(),
|
||||||
|
|||||||
-30
@@ -255,34 +255,15 @@ impl PumpFun {
|
|||||||
) -> Result<String, ClientError> {
|
) -> Result<String, ClientError> {
|
||||||
let start_time = Instant::now();
|
let start_time = Instant::now();
|
||||||
|
|
||||||
println!("111111111111111111");
|
|
||||||
|
|
||||||
let jito_client = self.jito_client.as_ref()
|
let jito_client = self.jito_client.as_ref()
|
||||||
.ok_or_else(|| ClientError::Other("Jito client not found".to_string()))?;
|
.ok_or_else(|| ClientError::Other("Jito client not found".to_string()))?;
|
||||||
|
|
||||||
println!("222222222222222222");
|
|
||||||
|
|
||||||
let global_account = self.get_global_account()?;
|
let global_account = self.get_global_account()?;
|
||||||
|
|
||||||
println!("333333333333333333");
|
|
||||||
// let bonding_curve_account = self.get_bonding_curve_account(mint)?;
|
|
||||||
|
|
||||||
println!("444444444444444444");
|
|
||||||
// let buy_amount = bonding_curve_account
|
|
||||||
// .get_buy_price(max_sol_cost)
|
|
||||||
// .map_err(ClientError::BondingCurveError)?;
|
|
||||||
|
|
||||||
println!("555555555555555555");
|
|
||||||
let buy_amount_with_slippage =
|
let buy_amount_with_slippage =
|
||||||
utils::calculate_with_slippage_buy(max_sol_cost, slippage_basis_points.unwrap_or(DEFAULT_SLIPPAGE));
|
utils::calculate_with_slippage_buy(max_sol_cost, slippage_basis_points.unwrap_or(DEFAULT_SLIPPAGE));
|
||||||
|
|
||||||
println!("666666666666666666");
|
|
||||||
|
|
||||||
let mut instructions = vec![];
|
let mut instructions = vec![];
|
||||||
|
|
||||||
let tip_account = jito_client.get_tip_account().await?;
|
let tip_account = jito_client.get_tip_account().await?;
|
||||||
|
|
||||||
println!("777777777777777777");
|
|
||||||
let ata = get_associated_token_address(&self.payer.pubkey(), mint);
|
let ata = get_associated_token_address(&self.payer.pubkey(), mint);
|
||||||
if self.rpc.get_account(&ata).is_err() {
|
if self.rpc.get_account(&ata).is_err() {
|
||||||
instructions.push(create_associated_token_account(
|
instructions.push(create_associated_token_account(
|
||||||
@@ -293,8 +274,6 @@ impl PumpFun {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("888888888888888888");
|
|
||||||
|
|
||||||
instructions.push(instruction::buy(
|
instructions.push(instruction::buy(
|
||||||
&self.payer.clone(),
|
&self.payer.clone(),
|
||||||
mint,
|
mint,
|
||||||
@@ -304,8 +283,6 @@ impl PumpFun {
|
|||||||
_max_sol_cost: buy_amount_with_slippage,
|
_max_sol_cost: buy_amount_with_slippage,
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
|
|
||||||
println!("999999999999999999");
|
|
||||||
|
|
||||||
instructions.push(
|
instructions.push(
|
||||||
system_instruction::transfer(
|
system_instruction::transfer(
|
||||||
@@ -315,8 +292,6 @@ impl PumpFun {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
println!("101010101010101010");
|
|
||||||
|
|
||||||
let recent_blockhash = self.rpc.get_latest_blockhash()?;
|
let recent_blockhash = self.rpc.get_latest_blockhash()?;
|
||||||
let transaction = Transaction::new_signed_with_payer(
|
let transaction = Transaction::new_signed_with_payer(
|
||||||
&instructions,
|
&instructions,
|
||||||
@@ -325,8 +300,6 @@ impl PumpFun {
|
|||||||
recent_blockhash,
|
recent_blockhash,
|
||||||
);
|
);
|
||||||
|
|
||||||
println!("110000000000000000");
|
|
||||||
|
|
||||||
let signature = jito_client.send_transaction(&transaction).await?;
|
let signature = jito_client.send_transaction(&transaction).await?;
|
||||||
println!("Total Jito buy operation time: {:?}ms", start_time.elapsed().as_millis());
|
println!("Total Jito buy operation time: {:?}ms", start_time.elapsed().as_millis());
|
||||||
|
|
||||||
@@ -597,12 +570,9 @@ impl PumpFun {
|
|||||||
&self,
|
&self,
|
||||||
mint: &Pubkey,
|
mint: &Pubkey,
|
||||||
) -> Result<accounts::BondingCurveAccount, ClientError> {
|
) -> Result<accounts::BondingCurveAccount, ClientError> {
|
||||||
println!("aaaaaa");
|
|
||||||
let bonding_curve_pda = Self::get_bonding_curve_pda(mint)
|
let bonding_curve_pda = Self::get_bonding_curve_pda(mint)
|
||||||
.ok_or(ClientError::BondingCurveNotFound)?;
|
.ok_or(ClientError::BondingCurveNotFound)?;
|
||||||
println!("bbbbbb");
|
|
||||||
let account = self.rpc.get_account(&bonding_curve_pda)?;
|
let account = self.rpc.get_account(&bonding_curve_pda)?;
|
||||||
println!("cccccc");
|
|
||||||
accounts::BondingCurveAccount::try_from_slice(&account.data)
|
accounts::BondingCurveAccount::try_from_slice(&account.data)
|
||||||
.map_err(ClientError::BorshError)
|
.map_err(ClientError::BorshError)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user