| Crates.io | lfi |
| lib.rs | lfi |
| version | 0.1.1 |
| created_at | 2026-01-17 13:20:12.75093+00 |
| updated_at | 2026-01-22 21:40:41.783721+00 |
| description | Unofficial Rust client for the Li.Fi API (lfi) |
| homepage | |
| repository | https://github.com/yldfi/yldfi-rs/tree/main/crates/lfi |
| max_upload_size | |
| id | 2050447 |
| size | 113,704 |
Unofficial Rust client for the LI.FI Cross-Chain Bridge and DEX Aggregator API
LI.FI is a multi-chain liquidity aggregation protocol that integrates multiple bridges and DEXs to provide optimal cross-chain swap routes across 20+ chains.
use lfi::{Client, QuoteRequest, chains};
#[tokio::main]
async fn main() -> Result<(), lfi::Error> {
// Create a client with an integrator identifier
let client = Client::with_integrator("my-app")?;
// Get a quote for swapping 1 ETH on Ethereum to USDC on Arbitrum
let request = QuoteRequest::new(
chains::ETHEREUM,
chains::ARBITRUM,
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"1000000000000000000",
"0xYourWalletAddress",
).with_slippage(0.5);
let quote = client.get_quote(&request).await?;
println!("Estimated output: {}", quote.estimate.to_amount);
Ok(())
}
[dependencies]
lfi = "0.1"
tokio = { version = "1", features = ["full"] }
MIT