Rust SDK for Lighter (v2)
Add this to your Cargo.toml:
[dependencies]
lighter-rust = "0.2.0"Or install via cargo:
cargo add lighter-rustOr use the latest from GitHub:
[dependencies]
lighter-rust = { git = "https://github.com/yongkangc/lighter-rust" }use lighter_rust::{LighterClient, Config, api::account::AccountBy};
#[tokio::main]
async fn main() -> Result<()> {
let config = LighterConfig::new()
.with_api_key_private(YOUR_API_KEY_PRIVATE)
.with_account_index(YOUR_ACCOUNT_INDEX)
.with_api_key_index(YOUR_API_KEY_INDEX);
let client = HttpClient::builder()
.with_config(config)
.with_account()
.build()?;
let account = client
.api()
.account()?
.account(AccountBy::L1Address, YOUR_ACCOUNT_ADDRESS)
.await?;
println!("Account: {:?}", account);
Ok(())
}- AccountApi - Account management operations
- AnnouncementApi - Announcement operations
- BlockApi - Info related to the network blocks
- BridgeApi - Fastbridge info
- CandlestickApi - Market data and OHLCV
- FundingApi - Info regarding the funding rates
- InfoApi - Other info
- NotificationApi - Notifications operations
- OrderApi - Order placement and management
- ReferralApi - Info related to referrals
- RootApi - General platform info
- TransactionApi - Transaction history and tracking
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
This is an unofficial SDK. Use at your own risk. Always test thoroughly before using in production.
For issues and questions:
- Open an issue on GitHub
- Check the API documentation