Skip to content

Elixir package for consuming any Insight-powered Bitcoin explorer.

Notifications You must be signed in to change notification settings

stampery/elixir-insight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Insight hex.pm version

Elixir package for consuming any Insight-powered Bitcoin explorer.

Installation

  1. Add insight to your list of dependencies in mix.exs:
def deps do
  [{:insight, "~> 0.0.1"}]
end
  1. Ensure insight is started before your application:
def application do
  [applications: [:insight]]
end

Usage

Using default BitPay's livenet explorer

defmodule Mymodule do
  use Insight

  def my_function do
    # Getting unspent transaction outputs
    bitcoin_address = "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy"
    utxos = get_utxos(bitcoin_address)

    # Broadcasting a signed transaction
    signed = "01000000017b1eabe0209b1fe794124575ef807057c77ada2138ae4fa8d6c4de0398a14f3f00000000494830450221008949f0cb400094ad2b5eb399d59d01c14d73d8fe6e96df1a7150deb388ab8935022079656090d7f6bac4c9a94e0aad311a4268e082a725f8aeae0573fb12ff866a5f01ffffffff01f0ca052a010000001976a914cbc20a7664f2f69e5355aa427045bc15e7c6c77288ac00000000"
    tx = broadcast(signed)
  end

end

Using a custom explorer

defmodule Mymodule do
  use Insight, "https://search.bitaccess.ca/api/"

  [...]
end

Some compatible API endpoints available out there

Livenet

Testnet

About

Elixir package for consuming any Insight-powered Bitcoin explorer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages