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

Bitcoin Accounting

tpub_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 tpub

xpub =
  "tpubDDJMFT1RGo7pAQxLSFSawLMBJGVizgq4Ny9hYmHWJCYTDW6JsGu3ZqU1RBVPJFhMJjr44fcdeny3uRjQmtUsH1dtuTQG9Ni29AHGwYK56Zq"

BitcoinAccounting.get_book_entries(xpub)