| Crates.io | mrls |
| lib.rs | mrls |
| version | 0.1.1 |
| created_at | 2026-01-17 08:10:30.271257+00 |
| updated_at | 2026-01-22 21:40:47.865084+00 |
| description | Unofficial Rust client for the Moralis Web3 API - tokens, NFTs, wallets, DeFi, and market data |
| homepage | |
| repository | https://github.com/yldfi/yldfi-rs/tree/main/crates/mrls |
| max_upload_size | |
| id | 2050128 |
| size | 200,011 |
Unofficial Rust client for the Moralis Web3 API
[dependencies]
mrls = "0.1"
tokio = { version = "1", features = ["full"] }
use mrls::Client;
#[tokio::main]
async fn main() -> Result<(), mrls::Error> {
// Create client from MORALIS_API_KEY env var
let client = Client::from_env()?;
// Get native balance
let balance = client.wallet().get_native_balance(
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
Some("eth"),
).await?;
println!("Balance: {} wei", balance.balance);
// Get token price
let price = client.token().get_price(
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH
Some("eth"),
).await?;
println!("WETH Price: ${:?}", price.usd_price);
Ok(())
}
MORALIS_API_KEY - Your Moralis API key (required)MIT