Elixir wrapper for the Blockchain.info API.
- Add
ex_blockchain
to your list of dependencies inmix.exs
:
```elixir
def deps do
[{:ex_blockchain, "~> 0.1.0"}]
end
```
- Ensure
ex_blockchain
is started before your application:
```elixir
def application do
[applications: [:ex_blockchain]]
end
```
# retrieve a block
block = ExBlockchain.Blockchain.block("000000000000000016f9a2c3e0f4c1245ff24856a79c34806969f5084f410680")
# retrieve a transaction
tx = ExBlockchain.Blockchain.tx("d4af240386cdacab4ca666d178afc88280b620ae308ae8d2585e9ab8fc664a94")
# retrieve an address
address = ExBlockchain.Blockchain.address("1HS9RLmKvJ7D1ZYgfPExJZQZA1DMU3DEVd")
# retrieves ticker of currency codes
ticker = ExBlockchain.ExchangeRates.ticker
# retrieves `value` of `currency` in BTC
btc_value = ExBlockchain.ExchangeRates.to_btc("USD", 50)
# retrieve stats from Blockchain.info homepage
stats = ExBlockchain.Stats.stats