From c5443946031ec32a7b3008fa751eb7916654a9f6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 14 Jun 2026 23:01:03 -0700 Subject: Rebuild as single-file offline BIP84 wallet Replace the SvelteKit/daisyUI prototype with a vanilla JS + hand-rolled CSS app that Bun bundles (code + scure/noble crypto + QR + CSS) into one self-contained dist/index.html runnable offline from file://. Wallet core (src/wallet.js): - BIP84 native-segwit HD wallet from BIP39 seed (+optional passphrase) - gap-limit scan of receive/change chains, aggregate balance, tx history - fresh receive/change addresses; signs with witnessUtxo only (enables offline signing with no prev-tx fetch) - coin selection + fee estimation via btc-signer selectUTXO; send-max; manual coin control - offline JSON snapshot export/import (keyless) + signed-tx hex/QR export - realtime mempool.space WebSocket: track-addresses -> debounced auto refresh of balances/history (no polling); live status badge UI (src/app.js): clean light paper-wallet; create (with optional, skippable backup verification) / import flow; receive (QR) / send / history / coins / tools tabs; clickable logo returns home. API (src/api.js): mempool.space wrapper with retry/backoff for scan-burst rate limiting; single network choke-point for offline enforcement. Verified: BIP84 spec vectors, build/sign/parse for auto/max/manual flows, snapshot roundtrip, live scan + WebSocket, headless-Chrome UI smoke tests. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/routes/+layout.svelte | 19 --- src/routes/+layout.ts | 2 - src/routes/+page.svelte | 342 ---------------------------------------------- 3 files changed, 363 deletions(-) delete mode 100644 src/routes/+layout.svelte delete mode 100644 src/routes/+layout.ts delete mode 100644 src/routes/+page.svelte (limited to 'src/routes') diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte deleted file mode 100644 index fe115b3..0000000 --- a/src/routes/+layout.svelte +++ /dev/null @@ -1,19 +0,0 @@ - - -
-
- -
- Adamant -
-
- - {@render children()} -
diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts deleted file mode 100644 index 89da957..0000000 --- a/src/routes/+layout.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const ssr = false; -export const prerender = true; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte deleted file mode 100644 index 4694a63..0000000 --- a/src/routes/+page.svelte +++ /dev/null @@ -1,342 +0,0 @@ - - -
-
- {#if revealSeed} - - {:else} - - {/if} -
- - - - -
-
- -
- {#if revealPassword} - - {:else} - - {/if} - -
- - - - - -
-
- -
- {#if address} -
-
- {address} -
- -
- - -
-
- {/if} -
-
- -{#if loading} -
-
-
-{:else if typeof balance !== 'undefined'} -
-
- Balance: {balance + pending} sats -
- {#if balance + pending > 0} - - {/if} -
-{/if} - -{#if txid} -
-
Transaction completed!
-
- Details -
-
-{:else if withdrawing} - - - - - -{/if} -- cgit v1.2.3