Skip to content

Conversation

@Luquitasjeffrey
Copy link
Collaborator

@Luquitasjeffrey Luquitasjeffrey commented Feb 3, 2026

Now when someone takes a sell order it displays the sats amount plus bot fees, so the seller sees just the sats he's sending
Fixes #734

Summary by CodeRabbit

  • Bug Fixes
    • Refined invoice payment request messaging across all supported languages (English, German, Spanish, French, Italian, Korean, Portuguese, Russian, Ukrainian, Persian) to ensure accurate amount and currency information display.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

Walkthrough

The pull request refactors the invoice payment request message construction to pass computed numeric fields (amount and fiatAmount) directly to the translation function instead of the entire order object. Corresponding placeholder references are updated across all locale files to match the new data structure.

Changes

Cohort / File(s) Summary
Message Template Code
bot/messages.ts
Modified invoice_payment_requestMessage to extract and compute amount (sum of order.amount and order.fee) and fiatAmount fields separately, replacing the monolithic order object passed to the i18n function.
Locale Files
locales/{de,en,es,fa,fr,it,ko,pt,ru,uk}.yaml
Updated invoice_payment_request translation templates to use ${amount} and ${fiatAmount} placeholders instead of ${order.amount} and ${order.fiat_amount}, maintaining consistent message structure across all language versions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • #652: Directly modifies invoicePaymentRequestMessage in bot/messages.ts and related invoice localization, making it a closely connected change.

Suggested reviewers

  • grunch

Poem

🐰 No nested paths, just values clean,
Amount and fiatAmount now plainly seen,
Across ten tongues, the message rings,
With simpler placeholders—invoice wings! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Changes align with issue #734: the code now passes amount (computed as Math.floor(order.amount + order.fee)) and fiatAmount separately, and all locale files updated to use the new placeholders.
Out of Scope Changes check ✅ Passed All changes directly support the fix for issue #734; modifications are limited to amount calculation and corresponding locale placeholder updates with no extraneous changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: fixing the amount displayed to the seller for a sell order by including bot fees in the displayed sats amount.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue734

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Luquitasjeffrey Luquitasjeffrey changed the title Fix in amount being displayed to the user for a sell order Fix in amount being displayed to the seller (order maker) for a sell order Feb 3, 2026
const message = i18n.t('invoice_payment_request', {
currency,
order,
amount: Math.floor(order.amount + order.fee),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Luquitasjeffrey why floor?

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.

Incorrect amount being displayed when someone takes a sell order

2 participants