From 363cbdc7b4520222b8a2a37a5af03953921c91b8 Mon Sep 17 00:00:00 2001 From: Nodirbek <57404324+Nodirbek75@users.noreply.github.com> Date: Tue, 15 Oct 2024 18:58:35 +0500 Subject: [PATCH] remove Math.round() when converting the amount and send actual amount to generate an invoice (#280) --- app/hooks/use-price-conversion.ts | 5 ++--- .../receive-bitcoin-screen/payment/payment-request.ts | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/hooks/use-price-conversion.ts b/app/hooks/use-price-conversion.ts index 5e15b1e28a..e9f26cb1bd 100644 --- a/app/hooks/use-price-conversion.ts +++ b/app/hooks/use-price-conversion.ts @@ -84,9 +84,8 @@ export const usePriceConversion = () => { return moneyAmount } - let amount = Math.floor( - moneyAmount.amount * priceOfCurrencyInCurrency(moneyAmount.currency, toCurrency), - ) + let amount = + moneyAmount.amount * priceOfCurrencyInCurrency(moneyAmount.currency, toCurrency) if ( moneyAmountIsCurrencyType(moneyAmount, DisplayCurrency) && diff --git a/app/screens/receive-bitcoin-screen/payment/payment-request.ts b/app/screens/receive-bitcoin-screen/payment/payment-request.ts index 0cfb50f9a2..d93330fc87 100644 --- a/app/screens/receive-bitcoin-screen/payment/payment-request.ts +++ b/app/screens/receive-bitcoin-screen/payment/payment-request.ts @@ -154,6 +154,7 @@ export const createPaymentRequest = ( // Handle USD payment requests if (pr.type === Invoice.Lightning) { if (pr.settlementAmount && pr.settlementAmount?.currency === WalletCurrency.Usd) { + console.log("Invoice create amount: ", pr.settlementAmount.amount) const { data, errors } = await mutations.lnUsdInvoiceCreate({ variables: { input: {