RUST

async fn submit_solana_transaction(base64_tx: &str) -> Result<String, Box<dyn std::error::Error + Send + Sync>> {
    let client = reqwest::Client::new();
    
    let response = client
        .post("http://lon.block0.wtf/")
        .header("Content-Type", "application/json")
        .json(&serde_json::json!({
            "base64_tx": base64_tx
        }))
        .send()
        .await?;
    
    if !response.status().is_success() {
        return Err(format!("Request failed with status {}", response.status()).into());
    }
    
    let response_text = response.text().await?;
    Ok(response_text)
}

Last updated