Feature: Create invoices in fiat currency (EUR, USD, etc.) #5

Open
opened 2026-01-01 16:27:17 +00:00 by padreug · 0 comments
Owner

Summary

Allow users to create Lightning invoices by specifying an amount in fiat currency (e.g., EUR, USD). The app converts the fiat amount to satoshis using real-time exchange rates from the server's configured fiat providers.

User Story

As a merchant or user, I want to create an invoice for a specific fiat amount (e.g., "5 EUR") so that I can easily charge customers in their local currency while receiving Bitcoin.

Requirements

Invoice Creation

  • Add currency selector to the "Receive" / "Create Invoice" dialog
  • Default to sats, but allow switching to any server-supported fiat currency
  • When fiat is selected:
    • User enters amount in fiat (e.g., "10.50 EUR")
    • App shows real-time conversion to sats before creating invoice
    • Invoice is created for the equivalent sat amount
  • Display both fiat and sat amounts on the created invoice

Currency Support

  • Use server's configured fiat providers (available in user.fiat_providers)
  • Support common currencies: EUR, USD, GBP, CHF, etc.
  • Fetch exchange rates from LNbits API

UI/UX

  • Currency dropdown/selector next to amount input
  • Live conversion preview as user types
  • Clear indication of which currency is selected
  • Remember user's preferred currency (optional)

Technical Considerations

LNbits API

LNbits has built-in fiat conversion support:

  • User object contains fiat_providers array
  • Likely has an endpoint for exchange rates (needs investigation)
  • May need to call conversion API before creating invoice

Files to Modify

  • src/modules/wallet/components/ReceiveDialog.vue - Add currency selector
  • src/modules/wallet/services/WalletService.ts - Add fiat conversion logic
  • Possibly add new API service for exchange rates

Data Flow

User enters "10 EUR"
        ↓
[Fetch exchange rate from LNbits]
        ↓
Convert: 10 EUR → X sats
        ↓
[Show preview: "10 EUR ≈ X sats"]
        ↓
User confirms
        ↓
[Create invoice for X sats]
        ↓
Display invoice with both amounts

Open Questions

  1. Which LNbits API endpoint provides exchange rates?
  2. Should we cache exchange rates or fetch fresh each time?
  3. How to handle rate fluctuations between preview and invoice creation?
  4. Should the invoice description include the original fiat amount?
## Summary Allow users to create Lightning invoices by specifying an amount in fiat currency (e.g., EUR, USD). The app converts the fiat amount to satoshis using real-time exchange rates from the server's configured fiat providers. ## User Story As a merchant or user, I want to create an invoice for a specific fiat amount (e.g., "5 EUR") so that I can easily charge customers in their local currency while receiving Bitcoin. ## Requirements ### Invoice Creation - Add currency selector to the "Receive" / "Create Invoice" dialog - Default to sats, but allow switching to any server-supported fiat currency - When fiat is selected: - User enters amount in fiat (e.g., "10.50 EUR") - App shows real-time conversion to sats before creating invoice - Invoice is created for the equivalent sat amount - Display both fiat and sat amounts on the created invoice ### Currency Support - Use server's configured fiat providers (available in `user.fiat_providers`) - Support common currencies: EUR, USD, GBP, CHF, etc. - Fetch exchange rates from LNbits API ### UI/UX - Currency dropdown/selector next to amount input - Live conversion preview as user types - Clear indication of which currency is selected - Remember user's preferred currency (optional) ## Technical Considerations ### LNbits API LNbits has built-in fiat conversion support: - User object contains `fiat_providers` array - Likely has an endpoint for exchange rates (needs investigation) - May need to call conversion API before creating invoice ### Files to Modify - `src/modules/wallet/components/ReceiveDialog.vue` - Add currency selector - `src/modules/wallet/services/WalletService.ts` - Add fiat conversion logic - Possibly add new API service for exchange rates ### Data Flow ``` User enters "10 EUR" ↓ [Fetch exchange rate from LNbits] ↓ Convert: 10 EUR → X sats ↓ [Show preview: "10 EUR ≈ X sats"] ↓ User confirms ↓ [Create invoice for X sats] ↓ Display invoice with both amounts ``` ## Open Questions 1. Which LNbits API endpoint provides exchange rates? 2. Should we cache exchange rates or fetch fresh each time? 3. How to handle rate fluctuations between preview and invoice creation? 4. Should the invoice description include the original fiat amount?
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: aiolabs/webapp#5
No description provided.