refactor: nsec script

This commit is contained in:
P. Reis 2024-03-30 17:25:41 -03:00
parent 90e110b1fd
commit 99b22ab726
3 changed files with 4 additions and 10 deletions

View File

@ -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/" },

View File

@ -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();

View File

@ -19,7 +19,6 @@ export {
nip13,
nip19,
nip21,
generateSecretKey,
type UnsignedEvent,
type VerifiedEvent,
} from 'npm:nostr-tools@^2.3.1';