From 56a04684c1fb77ea7b21afc6b0d2e1c4773906f6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Feb 2026 20:10:43 -0800 Subject: format --- src/routes/(app)/+layout.server.ts | 6 +- src/routes/(app)/+layout.svelte | 11 +-- .../(app)/[username]/(profile)/+layout.svelte | 75 ++++------------ src/routes/(app)/[username]/(profile)/+page.svelte | 16 +--- src/routes/(app)/[username]/(profile)/+page.ts | 3 +- .../[username]/(profile)/notes/new/+page.svelte | 7 +- src/routes/(app)/[username]/+layout.server.ts | 7 +- .../(app)/[username]/accepted/[text]/+page.svelte | 20 +---- .../(app)/[username]/accepted/create/+page.svelte | 19 +--- src/routes/(app)/[username]/receive/+page.svelte | 22 +---- src/routes/(app)/account/[id]/+page.svelte | 14 +-- src/routes/(app)/account/ark/+page.svelte | 75 ++++------------ src/routes/(app)/account/bitcoin/+page.svelte | 6 +- src/routes/(app)/account/import/+page.svelte | 6 +- src/routes/(app)/account/new/+page.svelte | 14 +-- src/routes/(app)/account/pass/+page.svelte | 38 ++------ src/routes/(app)/account/setup/+page.svelte | 9 +- src/routes/(app)/admin/+page.server.ts | 4 +- src/routes/(app)/apps/new/+page.server.ts | 6 +- src/routes/(app)/dm/+page.svelte | 73 ++++----------- .../(app)/ecash/[id]/[...version]/+layout.svelte | 8 +- .../(app)/ecash/[id]/[...version]/+page.server.ts | 3 +- .../(app)/ecash/[id]/[...version]/+page.svelte | 17 +--- .../ecash/[id]/[...version]/swap/+page.svelte | 4 +- src/routes/(app)/firehose/+page.svelte | 4 +- src/routes/(app)/fund/[id]/+page.svelte | 30 ++----- src/routes/(app)/fund/[id]/access/+page.svelte | 15 +--- src/routes/(app)/fund/[id]/gift/+page.svelte | 6 +- .../(app)/fund/[id]/sweep/[...amount]/+page.svelte | 8 +- src/routes/(app)/fund/[id]/withdraw/+page.svelte | 7 +- src/routes/(app)/invoice/[id]/+layout.server.ts | 3 +- src/routes/(app)/invoice/[id]/+page.svelte | 23 +---- src/routes/(app)/invoice/[id]/paid/+page.svelte | 11 +-- src/routes/(app)/invoice/[id]/tip/+page.server.ts | 6 +- src/routes/(app)/invoice/[id]/tip/+page.svelte | 26 ++---- src/routes/(app)/invoices/+page.svelte | 4 +- src/routes/(app)/ln/[lnurl]/+page.server.ts | 32 ++----- src/routes/(app)/ln/withdrawal/sent/+page.svelte | 10 +-- src/routes/(app)/messages/+page.server.ts | 4 +- src/routes/(app)/messages/+page.svelte | 16 +--- .../(app)/messages/[recipient]/+page.server.ts | 5 +- src/routes/(app)/messages/[recipient]/+page.svelte | 27 ++---- .../(app)/pay/[username]/[...amount]/+page.svelte | 13 +-- src/routes/(app)/payment/[id]/+page.svelte | 49 +++------- src/routes/(app)/payment/[id]/plain/+page.svelte | 12 +-- .../(app)/payments/[...page]/+page.server.ts | 5 +- src/routes/(app)/payments/[...page]/+page.svelte | 65 +++----------- src/routes/(app)/pos/+page.svelte | 49 +++------- src/routes/(app)/printer/+page.svelte | 16 +--- src/routes/(app)/qr/[text]/[icon]/+server.ts | 8 +- src/routes/(app)/qr/create/+page.svelte | 19 +--- src/routes/(app)/receive/[...token]/+page.svelte | 10 +-- src/routes/(app)/reset/[code]/+page.svelte | 29 ++---- src/routes/(app)/scan/+page.svelte | 7 +- src/routes/(app)/send/+layout.server.ts | 3 +- src/routes/(app)/send/[...text]/+page.svelte | 33 ++----- .../(app)/send/ark/[address]/+layout.server.ts | 3 +- src/routes/(app)/send/ark/[address]/+page.svelte | 21 +---- .../[amount]/[...feeRate]/+page.server.ts | 12 +-- .../[address]/[amount]/[...feeRate]/+page.svelte | 4 +- .../(app)/send/bitcoin/[address]/+page.svelte | 22 +---- .../[amount]/[...feeRate]/+page.server.ts | 12 +-- .../[address]/[amount]/[...feeRate]/+page.svelte | 62 ++++--------- .../send/fund/[...name]/[...amount]/+page.svelte | 14 +-- src/routes/(app)/send/invoice/[id]/+page.server.ts | 16 +--- src/routes/(app)/send/invoice/[id]/+page.svelte | 39 ++------ .../send/lightning/[payreq]/[...memo]/+page.svelte | 26 ++---- .../send/zap/[id]/[...amount]/+page.server.ts | 3 +- .../(app)/send/zap/[id]/[...amount]/+page.svelte | 4 +- src/routes/(app)/sent/[id]/+page.svelte | 9 +- src/routes/(app)/settings/+layout.svelte | 14 +-- src/routes/(app)/settings/account/+page.svelte | 100 +++++---------------- src/routes/(app)/settings/nostr/+page.svelte | 37 ++------ src/routes/(app)/settings/profile/+page.svelte | 53 +++-------- src/routes/(app)/settings/security/+page.svelte | 24 ++--- src/routes/(app)/thread/[id]/+page.svelte | 4 +- src/routes/(app)/verify/[code]/+page.svelte | 18 +--- src/routes/(static)/+layout.svelte | 5 +- src/routes/(static)/bounties/+page.svelte | 49 ++++------ src/routes/(static)/docs/+page.svelte | 67 +++++--------- src/routes/(static)/forgot/+page.svelte | 4 +- src/routes/(static)/login/+page.svelte | 41 ++------- src/routes/(static)/privacy/+page.svelte | 13 ++- src/routes/(static)/register/+page.svelte | 69 ++++---------- src/routes/(static)/removal/+page.svelte | 4 +- src/routes/(static)/support/+page.svelte | 26 ++---- src/routes/+layout.server.ts | 6 +- src/routes/+layout.svelte | 5 +- src/routes/+layout.ts | 4 +- src/routes/+page.svelte | 6 +- src/routes/phtest/+page.svelte | 4 +- 91 files changed, 416 insertions(+), 1402 deletions(-) (limited to 'src/routes') diff --git a/src/routes/(app)/+layout.server.ts b/src/routes/(app)/+layout.server.ts index 3b29df70..11114ebd 100644 --- a/src/routes/(app)/+layout.server.ts +++ b/src/routes/(app)/+layout.server.ts @@ -50,11 +50,7 @@ export async function load({ cookies, request, url, params }) { redirect(307, "/migrate"); } - if ( - user && - ["/login", "/register"].includes(pathname) && - request.method === "GET" - ) { + if (user && ["/login", "/register"].includes(pathname) && request.method === "GET") { redirect(307, `/${user.username}`); } diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index 346cc93e..6ac9bed5 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -24,12 +24,7 @@ import Password from "$comp/Password.svelte"; import { s, f, toFiat, success, getCookie, warning } from "$lib/utils"; import { t, locale, loading } from "$lib/translations"; - import { - goto, - invalidate, - afterNavigate, - preloadData, - } from "$app/navigation"; + import { goto, invalidate, afterNavigate, preloadData } from "$app/navigation"; let { data, children } = $props(); @@ -63,9 +58,7 @@ if (result?.received > 0) { if ($fiat && $rateStore && user?.currency) { - success( - `Received ${f(toFiat(result.received, $rateStore), user.currency)}!`, - ); + success(`Received ${f(toFiat(result.received, $rateStore), user.currency)}!`); } else { success(`Received ⚡️${s(result.received)}!`); } diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index 1bb9447f..6e6a318f 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -37,18 +37,14 @@ let stripped = $derived(n.replace(/\s/g, "")); let username = $derived(n.length > 60 ? n.substr(0, 6) : display || stripped); let lnaddr = $derived( - subject?.anon - ? subject.lud16 || undefined - : `${stripped}@${$page.url.host}`, + subject?.anon ? subject.lud16 || undefined : `${stripped}@${$page.url.host}`, ); let profile = $derived(`${$page.url.host}/${subject.anon ? npub : stripped}`); let lnurl = $derived( encode( "lnurl", toWords( - new TextEncoder().encode( - `https://${PUBLIC_DOMAIN}/p/${subject.anon ? npub : stripped}`, - ), + new TextEncoder().encode(`https://${PUBLIC_DOMAIN}/p/${subject.anon ? npub : stripped}`), ), 20000, ), @@ -57,33 +53,19 @@
-
-
+
+
{#if subject.id === user?.id} - - + + {:else} - - + + {/if} @@ -128,16 +110,14 @@ aria-label="Copy lightning address" onclick={() => copy(lnaddr)} > - > - +
@@ -156,18 +136,14 @@ aria-label="Copy profile URL" onclick={() => copy(profile)} > - > - +
@@ -185,16 +161,14 @@ aria-label="Copy LNURL" onclick={() => copy(`lightning:${lnurl}`)} > - > - +
@@ -259,8 +233,7 @@ aria-label="Reset password" >
- +
@@ -269,9 +242,7 @@
-
+
{@render children?.()}
@@ -293,20 +264,12 @@ {#if satsPerCurrency >= 1}
{f(1, currency, locale)} =
- + {s(satsPerCurrency)}
{:else}
- + 1
= {f(1 / satsPerCurrency, currency, locale)}
diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte index fb4d6dd9..78816e36 100644 --- a/src/routes/(app)/[username]/(profile)/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/+page.svelte @@ -73,8 +73,7 @@ aria-label={$t("accounts.addAccount")} title={$t("accounts.addAccount")} > - +
@@ -88,8 +87,7 @@ {#if $installPrompt} {/if} @@ -106,14 +104,8 @@ : `/pay/${subject.username}`} class="contents" > - + + diff --git a/src/routes/(app)/[username]/+layout.server.ts b/src/routes/(app)/[username]/+layout.server.ts index ab755410..5e921541 100644 --- a/src/routes/(app)/[username]/+layout.server.ts +++ b/src/routes/(app)/[username]/+layout.server.ts @@ -1,12 +1,7 @@ import { get } from "$lib/utils"; import { error } from "@sveltejs/kit"; -export const load = async ({ - cookies, - depends, - params: { username }, - parent, -}) => { +export const load = async ({ cookies, depends, params: { username }, parent }) => { depends("app:user"); try { diff --git a/src/routes/(app)/[username]/accepted/[text]/+page.svelte b/src/routes/(app)/[username]/accepted/[text]/+page.svelte index 339f6c9c..3e16177c 100644 --- a/src/routes/(app)/[username]/accepted/[text]/+page.svelte +++ b/src/routes/(app)/[username]/accepted/[text]/+page.svelte @@ -14,35 +14,23 @@ let lnurl = $derived( `https://${PUBLIC_DOMAIN}/ln/${encode( "lnurl", - toWords( - new TextEncoder().encode(`https://${PUBLIC_DOMAIN}/p/${username}`), - ), + toWords(new TextEncoder().encode(`https://${PUBLIC_DOMAIN}/p/${username}`)), 20000, )}`, );
-
+
- Bitcoin + Bitcoin
{#if nfc} - Tap + Tap - e.key === "Enter" ? e.preventDefault() || el.click() : (pasted = false); + let keypress = (e) => (e.key === "Enter" ? e.preventDefault() || el.click() : (pasted = false)); let paste = async () => { text = await navigator.clipboard.readText(); @@ -24,9 +23,7 @@
-

- Create QR -

+

Create QR

@@ -48,11 +45,7 @@ class="flex border rounded-2xl px-6 py-5 font-bold hover:opacity-80 w-full bg-primary justify-center gap-2" onclick={paste} > -
{$t("user.send.paste")}
@@ -62,11 +55,7 @@ type="submit" class="flex bg-black text-white border rounded-2xl px-6 py-5 w-full font-bold gap-2 justify-center" > -
{$t("user.dashboard.go")}
diff --git a/src/routes/(app)/[username]/receive/+page.svelte b/src/routes/(app)/[username]/receive/+page.svelte index 6921d443..14489c13 100644 --- a/src/routes/(app)/[username]/receive/+page.svelte +++ b/src/routes/(app)/[username]/receive/+page.svelte @@ -1,18 +1,6 @@
-
+

{creatingNewChat ? $t("dm.newChatHeader") : $t("dm.chatHeader")} {/if} {/each} {:else if searchQuery !== ""} {#if searchQuery.includes(".")} {$t(muted && muted.has(selectedChat.pubkey) ? "dm.unmute" : "dm.mute")}

@@ -418,13 +396,10 @@ {#each messageRumours.get(day) as rumour} {#if rumour.pubkey === user.pubkey && pTagKeys(rumour).includes(selectedChat.pubkey)}
  • {rumour.content} @@ -434,13 +409,10 @@
  • {:else if rumour.pubkey === selectedChat.pubkey && pTagKeys(rumour).includes(user.pubkey)}
  • {rumour.content} @@ -488,12 +460,7 @@

    {$t("dm.fadedWarning")}

    {#if canSend && !canSendExpiring}

    - {$t("dm.cantSendExpiring").replace( - "[R]", - name(selectedChat), - )} + {$t("dm.cantSendExpiring").replace("[R]", name(selectedChat))}

    {/if} {/if} @@ -506,9 +473,7 @@

    {$t("dm.noRelaysSet")} - {$t("dm.nostrSettingsLink")}{$t("dm.nostrSettingsLink")}

    {/if} diff --git a/src/routes/(app)/ecash/[id]/[...version]/+layout.svelte b/src/routes/(app)/ecash/[id]/[...version]/+layout.svelte index bf00964b..a4cfd805 100644 --- a/src/routes/(app)/ecash/[id]/[...version]/+layout.svelte +++ b/src/routes/(app)/ecash/[id]/[...version]/+layout.svelte @@ -24,9 +24,7 @@
    {f(amountFiat, currency)}
    {:else}
    - ⚡️{`${s(amount)}`} + ⚡️{`${s(amount)}`}
    {/if}
  • @@ -46,9 +44,7 @@
    {:else}
    - ⚡️{`${s(spent)}`} + ⚡️{`${s(spent)}`} {$t("payments.spent")}
    {/if} diff --git a/src/routes/(app)/ecash/[id]/[...version]/+page.server.ts b/src/routes/(app)/ecash/[id]/[...version]/+page.server.ts index 08efb998..9a20b85c 100644 --- a/src/routes/(app)/ecash/[id]/[...version]/+page.server.ts +++ b/src/routes/(app)/ecash/[id]/[...version]/+page.server.ts @@ -10,8 +10,7 @@ export async function load({ parent }) { export const actions = { default: async ({ cookies, request, url }) => { - if (!cookies.get("username")) - redirect(307, `/register?redirect=${url.pathname}`); + if (!cookies.get("username")) redirect(307, `/register?redirect=${url.pathname}`); const { token } = await fd(request); let claimed; diff --git a/src/routes/(app)/ecash/[id]/[...version]/+page.svelte b/src/routes/(app)/ecash/[id]/[...version]/+page.svelte index 3cfa502d..0702dcb0 100644 --- a/src/routes/(app)/ecash/[id]/[...version]/+page.svelte +++ b/src/routes/(app)/ecash/[id]/[...version]/+page.svelte @@ -51,11 +51,7 @@ {#if external} @@ -64,11 +60,7 @@ @@ -76,10 +68,7 @@ {/if} {/if} -
    diff --git a/src/routes/(app)/ecash/[id]/[...version]/swap/+page.svelte b/src/routes/(app)/ecash/[id]/[...version]/swap/+page.svelte index f05a7297..77f631af 100644 --- a/src/routes/(app)/ecash/[id]/[...version]/swap/+page.svelte +++ b/src/routes/(app)/ecash/[id]/[...version]/swap/+page.svelte @@ -2,6 +2,4 @@ let { data } = $props(); -
    - Support for swapping in cash from other mints is coming soon -
    +
    Support for swapping in cash from other mints is coming soon
    diff --git a/src/routes/(app)/firehose/+page.svelte b/src/routes/(app)/firehose/+page.svelte index 2fdaa4d0..a11d15d1 100644 --- a/src/routes/(app)/firehose/+page.svelte +++ b/src/routes/(app)/firehose/+page.svelte @@ -35,9 +35,7 @@
    -

    - Events -

    +

    Events

    {#each events as event} diff --git a/src/routes/(app)/fund/[id]/+page.svelte b/src/routes/(app)/fund/[id]/+page.svelte index 34e0d503..8d83038b 100644 --- a/src/routes/(app)/fund/[id]/+page.svelte +++ b/src/routes/(app)/fund/[id]/+page.svelte @@ -36,16 +36,10 @@
    -
    +
    {#if show}
    - URL + URL
    {/if}
    @@ -72,10 +66,7 @@
    {#if (user && !managers.length) || managers.some((m) => m.id === user?.id)} -
    + {$t("funds.manage")} @@ -85,8 +76,7 @@
    @@ -95,11 +85,7 @@
    - +
    {$t("payments.shareLink")}
    - +
    {$t("payments.giftLink")}
    diff --git a/src/routes/(app)/fund/[id]/access/+page.svelte b/src/routes/(app)/fund/[id]/access/+page.svelte index 24ded54e..9920fa5b 100644 --- a/src/routes/(app)/fund/[id]/access/+page.svelte +++ b/src/routes/(app)/fund/[id]/access/+page.svelte @@ -23,12 +23,8 @@
    -
    -

    - Fund managers -

    + diff --git a/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.svelte b/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.svelte index 451fc128..b67a024b 100644 --- a/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.svelte +++ b/src/routes/(app)/fund/[id]/sweep/[...amount]/+page.svelte @@ -15,13 +15,7 @@
    - +
    diff --git a/src/routes/(app)/fund/[id]/withdraw/+page.svelte b/src/routes/(app)/fund/[id]/withdraw/+page.svelte index 9b53824d..b8ccd5af 100644 --- a/src/routes/(app)/fund/[id]/withdraw/+page.svelte +++ b/src/routes/(app)/fund/[id]/withdraw/+page.svelte @@ -62,12 +62,7 @@ {/if} - - + + {:else} {#each tipAmounts as amount, i} {#if i === 0} @@ -163,10 +154,7 @@
    - {$t("payments.cancel")} @@ -186,9 +174,7 @@ placeholder={$t("payments.amount")} use:focus /> - + {/if}
    diff --git a/src/routes/(app)/invoices/+page.svelte b/src/routes/(app)/invoices/+page.svelte index 35a81a3e..418dfaf3 100644 --- a/src/routes/(app)/invoices/+page.svelte +++ b/src/routes/(app)/invoices/+page.svelte @@ -7,9 +7,7 @@
    -
    +
    {#each invoices as i}
    {i.type}
    {#if show[i.id]} diff --git a/src/routes/(app)/ln/[lnurl]/+page.server.ts b/src/routes/(app)/ln/[lnurl]/+page.server.ts index ae784401..912ed07c 100644 --- a/src/routes/(app)/ln/[lnurl]/+page.server.ts +++ b/src/routes/(app)/ln/[lnurl]/+page.server.ts @@ -62,15 +62,12 @@ export const actions = { pay: async ({ fetch, request }) => { let error; - let { callback, amount, minSendable, maxSendable, comment } = - await fd(request); + let { callback, amount, minSendable, maxSendable, comment } = await fd(request); minSendable = Math.round(minSendable / 1000); maxSendable = Math.round(maxSendable / 1000); - if (amount < minSendable) - error = `Amount must be at least ${minSendable} sats`; - if (amount > maxSendable) - error = `Amount must be at most ${maxSendable} sats`; + if (amount < minSendable) error = `Amount must be at least ${minSendable} sats`; + if (amount > maxSendable) error = `Amount must be at most ${maxSendable} sats`; if (error) return fail(400, { error }); let url = `${callback}?amount=${amount * 1000}`; @@ -86,33 +83,20 @@ export const actions = { withdraw: async ({ cookies, fetch, request }) => { let error; - let { - callback, - amount, - username, - currency, - minWithdrawable, - maxWithdrawable, - k1, - } = await fd(request); + let { callback, amount, username, currency, minWithdrawable, maxWithdrawable, k1 } = + await fd(request); minWithdrawable = Math.round(minWithdrawable / 1000); maxWithdrawable = Math.round(maxWithdrawable / 1000); - if (amount < minWithdrawable) - error = `Amount must be at least ${minWithdrawable} sats`; - if (amount > maxWithdrawable) - error = `Amount must be at most ${maxWithdrawable} sats`; + if (amount < minWithdrawable) error = `Amount must be at least ${minWithdrawable} sats`; + if (amount > maxWithdrawable) error = `Amount must be at most ${maxWithdrawable} sats`; if (error) return fail(400, { error }); const invoice = { amount, type: "lightning" }; const user = { username, currency }; - const { text: pr } = await post( - "/invoice", - { invoice, user }, - auth(cookies), - ); + const { text: pr } = await post("/invoice", { invoice, user }, auth(cookies)); const url = new URL(callback); url.searchParams.append("k1", k1); diff --git a/src/routes/(app)/ln/withdrawal/sent/+page.svelte b/src/routes/(app)/ln/withdrawal/sent/+page.svelte index fa888fc1..3f0b8711 100644 --- a/src/routes/(app)/ln/withdrawal/sent/+page.svelte +++ b/src/routes/(app)/ln/withdrawal/sent/+page.svelte @@ -9,14 +9,8 @@
    -
    - +

    Request Sent!

    diff --git a/src/routes/(app)/messages/+page.server.ts b/src/routes/(app)/messages/+page.server.ts index ec83bede..20ba5f39 100644 --- a/src/routes/(app)/messages/+page.server.ts +++ b/src/routes/(app)/messages/+page.server.ts @@ -22,9 +22,7 @@ export async function load({ params, parent }) { const { pubkey } = user; try { messages = await get(`/${pubkey}/${since}/messages`); - messages = messages.sort( - (a: Message, b: Message) => b.created_at - a.created_at, - ); + messages = messages.sort((a: Message, b: Message) => b.created_at - a.created_at); } catch (e) { console.log("failed to fetch nostr messages", e); } diff --git a/src/routes/(app)/messages/+page.svelte b/src/routes/(app)/messages/+page.svelte index 3e97398f..2aaede8b 100644 --- a/src/routes/(app)/messages/+page.svelte +++ b/src/routes/(app)/messages/+page.svelte @@ -9,10 +9,8 @@ let { data } = $props(); - let { messages, notes, invoices, sent, received, subject, user }: any = - $state(data); - let refresh = (d: any) => - ({ messages, notes, invoices, sent, received, subject, user } = d); + let { messages, notes, invoices, sent, received, subject, user }: any = $state(data); + let refresh = (d: any) => ({ messages, notes, invoices, sent, received, subject, user } = d); let keys = new Set(); let latest: any[] = $state([]); @@ -20,10 +18,7 @@ e.subscribe(async (event: any) => { if (!(browser && event && ready)) return; - if ( - event.recipient?.id === user.id && - !~latest.findIndex((m: any) => m.id === event.id) - ) { + if (event.recipient?.id === user.id && !~latest.findIndex((m: any) => m.id === event.id)) { event.content = await decrypt({ event, user }); let i = latest.findIndex((m: any) => m.pubkey === event.pubkey); @@ -46,10 +41,7 @@ if (!(event.author && event.recipient)) continue; - let k = - event.author.id === user.id - ? event.recipient?.pubkey - : event.author.pubkey; + let k = event.author.id === user.id ? event.recipient?.pubkey : event.author.pubkey; if (!keys.has(k)) { keys.add(k); diff --git a/src/routes/(app)/messages/[recipient]/+page.server.ts b/src/routes/(app)/messages/[recipient]/+page.server.ts index 85deabbb..d9a9c54f 100644 --- a/src/routes/(app)/messages/[recipient]/+page.server.ts +++ b/src/routes/(app)/messages/[recipient]/+page.server.ts @@ -12,10 +12,7 @@ export async function load({ params, parent }) { messages = await get(`/${user.pubkey}/${since}/messages`); messages = messages - .filter( - (m: Message) => - m.recipient?.id === recipient.id || m.author?.id === recipient.id, - ) + .filter((m: Message) => m.recipient?.id === recipient.id || m.author?.id === recipient.id) .sort((a, b) => a.created_at - b.created_at); } catch (e) { console.log("failed to fetch nostr messages", e); diff --git a/src/routes/(app)/messages/[recipient]/+page.svelte b/src/routes/(app)/messages/[recipient]/+page.svelte index 654ddcca..f828bde2 100644 --- a/src/routes/(app)/messages/[recipient]/+page.svelte +++ b/src/routes/(app)/messages/[recipient]/+page.svelte @@ -28,9 +28,7 @@ duration, css: (t) => { const eased = easing(t); - return `opacity: ${eased * o}; transform: scale(${ - eased * s * is + baseScale - })`; + return `opacity: ${eased * o}; transform: scale(${eased * s * is + baseScale})`; }, }; } @@ -41,9 +39,7 @@ let initialize = async (p: any) => { await Promise.all( - messages.map( - async (event) => (event.message = await decrypt({ event, user })), - ), + messages.map(async (event) => (event.message = await decrypt({ event, user }))), ); messages = messages; @@ -117,14 +113,8 @@
    -
    -
    +
    {message}
    @@ -184,8 +170,7 @@ tabindex="0" >
    diff --git a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte index 9807313a..6cae555c 100644 --- a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte +++ b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte @@ -54,23 +54,14 @@
    -
    + {#if user?.balance} -
    {:else}
    - + {s(amount, userLocale)}
    {/if} @@ -152,11 +135,7 @@
    - + {s((1 * sats) / rate)} = {f(1, currency, userLocale, 0, 0)}
    @@ -179,15 +158,17 @@ {:else if type === types.fund} - {$t("payments.viewFund")} + {$t( + "payments.viewFund", + )} {:else if memo?.includes("9734")} {@const eid = JSON.parse(memo).tags.find((t) => t[0] === "e")[1]} Nostr - {$t("payments.zappedEvent")} + {$t( + "payments.zappedEvent", + )} {:else if memo}
    @@ -220,10 +201,7 @@ rel="noreferrer">{txid}
    -
    @@ -234,10 +212,7 @@ Path
    {path}
    -
    diff --git a/src/routes/(app)/payment/[id]/plain/+page.svelte b/src/routes/(app)/payment/[id]/plain/+page.svelte index 46197260..87ad2207 100644 --- a/src/routes/(app)/payment/[id]/plain/+page.svelte +++ b/src/routes/(app)/payment/[id]/plain/+page.svelte @@ -3,17 +3,7 @@ import { onMount } from "svelte"; import { browser } from "$app/environment"; import { t } from "$lib/translations"; - import { - back, - copy, - f, - s, - toFiat, - post, - sats, - success, - types, - } from "$lib/utils"; + import { back, copy, f, s, toFiat, post, sats, success, types } from "$lib/utils"; import { fiat } from "$lib/store"; import Avatar from "$comp/Avatar.svelte"; import { format } from "date-fns"; diff --git a/src/routes/(app)/payments/[...page]/+page.server.ts b/src/routes/(app)/payments/[...page]/+page.server.ts index bf280937..9a81993a 100644 --- a/src/routes/(app)/payments/[...page]/+page.server.ts +++ b/src/routes/(app)/payments/[...page]/+page.server.ts @@ -25,10 +25,7 @@ export async function load({ cookies, depends, params }) { if (start) q.set("start", str(start * 1000)); if (end) q.set("end", str(end * 1000)); - const { count, payments, incoming, outgoing } = await get( - `/payments?${str(q)}`, - auth(cookies), - ); + const { count, payments, incoming, outgoing } = await get(`/payments?${str(q)}`, auth(cookies)); const pages = Array.from({ length: Math.ceil(count / limit) }); diff --git a/src/routes/(app)/payments/[...page]/+page.svelte b/src/routes/(app)/payments/[...page]/+page.svelte index 7d73a0b1..f6cbcba8 100644 --- a/src/routes/(app)/payments/[...page]/+page.svelte +++ b/src/routes/(app)/payments/[...page]/+page.svelte @@ -11,16 +11,7 @@ import { goto, invalidate } from "$app/navigation"; let { data } = $props(); - let { - start, - end, - user, - payments, - incoming, - outgoing, - pages, - page: p, - } = $derived(data); + let { start, end, user, payments, incoming, outgoing, pages, page: p } = $derived(data); let locale = $derived(loc(user)); @@ -55,9 +46,7 @@ ]); let selection = $derived( - presets.findIndex( - (p) => Math.abs(differenceInDays(new Date(start * 1000), p.start)) < 1, - ), + presets.findIndex((p) => Math.abs(differenceInDays(new Date(start * 1000), p.start)) < 1), ); $effect(() => { @@ -88,9 +77,7 @@ platform_fee: p.ourfee, amount_fiat: f((p.amount * p.rate) / sats, p.currency), fee_fiat: p.fee ? f((p.fee * p.rate) / sats, p.currency) : null, - platform_fee_fiat: p.ourfee - ? f((p.ourfee * p.rate) / sats, p.currency) - : null, + platform_fee_fiat: p.ourfee ? f((p.ourfee * p.rate) / sats, p.currency) : null, tip_fiat: p.tip ? f((p.tip * p.rate) / sats, p.currency) : null, total_fiat: f( ((p.amount + ((p.amount > 0 ? p.tip : -p.tip) || 0)) * p.rate) / sats, @@ -120,9 +107,7 @@ let csv = keys.map((k) => `"${k}"`).join(",") + "\n" + - payments - .map((r) => keys.map((k) => `"${r[k] || ""}"`).join(",")) - .join("\n"); + payments.map((r) => keys.map((k) => `"${r[k] || ""}"`).join(",")).join("\n"); let filename = "payments.csv"; let blob = new Blob([csv], { type: "text/csv;charset=utf-8;" }); @@ -148,10 +133,7 @@ if (i === 0 || i === pages.length - 1) return true; - let start = Math.max( - 1, - currentPage - Math.floor((maxVisiblePages - 4) / 2), - ); + let start = Math.max(1, currentPage - Math.floor((maxVisiblePages - 4) / 2)); let end = start + maxVisiblePages - 5; if (end >= pages.length - 1) { @@ -162,8 +144,7 @@ return i >= start && i <= end; }; - let isEllipsis = (i) => - (i === 1 && !showPage(i)) || (i === pages.length - 2 && !showPage(i)); + let isEllipsis = (i) => (i === 1 && !showPage(i)) || (i === pages.length - 2 && !showPage(i));
    @@ -189,19 +170,12 @@ {#each pages as _, i} {#if showPage(i)} -
    +
    {i + 1}
    {:else if isEllipsis(i)} -
    - ... -
    +
    ...
    {/if} {/each} {/if} @@ -218,9 +192,7 @@ {#if tipsIn > 0 || tipsOut > 0}{$t("payments.tips")}{/if} - {$t("payments.total")} + {$t("payments.total")} {@const totalIn = incoming[c]?.fiat || 0} {@const tipsIn = incoming[c]?.fiatTips || 0} @@ -231,25 +203,17 @@ {@const subtotalOut = totalOut - tipsOut} {#if totalIn > 0} - {$t("payments.income")} + {$t("payments.income")} {tipsIn > 0 ? f(tipsIn, c, locale) : ""} - {totalIn > 0 ? f(totalIn, c, locale) : "-"} + {totalIn > 0 ? f(totalIn, c, locale) : "-"} {/if} {#if totalOut > 0} - {$t("payments.expenditure")} + {$t("payments.expenditure")} {tipsOut > 0 ? f(tipsOut, c, locale) : "-"} - {totalOut > 0 ? f(totalOut, c, locale) : "-"} + {totalOut > 0 ? f(totalOut, c, locale) : "-"} {/if} {/each}
    @@ -258,8 +222,7 @@ {#if payments.length}
    diff --git a/src/routes/(app)/pos/+page.svelte b/src/routes/(app)/pos/+page.svelte index 056a9254..0b29608d 100644 --- a/src/routes/(app)/pos/+page.svelte +++ b/src/routes/(app)/pos/+page.svelte @@ -63,9 +63,7 @@ chip = await esploader.main(); connected = true; - portInfo = (await device.getInfo?.()) - ? JSON.stringify(await device.getInfo()) - : "Connected"; + portInfo = (await device.getInfo?.()) ? JSON.stringify(await device.getInfo()) : "Connected"; } catch (e) { console.log(e); connected = false; @@ -148,9 +146,7 @@
    -

    - ESP32-C3 Flasher -

    +

    ESP32-C3 Flasher

    {#if !connected}
    @@ -162,15 +158,11 @@ {#if connected}
    - (tab = "config")} + >Flash config - (tab = "firmware")} + >Flash firmware
    @@ -181,15 +173,12 @@
    Config written ✔
    {:else}
    Generated config file ({bytes.length} bytes)
    - + - (littlefsAddress = Number((e.target as HTMLInputElement).value))} + onchange={(e) => (littlefsAddress = Number((e.target as HTMLInputElement).value))} />
    @@ -202,21 +191,14 @@ - + {/if} {:else}
    - + - + - (fwAddress = Number((e.target as HTMLInputElement).value))} + onchange={(e) => (fwAddress = Number((e.target as HTMLInputElement).value))} />
    - +
    {#if fwProgress > 0 && !fwDone} diff --git a/src/routes/(app)/printer/+page.svelte b/src/routes/(app)/printer/+page.svelte index 28a3dfb1..108af3b5 100644 --- a/src/routes/(app)/printer/+page.svelte +++ b/src/routes/(app)/printer/+page.svelte @@ -69,9 +69,7 @@
    -

    - Printer -

    +

    Printer

    {#if esploader} {#if data} @@ -85,16 +83,8 @@
    - - + +
    {/if} diff --git a/src/routes/(app)/qr/[text]/[icon]/+server.ts b/src/routes/(app)/qr/[text]/[icon]/+server.ts index 4a1bb78e..85311a8f 100644 --- a/src/routes/(app)/qr/[text]/[icon]/+server.ts +++ b/src/routes/(app)/qr/[text]/[icon]/+server.ts @@ -15,13 +15,7 @@ export async function GET({ params }) { const logo = await loadImage(`static/images/${icon}`); const logoSize = size * 0.3; - ctx.drawImage( - logo, - (size - logoSize) / 2, - (size - logoSize) / 2, - logoSize, - logoSize, - ); + ctx.drawImage(logo, (size - logoSize) / 2, (size - logoSize) / 2, logoSize, logoSize); const buffer = canvas.toBuffer("image/png"); return new Response(buffer, { diff --git a/src/routes/(app)/qr/create/+page.svelte b/src/routes/(app)/qr/create/+page.svelte index 189a734d..3a17bcc0 100644 --- a/src/routes/(app)/qr/create/+page.svelte +++ b/src/routes/(app)/qr/create/+page.svelte @@ -8,8 +8,7 @@ text = $state(), pasted = $state(); - let keypress = (e) => - e.key === "Enter" ? e.preventDefault() || el.click() : (pasted = false); + let keypress = (e) => (e.key === "Enter" ? e.preventDefault() || el.click() : (pasted = false)); let paste = async () => { text = await navigator.clipboard.readText(); @@ -24,9 +23,7 @@
    -

    - Create QR -

    +

    Create QR

    @@ -48,11 +45,7 @@ class="flex border rounded-2xl px-6 py-5 font-bold hover:opacity-80 w-full bg-primary justify-center gap-2" onclick={paste} > -
    {$t("user.send.paste")}
    @@ -62,11 +55,7 @@ type="submit" class="flex bg-black text-white border rounded-2xl px-6 py-5 w-full font-bold gap-2 justify-center" > -
    {$t("user.dashboard.go")}
    diff --git a/src/routes/(app)/receive/[...token]/+page.svelte b/src/routes/(app)/receive/[...token]/+page.svelte index 1f4c81fc..bea32277 100644 --- a/src/routes/(app)/receive/[...token]/+page.svelte +++ b/src/routes/(app)/receive/[...token]/+page.svelte @@ -43,9 +43,7 @@ {#if form?.error}
    - {form.error === "default" - ? $t("error.unrecognizedInput") - : form.error} + {form.error === "default" ? $t("error.unrecognizedInput") : form.error}
    {/if} @@ -66,15 +64,13 @@
    diff --git a/src/routes/(app)/reset/[code]/+page.svelte b/src/routes/(app)/reset/[code]/+page.svelte index 93fdf8f9..deade18a 100644 --- a/src/routes/(app)/reset/[code]/+page.svelte +++ b/src/routes/(app)/reset/[code]/+page.svelte @@ -19,8 +19,7 @@ onMount(() => { if (!isTor && recaptchaSiteKey) { let s = document.createElement("script"); - s.src = - "https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey; + s.src = "https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey; document.head.appendChild(s); } }); @@ -28,13 +27,9 @@ const getRecaptchaToken = () => new Promise((resolve, reject) => { if (isTor) return resolve(""); - if (!browser || !grecaptcha) - return reject(new Error("captcha unavailable")); + if (!browser || !grecaptcha) return reject(new Error("captcha unavailable")); grecaptcha.ready(() => { - grecaptcha - .execute(recaptchaSiteKey, { action: "reset" }) - .then(resolve) - .catch(reject); + grecaptcha.execute(recaptchaSiteKey, { action: "reset" }).then(resolve).catch(reject); }); }); @@ -59,9 +54,7 @@ } const scriptSelector = - "script[src='https://www.google.com/recaptcha/api.js?render=" + - recaptchaSiteKey + - "']"; + "script[src='https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey + "']"; const script = document.querySelector(scriptSelector); if (script) { script.remove(); @@ -77,9 +70,7 @@
    -
    +

    {$t("login.reset")}

    {#if form?.error} @@ -90,15 +81,11 @@ - +
    - A new seed phrase will be generated for your account. You'll need to - import your old seed phrase if you want to use the same nostr profile - and savings account as before. + A new seed phrase will be generated for your account. You'll need to import your old seed + phrase if you want to use the same nostr profile and savings account as before.
    @@ -115,17 +110,13 @@ > @@ -151,9 +142,7 @@ onclick={(e) => pin(e, c)} aria-label={c.pinned ? "Unpin contact" : "Pin contact"} > -
    @@ -176,8 +163,6 @@ {/if} {#if !loaded && contacts.length > 0} - + {/if}
    diff --git a/src/routes/(app)/send/ark/[address]/+layout.server.ts b/src/routes/(app)/send/ark/[address]/+layout.server.ts index bb167d2d..6381463a 100644 --- a/src/routes/(app)/send/ark/[address]/+layout.server.ts +++ b/src/routes/(app)/send/ark/[address]/+layout.server.ts @@ -18,8 +18,7 @@ export async function load({ cookies, params, parent }) { const recipient = await get(`/users/${invoice.uid}`); let r = `/pay/${recipient.username}`; if (amount) r += `/${amount}`; - if (recipient?.id !== user.id && recipient.id === invoice.aid) - redirect(307, r); + if (recipient?.id !== user.id && recipient.id === invoice.aid) redirect(307, r); } return { balance }; diff --git a/src/routes/(app)/send/ark/[address]/+page.svelte b/src/routes/(app)/send/ark/[address]/+page.svelte index 0bf9e0de..23f3a7fb 100644 --- a/src/routes/(app)/send/ark/[address]/+page.svelte +++ b/src/routes/(app)/send/ark/[address]/+page.svelte @@ -34,21 +34,10 @@
    {address}
    - +
    - diff --git a/src/routes/(app)/send/ark/[address]/[amount]/[...feeRate]/+page.server.ts b/src/routes/(app)/send/ark/[address]/[amount]/[...feeRate]/+page.server.ts index 07972e6c..10a6a737 100644 --- a/src/routes/(app)/send/ark/[address]/[amount]/[...feeRate]/+page.server.ts +++ b/src/routes/(app)/send/ark/[address]/[amount]/[...feeRate]/+page.server.ts @@ -36,19 +36,11 @@ export async function load({ params: { address, amount }, cookies, parent }) { } export const actions = { - default: async ({ - cookies, - params: { address, amount, feeRate }, - request, - }) => { + default: async ({ cookies, params: { address, amount, feeRate }, request }) => { let p; try { const body = await fd(request); - p = await post( - "/ark/send", - { ...body, address, amount: parseInt(amount) }, - auth(cookies), - ); + p = await post("/ark/send", { ...body, address, amount: parseInt(amount) }, auth(cookies)); } catch (e) { console.log("problem sending bitcoin", e); const { message } = e as Error; diff --git a/src/routes/(app)/send/ark/[address]/[amount]/[...feeRate]/+page.svelte b/src/routes/(app)/send/ark/[address]/[amount]/[...feeRate]/+page.svelte index f5bc3bc6..c7c08772 100644 --- a/src/routes/(app)/send/ark/[address]/[amount]/[...feeRate]/+page.svelte +++ b/src/routes/(app)/send/ark/[address]/[amount]/[...feeRate]/+page.svelte @@ -68,9 +68,7 @@ submit = $state(); -
    +

    {$t("payments.send")}

    {#if form?.message || message || error} diff --git a/src/routes/(app)/send/bitcoin/[address]/+page.svelte b/src/routes/(app)/send/bitcoin/[address]/+page.svelte index 6c49ad6c..76ac093e 100644 --- a/src/routes/(app)/send/bitcoin/[address]/+page.svelte +++ b/src/routes/(app)/send/bitcoin/[address]/+page.svelte @@ -34,21 +34,10 @@
    {address}
    - +
    - diff --git a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.server.ts b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.server.ts index 7cdd86f5..c5149a93 100644 --- a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.server.ts +++ b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.server.ts @@ -2,11 +2,7 @@ import getRates from "$lib/rates"; import { auth, fd, get, post } from "$lib/utils"; import { fail, redirect } from "@sveltejs/kit"; -export async function load({ - params: { address, amount, feeRate }, - cookies, - parent, -}) { +export async function load({ params: { address, amount, feeRate }, cookies, parent }) { const rates = await getRates(); const { user } = await parent(); const aid = cookies.get("aid") || user.id; @@ -50,11 +46,7 @@ export async function load({ } export const actions = { - default: async ({ - cookies, - params: { address, amount, feeRate }, - request, - }) => { + default: async ({ cookies, params: { address, amount, feeRate }, request }) => { let p; try { const body = await fd(request); 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 6581e12f..49dbe7c6 100644 --- a/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte +++ b/src/routes/(app)/send/bitcoin/[address]/[amount]/[...feeRate]/+page.svelte @@ -14,10 +14,7 @@ import { hex as hexUtil } from "@scure/base"; import * as btc from "@scure/btc-signer"; import { decrypt } from "nostr-tools/nip49"; - import { - getRememberedWalletPassword, - forgetWalletPassword, - } from "$lib/passwordCache"; + import { getRememberedWalletPassword, forgetWalletPassword } from "$lib/passwordCache"; import { sendArkViaForward } from "$lib/ark"; import Amount from "$comp/Amount.svelte"; @@ -78,8 +75,7 @@ return; } - if ((account.seed || data.user.seed) && !signed) - (cancel(), void togglePassword()); + if ((account.seed || data.user.seed) && !signed) (cancel(), void togglePassword()); return async ({ result }) => { if (result.type === "redirect") { goto(result.location); @@ -92,29 +88,21 @@ let signTx = async () => { const { decrypt } = await import("nostr-tools/nip49"); - const [ - { Transaction }, - { HDKey }, - { entropyToMnemonic, mnemonicToSeed }, - { wordlist }, - ] = await Promise.all([ - import("@scure/btc-signer"), - import("@scure/bip32"), - import("@scure/bip39"), - import("@scure/bip39/wordlists/english.js"), - ]); - let entropy = await decrypt( - account.seed || data.user.seed, - password as string, - ); + const [{ Transaction }, { HDKey }, { entropyToMnemonic, mnemonicToSeed }, { wordlist }] = + await Promise.all([ + import("@scure/btc-signer"), + import("@scure/bip32"), + import("@scure/bip39"), + import("@scure/bip39/wordlists/english.js"), + ]); + let entropy = await decrypt(account.seed || data.user.seed, password as string); let mnemonic = entropyToMnemonic(entropy, wordlist); let seed = await mnemonicToSeed(mnemonic, password as string); let master = HDKey.fromMasterSeed(seed, network as any); let child = master.derive(`m/84'/0'/${account.accountIndex ?? 0}'`); let raw = decode(hex); - let isPSBT = - raw[0] === 0x70 && raw[1] === 0x73 && raw[2] === 0x62 && raw[3] === 0x74; + let isPSBT = raw[0] === 0x70 && raw[1] === 0x73 && raw[2] === 0x62 && raw[3] === 0x74; let tx: any = isPSBT ? Transaction.fromPSBT(raw) : Transaction.fromRaw(raw); for (let [i, input] of tx.inputs.entries()) { @@ -137,27 +125,15 @@ let toggle = () => (submitting = !submitting); - let { - account, - amount, - address, - message, - fee, - fees, - subtract, - ourfee, - hex, - inputs, - } = $derived(data); + let { account, amount, address, message, fee, fees, subtract, ourfee, hex, inputs } = + $derived(data); let { feeRate }: any = $state(data); $effect(() => { if (fees) { delete fees.minimumFee; - feeRate = feeRate - ? closest(Object.values(fees), feeRate) - : fees.halfHourFee; + feeRate = feeRate ? closest(Object.values(fees), feeRate) : fees.halfHourFee; } }); @@ -182,9 +158,7 @@ let goBack = () => goto(`/send/bitcoin/${address}`); -
    +

    {$t("payments.send")}

    {#if form?.message || message || error} @@ -194,11 +168,7 @@ {:else}
    {address}
    - + {#if fees}
    diff --git a/src/routes/(app)/send/fund/[...name]/[...amount]/+page.svelte b/src/routes/(app)/send/fund/[...name]/[...amount]/+page.svelte index 58d4812f..d0cf6743 100644 --- a/src/routes/(app)/send/fund/[...name]/[...amount]/+page.svelte +++ b/src/routes/(app)/send/fund/[...name]/[...amount]/+page.svelte @@ -52,12 +52,7 @@
    -
    + @@ -76,12 +71,7 @@ {/if} - {:else} - {/if}
    - + {#if !trusted} + {/if}
    diff --git a/src/routes/(app)/send/zap/[id]/[...amount]/+page.server.ts b/src/routes/(app)/send/zap/[id]/[...amount]/+page.server.ts index a658a5c1..2886f00a 100644 --- a/src/routes/(app)/send/zap/[id]/[...amount]/+page.server.ts +++ b/src/routes/(app)/send/zap/[id]/[...amount]/+page.server.ts @@ -8,8 +8,7 @@ export async function load({ cookies, params, parent }) { const rates = await getRates(); let request; - if (amount) - request = await post("/zapRequest", { amount, id }, auth(cookies)); + if (amount) request = await post("/zapRequest", { amount, id }, auth(cookies)); const rate = rates[user.currency]; return { amount, id, rates, rate, request }; diff --git a/src/routes/(app)/send/zap/[id]/[...amount]/+page.svelte b/src/routes/(app)/send/zap/[id]/[...amount]/+page.svelte index 3d0d144c..bf5f5202 100644 --- a/src/routes/(app)/send/zap/[id]/[...amount]/+page.svelte +++ b/src/routes/(app)/send/zap/[id]/[...amount]/+page.svelte @@ -70,8 +70,6 @@ submit={next} element={undefined} /> - +
    diff --git a/src/routes/(app)/sent/[id]/+page.svelte b/src/routes/(app)/sent/[id]/+page.svelte index ba2b7366..3dde854f 100644 --- a/src/routes/(app)/sent/[id]/+page.svelte +++ b/src/routes/(app)/sent/[id]/+page.svelte @@ -10,14 +10,7 @@ let locale = $derived(loc(user)); - +
    diff --git a/src/routes/(app)/settings/+layout.svelte b/src/routes/(app)/settings/+layout.svelte index b670737f..b14f59d4 100644 --- a/src/routes/(app)/settings/+layout.svelte +++ b/src/routes/(app)/settings/+layout.svelte @@ -49,9 +49,7 @@ import { PUBLIC_DM_RELAYS } from "$env/static/public"; const DM_RELAYS_LIST = PUBLIC_DM_RELAYS.split(","); const updateRelaysIfAvailable = async () => { - const relayEntry = document.getElementById( - "dmRelays", - ) as HTMLTextAreaElement | null; + const relayEntry = document.getElementById("dmRelays") as HTMLTextAreaElement | null; if (!relayEntry || relayEntry.value.length === 0) return; const newRelays = relayEntry.value.split(/[ \r\n\t]+/).filter(isValidURL); @@ -233,8 +231,7 @@ } }); $effect(() => { - if (!$loading && $page.url.searchParams.get("verified")) - success($t("user.settings.verified")); + if (!$loading && $page.url.searchParams.get("verified")) success($t("user.settings.verified")); }); @@ -242,12 +239,7 @@ {/if} -
    + diff --git a/src/routes/(app)/settings/account/+page.svelte b/src/routes/(app)/settings/account/+page.svelte index fb182887..7a1bbab1 100644 --- a/src/routes/(app)/settings/account/+page.svelte +++ b/src/routes/(app)/settings/account/+page.svelte @@ -20,8 +20,7 @@ let fiats = Object.keys(rates).sort((a, b) => a.localeCompare(b)); let el: any; - let keypress = (e: any) => - e.key === "Enter" && (e.preventDefault() || el.click()); + let keypress = (e: any) => e.key === "Enter" && (e.preventDefault() || el.click()); let editingReserve = $state(), editingThreshold = $state(), @@ -56,9 +55,7 @@ onMount(async () => { if (!browser) return; - pm = - navigator?.serviceWorker && - (await navigator.serviceWorker.getRegistration())?.pushManager; + pm = navigator?.serviceWorker && (await navigator.serviceWorker.getRegistration())?.pushManager; permission = await pm.permissionState({ userVisibleOnly: true, @@ -105,16 +102,12 @@
    - +
    - + {#if verified} - {:else if email} - {/if} @@ -192,9 +175,7 @@ {$t("user.settings.tipDesc")}

    -
    @@ -211,9 +192,7 @@
    - +
    diff --git a/src/routes/(app)/settings/security/+page.svelte b/src/routes/(app)/settings/security/+page.svelte index 193cd91b..cb9897a1 100644 --- a/src/routes/(app)/settings/security/+page.svelte +++ b/src/routes/(app)/settings/security/+page.svelte @@ -164,9 +164,7 @@
    {verifying - ? $t("user.settings.verifyPIN") - : $t("user.settings.securityPIN")}{verifying ? $t("user.settings.verifyPIN") : $t("user.settings.securityPIN")}

    {$t("user.settings.securityPINDescription")} @@ -174,12 +172,7 @@ {#if verifying} {:else if settingPin} - + {:else} {/if}

    @@ -216,14 +207,12 @@ {:else if user.twofa} {:else} {/if} @@ -236,8 +225,7 @@
    diff --git a/src/routes/(app)/thread/[id]/+page.svelte b/src/routes/(app)/thread/[id]/+page.svelte index a77e6e36..70397e17 100644 --- a/src/routes/(app)/thread/[id]/+page.svelte +++ b/src/routes/(app)/thread/[id]/+page.svelte @@ -6,9 +6,7 @@
    -

    - Thread -

    +

    Thread

    {#each thread as event} diff --git a/src/routes/(app)/verify/[code]/+page.svelte b/src/routes/(app)/verify/[code]/+page.svelte index 17ff858a..813c29e6 100644 --- a/src/routes/(app)/verify/[code]/+page.svelte +++ b/src/routes/(app)/verify/[code]/+page.svelte @@ -8,24 +8,14 @@
    {#if error} -

    - Email verification failed -

    +

    Email verification failed

    {:else if user.verified} -
    - +
    -

    - Email verified successfully! -

    +

    Email verified successfully!

    {/if}
    diff --git a/src/routes/(static)/+layout.svelte b/src/routes/(static)/+layout.svelte index a6f6d858..9c7f5e5e 100644 --- a/src/routes/(static)/+layout.svelte +++ b/src/routes/(static)/+layout.svelte @@ -16,10 +16,7 @@ -
    +
    {@render children?.()}
    diff --git a/src/routes/(static)/bounties/+page.svelte b/src/routes/(static)/bounties/+page.svelte index 3cc269dc..fad8c041 100644 --- a/src/routes/(static)/bounties/+page.svelte +++ b/src/routes/(static)/bounties/+page.svelte @@ -41,10 +41,7 @@
    First {b}
    - {s(100000, "en-CA")}
    {/each} @@ -57,10 +54,7 @@
    {b.type}
    - {s(b.amount, "en-CA")}
    {/each} @@ -85,9 +79,7 @@ class="whitespace-wrap text-base font-semibold max-w-[150px] truncate sm:max-w-full" title={merchant.display || merchant.username} > - {merchant.display || merchant.username} + {merchant.display || merchant.username} - Referred by @{user.username} + Referred by @{user.username}
    - {s(amount, "en-CA")} @@ -145,38 +132,32 @@

    - 25% of the bounty will be awarded once the business is ready to take - payments and has been announced + 25% of the bounty will be awarded once the business is ready to take payments and has been + announced

    -

    - The rest will be awarded once they've been accepting Bitcoin for 6 months -

    +

    The rest will be awarded once they've been accepting Bitcoin for 6 months

    Bounties will be awarded at our discretion

    -

    - We reserve the right to refuse applicants and change these terms without - cause or notice -

    +

    We reserve the right to refuse applicants and change these terms without cause or notice

    Get Started!

    - Reach out to bounties@coinos.iobounties@coinos.io and let us know who we should contact

    - We'll update this page as the bounties are claimed so you'll be able to see - which ones are still available. + We'll update this page as the bounties are claimed so you'll be able to see which ones are still + available.

    - Have a lead or idea for something that's not on the list? Reach out! We - offer sats for all sorts of referrals! + Have a lead or idea for something that's not on the list? Reach out! We offer sats for all sorts + of referrals!

    Thanks for participating and helping to orange pill Vancouver!

    diff --git a/src/routes/(static)/docs/+page.svelte b/src/routes/(static)/docs/+page.svelte index 51b1f54e..fc803158 100644 --- a/src/routes/(static)/docs/+page.svelte +++ b/src/routes/(static)/docs/+page.svelte @@ -11,20 +11,13 @@ ? `${PUBLIC_COINOS_URL}` : `https://${PUBLIC_DOMAIN}/api`; - let tokenSample = token - ? `export token="${token}"` - : `export token=`; + let tokenSample = token ? `export token="${token}"` : `export token=`; let roSample = `export token="${ro}"`; {#snippet cp(something)} - {/snippet} @@ -40,17 +33,15 @@

    - Coinos has a REST API that can be used to register accounts and make - payments. The following examples show how you can call the API with curl

    API Base URL

    -
    +
    {api}
    {@render cp(api)}
    @@ -60,38 +51,32 @@ {#if user && token} This token authorizes you to use the API as {user.username}. {:else} - Sign in to view your auth token here, - or get one from the /login endpoint. + Sign in to view your auth token here, or get one from the + /login endpoint. {/if} - Save it in a variable called $token to run the examples. It gives full - access to your account so keep it safe. + Save it in a variable called $token to run the examples. It gives full access to your account + so keep it safe.

    -
    +
    {tokenSample}
    {@render cp(tokenSample)}
    {#if ro}

    - This read-only token has permission to create invoices and fetch payments - but can't be used to make withdrawals + This read-only token has permission to create invoices and fetch payments but can't be used to + make withdrawals

    -
    +
    {roSample}
    {@render cp(roSample)}
    {/if}

    POST /register

    -

    - Register a new user account with a username and password -

    +

    Register a new user account with a username and password

    POST /login

    @@ -111,13 +96,9 @@
    display
    string - spaces allowed
    currency
    -
    - string - three-letter ISO currency code e.g. CAD or USD -
    +
    string - three-letter ISO currency code e.g. CAD or USD
    language
    -
    - string - two-letter language code e.g. en, fr, es -
    +
    string - two-letter language code e.g. en, fr, es
    @@ -131,19 +112,13 @@
    type (string, default: lightning)
    bitcoin or lightning
    fiat (boolean, default: false)
    -
    - whether the amount is denominated in satoshis or local currency -
    +
    whether the amount is denominated in satoshis or local currency
    amount (numeric)
    amount to be paid
    webhook (string, optional)
    -
    - remote endpoint to call when the invoice is paid -
    +
    remote endpoint to call when the invoice is paid
    secret (string, optional)
    -
    - a secret value passed to the webhook to authenticate the request -
    +
    a secret value passed to the webhook to authenticate the request
    @@ -178,9 +153,7 @@

    GET /payments

    -

    - Get all payments sent or received by the current user -

    +

    Get all payments sent or received by the current user

    Query params
    diff --git a/src/routes/(static)/forgot/+page.svelte b/src/routes/(static)/forgot/+page.svelte index 711c5568..82ea75a3 100644 --- a/src/routes/(static)/forgot/+page.svelte +++ b/src/routes/(static)/forgot/+page.svelte @@ -8,9 +8,7 @@ let loading; -
    +

    {$t("login.reset")}

    diff --git a/src/routes/(static)/login/+page.svelte b/src/routes/(static)/login/+page.svelte index 08694cd8..7c9c29fc 100644 --- a/src/routes/(static)/login/+page.svelte +++ b/src/routes/(static)/login/+page.svelte @@ -45,8 +45,7 @@ onMount(() => { if (!isTor && recaptchaSiteKey) { let s = document.createElement("script"); - s.src = - "https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey; + s.src = "https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey; document.head.appendChild(s); } }); @@ -72,13 +71,9 @@ const getRecaptchaToken = () => new Promise((resolve, reject) => { if (isTor || !recaptchaSiteKey) return resolve(""); - if (!browser || !grecaptcha) - return reject(new Error("captcha unavailable")); + if (!browser || !grecaptcha) return reject(new Error("captcha unavailable")); grecaptcha.ready(() => { - grecaptcha - .execute(recaptchaSiteKey, { action: "login" }) - .then(resolve) - .catch(reject); + grecaptcha.execute(recaptchaSiteKey, { action: "login" }).then(resolve).catch(reject); }); }); @@ -108,9 +103,7 @@ }); }); - let redirect = $derived( - $loginRedirect || $page.url.searchParams.get("redirect"), - ); + let redirect = $derived($loginRedirect || $page.url.searchParams.get("redirect")); let nostrLogin = async () => { let event = { @@ -157,9 +150,7 @@ } const scriptSelector = - "script[src='https://www.google.com/recaptcha/api.js?render=" + - recaptchaSiteKey + - "']"; + "script[src='https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey + "']"; const script = document.querySelector(scriptSelector); if (script) { script.remove(); @@ -167,9 +158,7 @@ }); -
    +

    {$t("login.signIn")}

    {#if form?.error && !form?.message.includes("2fa")}
    @@ -177,12 +166,7 @@
    {/if} - + @@ -205,12 +189,7 @@ >
    - @@ -246,9 +225,7 @@ aria-labelledby="title" tabindex="-1" > -
    +

    2FA

    diff --git a/src/routes/(static)/privacy/+page.svelte b/src/routes/(static)/privacy/+page.svelte index 7b21a5be..ccbe8a92 100644 --- a/src/routes/(static)/privacy/+page.svelte +++ b/src/routes/(static)/privacy/+page.svelte @@ -2,15 +2,14 @@
    Privacy Policy
    - The only personal information we require to create an account is a username - and password. Some users may provide an email address for notification or - password reset purposes. We will not share your email with anyone or use it - for anything other than the purposes stated. + The only personal information we require to create an account is a username and password. Some + users may provide an email address for notification or password reset purposes. We will not + share your email with anyone or use it for anything other than the purposes stated.
    - We keep records of payment history associated to accounts and may be - obligated to share our records with financial authorities. You may request - that your account be deleted by visiting https://coinos.io/removal + We keep records of payment history associated to accounts and may be obligated to share our + records with financial authorities. You may request that your account be deleted by visiting + https://coinos.io/removal
    diff --git a/src/routes/(static)/register/+page.svelte b/src/routes/(static)/register/+page.svelte index 0200b15b..f594244c 100644 --- a/src/routes/(static)/register/+page.svelte +++ b/src/routes/(static)/register/+page.svelte @@ -18,12 +18,7 @@ import { avatar, signer, password, pin, loginRedirect } from "$lib/store"; import { t } from "$lib/translations"; import { page } from "$app/stores"; - import { - NumberDictionary, - uniqueNamesGenerator, - colors, - animals, - } from "unique-names-generator"; + import { NumberDictionary, uniqueNamesGenerator, colors, animals } from "unique-names-generator"; import { sign } from "$lib/nostr"; let { form, data }: any = $props(); @@ -34,8 +29,7 @@ onMount(() => { if (!isTor && recaptchaSiteKey) { let s = document.createElement("script"); - s.src = - "https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey; + s.src = "https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey; document.head.appendChild(s); } }); @@ -109,13 +103,9 @@ const getRecaptchaToken = () => new Promise((resolve, reject) => { if (isTor) return resolve(""); - if (!browser || !grecaptcha) - return reject(new Error("captcha unavailable")); + if (!browser || !grecaptcha) return reject(new Error("captcha unavailable")); grecaptcha.ready(() => { - grecaptcha - .execute(recaptchaSiteKey, { action: "register" }) - .then(resolve) - .catch(reject); + grecaptcha.execute(recaptchaSiteKey, { action: "register" }).then(resolve).catch(reject); }); }); @@ -260,9 +250,7 @@ } const scriptSelector = - "script[src='https://www.google.com/recaptcha/api.js?render=" + - recaptchaSiteKey + - "']"; + "script[src='https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey + "']"; const script = document.querySelector(scriptSelector); if (script) { script.remove(); @@ -274,16 +262,9 @@ {/if} -
    +

    {$t("login.createAccount")}

    - handleFile(e)} - /> + handleFile(e)} />
    @@ -337,10 +313,7 @@ -
    diff --git a/src/routes/(static)/support/+page.svelte b/src/routes/(static)/support/+page.svelte index dd5439d5..8a7f55bf 100644 --- a/src/routes/(static)/support/+page.svelte +++ b/src/routes/(static)/support/+page.svelte @@ -23,8 +23,7 @@ onMount(() => { if (!isTor && recaptchaSiteKey) { let s = document.createElement("script"); - s.src = - "https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey; + s.src = "https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey; document.head.appendChild(s); } }); @@ -64,9 +63,7 @@ } const scriptSelector = - "script[src='https://www.google.com/recaptcha/api.js?render=" + - recaptchaSiteKey + - "']"; + "script[src='https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey + "']"; const script = document.querySelector(scriptSelector); if (script) { script.remove(); @@ -77,9 +74,7 @@
    {#if sent}

    Thank you!

    -
    - Someone will be in touch shortly. -
    +
    Someone will be in touch shortly.
    @@ -102,25 +97,18 @@
    - +
    - +
    - - + +