From 1109581ac894bc7f872c53989d1aecde7cfa229f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 3 Mar 2026 14:49:16 -0800 Subject: preload --- .../bitcoin/[address]/[amount]/[...feeRate]/+page.svelte | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/routes/(app)') diff --git a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte index d5eb0293..54927f0f 100644 --- a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte +++ b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte @@ -31,7 +31,9 @@ try { await signTxWithPrf(prfKey); return; - } catch (e: any) {} + } catch (e: any) { + console.log("Signing with cached PRF key failed:", e.message); + } } const { getWalletEntropy, deriveNostrEntropy } = await import("$lib/walletEntropy"); const entropy = await getWalletEntropy(); @@ -39,12 +41,15 @@ try { await signTxWithPrf(entropy); return; - } catch (e: any) {} + } catch (e: any) { + console.log("Signing with wallet entropy failed:", e.message); + } } try { const interactiveEntropy = await deriveNostrEntropy(); await signTxWithPrf(interactiveEntropy); } catch (e: any) { + console.log("Signing with interactive entropy failed:", e.message); error = e.message || $t("payments.failedToSend"); } }; @@ -105,6 +110,10 @@ let master = HDKey.fromMasterSeed(seed, network as any); let child = master.derive(`m/84'/0'/${account.accountIndex ?? 0}'`); + if (account.pubkey && child.publicExtendedKey !== account.pubkey) { + throw new Error("Derived key does not match account — try logging in again"); + } + let raw = decode(hex); let isPSBT = raw[0] === 0x70 && raw[1] === 0x73 && raw[2] === 0x62 && raw[3] === 0x74; let tx: any = isPSBT ? Transaction.fromPSBT(raw) : Transaction.fromRaw(raw); -- cgit v1.2.3