{"id":18928831,"url":"https://github.com/lightninglabs/lnc-web","last_synced_at":"2026-01-05T23:10:07.402Z","repository":{"id":37088132,"uuid":"470702630","full_name":"lightninglabs/lnc-web","owner":"lightninglabs","description":"Lightning Node Connect npm module for web","archived":false,"fork":false,"pushed_at":"2025-01-23T20:24:09.000Z","size":12916,"stargazers_count":49,"open_issues_count":10,"forks_count":17,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-28T21:01:38.380Z","etag":null,"topics":["bitcoin","lightning-network","typescript","webassembly"],"latest_commit_sha":null,"homepage":"https://docs.lightning.engineering/lightning-network-tools/lightning-terminal/lnc-npm","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightninglabs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-16T18:18:46.000Z","updated_at":"2025-01-23T20:23:13.000Z","dependencies_parsed_at":"2024-09-09T16:36:55.863Z","dependency_job_id":"4bb850ca-58ea-4324-9ffe-3609a7fafd9a","html_url":"https://github.com/lightninglabs/lnc-web","commit_stats":{"total_commits":129,"total_committers":7,"mean_commits":"18.428571428571427","dds":"0.39534883720930236","last_synced_commit":"f6d9d1f293744a0c8070ffdb1483a9da026573ea"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightninglabs%2Flnc-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightninglabs%2Flnc-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightninglabs%2Flnc-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightninglabs%2Flnc-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightninglabs","download_url":"https://codeload.github.com/lightninglabs/lnc-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256103,"owners_count":20909240,"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","lightning-network","typescript","webassembly"],"created_at":"2024-11-08T11:28:11.972Z","updated_at":"2026-01-05T23:10:07.330Z","avatar_url":"https://github.com/lightninglabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @lightninglabs/lnc-web\n\n## A npm module for Lightning Node Connect\n\n## Install\n\n`npm i @lightninglabs/lnc-web`\n\n## API Design\n\n#### Set-up and connection\n\nThe constructor for the LNC object takes a parameters object with the three following fields:\n\n-   `pairingPhrase` (string): Your LNC pairing phrase\n-   `serverHost` (string): Specify a custom Lightning Node Connect proxy server. If not specified we'll default to `mailbox.terminal.lightning.today:443`.\n-   `wasmClientCode` (string): Custom location for the WASM client code. Can be remote or local. If not specified we’ll default to our instance on our CDN.\n-   `namespace` (string): JavaScript namespace used for the main WASM calls. You can maintain multiple connections if you use different namespaces. If not specified we'll default to `default`.\n-   `password` (string): By default, this module will handle storage of your local and remote keys for you in local storage. We highly recommend encrypting that data with a password you set here.\n\n```typescript\nimport LNC from ‘@lightninglabs/lnc-web’;\n\nconst pairingPhrase = ‘artefact morning piano photo consider light’;\nconst password = 'u*E0F?gU\\d($N\u0026Ckh8u)tLm';\n\n// default connection using WASM from CDN\n// WASM loaded on object creation\n// default host: mailbox.terminal.lightning.today:443\n// password used for encrypting credentials\nconst lnc = new LNC({\n   pairingPhrase,\n   password\n});\n\n// using custom Lightning Node Connect proxy server\nconst lnc = new LNC({\n   pairingPhrase,\n   serverHost: ‘custom.lnd-server.host:443’\n});\n\n// using WASM pulled into app\nconst lnc = new LNC({\n   pairingPhrase,\n   wasmClientCode: ‘/path/to/​​wasm-client.wasm’\n});\n\n// using WASM from external link\nconst lnc = new LNC({\n   pairingPhrase,\n   wasmClientCode: ‘https://dev.example/wasm-client.wasm’\n});\n\n// check ready status\nlnc.isReady();\n\n// connect\nlnc.connect();\n\n// check connection status\nlnc.isConnected();\n\n// disconnect\nlnc.disconnect();\n```\n\n#### Base functions\n\nAll of the services (lnd, loop, pool, faraday) will be objects under the main lnc object. Each services’ sub-services will be underneath each service object, and each sub-service function below that (except in the case of faraday which only has one service - its functions will live directly under it). All service, function, and param names will be camel-cased.\n\n```typescript\nconst { lnd, loop, pool, faraday } = lnc;\n\n// all functions on the base object should have proper types\n// sub-servers exist as objects on each main service\nlnd.lightning.listInvoices();\nlnd.lightning.connectPeer({ addr: ‘03aa49c1e98ff4f216d886c09da9961c516aca22812c108af1b187896ded89807e@m3keajflswtfq3bw4kzvxtbru7r4z4cp5stlreppdllhp5a7vuvjzqyd.onion:9735’ });\n\nconst signature = lnd.signer.signMessage({...params});\n\nconst swaps = await loop.swapClient.listSwaps();\nconst poolAccount = await pool.trader.initAccount({\n   accountValue: 100000000,\n   relativeHeight: 1000\n });\n\nconst insights = await faraday.channelInsights();\n```\n\n#### Subscriptions\n\n```typescript\nconst { lnd } = lnc;\n\n// handle subscriptions\nlnd.lightning.subscribeTransactions(\n   params,\n   transaction =\u003e handleNewData(transaction),\n   error =\u003e handleError(error),\n);\n\nlnd.lightning.subscribeChannelEvents(\n   params,\n   event =\u003e handleNewChannelEventData(event),\n   error =\u003e handleError(error),\n);\n```\n\n## Further documentation\n\n- https://docs.lightning.engineering/lightning-network-tools/lightning-terminal/lnc-npm\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightninglabs%2Flnc-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightninglabs%2Flnc-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightninglabs%2Flnc-web/lists"}