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() {
let exchange = CoinExchange::new("btc", "xmr");
let market_info = exchange.get_market_info().expect("parsing error");
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);
}