use hypermid_sdk::{Hypermid, types::{QuoteParams, ExecuteParams}};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Hypermid::anonymous();
let quote = client.get_quote(&QuoteParams {
from_chain: "1".to_string(),
from_token: "0x0000000000000000000000000000000000000000".to_string(),
from_amount: "1000000000000000000".to_string(),
to_chain: "42161".to_string(),
to_token: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831".to_string(),
from_address: "0xYourAddress".to_string(),
..Default::default()
}).await?;
println!("Provider: {} | feeBps: {}", quote.provider, quote.fee_bps);
let exec = client.execute(&ExecuteParams {
from_chain: "1".to_string(),
from_token: "0x0000000000000000000000000000000000000000".to_string(),
from_amount: "1000000000000000000".to_string(),
to_chain: "42161".to_string(),
to_token: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831".to_string(),
from_address: "0xYourAddress".to_string(),
to_address: Some("0xYourAddress".to_string()),
..Default::default()
}).await?;
if let Some(tx) = exec.transaction_request {
println!("Sign and broadcast tx to {}", tx.to);
}
Ok(())
}