{"id":30196318,"url":"https://github.com/bob6664569/phoenixd-client","last_synced_at":"2026-01-20T16:36:21.899Z","repository":{"id":307160725,"uuid":"1028611705","full_name":"bob6664569/phoenixd-client","owner":"bob6664569","description":"Node.js TypeScript client for the phoenixd Lightning API","archived":false,"fork":false,"pushed_at":"2025-07-29T19:53:31.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-29T20:44:11.805Z","etag":null,"topics":["api-client","bitcoin","client","javascript","lightning-network","nodejs","npm"],"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/bob6664569.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2025-07-29T19:41:14.000Z","updated_at":"2025-07-29T19:54:50.000Z","dependencies_parsed_at":"2025-07-29T20:44:13.587Z","dependency_job_id":"0969a764-b20a-4507-b669-e6e12f4773ea","html_url":"https://github.com/bob6664569/phoenixd-client","commit_stats":null,"previous_names":["bob6664569/phoenixd-client"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bob6664569/phoenixd-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bob6664569%2Fphoenixd-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bob6664569%2Fphoenixd-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bob6664569%2Fphoenixd-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bob6664569%2Fphoenixd-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bob6664569","download_url":"https://codeload.github.com/bob6664569/phoenixd-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bob6664569%2Fphoenixd-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270183606,"owners_count":24541341,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api-client","bitcoin","client","javascript","lightning-network","nodejs","npm"],"created_at":"2025-08-13T05:17:55.054Z","updated_at":"2025-12-30T21:46:28.222Z","avatar_url":"https://github.com/bob6664569.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phoenixd-client\n\nA Node.js TypeScript client for the [phoenixd](https://github.com/ACINQ/phoenixd) Lightning API. This package provides a complete interface to interact with phoenixd Lightning nodes, including creating invoices, making payments, managing channels, and real-time notifications.\n\n[phoenixd](https://phoenix.acinq.co/server) is the server equivalent of the popular Phoenix wallet for mobile, written in Kotlin Multiplatform and running natively on Linux, MacOS, and Windows.\n\n## Features\n\n- 🔌 Complete TypeScript support with full type definitions\n- 💰 Create and pay Lightning invoices (BOLT11)\n- 🎯 Create and pay Lightning offers (BOLT12)\n- 📧 Lightning address payments\n- 🔗 LNURL support (pay, withdraw, auth)\n- 📊 Payment history and export\n- 🌐 Real-time WebSocket notifications\n- 🔐 Secure authentication\n- 🛡️ Error handling and validation\n\n## Installation\n\n```bash\nnpm install phoenixd-client\n```\n\n## Quick Start\n\n```typescript\nimport { PhoenixdClient } from 'phoenixd-client';\n\n// Initialize the client\nconst client = new PhoenixdClient({\n  host: 'localhost',\n  port: 9740,\n  password: 'your_phoenixd_password',\n  useHttps: false\n});\n\n// Create an invoice\nconst invoice = await client.createInvoice({\n  description: 'Coffee payment',\n  amountSat: 1000,\n  expirySeconds: 3600\n});\n\nconsole.log('Invoice created:', invoice.serialized);\n```\n\n## Configuration\n\n```typescript\ninterface PhoenixdConfig {\n  host?: string;        // Default: 'localhost'\n  port?: number;        // Default: 9740\n  password: string;     // Required: Your phoenixd API password\n  useHttps?: boolean;   // Default: false\n  timeout?: number;     // Default: 30000ms\n}\n```\n\n## API Reference\n\n### Invoices\n\n#### Create Invoice\n```typescript\nconst invoice = await client.createInvoice({\n  description: 'Payment for services',\n  amountSat: 5000,\n  expirySeconds: 3600,\n  externalId: 'order-123',\n  webhookUrl: 'https://your-webhook.com/payment'\n});\n```\n\n#### Pay Invoice\n```typescript\nconst payment = await client.payInvoice({\n  invoice: 'lntb1u1pjlsjnqpp57svjqly7mh5sy84lk67sma4apfnqdm90jdf40np0xchrpq6uxajscqpjsp592kp0fs2ssgpq9h54tsfaj5w34287v8fezgaw6cr56f076c05glq9q7sqqqqqqqqqqqqqqqqqqqsqqqqqysgqdq6d4ujqenfwfehggrfdemx76trv5mqz9grzjqwfn3p9278ttzzpe0e00uhyxhned3j5d9acqak5emwfpflp8z2cnflcyamh4dcuhwqqqqqlgqqqqqeqqjqnjpjvnv0p3wvwc6vhzkkgm8kl9r837x4p9qupk5ln5tqlm7prrlsy5xd8cf5agae64f53dvm9el0z5hvgcnta4stgmrg7zwfah0nqrqph4ts8l'\n});\n```\n\n### Offers (BOLT12)\n\n#### Create Offer\n```typescript\nconst offer = await client.createOffer({\n  description: 'Donation for the project',\n  amountSat: 1000\n});\n```\n\n#### Pay Offer\n```typescript\nconst payment = await client.payOffer({\n  offer: 'lno1qgsyxjtl6luzd9t3pr62xr7eemp6awnejusgf6gw45q75vcfqqqqqqqgqvqcdgq2zdskugr0venx2u3qvehhygzsd9jhyun9zrhq8yecsj40r443pquhuhh7tjrteukce2xj7uqwm2vahys5lsn39vf5q2fyfxsw6xn824393en87nre87xcectkgcj85trcu5hn9r9703645qsrxtcq785whraquh5atw89w5scg707fz23405ygk7jn9uek3tkmvdqqvc8yz8xm2yme6hjx3x02csmq6pfzaejqr3kzg7u8am96txu95z8am8zgvfvfcnzk27ylwk43ut48xv2vrkhqtj3wes32glw5ft5h7f4p8ytwey4cqjsks55zcmr3hka0p8e50thjqpjytmt5wsa4ylhavdmewv7jmj2ppy9daujfmfvpmnw9cf75cymjffzh2nafn883vsqr3a8u2l797mayh3p',\n  amountSat: 1000,\n  message: 'Thank you for your work!'\n});\n```\n\n### Lightning Address\n\n#### Pay Lightning Address\n```typescript\nconst payment = await client.payLnAddress({\n  address: 'alice@lightning.com',\n  amountSat: 500,\n  message: 'For lunch'\n});\n```\n\n### Payments\n\n#### List Incoming Payments\n```typescript\nconst payments = await client.listIncomingPayments({\n  limit: 10,\n  offset: 0,\n  all: true\n});\n```\n\n#### List Outgoing Payments\n```typescript\nconst payments = await client.listOutgoingPayments({\n  limit: 10,\n  offset: 0,\n  all: true\n});\n```\n\n#### Get Specific Payment\n```typescript\nconst payment = await client.getIncomingPayment('payment_hash_here');\nconst outgoingPayment = await client.getOutgoingPayment('payment_id_here');\n```\n\n### Node Information\n\n#### Get Node Info\n```typescript\nconst info = await client.getInfo();\nconsole.log('Node ID:', info.nodeId);\nconsole.log('Channels:', info.channels);\n```\n\n#### Get Balance\n```typescript\nconst balance = await client.getBalance();\nconsole.log('Balance:', balance.balanceSat, 'sats');\nconsole.log('Fee Credit:', balance.feeCreditSat, 'sats');\n```\n\n#### List Channels\n```typescript\nconst channels = await client.listChannels();\nchannels.forEach(channel =\u003e {\n  console.log('Channel:', channel.channelId, 'Balance:', channel.balanceSat);\n});\n```\n\n### On-chain Operations\n\n#### Send to Address\n```typescript\nconst txId = await client.sendToAddress({\n  amountSat: 100000,\n  address: 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh',\n  feerateSatByte: 12\n});\n```\n\n#### Bump Fee\n```typescript\nconst childTxId = await client.bumpFee({\n  feerateSatByte: 15\n});\n```\n\n### LNURL Operations\n\n#### LNURL Pay\n```typescript\nconst payment = await client.lnUrlPay({\n  amountSat: 1000,\n  lnurl: 'LNURL1DP68GURN8GHJ7MRWW4EXCTNXD9SHG6NPVCHXXMMD9AKXUATJDSKHQCTE8AEK2UMND9HKU0TZV9JR2VM9XV6RVV3JVSUNWDRYXUCNVDFHV43KVE3KXQCRJDFHX33XGDENX9NRSVTRXCENVC3KV33NGWR9XQURWC3N8YEN2WP4V4JNZV8XSUH',\n  message: 'Payment for service'\n});\n```\n\n#### LNURL Withdraw\n```typescript\nconst withdraw = await client.lnUrlWithdraw({\n  lnurl: 'lightning:LNURL1DP68GURN8GHJ7MRWW4EXCTNXD9SHG6NPVCHXXMMD9AKXUATJDSKHW6T5DPJ8YCTH8AEK2UMND9HKU0T9893XYVF5XQMX2EP4VYCNJWR9X56RSCEE893NYVP3VC6KGEPNX5UNGDFCV9NRJDNXXCMNXENZXPJXVCFS89NRWVFJXYCNXD3K89JNGAXMZVT'\n});\n```\n\n#### LNURL Auth\n```typescript\nconst result = await client.lnUrlAuth({\n  lnurl: 'lnurl1dp68gurn8ghj7um5v93kketj9ehx2amn9ashq6f0d3hxzat5dqlhgct884kx7emfdcnxkvfav3nxxcehxyckvdrpxsexyden8qexywrpv33nvdmpxsukzdpnvgungct9xesnvcf3x9jnsenxvvurvcmzvd3rwdfevgmnwdpjxp3nqvg50j329'\n});\n```\n\n### Utilities\n\n#### Decode Invoice\n```typescript\nconst decoded = await client.decodeInvoice({\n  invoice: 'lntb1u1pjlsjnqpp57svjqly7mh5sy84lk67sma4apfnqdm90jdf40np0xchrpq6uxajscqpjsp592kp0fs2ssgpq9h54tsfaj5w34287v8fezgaw6cr56f076c05glq9q7sqqqqqqqqqqqqqqqqqqqsqqqqqysgqdq6d4ujqenfwfehggrfdemx76trv5mqz9grzjqwfn3p9278ttzzpe0e00uhyxhned3j5d9acqak5emwfpflp8z2cnflcyamh4dcuhwqqqqqlgqqqqqeqqjqnjpjvnv0p3wvwc6vhzkkgm8kl9r837x4p9qupk5ln5tqlm7prrlsy5xd8cf5agae64f53dvm9el0z5hvgcnta4stgmrg7zwfah0nqrqph4ts8l'\n});\n```\n\n#### Estimate Liquidity Fees\n```typescript\nconst fees = await client.estimateLiquidityFees(2000000);\nconsole.log('Mining fee:', fees.miningFeeSat, 'sats');\nconsole.log('Service fee:', fees.serviceFeeSat, 'sats');\n```\n\n### Real-time Notifications\n\nThe client extends EventEmitter and provides WebSocket support for real-time payment notifications:\n\n```typescript\n// Listen for payment events\nclient.on('payment_received', (event) =\u003e {\n  console.log('Payment received:', event.amountSat, 'sats');\n  console.log('Payment hash:', event.paymentHash);\n});\n\n// Connect to WebSocket\nconst ws = client.connectWebSocket();\n\n// Handle WebSocket events\nclient.on('websocket_closed', () =\u003e {\n  console.log('WebSocket connection closed');\n});\n\nclient.on('error', (error) =\u003e {\n  console.error('Client error:', error);\n});\n```\n\n### Error Handling\n\n```typescript\ntry {\n  const invoice = await client.createInvoice({\n    description: 'Test invoice',\n    amountSat: 1000\n  });\n} catch (error) {\n  if (error instanceof Error) {\n    console.error('Failed to create invoice:', error.message);\n  }\n}\n```\n\n## Security\n\n⚠️ **Important Security Notes:**\n\n- The phoenixd API gives access to your funds\n- Always use HTTPS in production\n- Never expose the API to the internet\n- Keep your API password secure\n- Use the limited access password when possible\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Build the project\nnpm run build\n\n# Run tests\nnpm test\n\n# Lint code\nnpm run lint\n\n# Format code\nnpm run format\n```\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Support\n\nFor issues and questions:\n1. Check the [phoenixd documentation](https://github.com/ACINQ/phoenixd)\n2. Open an issue on [GitHub](https://github.com/bob6664569/phoenixd-client/issues)\n3. Review the examples in the `examples/` directory\n\n## Related Projects\n\n- [phoenixd](https://github.com/ACINQ/phoenixd) - The official phoenixd server\n- [phoenix.acinq.co/server](https://phoenix.acinq.co/server) - Official phoenixd website ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbob6664569%2Fphoenixd-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbob6664569%2Fphoenixd-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbob6664569%2Fphoenixd-client/lists"}