aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-11-21 19:37:37 -0800
committerAdam Soltys <[email protected]>2026-02-11 15:33:07 -0800
commit21023052918c0b787916ef78937e0be41f46142a (patch)
tree09c5d29fae412a1ed274559098369d0886342178 /src/routes/(app)
parent8dc79c6080a66b587220634ad1b143d52ec60570 (diff)
downloadcoinos-ui-21023052918c0b787916ef78937e0be41f46142a.tar.gz
coinos-ui-21023052918c0b787916ef78937e0be41f46142a.zip
ark route
Diffstat (limited to 'src/routes/(app)')
-rw-r--r--src/routes/(app)/ark/+page.svelte53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/routes/(app)/ark/+page.svelte b/src/routes/(app)/ark/+page.svelte
new file mode 100644
index 00000000..81ef9354
--- /dev/null
+++ b/src/routes/(app)/ark/+page.svelte
@@ -0,0 +1,53 @@
+<script>
+ import { SingleKey, Wallet } from "@arkade-os/sdk";
+ import { onMount, tick } from "svelte";
+ import { HDKey } from "@scure/bip32";
+
+ const identity = SingleKey.fromHex(
+ "ce66c68f8875c0c98a502c666303dc183a21600130013c06f9d1edf60207abf2",
+ );
+
+ let loading = $state();
+ let balance = $state();
+
+ onMount(async () => {
+ setTimeout(checkBalance, 1000);
+ });
+
+ let checkBalance = async (e) => {
+ e?.preventDefault();
+ loading = true;
+
+ const wallet = await Wallet.create({
+ identity,
+ arkServerUrl: "https://arkade.computer",
+ });
+
+ balance = await wallet.getBalance();
+
+ loading = false;
+ };
+</script>
+
+<div class="space-y-5">
+ <h1 class="text-center text-3xl font-semibold">Ark</h1>
+
+ <div class="container w-full mx-auto text-lg px-4 max-w-xl space-y-5">
+ {#if loading}
+ <div>
+ <div class="loading loading-spinner"></div>
+ </div>
+ {:else if typeof balance !== "undefined"}
+ <div class="flex items-center gap-2">
+ <div>
+ {balance.available} sats
+ </div>
+ </div>
+ {/if}
+
+ <div class="flex gap-2 justify-center w-full">
+ <a href="/receive" class="btn grow">Receive</a>
+ <a href="/send" class="btn grow">Send</a>
+ </div>
+ </div>
+</div>