diff options
| author | Adam Soltys <[email protected]> | 2026-02-03 13:46:15 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-11 15:34:01 -0800 |
| commit | 918f4b29bc66be343914fd4c9284375825c57fdf (patch) | |
| tree | 68f1b93ee8f1d60400988fd71231295ca886bad6 /src/routes/(app)/account | |
| parent | 44f09f89eb8f69dbb9bba76e0a55125093e7ecc0 (diff) | |
| download | coinos-ui-918f4b29bc66be343914fd4c9284375825c57fdf.tar.gz coinos-ui-918f4b29bc66be343914fd4c9284375825c57fdf.zip | |
cleanup
Diffstat (limited to 'src/routes/(app)/account')
| -rw-r--r-- | src/routes/(app)/account/[id]/+page.svelte | 2 | ||||
| -rw-r--r-- | src/routes/(app)/account/ark/+page.svelte | 6 | ||||
| -rw-r--r-- | src/routes/(app)/account/pass/+page.svelte | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/routes/(app)/account/[id]/+page.svelte b/src/routes/(app)/account/[id]/+page.svelte index 258912d6..bda81cbc 100644 --- a/src/routes/(app)/account/[id]/+page.svelte +++ b/src/routes/(app)/account/[id]/+page.svelte @@ -6,7 +6,6 @@ import { copy, fail, focus, post } from "$lib/utils"; import { enhance } from "$app/forms"; import { t } from "$lib/translations"; - import { decrypt } from "nostr-tools/nip49"; import { entropyToMnemonic, mnemonicToSeed } from "@scure/bip39"; import { wordlist } from "@scure/bip39/wordlists/english.js"; import { @@ -27,6 +26,7 @@ let submit = $state(async () => { toggle(); + const { decrypt } = await import("nostr-tools/nip49"); let entropy = await decrypt(seed, password); mnemonic = entropyToMnemonic(entropy, wordlist); }); diff --git a/src/routes/(app)/account/ark/+page.svelte b/src/routes/(app)/account/ark/+page.svelte index 4036d140..6d16556c 100644 --- a/src/routes/(app)/account/ark/+page.svelte +++ b/src/routes/(app)/account/ark/+page.svelte @@ -3,13 +3,10 @@ import { tick, onMount } from "svelte"; import { t } from "$lib/translations"; import Spinner from "$comp/Spinner.svelte"; - import { encrypt } from "nostr-tools/nip49"; import { bytesToHex, randomBytes } from "@noble/hashes/utils"; - import { nip19 } from "nostr-tools"; import { hex } from "@scure/base"; import { focus, fail, post, copy } from "$lib/utils"; import { goto } from "$app/navigation"; - import { SingleKey, Wallet } from "@arkade-os/sdk"; import { arkServerUrl } from "$lib/ark"; let { data } = $props(); @@ -35,6 +32,8 @@ }); let generateKey = async () => { + const { nip19 } = await import("nostr-tools"); + const { SingleKey, Wallet } = await import("@arkade-os/sdk"); privateKey = bytesToHex(randomBytes(32)); nsec = nip19.nsecEncode(hex.decode(privateKey)); showNsec = false; @@ -70,6 +69,7 @@ try { // Encrypt the private key using NIP-49 + const { encrypt } = await import("nostr-tools/nip49"); let seed = await encrypt(hex.decode(privateKey), password); await post("/account", { name, seed, type, arkAddress }); diff --git a/src/routes/(app)/account/pass/+page.svelte b/src/routes/(app)/account/pass/+page.svelte index 7de18184..5e681033 100644 --- a/src/routes/(app)/account/pass/+page.svelte +++ b/src/routes/(app)/account/pass/+page.svelte @@ -5,7 +5,6 @@ import { t } from "$lib/translations"; import { mnemonic } from "$lib/store"; import Spinner from "$comp/Spinner.svelte"; - import { encrypt } from "nostr-tools/nip49"; import { mnemonicToSeed, mnemonicToEntropy, @@ -41,6 +40,7 @@ } try { + const { encrypt } = await import("nostr-tools/nip49"); let seed = await encrypt( mnemonicToEntropy($mnemonic, wordlist), password, |
