{"id":21561736,"url":"https://github.com/synonymdev/react-native-electrum-client","last_synced_at":"2025-04-10T12:06:07.073Z","repository":{"id":39661444,"uuid":"304383253","full_name":"synonymdev/react-native-electrum-client","owner":"synonymdev","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-19T15:27:15.000Z","size":557,"stargazers_count":4,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-02T04:41:23.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/synonymdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-15T16:18:33.000Z","updated_at":"2025-03-19T15:27:32.000Z","dependencies_parsed_at":"2024-05-09T02:41:04.144Z","dependency_job_id":"29f5cf0f-6ccf-42ad-bdb4-e20bdd687dca","html_url":"https://github.com/synonymdev/react-native-electrum-client","commit_stats":null,"previous_names":["synonymdev/rn-electrum-client"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-electrum-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-electrum-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-electrum-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-electrum-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synonymdev","download_url":"https://codeload.github.com/synonymdev/react-native-electrum-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248216883,"owners_count":21066631,"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","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":[],"created_at":"2024-11-24T09:27:49.189Z","updated_at":"2025-04-10T12:06:07.056Z","avatar_url":"https://github.com/synonymdev.png","language":"JavaScript","readme":"## Install\n - `yarn add rn-electrum-client`\n\n## Usage \u0026 Examples\n```js\nimport {\n    start,\n    getPeers,\n    getAddressScriptHashBalance,\n    getAddressScriptHashBalances,\n    subscribeHeader,\n    subscribeAddress\n} from \"rn-electrum-client/helpers\";\n\n//Connect To A Random Electrum Server\nconst startResponse = await start({ network: \"bitcoinTestnet\" });\nconsole.log(startResponse);\nif (startResponse.error) return;\n\n//Get Server Peers\nconst getPeersResponse = await getPeers({ network: \"bitcoinTestnet\" });\nconsole.log(getPeersResponse);\n\n//Get Address Balance\nconst getAddressScriptHashBalanceResponse = await getAddressScriptHashBalance({\n    network: \"bitcoinTestnet\",\n    scriptHash: \"77ca78f9a84b48041ad71f7cc6ff6c33460c25f0cb99f558f9813ed9e63727dd\"\n});\nconsole.log(getAddressScriptHashBalanceResponse);\n\n//Subscribe To Headers\nconst subscribeHeaderResponse = await subscribeHeader({\n    network: \"bitcoinTestnet\",\n    onReceive: (data) =\u003e { console.log(\"New block!\", data); } \n});\nconsole.log(subscribeHeaderResponse);\n\n//Subscribe To An Address\nconst subscribeAddressResponse = await subscribeAddress({\n  network: \"bitcoinTestnet\",\n  scriptHash: \"77ca78f9a84b48041ad71f7cc6ff6c33460c25f0cb99f558f9813ed9e63727dd\", //tb1qnv5luf8mav8263sxfa4fdr3m6kws74n0yfzzrx\n  onReceive: (data) =\u003e { console.log(\"Received some Testnet BTC!\", data); }\n});\nconsole.log(subscribeAddressResponse);\n\n//Get Address Balances (Batch Method)\nconst getAddressScriptHashes = [\n\t\"21031994b184684de964e930e9937b1b6d75c9af12bb99ae6ee266a724e12632\",\n\t\"9ff2d1500272589aff699e1582dbc2f47a7bbe19f7d3a4d77e1c9e54735d4fc4\",\n\t\"bfb2a1c0a45421f908e0b3f63cee65a2dee33ae276bdb82c6f53f6ec1d53093b\",\n\t\"ce2b6d0b4ed19ff9b264d1d218220cae85388b6d53a539bd0852404b65d74b1b\",\n\t\"4470798cb53a34f8adf763248c90b7b09e6375043a74346d5ad9a1b6c6cc1130\"\n];\nconst getAddressScriptHashBalancesResponse = await getAddressScriptHashBalances({\n    scriptHashes: getAddressScriptHashes,\n  \tnetwork: \"bitcoinTestnet\"\n});\nconsole.log(getAddressScriptHashBalancesResponse);\n\n/*\nWe are also able to get out what we put in using the following patterns.\nThis works with any batch method.\n*/\nconst getAddressScriptHashes2 = {\n    key: \"scriptHash\",\n    data: [\n        {\n            address: \"tb1qnv5luf8mav8263sxfa4fdr3m6kws74n0yfzzrx\",\n            path: \"m/84'/1'/0'/0/0\",\n            scriptHash: \"77ca78f9a84b48041ad71f7cc6ff6c33460c25f0cb99f558f9813ed9e63727dd\"\n        },\n    ]\n};\nconst getAddressScriptHashBalancesResponse2 = await getAddressScriptHashBalances({\n    scriptHashes: getAddressScriptHashes2,\n  \tnetwork: \"bitcoinTestnet\"\n});\nconsole.log(getAddressScriptHashBalancesResponse2);\n\nconst getAddressScriptHashes3 = {\n    key: \"scriptHash\",\n    data: {\n        77ca78f9a84b48041ad71f7cc6ff6c33460c25f0cb99f558f9813ed9e63727dd: {\n            address: \"tb1qnv5luf8mav8263sxfa4fdr3m6kws74n0yfzzrx\",\n            path: \"m/84'/1'/0'/0/0\",\n            scriptHash: \"77ca78f9a84b48041ad71f7cc6ff6c33460c25f0cb99f558f9813ed9e63727dd\"\n        },\n    }\n};\nconst getAddressScriptHashBalancesResponse3 = await getAddressScriptHashBalances({\n    scriptHashes: getAddressScriptHashes3,\n  \tnetwork: \"bitcoinTestnet\"\n});\nconsole.log(getAddressScriptHashBalancesResponse3);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynonymdev%2Freact-native-electrum-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynonymdev%2Freact-native-electrum-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynonymdev%2Freact-native-electrum-client/lists"}