{"id":15201965,"url":"https://github.com/synonymdev/react-native-lightning","last_synced_at":"2025-10-02T18:31:15.214Z","repository":{"id":38022126,"uuid":"313728689","full_name":"synonymdev/react-native-lightning","owner":"synonymdev","description":"Library for LND mobile in react native","archived":true,"fork":false,"pushed_at":"2022-07-29T14:50:39.000Z","size":194062,"stargazers_count":36,"open_issues_count":5,"forks_count":7,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-20T21:18:27.807Z","etag":null,"topics":["bitcoin","bitcoin-wallet","lightning-network","mobile","react-native"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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}},"created_at":"2020-11-17T19:59:35.000Z","updated_at":"2024-04-03T17:47:27.000Z","dependencies_parsed_at":"2022-09-16T22:01:11.006Z","dependency_job_id":null,"html_url":"https://github.com/synonymdev/react-native-lightning","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-lightning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-lightning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-lightning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-lightning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synonymdev","download_url":"https://codeload.github.com/synonymdev/react-native-lightning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235031461,"owners_count":18925237,"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":["bitcoin","bitcoin-wallet","lightning-network","mobile","react-native"],"created_at":"2024-09-28T03:44:00.544Z","updated_at":"2025-10-02T18:31:05.204Z","avatar_url":"https://github.com/synonymdev.png","language":"TypeScript","readme":"# react-native-lightning\n\n:warning: We will review and merge any outside pull requests but this repo will no longer be actively maintained. Consider using [react-native-lightning](https://github.com/synonymdev/react-native-ldk) instead.\n\n### Description\nThis library hopes to simplify the process of adding Lightning via LND's Neutrino to any React-Native app.\n\n## Getting started\n\n```bash\nyarn add @synonymdev/react-native-lightning\n#or\nnpm i -s @synonymdev/react-native-lightning\n````\n\n### iOS installation\n```bash\ncd ios \u0026\u0026 pod install \u0026\u0026 cd ../\n````\n\n### Android installation\n\nopen `android/app/build.gradle` and add the below line to `dependencies`\n\n`implementation files(\"../../node_modules/@synonymdev/react-native-lightning/android/libs/Lndmobile.aar\")`\n\n## Running example app\n```bash\n\n#Build dist files\ngit clone https://github.com/synonymdev/react-native-lightning.git\nyarn install \u0026\u0026 yarn build\n\ncd example/\nyarn install\n\nyarn ios\n#or\nyarn android\n```\n\n## Usage\n```javascript\nimport lnd, {\n    ENetworks,\n    LndConf,\n\tss_lnrpc\n} from '@synonymdev/react-native-lightning';\n\nconst lndConf = new LndConf(ENetworks.regtest);\n```\n\n```javascript\nconst res = await lnd.start(lndConf);\nif (res.isErr()) {\n    //Lnd failed to start\n    console.error(res.error)\n}\n\n//LND state changes\nlnd.stateService.subscribeToStateChanges(\n\t(res: Result\u003css_lnrpc.WalletState\u003e) =\u003e {\n\t\tif (res.isOk()) {\n\t\t\tsetLndState(res.value);\n\t\t}\n\t},\n\t() =\u003e {\n        //Subscription has ended\n    },\n);\n\n\n//Subscribe to LND logs\nconst logListener = lnd.addLogListener((message) =\u003e {\n    console.log(message);\n});\n\n//Unsubscribe if listening component is unmounted\nlnd.removeLogListener(logListener);\n\n//All function results can be checked with res.isOk() or res.isErr()\nconst res = await lnd.getInfo();\nif (res.isErr()) {\n    console.log(res.error.message);\n}\n\nif (res.isOk()) {\n    console.log(res.value);\n}\n\n//Use subscribeToOnChainTransactions/subscribeToInvoices for real time transaction updates\nlnd.subscribeToOnChainTransactions(\n    (res) =\u003e {\n        if (res.isOk()) {\n            const { amount, blockHeight, numConfirmations } = res.value;\n            \n            alert(`Received ${amount} sats on chain in block ${blockHeight}`)\n        }\n    },\n    (res) =\u003e {\n        //If this fails ever then we need to subscribe again\n        console.error(res);\n    },\n);\n\n\n```\n\n### Using neutrino headers cache\nInitial neutrino sync times can take a while for first time users. This is a trusted setup that allows the app to download a cached pre-synced archive of the neutrino headers. This speeds up the time it takes for LND to become usable as syncing doesn't need to start from scratch.\n```bash\n#Add these dependencies to your app\nyarn add react-native-fs react-native-zip-archive  \n#or\nnpm i react-native-fs react-native-zip-archive -S \n\ncd ios \u0026\u0026 pod install \u0026\u0026 cd ../\n````\n\nUsing it:\n\n```javascript\nimport lndCache from '@synonymdev/react-native-lightning/dist/utils/neutrino-cache';\n```\n\n```javascript\nlndCache.addStateListener(\n    (state: ICachedNeutrinoDBDownloadState) =\u003e {\n      setMessage(JSON.stringify(state));\n    },\n);\n\nawait lndCache.downloadCache(ENetworks.testnet);\nawait startLnd();\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynonymdev%2Freact-native-lightning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynonymdev%2Freact-native-lightning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynonymdev%2Freact-native-lightning/lists"}