coinmarket 0.3.100

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 by interacting with ShapeShift and Etherscan APIs.

DEPRECATION NOTICE

  • The Ethereum module has been deprecated and will replaced by a generic Web3 API to accommodate newer EVM-based networks.
  • Version 0.4 will be the final release.

Installation

[dependencies]
coinmarket = "0.3"

Examples

New

APIKEY=[key]
use coinmarket::web3::Web3;

pub fn main() {
    let network = Web3::new("api.etherscan.io");
    let balance = network
    .ether_balance("0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B")
    .expect("Parsing error");

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

Legacy

ETHSCAN=[key]
use coinmarket::ethereum::{Web3, Web3Provider};

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

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

Requirements

License

This project is dual-licensed under the BSD-3-Clause or the UNLICENSE.