From 969fc0ca8041f492ebede65275890c22bd48b012 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 3 Aug 2026 10:06:16 -0700 Subject: Add /migrate: hand a legacy account over to coinos v3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit coinos v3 links here with ?to=&back=. The user is already signed in on this site, so no password or key has to travel anywhere: we fetch an invoice from the v3 registrar for the balance (less a small routing reserve), pay it, then rename the account to _v2 — which releases the username so v3's registrar will let them claim it. Old account stays, renamed, and stops receiving. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi --- src/routes/(app)/migrate/+page.server.ts | 10 +++ src/routes/(app)/migrate/+page.svelte | 118 +++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 src/routes/(app)/migrate/+page.server.ts create mode 100644 src/routes/(app)/migrate/+page.svelte (limited to 'src') diff --git a/src/routes/(app)/migrate/+page.server.ts b/src/routes/(app)/migrate/+page.server.ts new file mode 100644 index 00000000..4529c14c --- /dev/null +++ b/src/routes/(app)/migrate/+page.server.ts @@ -0,0 +1,10 @@ +import { redirect } from "@sveltejs/kit"; + +export async function load({ parent, url }) { + const { user } = await parent(); + if (!user) redirect(307, `/login?redirect=${encodeURIComponent(url.pathname + url.search)}`); + return { + to: url.searchParams.get("to") || "", + back: url.searchParams.get("back") || "", + }; +} diff --git a/src/routes/(app)/migrate/+page.svelte b/src/routes/(app)/migrate/+page.svelte new file mode 100644 index 00000000..4493709b --- /dev/null +++ b/src/routes/(app)/migrate/+page.svelte @@ -0,0 +1,118 @@ + + +
+

Move your account to coinos v3

+ + {#if !to} +

+ This page needs a destination. Start the migration from coinos v3. +

+ {:else if step === "done"} +
+

✓ All done!

+ {#if sent} +

{sent.toLocaleString()} sats are on their way to your new wallet.

+ {/if} +

+ Your old username was released, so {user.username} can now be + yours on coinos v3. +

+ +
+ {:else if step === "working"} +

{note}

+ + {:else} +
+

+ This moves your balance to your new wallet and frees up your username so you can + keep it there. Your old account stays, renamed to + {newName}, and stops receiving payments. +

+
+
Balance{balance.toLocaleString()} sats
+
Sending{amount.toLocaleString()} sats
+
Left for routing{reserve.toLocaleString()} sats
+
To{to}
+
+ {#if user?.haspin} + + {/if} + {#if error}

{error}

{/if} + +

+ You can also do nothing — your old account keeps working as it is. +

+
+ {/if} +
-- cgit v1.2.3