feat: add NWC payments processor (#323) - #539
Conversation
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds a new Alby payments processor implementation using NIP-47 Nostr Wallet Connect (NWC) for invoice creation and status lookup, wired into the existing payments processor selection flow.
Changes:
- Implement
AlbyNwcPaymentsProcessor(create viamake_invoice, reconcile vialookup_invoice) with configurable reply-timeout and invoice expiry handling. - Add a factory + switch-case wiring to select
albyaspayments.processor, including env/config validation and unit tests. - Update defaults and documentation (
default-settings.yaml,.env.example,README.md,CONFIGURATION.md) and add a changeset.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/payments-processors/alby-nwc-payments-processor.spec.ts | Adds unit tests for NWC response/state mapping, timeouts, and expiry propagation. |
| test/unit/factories/payments-processors/alby-nwc-payments-processor-factory.spec.ts | Adds factory validation tests for env/config and legacy URI scheme support. |
| src/payments-processors/alby-nwc-payments-processor.ts | New NWC-based payments processor implementation. |
| src/factories/payments-processors/alby-nwc-payments-processor-factory.ts | New factory to validate config/env and construct the Alby NWC processor. |
| src/factories/payments-processor-factory.ts | Wires alby into the payments processor selection switch. |
| src/@types/settings.ts | Adds paymentsProcessors.alby settings type. |
| resources/default-settings.yaml | Adds default Alby processor settings (expiry + reply timeout). |
| package.json | Adds @getalby/sdk dependency. |
| README.md | Documents Alby NWC setup steps and adds alby to the supported processor list. |
| CONFIGURATION.md | Documents ALBY_NWC_URL and extends payments.processor allowed values. |
| .env.example | Adds ALBY_NWC_URL example value. |
| .changeset/seven-lines-heal.md | Adds a minor-version changeset entry for the feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Justxd22
commented
Apr 19, 2026
How to test
payments:
enabled: trueprocessor: albypaymentsProcessors:
alby:
invoiceExpirySeconds: 900replyTimeoutMs: 10000
curl -X POST "https://faucet.nwc.dev?balance=10000"
ALBY_NWC_URL=nostr+walletconnect://....Done run your relay and test invoices |
Justxd22
commented
Apr 19, 2026
addressing copilot comments |
Justxd22
commented
Apr 20, 2026
@cameri Added Ready |
Uh oh!
There was an error while loading. Please reload this page.
🦋 Changeset detectedLatest commit: 73120b0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Justxd22
commented
Apr 26, 2026
@cameri ready |
Add new alby payments processor using NIP-47 NWC (make_invoice, lookup_invoice)
Description
paymentsProcessors.albyconfig:invoiceExpirySecondsreplyTimeoutMsnostr+walletconnect://...nostrwalletconnect://...make_invoicefor invoice generation.lookup_invoicefor polling/status reconciliation.README.md,CONFIGURATION.md,.env.example,default-settings.yaml).Related Issue
#323
How Has This Been Tested?
Screenshots:
Types of changes
Checklist: