mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-14 01:18:04 +00:00
fix
This commit is contained in:
@@ -24,8 +24,6 @@ pub struct RpcResponse {
|
||||
}
|
||||
|
||||
pub async fn get_tip_accounts(block_engine_url: &str) -> Result<RpcResponse> {
|
||||
println!("get_tip_accounts: {}", block_engine_url);
|
||||
|
||||
let client_builder = reqwest::Client::builder();
|
||||
let client = client_builder.build()?;
|
||||
let request_body = RpcRequest {
|
||||
@@ -43,7 +41,6 @@ pub async fn get_tip_accounts(block_engine_url: &str) -> Result<RpcResponse> {
|
||||
.json::<RpcResponse>()
|
||||
.await?;
|
||||
|
||||
println!("result: {:?}", result);
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -103,15 +103,12 @@ impl JitoClient {
|
||||
};
|
||||
|
||||
let result = self.send_request(&endpoint, "getTipAccounts", None).await?;
|
||||
println!("get_tip_accounts result: {:?}", serde_json::to_string_pretty(&result).unwrap());
|
||||
let tip_accounts = TipAccountResult::from(result).map_err(|e| anyhow!(e))?;
|
||||
Ok(tip_accounts)
|
||||
}
|
||||
|
||||
async fn send_request(&self, endpoint: &str, method: &str, params: Option<Value>) -> Result<Value> {
|
||||
let url = format!("{}{}", self.base_url, endpoint);
|
||||
println!("send_request url: {:?}", url);
|
||||
|
||||
let url = format!("{}{}", self.base_url, endpoint);
|
||||
let data = json!({
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
|
||||
+2
-2
@@ -262,7 +262,7 @@ impl PumpFun {
|
||||
let buy_amount_with_slippage =
|
||||
utils::calculate_with_slippage_buy(max_sol_cost, slippage_basis_points.unwrap_or(DEFAULT_SLIPPAGE));
|
||||
|
||||
let mut instructions = vec![];
|
||||
let mut instructions = self.create_priority_fee_instructions(None);
|
||||
let tip_account = jito_client.get_tip_account().await.map_err(|e| anyhow!(e)).unwrap();
|
||||
let ata = get_associated_token_address(&self.payer.pubkey(), mint);
|
||||
if self.rpc.get_account(&ata).is_err() {
|
||||
@@ -450,7 +450,7 @@ impl PumpFun {
|
||||
slippage_basis_points.unwrap_or(DEFAULT_SLIPPAGE),
|
||||
);
|
||||
|
||||
let mut instructions = vec![];
|
||||
let mut instructions = self.create_priority_fee_instructions(None);
|
||||
let tip_account = jito_client.get_tip_account().await.map_err(|e| anyhow!(e))?;
|
||||
instructions.push(instruction::sell(
|
||||
&self.payer.clone(),
|
||||
|
||||
Reference in New Issue
Block a user