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

Bitcoin Accounting

vpub_to_debits_and_credits.livemd

Bitcoin Accounting

Mix.install([
  {:bitcoin_accounting, "~> 0.1.6"}
])

Start the electrum server

ip = System.fetch_env!("LB_ELECTRUM_CLIENT_IP")
port = System.fetch_env!("LB_ELECTRUM_CLIENT_PORT") |> Integer.parse() |> elem(0)

ElectrumClient.start_link(ip, port)

Get credits and debits from a vpub

vpub =
  "vpub5ZQ9mcm9jHj3j52uiuhRiFiijB9DDHwiNpC3ppnbQPrmdqjdZN1sJyjStVBDTY2mU3ZFxaoNL3GUKAUARQk27xN3LW79ptfooLR7AiH6pHa"

BitcoinAccounting.get_book_entries(vpub)