feat: add notification screen

This commit is contained in:
reya
2024-05-06 15:17:34 +07:00
parent 28337e5915
commit c843626bca
37 changed files with 729 additions and 263 deletions
+17
View File
@@ -0,0 +1,17 @@
import { decode } from "light-bolt11-decoder";
import { getBitcoinDisplayValues } from "./formater";
export function decodeZapInvoice(tags?: string[][]) {
const invoice = tags.find((tag) => tag[0] === "bolt11")?.[1];
if (!invoice) return;
const decodedInvoice = decode(invoice);
const amountSection = decodedInvoice.sections.find(
(s: any) => s.name === "amount",
);
const amount = parseInt(amountSection.value);
const displayValue = getBitcoinDisplayValues(amount);
return displayValue;
}