Skip to content

Conversation

achaljhawar
Copy link
Contributor

@achaljhawar achaljhawar commented May 27, 2025

Describe the changes you have made in this PR

This PR adds a two-way currency conversion feature to the "Make Invoice" screen. You can now enter amounts in either satoshis or your local fiat currency, with the other field updating dynamically based on fetched exchange rates. This enhances flexibility when creating invoices.

Key changes:

  • Added a fiat currency input field to MakeInvoice.tsx.
  • Implemented logic for bidirectional conversion using rates from SettingsContext.
  • Added error handling for invalid inputs, amounts outside limits, and rate fetching issues.
  • Ensured getCurrencyRate from SettingsContext is exposed and used.
  • Verified the correct satoshi amount is used for invoice generation.

Link this PR to an issue [optional]

Fixes #3158

Type of change

  • feat: New feature (non-breaking change which adds functionality)

Checklist

  • Self-review of changed code
  • Manual testing
  • Added automated tests where applicable
  • Update Docs & Guides
  • For UI-related changes
  • Darkmode
  • Responsive layout

@achaljhawar achaljhawar changed the title Main Invoice Currency Conversion May 27, 2025
@pavanjoshi914
Copy link
Contributor

can you share screenshot/video related to changes

@pavanjoshi914
Copy link
Contributor

you can maybe try to implement it like this at all the places: #3089

@achaljhawar
Copy link
Contributor Author

ok I'll create new PR for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Show/Use converted currency value when generating an Lightning invoice

2 participants