Overview
This node integrates with the Nostr Wallet Connect (NWC) protocol to interact with Lightning Network wallets. Specifically, the "Make invoice" operation allows users to create a Lightning Network invoice to receive satoshis (Bitcoin's smallest unit). This is useful when you want to request payments from others by generating an invoice that they can pay.
Practical examples:
- A merchant creating an invoice to request payment for goods or services.
- A developer generating invoices dynamically in an application to collect user payments.
- Any scenario where you need to generate a Lightning invoice programmatically within an n8n workflow.
Properties
| Name | Meaning |
|---|---|
| Amount (sats) | The amount of satoshis to request in the invoice. Must be a number and is required. |
| Description | An optional text description attached to the invoice, explaining the purpose or details of the payment. |
Output
The output is a JSON array where each item corresponds to one created invoice. For the "Make invoice" operation, each item contains the invoice data returned by the NWC client’s makeInvoice method. This typically includes fields such as the BOLT-11 invoice string and metadata describing the invoice.
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to a Nostr Wallet Connect (NWC) compatible wallet via a URL credential.
- Uses the
@getalby/sdkpackage to interact with the NWC protocol. - Uses the
@getalby/lightning-toolspackage for handling Lightning addresses (not directly relevant for "Make invoice" but part of the node). - Requires the user to provide the NWC connection URL credential in n8n.
Troubleshooting
Common issues:
- Invalid or unreachable NWC URL credential will cause connection failures.
- Providing zero or negative amounts may result in errors from the wallet.
- Network or wallet downtime can cause timeouts or failed requests.
Error messages:
- Errors thrown by the underlying SDK are passed through; typical messages might include connection errors or invalid parameter errors.
- If the node is set to continue on fail, errors will appear in the output JSON under an
errorfield.
Resolutions:
- Verify the NWC URL credential is correct and accessible.
- Ensure the wallet supports invoice creation and is online.
- Validate input parameters before execution.