From cc3899a4fa8d0744777457d59fb4c9f3a2a37cd0 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 15 Jan 2025 12:45:04 -0800 Subject: sign page --- src/routes/(app)/sign/+page.server.ts | 19 +++++++++++++++++++ src/routes/(app)/sign/+page.svelte | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 src/routes/(app)/sign/+page.server.ts create mode 100644 src/routes/(app)/sign/+page.svelte (limited to 'src/routes/(app)/sign') diff --git a/src/routes/(app)/sign/+page.server.ts b/src/routes/(app)/sign/+page.server.ts new file mode 100644 index 00000000..c10f183c --- /dev/null +++ b/src/routes/(app)/sign/+page.server.ts @@ -0,0 +1,19 @@ +import { auth, fd, post, types } from "$lib/utils"; + +export async function load({ cookies }) { + const invoice = { + address_type: "legacy", + type: types.bitcoin, + }; + + const { text: address } = await post("/invoice", { invoice }, auth(cookies)); + + return { address }; +} + +export const actions = { + default: async ({ cookies, request }) => { + const body = await fd(request); + return post("/sign", body, auth(cookies)); + }, +}; diff --git a/src/routes/(app)/sign/+page.svelte b/src/routes/(app)/sign/+page.svelte new file mode 100644 index 00000000..819ba27c --- /dev/null +++ b/src/routes/(app)/sign/+page.svelte @@ -0,0 +1,33 @@ + + +
+

+ Sign message with address +

+ + {#if form} +
{signature}
+ + + {:else} +
{address}
+
+ + + +
+ {/if} +
-- cgit v1.2.3