feat: add Alby NWC payments processor (#323)#539
feat: add Alby NWC payments processor (#323)#539Justxd22 wants to merge 10 commits intocameri:mainfrom
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.
How to test
payments:
enabled: true
processor: alby
paymentsProcessors:
alby:
invoiceExpirySeconds: 900
replyTimeoutMs: 10000
curl -X POST "https://faucet.nwc.dev?balance=10000"
ALBY_NWC_URL=nostr+walletconnect://....Done run your relay and test invoices |
|
addressing copilot comments |
|
@cameri Added Ready |
| import { Settings } from '../@types/settings' | ||
| import { createLogger } from '../factories/logger-factory' | ||
|
|
||
| const debug = createLogger('alby-nwc-payments-processor') |
There was a problem hiding this comment.
let's please call this logger not debug
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: