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

Bitcoin Accounting

upub_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 upub

upub =
  "upub5DZdDNpgxN9jBQsVgrdbWBNbbmdPUaRAFFCLnk291c4zCcBzhhC3QssUoVdCB6mZCuGx1mBEz6dcLC5EGVPtBv88WeDDxujRRHk3Gwwywif"

BitcoinAccounting.get_book_entries(upub)