{"id":21561790,"url":"https://github.com/synonymdev/react-native-ldk","last_synced_at":"2025-04-05T13:02:05.135Z","repository":{"id":46663507,"uuid":"489280368","full_name":"synonymdev/react-native-ldk","owner":"synonymdev","description":"React Native LDK","archived":false,"fork":false,"pushed_at":"2025-03-10T11:28:06.000Z","size":930214,"stargazers_count":49,"open_issues_count":21,"forks_count":16,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-02T04:41:22.735Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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":"2022-05-06T08:42:05.000Z","updated_at":"2025-03-10T11:28:21.000Z","dependencies_parsed_at":"2025-03-14T12:18:30.942Z","dependency_job_id":null,"html_url":"https://github.com/synonymdev/react-native-ldk","commit_stats":{"total_commits":359,"total_committers":7,"mean_commits":"51.285714285714285","dds":"0.23119777158774368","last_synced_commit":"e4bedb32c7112785ad5665672dbff3f0fb0833de"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-ldk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-ldk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-ldk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-ldk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synonymdev","download_url":"https://codeload.github.com/synonymdev/react-native-ldk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339147,"owners_count":20923013,"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:28:05.233Z","updated_at":"2025-04-05T13:02:05.113Z","avatar_url":"https://github.com/synonymdev.png","language":"C++","readme":"# react-native-ldk\n\n:warning: This is pre-alpha software and not suitable for production apps yet.\n\n\n### Description\nThis library hopes to simplify the process of adding Lightning via LDK to any React-Native app.\n\n## Getting started\n\n```bash\nyarn add @synonymdev/react-native-ldk\n#or\nnpm i -S @synonymdev/react-native-ldk\n```\n\n### iOS installation\n```bash\ncd ios \u0026\u0026 pod install \u0026\u0026 cd ../\n```\n\n### Android installation\n1. Add the following line to `dependencies` in `/android/app/build.gradle`\n    ```groovy\n    dependencies {\n      //...\n      implementation files(\"../../node_modules/@synonymdev/react-native-ldk/android/libs/LDK-release.aar\") // \u003c- this\n    }\n    ```\n2. Ensure `minSdkVersion` is set to at least `24` in `/android/build.gradle`\n\n## Development\n### Android\n- Open `lib/android` in Android Studio\n- To enable documentation for the LDK code, follow this guide: [How to attach JavaDoc to the library in Android Studio](https://medium.com/@mydogtom/tip-how-to-attach-javadoc-to-the-library-in-android-studio-5ff43c4303b3), ie.:\n  1. Switch to `Project` view in the Project browser tool window\n  2. Expand `External Libraries`\n  3. Right click on `Gradle: ./libs/LDK-release.aar` then `Library Properties…`\n  4. Tap the ➕ button and select the `./lib/android/libs/ldk-java-javadoc.jar` file\n  5. In the popup that appears select `JavaDocs` and tap `OK` then `OK` again\n\n### Version Bump\n```sh\n# apply your changes\ncd example\nyarn reinstall # bump versions package.json \u0026 podfile\ncd ../\n# copy version from `./lib/package.json` to `backup-server/package.json`\n\n```\n## Running example app\nSee also [`./example/README.md`](./example/README.md)\n```bash\n# Build dist files\ngit clone https://github.com/synonymdev/react-native-ldk.git\ncd react-native-ldk/lib/ \u0026\u0026 yarn install \u0026\u0026 yarn build \u0026\u0026 cd ../\n\ncd example/ \u0026\u0026 yarn install \u0026\u0026 yarn rn-setup\n\nyarn ios\n# or\nyarn android\n```\n\n### Update config to match your local setup\nIn `constants.ts` update `peers.lnd` if you're using Polar locally.\n### Example for Android\n```ts\n//  export const peers = {\n// \tlnd: {\n    pubKey:\n      '_033f4d3032ce7f54224f4bd9747b50b7cd72074a859758e40e1ca46ffa79a34324_',\n    address: '10.0.2.2',\n    port: 9737,\n// },\n```\n\n## Notes\n - It is important to not mix and match account names and seeds when starting LDK. Doing so can result in a corrupt save.\n\n ## Using zero conf channels\n Channels needs to be manually accepted but this is handled by channel-manager.ts if counterparty is in our trusted peer list.\n ```javascript\n const userConfig: TUserConfig = {\n\tchannel_handshake_config: {\n\t\tannounced_channel: false,\n\t\tminimum_depth: 1,\n\t\tmax_htlc_value_in_flight_percent_of_channel: 100,\n\t\tnegotiate_anchors_zero_fee_htlc_tx: true, //Required for zero conf\n\t},\n\tmanually_accept_inbound_channels: true, //Required for zero conf\n\taccept_inbound_channels: true,\n};\n ```\nWhen starting LDK, provide a list of node public keys from which you are willing to accept zero-confirmation channels.\n\n```javascript\nconst lmStart = await lm.start(\n  ...\n  trustedZeroConfPeers: ['03fc8877790430d7fb29e7bcf6b8bbfa3050e5e89189e27f97300e8a1e9ce589a3']\n```\n\nFrom LND update your conf as specified [here](https://github.com/lightningnetwork/lnd/blob/master/docs/zero_conf_channels.md) and open with these params:\n `lncli openchannel --node_key=03c6b2081d6f333fe3a9655cdb864be7b6b46c8648188a44b6a412e41b63a43272 --local_amt=200000 --push_amt=50000 --private=true --zero_conf --channel_type=anchors`\n\n## Upgrading LDK\n- Use latest LDK-release.aar from [ldk-garbagecollected](https://github.com/lightningdevkit/ldk-garbagecollected/releases) and place in `lib/android/libs`.\n- Use latest LDKFramework.xcframework from [ldk-swift](https://github.com/lightningdevkit/ldk-swift/releases) and place in lib/ios.\n  - To get `pod install` working you might have to open the `LDKFramework.xcframework` directory, delete non ios frameworks and remove all references to deleted frameworks inside `LDKFramework.xcframework/Info.plist`.\n- Update Swift and Kotlin code if there are any breaking changes.\n\n## Testing\n\nTests are implemented using [mocha-remote](https://github.com/kraenhansen/mocha-remote). To run tests at first you need to install docker and start tesing regtest enviroment using docker-compose:\n\n```bash\ncd example\ndocker-compose up\n```\n\nThen to run tests open two terminals and execute the following commands:\n\n```bash\n# Terminal 1\ncd example\nnpm run start\n```\n\n\n```bash\n# Terminal 2\ncd example\nnpm run test:mocha\n```\n\n## How to test your code\n\nBecause it's a native module, you need to mock this package.\n\nThe package provides a default mock you may use in your \\_\\_mocks\\_\\_/@synonymdev/react-native-ldk.js or jest.setup.js.\n\n```ts\nimport * as mockLDK from '@synonymdev/react-native-ldk/dist/mock';\n\njest.mock('@synonymdev/react-native-ldk', () =\u003e mockLDK);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynonymdev%2Freact-native-ldk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynonymdev%2Freact-native-ldk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynonymdev%2Freact-native-ldk/lists"}