Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

JungleBus

junglebus.livemd

JungleBus

Mix.install(
  [
    {:bsv, "~> 2.1"},
    {:httpoison, "~> 1.8"},
    {:jason, "~> 1.3"},
  ],
  config: [
    bsv: [
      network: :main
      # network: :test
    ]
  ]
)

server_url = "https://junglebus.gorillapool.io"

Consuming JungleBus Endpoints

https://junglebus.gorillapool.io/docs/

txid = "A-TXID-GOES-HERE"
address = "AN-ADDRESS-GOES-HERE"
height = 800000

GET /v1/transaction/get/:txid


url = "#{server_url}/v1/transaction/get/#{txid}"
response = HTTPoison.get(url)
{:ok, body} = response
body.body |> Jason.decode!

By Address

url = "#{server_url}/v1/address/get/#{address}"
response = HTTPoison.get(url)
{:ok, body} = response
body.body |> Jason.decode!
url = "#{server_url}/v1/address/transactions/#{address}"
response = HTTPoison.get(url)
{:ok, body} = response
body.body |> Jason.decode!

Blocks

GET /v1/block_header/get/:height

url = "#{server_url}/v1/block_header/get/#{height}"
response = HTTPoison.get(url)
{:ok, body} = response
body.body |> Jason.decode!

GET /v1/block_header/list/:height

url = "#{server_url}/v1/block_header/list/#{height}"
response = HTTPoison.get(url)
{:ok, body} = response
body.body |> Jason.decode!