diff options
Diffstat (limited to 'src/routes/(app)/sign/+page.server.ts')
| -rw-r--r-- | src/routes/(app)/sign/+page.server.ts | 19 |
1 files changed, 19 insertions, 0 deletions
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)); + }, +}; |
