This commit is contained in:
William
2025-02-13 00:08:14 +08:00
parent 705200e538
commit d75b368e5e
3 changed files with 3 additions and 9 deletions
-3
View File
@@ -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
View File
@@ -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,