Skip to content

tvallotton/cryptomkt-rs

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 23 commits ahead, 1 commit behind gallegogt:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

[UNOFFICIAL] Criptomarket API

This is a fork of gallegogt/cryptomkt-rs. It allows to make non blocking calls.

Examples

use cryptomkt::{Client, OrderType};
const API_KEY: &'static str = "<API_KEY>";
const API_SECRET: &'static str = "<API SECRET>";

#[tokio::main]
async fn main() {
    let client = Client::new(API_KEY, API_SECRET);

    // Get all markets available
    let markets = client.get_markets().await;
    for m in markets.iter() {
        println!("{}", m.get_name());

        // Get the current ticker for the market
        match m.get_current_ticker().await {
            Ok(ticker) => {
                println!("{:?}", ticker);
            }
            Err(e) => {
                println!("{:?}", e);
            }
        }

        println!("------- Orders ------");
        match m.get_orders_book(OrderType::Buy, 0, 20).await {
            Ok(orders) => {
                println!("{:?}", orders);
            }
            Err(e) => {
                println!("{:?}", e);
            }
        }

        println!("------- Trades ------");
        match m.get_trades("2018-05-15", "2018-05-16", 0, 20).await {
            Ok(trades) => {
                println!("{:?}", trades);
            }
            Err(e) => {
                println!("{:?}", e);
            }
        }
    }
}

Support My Efforts

Gallegogt programmed this lib for fun and he does his best effort to support those that have issues with it, please return the favor and support him.

paypal

About

Biblioteca para el acceso a la plataforma cryptomarket (https://www.cryptomkt.com)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%