coinmarket 0.2.0

Coin Market is a simple library designed to make it easy get market information for cryptocurrencies from exchanges like Shapeshift.
Documentation

Coin Market

Coin Market is a simple library designed to make it easy get market or account information for cryptocurrencies from ShapeShift and Etherscan.io.

Installation

[dependencies]
coinmarket = "0.2"

Development

[dependencies]
coinmarket = { git = "https://github.com/tonytins/coinmarket" }

Example

Exchange information

 extern crate coinmarket;
 use coinmarket::exchange::CoinExchange;

 pub fn main() {
      // Tell the exchange we want to pair against Bitcoin and Monero
     let exchange = CoinExchange::new("btc", "xmr");
     // Get the market info of Bitcoin in Monero
     let market_info = exchange.get_market_info().expect("parsing error");

     // Print the market rate
     println!("{}", market_info.rate);
}

Ethereum account balance

extern crate coinmarket;
use coinmarket::ethereum::{Ethereum, EthNetworks};

pub fn main() {
    let network = Web3::new(Web3Provider::MainNet);
    let balance = network.ether_balance("0x341A3A994A150962F3e82b195873B736dAEb4bB3")
        .expect("Parsing error");

    println!("{}", balance);
}