aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Nostr.svelte
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/components/Nostr.svelte
parent13466248004327e9a026cb89f94926f9b060d1c1 (diff)
downloadcoinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.tar.gz
coinos-ui-56a04684c1fb77ea7b21afc6b0d2e1c4773906f6.zip
format
Diffstat (limited to 'src/components/Nostr.svelte')
-rw-r--r--src/components/Nostr.svelte28
1 files changed, 7 insertions, 21 deletions
diff --git a/src/components/Nostr.svelte b/src/components/Nostr.svelte
index 74e85faf..529dd6e7 100644
--- a/src/components/Nostr.svelte
+++ b/src/components/Nostr.svelte
@@ -32,8 +32,7 @@
let connectUrl: string | undefined = $state();
let nostrConnect = async () => {
const { Relay } = await import("nostr-tools/relay");
- const { nip04, generateSecretKey, getPublicKey } =
- await import("nostr-tools");
+ const { nip04, generateSecretKey, getPublicKey } = await import("nostr-tools");
const { getConversationKey, decrypt } = await import("nostr-tools/nip44");
let connectionSecret = crypto.randomUUID();
@@ -49,9 +48,7 @@
try {
let result;
try {
- ({ result } = JSON.parse(
- await nip04.decrypt(sk, pk, event.content),
- ));
+ ({ result } = JSON.parse(await nip04.decrypt(sk, pk, event.content)));
} catch (e) {
let ck = await getConversationKey(sk, pk);
({ result } = JSON.parse(await decrypt(event.content, ck)));
@@ -119,9 +116,7 @@
{#if $eventToSign && !$signer?.ready}
<div class="fixed inset-0 bg-base-100/90 overflow-y-auto h-full w-full z-50">
- <div
- class="relative mx-auto mt-10 p-5 border w-96 shadow-lg rounded-md bg-base-100 space-y-5"
- >
+ <div class="relative mx-auto mt-10 p-5 border w-96 shadow-lg rounded-md bg-base-100 space-y-5">
<h1 class="text-center text-2xl font-semibold">Nostr sign</h1>
{#if ($eventToSign as any).sig && !hadSigner}
@@ -140,16 +135,11 @@
</div>
</a>
<a href={connectUrl} class="btn">
- <iconify-icon
- noobserver
- icon="ph:arrow-square-out-bold"
- width="32"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:arrow-square-out-bold" width="32"></iconify-icon>
{$t("payments.openLink")}</a
>
<button class="btn" onclick={() => copy(connectUrl!)}>
- <iconify-icon noobserver icon="ph:copy-bold" width="32"
- ></iconify-icon>
+ <iconify-icon noobserver icon="ph:copy-bold" width="32"></iconify-icon>
{$t("payments.copy")}</button
>
</div>
@@ -157,8 +147,7 @@
{#if $signer?.method === "nsec"}
<input bind:value={nsec} placeholder="nsec..." />
<button type="button" class="btn btn-accent" onclick={nsecSign}>
- <iconify-icon icon="ph:paper-plane-right-bold" width="32"
- ></iconify-icon>
+ <iconify-icon icon="ph:paper-plane-right-bold" width="32"></iconify-icon>
<div class="my-auto">Submit</div>
</button>
{/if}
@@ -166,10 +155,7 @@
{#if !$signer}
{#if extensionAvailable}
<button type="button" class="btn" onclick={extensionSign}>
- <iconify-icon
- icon="lucide-lab:bee"
- width="32"
- class="text-yellow-400"
+ <iconify-icon icon="lucide-lab:bee" width="32" class="text-yellow-400"
></iconify-icon>
<div class="my-auto">Browser extension</div>
</button>