From 99b22ab7263ca66e8ec008a20af8d51a8e8d62be Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Sat, 30 Mar 2024 17:25:41 -0300 Subject: [PATCH] refactor: nsec script --- deno.json | 2 +- scripts/nsec.ts | 11 +++-------- src/deps.ts | 1 - 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/deno.json b/deno.json index 58edb3e..99f1eb0 100644 --- a/deno.json +++ b/deno.json @@ -8,7 +8,7 @@ "test": "DB_PATH=\":memory:\" deno test -A --unstable-ffi", "check": "deno check src/server.ts", "relays:sync": "deno run -A --unstable-ffi scripts/relays.ts sync", - "nsec": "deno run -A --unstable-ffi scripts/nsec.ts" + "nsec": "deno run scripts/nsec.ts" }, "exclude": ["./public"], "imports": { "@/": "./src/", "@soapbox/nspec": "jsr:@soapbox/nspec@^0.8.1", "~/fixtures/": "./fixtures/" }, diff --git a/scripts/nsec.ts b/scripts/nsec.ts index cbef7c7..dcfa926 100644 --- a/scripts/nsec.ts +++ b/scripts/nsec.ts @@ -1,12 +1,7 @@ -import { generateSecretKey, nip19 } from '@/deps.ts'; +import { generateSecretKey, nip19 } from 'npm:nostr-tools'; -switch (Deno.args[0]) { - default: { - const encodedNsec = generateEncodedPrivateKey(); - console.log(encodedNsec); - Deno.exit(0); - } -} +const encodedNsec = generateEncodedPrivateKey(); +console.log(encodedNsec); function generateEncodedPrivateKey(): string { const sk = generateSecretKey(); diff --git a/src/deps.ts b/src/deps.ts index 5227526..2e5130e 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -19,7 +19,6 @@ export { nip13, nip19, nip21, - generateSecretKey, type UnsignedEvent, type VerifiedEvent, } from 'npm:nostr-tools@^2.3.1';