Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

Commit c4e6f20

Browse files
committed
Warn about hodl invoice
1 parent 4d3ecdc commit c4e6f20

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/routes/Send.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MutinyInvoice } from "@mutinywallet/mutiny-wasm";
1+
import { MutinyInvoice, MutinyWallet } from "@mutinywallet/mutiny-wasm";
22
import { A, useNavigate, useSearchParams } from "@solidjs/router";
33
import {
44
createEffect,
@@ -451,11 +451,15 @@ export function Send() {
451451
function processInvoice(source: ParsedParams & { invoice: string }) {
452452
state.mutiny_wallet
453453
?.decode_invoice(source.invoice!)
454-
.then((invoice) => {
454+
.then(async (invoice) => {
455455
if (invoice.expire <= Date.now() / 1000) {
456456
navigate("/search");
457457
throw new Error(i18n.t("send.error_expired"));
458458
}
459+
const isHodl = await MutinyWallet.is_potential_hodl_invoice(
460+
source.invoice!
461+
);
462+
setIsHodlInvoice(isHodl);
459463

460464
if (invoice?.amount_sats) {
461465
setAmountSats(invoice.amount_sats);

0 commit comments

Comments
 (0)