# Lighter Rust SDK (WIP)
[](https://crates.io/crates/lighter-rust)
[](https://docs.rs/lighter-rust)
[](https://github.com/yongkangc/lighter-rust/actions/workflows/ci.yml)
[](https://opensource.org/licenses/MIT)
Rust SDK for [Lighter](https://lighter.xyz/) (v2)
## Installation
Add this to your `Cargo.toml`:
```toml
[dependencies]
lighter-rust = "0.1.0"
```
Or use the latest from GitHub:
```toml
[dependencies]
lighter-rust = { git = "https://github.com/yongkangc/lighter-rust" }
```
## Quick Start
```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(())
}
```
## Documentation
### API Documentation & Coverage
- [**AccountApi**](./docs/AccountApi.md) - Account management operations
- [**AnnouncementApi**](./docs/AnnouncementApi.md) - Announcement operations
- [**BlockApi**](./docs/BlockApi.md) - Info related to the network blocks
- [**BridgeApi**](./docs/BridgeApi.md) - Fastbridge info
- [**CandlestickApi**](./docs/CandlestickApi.md) - Market data and OHLCV
- [**FundingApi**](./docs/FundingApi.md) - Info regarding the funding rates
- [**InfoApi**](./docs/InfoApi.md) - Other info
- [**NotificationApi**](./docs/NotificationApi.md) - Notifications operations
- [**OrderApi**](./docs/OrderApi.md) - Order placement and management
- [**ReferralApi**](./docs/ReferralApi.md) - Info related to referrals
- [**RootApi**](./docs/RootApi.md) - General platform info
- [**TransactionApi**](./docs/TransactionApi.md) - Transaction history and tracking
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Disclaimer
This is an unofficial SDK. Use at your own risk. Always test thoroughly before using in production.
## Support
For issues and questions:
- Open an issue on [GitHub](https://github.com/yongkangc/lighter-rust/issues)
- Check the [API documentation](https://apidocs.lighter.xyz/docs/get-started-for-programmers-1)
## Related
- [`lighter-python` SDK](https://github.com/elliottech/lighter-python)
- [`lighter-go` signing module](https://github.com/elliottech/lighter-go)