cryptomkt

Crates.iocryptomkt
lib.rscryptomkt
version0.2.4
sourcesrc
created_at2018-05-22 15:21:44.365701
updated_at2020-02-29 16:53:34.449081
descriptionImplementation of Cryptomarket API
homepagehttps://github.com/gallegogt/cryptomkt-rs
repositoryhttps://github.com/gallegogt/cryptomkt-rs.git
max_upload_size
id66621
size101,670
Yolier Galan Tasse (gallegogt)

documentation

README

[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.

paypal

Commit count: 37

cargo fmt