aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/account
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-11 20:10:43 -0800
committerAdam Soltys <[email protected]>2026-02-11 20:10:43 -0800
commit56a04684c1fb77ea7b21afc6b0d2e1c4773906f6 (patch)
treed6bc2557c56b93177bb14aa376847c6e123a4862 /src/routes/(app)/account
parent13466248004327e9a026cb89f94926f9b060d1c1 (diff)
downloadcoinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.tar.gz
coinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.zip
format
Diffstat (limited to 'src/routes/(app)/account')
-rw-r--r--src/routes/(app)/account/[id]/+page.svelte14
-rw-r--r--src/routes/(app)/account/ark/+page.svelte75
-rw-r--r--src/routes/(app)/account/bitcoin/+page.svelte6
-rw-r--r--src/routes/(app)/account/import/+page.svelte6
-rw-r--r--src/routes/(app)/account/new/+page.svelte14
-rw-r--r--src/routes/(app)/account/pass/+page.svelte38
-rw-r--r--src/routes/(app)/account/setup/+page.svelte9
7 files changed, 38 insertions, 124 deletions
diff --git a/src/routes/(app)/account/[id]/+page.svelte b/src/routes/(app)/account/[id]/+page.svelte
index 6b48bac2..43ebe508 100644
--- a/src/routes/(app)/account/[id]/+page.svelte
+++ b/src/routes/(app)/account/[id]/+page.svelte
@@ -8,10 +8,7 @@
import { t } from "$lib/translations";
import { entropyToMnemonic, mnemonicToSeed } from "@scure/bip39";
import { wordlist } from "@scure/bip39/wordlists/english.js";
- import {
- getRememberedWalletPassword,
- forgetWalletPassword,
- } from "$lib/passwordCache";
+ import { getRememberedWalletPassword, forgetWalletPassword } from "$lib/passwordCache";
let { data } = $props();
let { account, user } = data;
@@ -94,22 +91,19 @@
<Mnemonic {mnemonic} />
<button onclick={() => copy(mnemonic)} type="button" class="btn">
- <iconify-icon noobserver icon="ph:copy-bold" width="32"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:copy-bold" width="32"></iconify-icon>
<div class="my-auto">{$t("accounts.copy")}</div></button
>
{:else if seed}
<button onclick={requestMnemonic} type="button" class="btn">
- <iconify-icon noobserver icon="ph:eye-bold" width="32"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:eye-bold" width="32"></iconify-icon>
<div class="my-auto">{$t("accounts.revealMnemonic")}</div></button
>
{/if}
{#if seed}
<button onclick={del} type="button" class="btn">
- <iconify-icon noobserver icon="ph:trash-bold" width="32"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:trash-bold" width="32"></iconify-icon>
<div class="my-auto">{$t("accounts.deleteAccount")}</div></button
>
{/if}
diff --git a/src/routes/(app)/account/ark/+page.svelte b/src/routes/(app)/account/ark/+page.svelte
index 42329ef8..c21da0d5 100644
--- a/src/routes/(app)/account/ark/+page.svelte
+++ b/src/routes/(app)/account/ark/+page.svelte
@@ -165,14 +165,11 @@
{#if hasMasterSeed}
<form onsubmit={preventDefault(submit)} class="space-y-5">
<p class="text-secondary">
- Your Ark wallet will be derived from your master seed. Enter your
- wallet password to continue.
+ Your Ark wallet will be derived from your master seed. Enter your wallet password to
+ continue.
</p>
- <label
- for="password"
- class="input flex items-center justify-center gap-2 w-full"
- >
+ <label for="password" class="input flex items-center justify-center gap-2 w-full">
{#if revealPassword}
<input
name="password"
@@ -211,15 +208,12 @@
</label>
<div class="space-y-2">
- <label for="rememberFor" class="text-sm text-secondary">
- Remember for
- </label>
+ <label for="rememberFor" class="text-sm text-secondary"> Remember for </label>
<select
id="rememberFor"
class="w-full"
value={rememberForMs}
- onchange={(e) =>
- (rememberForMs = Number((e.target as HTMLSelectElement).value))}
+ onchange={(e) => (rememberForMs = Number((e.target as HTMLSelectElement).value))}
>
{#each rememberForOptions as option}
<option value={option.ms}>{option.label}</option>
@@ -231,11 +225,7 @@
<a href={`/${user.username}`} class="contents">
<button type="button" class="btn !w-auto grow"> Back </button>
</a>
- <button
- disabled={submitting}
- type="submit"
- class="btn btn-accent !w-auto grow"
- >
+ <button disabled={submitting} type="submit" class="btn btn-accent !w-auto grow">
{#if submitting}
<Spinner />
{:else}
@@ -247,8 +237,7 @@
{:else if !confirmed}
<div class="space-y-4">
<p class="text-secondary">
- Your Ark wallet is secured by a private key. Please copy it down
- somewhere safe.
+ Your Ark wallet is secured by a private key. Please copy it down somewhere safe.
</p>
{#if showNsec}
@@ -264,24 +253,14 @@
</div>
<div class="flex gap-2">
- <button
- type="button"
- class="btn btn-accent flex-grow"
- onclick={confirmBackup}
- >
- <iconify-icon noobserver icon="ph:check-bold" width="24"
- ></iconify-icon>
+ <button type="button" class="btn btn-accent flex-grow" onclick={confirmBackup}>
+ <iconify-icon noobserver icon="ph:check-bold" width="24"></iconify-icon>
I've backed it up
</button>
</div>
{:else}
- <button
- type="button"
- class="btn btn-warning w-full"
- onclick={revealNsec}
- >
- <iconify-icon noobserver icon="ph:eye-bold" width="24"
- ></iconify-icon>
+ <button type="button" class="btn btn-warning w-full" onclick={revealNsec}>
+ <iconify-icon noobserver icon="ph:eye-bold" width="24"></iconify-icon>
Reveal backup key
</button>
{/if}
@@ -289,14 +268,10 @@
{:else}
<form onsubmit={preventDefault(submit)} class="space-y-5">
<p class="text-secondary">
- Set a password to encrypt your key. You'll need this password to send
- funds.
+ Set a password to encrypt your key. You'll need this password to send funds.
</p>
- <label
- for="password"
- class="input flex items-center justify-center gap-2 w-full"
- >
+ <label for="password" class="input flex items-center justify-center gap-2 w-full">
{#if revealPassword}
<input
name="password"
@@ -334,10 +309,7 @@
</button>
</label>
- <label
- for="confirm"
- class="input flex items-center justify-center gap-2 w-full"
- >
+ <label for="confirm" class="input flex items-center justify-center gap-2 w-full">
{#if revealConfirm}
<input
name="confirm"
@@ -373,15 +345,12 @@
</label>
<div class="space-y-2">
- <label for="rememberFor" class="text-sm text-secondary">
- Remember for
- </label>
+ <label for="rememberFor" class="text-sm text-secondary"> Remember for </label>
<select
id="rememberFor"
class="w-full"
value={rememberForMs}
- onchange={(e) =>
- (rememberForMs = Number((e.target as HTMLSelectElement).value))}
+ onchange={(e) => (rememberForMs = Number((e.target as HTMLSelectElement).value))}
>
{#each rememberForOptions as option}
<option value={option.ms}>{option.label}</option>
@@ -390,18 +359,10 @@
</div>
<div class="flex gap-2">
- <button
- type="button"
- class="btn !w-auto grow"
- onclick={() => (confirmed = false)}
- >
+ <button type="button" class="btn !w-auto grow" onclick={() => (confirmed = false)}>
Back
</button>
- <button
- disabled={submitting}
- type="submit"
- class="btn btn-accent !w-auto grow"
- >
+ <button disabled={submitting} type="submit" class="btn btn-accent !w-auto grow">
{#if submitting}
<Spinner />
{:else}
diff --git a/src/routes/(app)/account/bitcoin/+page.svelte b/src/routes/(app)/account/bitcoin/+page.svelte
index 87dc32e2..ca90c758 100644
--- a/src/routes/(app)/account/bitcoin/+page.svelte
+++ b/src/routes/(app)/account/bitcoin/+page.svelte
@@ -11,8 +11,7 @@
<a href="/account/seed" class="block">
<div class="card card-side shadow shadow-base-300 p-8 hover:bg-base-200">
<figure class="w-20 flex items-center justify-center">
- <iconify-icon noobserver icon="ph:file-plus-bold" width="64"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:file-plus-bold" width="64"></iconify-icon>
</figure>
<div>
<div class="text-xl">{$t("accounts.create")}</div>
@@ -23,8 +22,7 @@
<a href="/account/import" class="block">
<div class="card card-side shadow shadow-base-300 p-8 hover:bg-base-200">
<figure class="w-20 flex items-center justify-center">
- <iconify-icon noobserver icon="ph:folder-open-bold" width="64"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:folder-open-bold" width="64"></iconify-icon>
</figure>
<div>
<div class="text-xl">{$t("accounts.import")}</div>
diff --git a/src/routes/(app)/account/import/+page.svelte b/src/routes/(app)/account/import/+page.svelte
index 551cbb2d..09e1edb1 100644
--- a/src/routes/(app)/account/import/+page.svelte
+++ b/src/routes/(app)/account/import/+page.svelte
@@ -53,11 +53,7 @@
{$t("accounts.back")}
</button>
</a>
- <button
- bind:this={el}
- type="submit"
- class="btn btn-accent !w-auto grow"
- >
+ <button bind:this={el} type="submit" class="btn btn-accent !w-auto grow">
<div class="my-auto">{$t("accounts.next")}</div>
</button>
</div>
diff --git a/src/routes/(app)/account/new/+page.svelte b/src/routes/(app)/account/new/+page.svelte
index 4100e001..c4045db8 100644
--- a/src/routes/(app)/account/new/+page.svelte
+++ b/src/routes/(app)/account/new/+page.svelte
@@ -7,9 +7,7 @@
<div class="container w-full mx-auto text-lg px-4 max-w-xl space-y-5">
<a href="/account/bitcoin" class="block">
- <div
- class="card card-side shadow shadow-base-300 p-8 hover:bg-base-200 gap-4 items-center"
- >
+ <div class="card card-side shadow shadow-base-300 p-8 hover:bg-base-200 gap-4 items-center">
<iconify-icon noobserver icon="logos:bitcoin" width={48}></iconify-icon>
<div>
<div class="text-xl">Bitcoin (On-chain)</div>
@@ -20,14 +18,8 @@
</div>
</a>
<a href="/account/ark" class="block">
- <div
- class="card card-side shadow shadow-base-300 p-8 hover:bg-base-200 gap-4 items-center"
- >
- <img
- src="/images/ark.png"
- class="w-12 h-12 rounded-full object-cover"
- alt="Ark"
- />
+ <div class="card card-side shadow shadow-base-300 p-8 hover:bg-base-200 gap-4 items-center">
+ <img src="/images/ark.png" class="w-12 h-12 rounded-full object-cover" alt="Ark" />
<div>
<div class="text-xl">Ark (Off-chain)</div>
<div class="text-secondary">
diff --git a/src/routes/(app)/account/pass/+page.svelte b/src/routes/(app)/account/pass/+page.svelte
index 2f62c38c..fd58921f 100644
--- a/src/routes/(app)/account/pass/+page.svelte
+++ b/src/routes/(app)/account/pass/+page.svelte
@@ -5,11 +5,7 @@
import { t } from "$lib/translations";
import { mnemonic } from "$lib/store";
import Spinner from "$comp/Spinner.svelte";
- import {
- mnemonicToSeed,
- mnemonicToEntropy,
- entropyToMnemonic,
- } from "@scure/bip39";
+ import { mnemonicToSeed, mnemonicToEntropy, entropyToMnemonic } from "@scure/bip39";
import { wordlist } from "@scure/bip39/wordlists/english.js";
import { focus, versions, fail, post } from "$lib/utils";
import { goto } from "$app/navigation";
@@ -46,10 +42,7 @@
try {
const { encrypt } = await import("nostr-tools/nip49");
- let seed = await encrypt(
- mnemonicToEntropy($mnemonic as string, wordlist),
- password,
- );
+ let seed = await encrypt(mnemonicToEntropy($mnemonic as string, wordlist), password);
// Save master seed on user
await post("/post/user", { seed });
@@ -98,16 +91,11 @@
onsubmit={preventDefault(submit)}
class="container w-full mx-auto text-lg px-4 max-w-xl space-y-5"
>
- <p
- class="text-secondary p-4 bg-warning/80 rounded-2xl border-warning border-2"
- >
+ <p class="text-secondary p-4 bg-warning/80 rounded-2xl border-warning border-2">
{$t("accounts.passwordWarning")}
</p>
- <label
- for="password"
- class="input flex items-center justify-center gap-2 w-full"
- >
+ <label for="password" class="input flex items-center justify-center gap-2 w-full">
{#if revealPassword}
<input
name="password"
@@ -144,10 +132,7 @@
</button>
</label>
- <label
- for="confirm"
- class="input flex items-center justify-center gap-2 w-full"
- >
+ <label for="confirm" class="input flex items-center justify-center gap-2 w-full">
{#if revealConfirm}
<input
name="confirm"
@@ -183,15 +168,12 @@
</label>
<div class="space-y-2">
- <label for="rememberFor" class="text-sm text-secondary">
- Remember for
- </label>
+ <label for="rememberFor" class="text-sm text-secondary"> Remember for </label>
<select
id="rememberFor"
class="w-full"
value={rememberForMs}
- onchange={(e) =>
- (rememberForMs = Number((e.target as HTMLSelectElement).value))}
+ onchange={(e) => (rememberForMs = Number((e.target as HTMLSelectElement).value))}
>
{#each rememberForOptions as option}
<option value={option.ms}>{option.label}</option>
@@ -205,11 +187,7 @@
{$t("accounts.back")}
</button>
</a>
- <button
- disabled={submitting}
- type="submit"
- class="btn btn-accent !w-auto grow"
- >
+ <button disabled={submitting} type="submit" class="btn btn-accent !w-auto grow">
{#if submitting}
<Spinner />
{:else}
diff --git a/src/routes/(app)/account/setup/+page.svelte b/src/routes/(app)/account/setup/+page.svelte
index 9d747578..faab0938 100644
--- a/src/routes/(app)/account/setup/+page.svelte
+++ b/src/routes/(app)/account/setup/+page.svelte
@@ -19,16 +19,11 @@
</a>
<a href="/account/new" class="block">
<div class="shadow p-8 rounded-xl flex gap-4 hover:bg-primary">
- <img
- src="/images/keys.png"
- class="w-20 my-auto"
- alt="Savings account"
- />
+ <img src="/images/keys.png" class="w-20 my-auto" alt="Savings account" />
<div>
<div class="text-xl">Savings</div>
<div class="text-secondary">
- You hold the keys to the account and are responsible for
- safeguarding them.
+ You hold the keys to the account and are responsible for safeguarding them.
</div>
</div>
</div>