ln decoder for qr code scan and mobile qr modal fix

This commit is contained in:
lemonknowsall committed 2025-10-27 14:42:19 -07:00
1 parent fde64074ed
commit 0925bb9f1c
3 files changed
+35 -21

No files matched your search

+4 -2
View File
@@ -12,6 +12,7 @@ import { useWalletTransactions } from '@/hooks/cashu/useWalletTransactions';
import { useHistoryManager } from '@/hooks/cashu/useHistoryManager';
import { useBitcoinBalance, useBitcoinTransactionHistory, useBitcoinOperations } from '@/hooks/useBitcoinBalance';
import { useNsecAccess } from '@/hooks/useNsecAccess';
import { decodeBolt11Amount } from '@/lib/bolt11Decoder';
import { nostrPubkeyToBitcoinAddress } from '@/lib/bitcoin';
import { QRModal } from '@/components/ui/qr-modal';
import { WalletHeader } from './WalletHeader';
@@ -367,11 +368,12 @@ export function CashuWallet() {
setLightningInvoice(result.value);
setPendingInvoice(result.value);
// Decode invoice amount
setDecodedInvoiceAmount(100); // Placeholder - would need actual decoding
const amount = decodeBolt11Amount(result.value);
setDecodedInvoiceAmount(amount);
setShowSendModal(true);
toast({
title: "Lightning Invoice Scanned",
description: "Invoice ready to pay",
description: amount ? `${amount} sats` : "Invoice ready to pay",
});
break;
}