diff options
| author | Adrien Hopkins <[email protected]> | 2026-01-23 10:28:34 -0500 |
|---|---|---|
| committer | Adrien Hopkins <[email protected]> | 2026-01-23 10:28:34 -0500 |
| commit | 0b6b65c1ab1e415969135c0bdbe3d37d0e3bb92a (patch) | |
| tree | 4e57b4a6329afe44630436318aacd2e37dc75ca4 /src/routes/(app)/pos/+page.server.ts | |
| parent | 7325a623cf398dbab138ed6c8a1c9f61a508773d (diff) | |
| parent | 3e7f4613c7133b3de17e785b8b8461355ef807c6 (diff) | |
| download | coinos-ui-0b6b65c1ab1e415969135c0bdbe3d37d0e3bb92a.tar.gz coinos-ui-0b6b65c1ab1e415969135c0bdbe3d37d0e3bb92a.zip | |
Merge branch 'master' into nip17dm
Diffstat (limited to 'src/routes/(app)/pos/+page.server.ts')
| -rw-r--r-- | src/routes/(app)/pos/+page.server.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/routes/(app)/pos/+page.server.ts b/src/routes/(app)/pos/+page.server.ts new file mode 100644 index 00000000..f7a3fda3 --- /dev/null +++ b/src/routes/(app)/pos/+page.server.ts @@ -0,0 +1,21 @@ +import { PUBLIC_COINOS_URL } from "$env/static/public"; +import { fd } from "$lib/utils"; +import { hex } from "@scure/base"; + +export const actions = { + default: async ({ fetch, request }) => { + const body = await fd(request); + console.log("POSTING", body); + const res = await fetch(`${PUBLIC_COINOS_URL}/flash`, { + method: "POST", + body: JSON.stringify(body), + headers: { + "content-type": "application/json", + accept: "application/octet-stream", + }, + }); + + const buf = new Uint8Array(await res.arrayBuffer()); + return { data: hex.encode(buf) }; + }, +}; |
