{"id":18031575,"url":"https://github.com/roosoft/electrum_client","last_synced_at":"2025-07-22T00:31:51.654Z","repository":{"id":59769513,"uuid":"539085507","full_name":"RooSoft/electrum_client","owner":"RooSoft","description":"Elixir library simplifying calls to an Electrum RPC Server","archived":false,"fork":false,"pushed_at":"2024-02-15T13:33:59.000Z","size":130,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T01:29:11.087Z","etag":null,"topics":["bitcoin","electrum","electrumx"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RooSoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-20T16:25:31.000Z","updated_at":"2024-03-18T16:14:35.000Z","dependencies_parsed_at":"2023-01-29T04:15:17.363Z","dependency_job_id":null,"html_url":"https://github.com/RooSoft/electrum_client","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/RooSoft/electrum_client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RooSoft%2Felectrum_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RooSoft%2Felectrum_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RooSoft%2Felectrum_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RooSoft%2Felectrum_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RooSoft","download_url":"https://codeload.github.com/RooSoft/electrum_client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RooSoft%2Felectrum_client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266404940,"owners_count":23923490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin","electrum","electrumx"],"created_at":"2024-10-30T10:09:38.303Z","updated_at":"2025-07-22T00:31:51.619Z","avatar_url":"https://github.com/RooSoft.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ElectrumClient\n\nElixir library simplifying calls to an Electrum RPC Server\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:electrum_client, \"~\u003e 0.1.30\"}\n  ]\nend\n```\n\n## Example usage\n\nWorks both on `mainnet` or `testnet`, depends on the electrum server's configuration.\n\nExample calling a `testnet` server at `192.168.1.10` on port `60001` to get a list of\nUTXO from the `67a5662abf889b5a28ffa821c1f85fd3ef9313756b881351d91a3671f3f52858` script hash.\n\n```elixir\nElectrumClient.start_link(\"192.168.1.10\", 60001)\nElectrumClient.list_unspent(\"67a5662abf889b5a28ffa821c1f85fd3ef9313756b881351d91a3671f3f52858\")\n```\n\n## Local configuration\n\nIt is possible ton configure your own electrum server automatically when iex starts.\n\nCreate a `.iex.local.exs` file containing the follwing contents, assuming your electrum\nserver is at `192.168.1.10`, answering to port `60001`:\n\n```elixir\nElectrumClient.start_link(\"192.168.1.10\", 60001)\n```\n\n## Get a bitcoin address balance\n\nSend an address to `get_balance` and get a number of confirmed and unconfirmed sats\n\n```elixir\nElectrumClient.get_balance(\"mrEpoDtBXKwrudWUhRqnz3j1yuj7kKHw5p\")\n```\n\n```elixir\n%{confirmed: 1318882, unconfirmed: 0}\n```\n\n## List a bitcoin address UTXOs\n\nTo get a list of unspent transaction outputs related to an address, send the address\nto `list_unspent`\n\n```elixir\nElectrumClient.list_unspent(\"mrEpoDtBXKwrudWUhRqnz3j1yuj7kKHw5p\")\n```\n\n```elixir\n[\n  %{\n    height: 2347375,\n    transaction_id: \"dde058767aa566f2aba736320796771922efa6cb6e75f1cba3d47e4bfd5ae0d8\",\n    value: 1318882,\n    vxid: 1\n  }\n]\n```\n\n## Broadcast a transaction\n\nSend an encoded transaction to `broadcast_transaction` and you'll get a transaction id back\n\n```elixir\nElectrumClient.broadcast_transaction(\"0100000001fa80e26e6427d965b670963747b8103226f40af76d358e47a53217db208fafc8010000006a47304402203234d17d3f6f132b81410d6a8c481912bc650c6dcb31d9a4a34d2ac0f6506e28022026146c17ba95b2c2719a2b4879a35dbbfcbd5144aecb3ff1a9a3cfc7894ae392012103ea1c6a4e250bc539f950c29f083f5e93aa0bf5d4a344af36a356ad4cf8a3ad2cffffffff02f0ff3700000000001976a9140afcad5c79123211ad61bd4723e1b23e9480f1c788ac10270000000000001976a9140fe85c1741be269c77f21c3a0386b8a2fb84ff8388ac00000000\")\n```\n\n```elixir\n{:ok, \"ba9e74b6359c5ff49bb5a1dc0979ce85db8ee45aa90fbf170ff72dec0aad542f\"}\n```\n\n## Get a transaction's details\n\nSend a transaction id to `get_transaction` to get a map containing all the transaction's details\n\n```elixir\nElectrumClient.get_transaction \"05517750a78fb8c38346b1bf5908d71abe728811b643105be6595e11a9392373\"\n```\n\n```elixir\n%BitcoinLib.Transaction{\n  version: 1,\n  inputs: [\n    %BitcoinLib.Transaction.Input{\n      txid: \"420c552d7821da5da61be91dffe984537f460dc668f0766f6c2e1c7a10287610\",\n      vout: 0,\n      script_sig: [%BitcoinLib.Script.Opcodes.Data{value: \u003c\u003c0x30440220571a1484112982604f16f2d1a49c862e2093cedfaf3042af42d7b587c220fbff022055435f538623f09572b87770cf93d7183d1bcb7503895682672f8f98134b320e01::568\u003e\u003e},\n       %BitcoinLib.Script.Opcodes.Data{value: \u003c\u003c0x02f942091e070d59e2f86e17b77e4f96539752f19f360dbf87ef15ea1f0fe8a4e2::264\u003e\u003e}],\n      sequence: 4294967295\n    }\n  ],\n  outputs: [\n    %BitcoinLib.Transaction.Output{\n      value: 4000,\n      script_pub_key: [%BitcoinLib.Script.Opcodes.Stack.Dup{},\n       %BitcoinLib.Script.Opcodes.Crypto.Hash160{},\n       %BitcoinLib.Script.Opcodes.Data{value: \u003c\u003c0x09d6cbc4a478c8f1cbde9085b10fb84519591afb::160\u003e\u003e},\n       %BitcoinLib.Script.Opcodes.BitwiseLogic.EqualVerify{},\n       %BitcoinLib.Script.Opcodes.Crypto.CheckSig{script: \u003c\u003c0x76a91409d6cbc4a478c8f1cbde9085b10fb84519591afb88ac::200\u003e\u003e}]\n    },\n    %BitcoinLib.Transaction.Output{\n      value: 5000,\n      script_pub_key: [%BitcoinLib.Script.Opcodes.Stack.Dup{},\n       %BitcoinLib.Script.Opcodes.Crypto.Hash160{},\n       %BitcoinLib.Script.Opcodes.Data{value: \u003c\u003c0xe8046c97f9c1c38ff6c15e4d7696385309d54388::160\u003e\u003e},\n       %BitcoinLib.Script.Opcodes.BitwiseLogic.EqualVerify{},\n       %BitcoinLib.Script.Opcodes.Crypto.CheckSig{script: \u003c\u003c0x76a914e8046c97f9c1c38ff6c15e4d7696385309d5438888ac::200\u003e\u003e}]\n    }\n  ],\n  locktime: 0\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froosoft%2Felectrum_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froosoft%2Felectrum_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froosoft%2Felectrum_client/lists"}