Expand description
This library provides access to all of Binance’s APIs using .
[async/std
]: https://docs.rs/async-std/1.9.0/async_std/
Risk Warning
It is a personal project, use at your own risk. I will not be responsible for your investment losses. Cryptocurrency investment is subject to high market risk. Nonetheless, this crate is aimed at high performance and production use.
Example
This example simply pings the main binance api
use binance::general::General;
use binance::api::Binance;
use binance::errors::Error as BinanceLibError;
#[tokio::main]
async fn main() -> std::io::Result<()> {
let general: General = Binance::new(None, None);
let ping = general.ping().await;
match ping {
Ok(answer) => println!("{:?}", answer),
Err(err) => {
match err {
BinanceLibError::BinanceError { response } => match response.code {
-1000_i16 => println!("An unknown error occured while processing the request"),
_ => println!("Unknown code {}: {}", response.code, response.msg),
},
_ => println!("Other errors: {}.", err),
};
}
}
Ok(())
}
Details
Re-exports
pub use util::bool_to_string;
pub use util::bool_to_string_some;