Etherscan v0.1.4 Etherscan.API.Stats

Module to wrap Etherscan stats endpoints.

Etherscan API Documentation

Link to this section Summary

Functions

Get ether price

Get total supply of ether

Get total supply of ERC20 token, by token_address

Link to this section Functions

Link to this function get_eth_price()
get_eth_price() :: {:ok, map()}

Get ether price.

Example

iex> Etherscan.API.Stats.get_eth_price()
{:ok, %{"ethbtc" => 0.0322, "ethusd" => 439.72}}
Link to this function get_eth_supply()
get_eth_supply() :: {:ok, non_neg_integer()}

Get total supply of ether.

Total supply is returned in wei.

Example

iex> Etherscan.API.Stats.get_eth_supply()
{:ok, 96244925280300000000000000}
Link to this function get_token_supply(token_address)
get_token_supply(token_address :: String.t()) ::
  {:ok, non_neg_integer()} |
  {:error, atom()}

Get total supply of ERC20 token, by token_address.

More Info

Example

iex> Etherscan.API.Stats.get_token_supply("0x57d90b64a1a57749b0f932f1a3395792e12e7055")
{:ok, 21265524714464}