{"id":21561763,"url":"https://github.com/synonymdev/react-native-ldk-api-plugin","last_synced_at":"2025-03-18T04:47:13.271Z","repository":{"id":199993961,"uuid":"704173362","full_name":"synonymdev/react-native-ldk-api-plugin","owner":"synonymdev","description":"An API Plugin for @synonymdev/react-native-ldk","archived":false,"fork":false,"pushed_at":"2023-11-17T13:53:50.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T07:05:33.785Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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,"governance":null}},"created_at":"2023-10-12T17:32:08.000Z","updated_at":"2024-05-02T07:57:07.000Z","dependencies_parsed_at":"2023-11-17T14:53:50.698Z","dependency_job_id":null,"html_url":"https://github.com/synonymdev/react-native-ldk-api-plugin","commit_stats":null,"previous_names":["synonymdev/react-native-ldk-api-plugin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-ldk-api-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-ldk-api-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-ldk-api-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synonymdev%2Freact-native-ldk-api-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synonymdev","download_url":"https://codeload.github.com/synonymdev/react-native-ldk-api-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244159990,"owners_count":20408019,"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:54.544Z","updated_at":"2025-03-18T04:47:13.254Z","avatar_url":"https://github.com/synonymdev.png","language":"TypeScript","readme":"# react-native-ldk-api-plugin\nAn API Plugin for @synonymdev/react-native-ldk\n\n## Description\nThis library provides the required methods for @synonymdev/react-native-ldk's `lm.start` method.\n\nIncluded APIs are:\n- Blockstream\n- Mempool\n\n## Getting started\n\n```bash\nyarn add @synonymdev/react-native-ldk-api-plugin\n#or\nnpm i -S @synonymdev/react-native-ldk-api-plugin\n````\n\n## Usage with @synonymdev/react-native-ldk\n```javascript\nimport { EAvailableApis, createLdkMethods } from '@synonymdev/react-native-ldk-api-plugin';\nimport lm, { ENetworks, ldk } from '@synonymdev/react-native-ldk';\n\nconst mnemonic = 'volcano you diagram lab chronic twin believe card bamboo bar divert hover';\nconst buffer = Buffer.from(mnemonic, 'utf8');\nconst hash = bitcoin.crypto.sha256(buffer);\nconst seed = hash.toString('hex');\nconst network = ENetworks.mainnet;\nconst api = EAvailableApis.blockstream;\n\n// Create LDK methods for the provided network and api.\nconst ldkMethods = createLdkMethods({ network, api });\n// Start LDK from the Lightning Manager.\nconst lmStart = await lm.start({\n  ...ldkMethods,\n  account: { seed },\n  //Ensure this returns an address that the user controls.\n  getAddress: async () =\u003e 'bc1qnva83atzcrxp7esuszje0cszjc8cg7ah80ne6h',\n  network,\n});\n```\n\n## Custom API Usage\n```javascript\nimport { EAvailableApis, createLdkMethods } from '@synonymdev/react-native-ldk-api-plugin';\nconst network = ENetworks.mainnet; //or 'testnet'\nconst api = EAvailableApis.blockstream;\nconst apiBase = 'custom-blockstream-base-url.com/api';\n\n// Create LDK methods for the provided network and api.\nconst ldkMethods = createLdkMethods({ network, api, apiBase });\n````\n\n### Build:\n```bash\nnpm i \u0026\u0026 npm run build\n```\n\n### Run tests:\n```bash\nnpm run test\n```\n\n### Run example:\n```bash\nnpm run example\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynonymdev%2Freact-native-ldk-api-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynonymdev%2Freact-native-ldk-api-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynonymdev%2Freact-native-ldk-api-plugin/lists"}