diff options
Diffstat (limited to 'src/routes/(app)/ln')
| -rw-r--r-- | src/routes/(app)/ln/[lnurl]/+page.server.ts | 32 | ||||
| -rw-r--r-- | src/routes/(app)/ln/withdrawal/sent/+page.svelte | 10 |
2 files changed, 10 insertions, 32 deletions
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 @@ </script> <div class="text-center mt-20 md:mt-0"> - <div - class="flex w-full max-w-[200px] mx-auto py-20" - in:scale={{ start: 0.5 }} - > - <iconify-icon - noobserver - icon="ph:check-bold" - class="mx-auto w-full text-[#7ACC8F]" + <div class="flex w-full max-w-[200px] mx-auto py-20" in:scale={{ start: 0.5 }}> + <iconify-icon noobserver icon="ph:check-bold" class="mx-auto w-full text-[#7ACC8F]" ></iconify-icon> </div> <h1 class="text-3xl md:text-4xl font-bold mb-6">Request Sent!</h1> |
