8 releases
0.2.4 | Feb 29, 2020 |
---|---|
0.2.3 | Oct 1, 2019 |
0.2.2 | Jan 29, 2019 |
0.2.0 | Nov 20, 2018 |
0.1.2 | May 29, 2018 |
#84 in #development
72KB
1.5K
SLoC
[UNOFFICIAL] Criptomarket API
Library for access to the cryptomarket platform (https://www.cryptomkt.com)
Example
///
/// Example of access to the Public API of cryptomkt
///
extern crate cryptomkt;
use cryptomkt::{CryptoMktClient, OrderType};
const API_KEY: &'static str = "<API_KEY>";
const API_SECRET: &'static str = "<API SECRET>";
fn main() {
let client = CryptoMktClient::new(API_KEY, API_SECRET);
// Get Markets
let markets = client.get_markets();
for m in markets.iter() {
println!("{}", m.get_name());
// Get Current Ticker
match m.get_current_ticker() {
Ok(ticker) => {
println!("{:?}", ticker);
}
Err(e) => {
println!("{:?}", e);
}
}
// Get Orders Book
println!("------- Orders ------");
match m.get_orders_book(OrderType::Buy, 0, 20) {
Ok(orders) => {
println!("{:?}", orders);
}
Err(e) => {
println!("{:?}", e);
}
}
// Get Trades
println!("------- Trades ------");
match m.get_trades("2018-05-15", "2018-05-16", 0, 20) {
Ok(trades) => {
println!("{:?}", trades);
}
Err(e) => {
println!("{:?}", e);
}
}
}
}
Contributing
You want to contribute to this project? Wow, thanks! So please just fork it and send me a pull request.
Support My Efforts
I programmed this lib for fun and do my best effort to support those that have issues with it, please return the favor and support me.
Dependencies
~9–14MB
~362K SLoC