This repo contains DataMaxi+ API SDK for Rust
In order to use the SDK, you must already have Rust and Cargo installed. If you don't, these instructions describe how to install Rust and Cargo.
The SDK provides one crate per DataMaxi+ API. You must add tokio as a dependency within your Rust project to execute asynchronous code.
- Create a new Rust project:
cargo new dtmx_sdk_test
- Add dependencies to datamaxiplus_rs and tokio to your Cargo.toml file:
[dependencies] datamaxiplus_rs = { git = "https://github.com/team-aIdentity/datamaxiplus_rs.git" } tokio = { version = "1", features = ["full"] }
- Make a candle request using datamaxiplus_rs
use datamaxiplus_rs::candle; #[tokio::main] async fn main() { let exchange: &str = "binance"; let symbol: &str = "BTC-USDT"; let api_key: &str = "your_api_key"; let candle = candle::fetch_candle(exchange, symbol, api_key).await.unwrap(); println!("{:?}", candle); }
For more examples, please refer to the Documentation