aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/ln
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)/ln
parent13466248004327e9a026cb89f94926f9b060d1c1 (diff)
downloadcoinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.tar.gz
coinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.zip
format
Diffstat (limited to 'src/routes/(app)/ln')
-rw-r--r--src/routes/(app)/ln/[lnurl]/+page.server.ts32
-rw-r--r--src/routes/(app)/ln/withdrawal/sent/+page.svelte10
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>