https://github.com/vadim-su/rust_binance
https://github.com/vadim-su/rust_binance
binance binance-api
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vadim-su/rust_binance
- Owner: vadim-su
- Created: 2025-04-17T15:46:08.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-05-01T14:36:03.000Z (about 1 year ago)
- Last Synced: 2025-06-08T04:42:56.281Z (about 1 year ago)
- Topics: binance, binance-api
- Language: Rust
- Homepage:
- Size: 149 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust Binance
A Rust library for interacting with the Binance API. This library provides a convenient way to access various Binance endpoints for trading and market data.
## Features
- Support for Binance API endpoints including market data and trading operations.
- Easy-to-use client for making API requests.
- Support for both mainnet and testnet environments.
- Error handling with custom error types.
## Installation
Add this to your `Cargo.toml`:
```toml
[dependencies]
rust_binance = { git = "https://github.com/vadim-su/rust_binance.git" }
```
## Usage
```rust
use rust_binance::BinanceClient;
#[tokio::main]
async fn main() {
let api_key = "your_api_key".to_string();
let secret_key = "your_secret_key".to_string();
let client = BinanceClient::new(api_key, secret_key, true); // true for testnet
// Ping the server
client.ping().await.unwrap();
// Get server time
let time = client.get_time().await.unwrap();
println!("Server Time: {}", time.server_time);
}
```
## Endpoints
- **General Endpoints**: Ping, server time, exchange info.
- **Market Data**: Order book, recent trades, historical trades, compressed trades, klines/candlestick data, and average price.
## Testing
Run tests with:
```bash
cargo test
```
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the LICENSE file for details.