feat: display invoice memo in Lightning invoice cards (#643)

Co-authored-by: The Daniel <dmnyc@users.noreply.github.com>
This commit is contained in:
The Daniel ⚡️ 2025-11-04 21:15:21 -05:00 committed by GitHub
parent 0eb0be4780
commit b0b9a391a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 3 deletions

View file

@ -7,6 +7,14 @@ export function getAmountFromInvoice(invoice: string): number {
return _invoice.satoshi
}
export function getInvoiceDetails(invoice: string): { amount: number; description: string | null } {
const _invoice = new Invoice({ pr: invoice }) // TODO: need to validate
return {
amount: _invoice.satoshi,
description: _invoice.description,
}
}
export function formatAmount(amount: number) {
if (amount < 1000) return amount
if (amount < 1000000) return `${Math.round(amount / 100) / 10}k`