refactor: nsec script
This commit is contained in:
parent
90e110b1fd
commit
99b22ab726
|
@ -8,7 +8,7 @@
|
||||||
"test": "DB_PATH=\":memory:\" deno test -A --unstable-ffi",
|
"test": "DB_PATH=\":memory:\" deno test -A --unstable-ffi",
|
||||||
"check": "deno check src/server.ts",
|
"check": "deno check src/server.ts",
|
||||||
"relays:sync": "deno run -A --unstable-ffi scripts/relays.ts sync",
|
"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"],
|
"exclude": ["./public"],
|
||||||
"imports": { "@/": "./src/", "@soapbox/nspec": "jsr:@soapbox/nspec@^0.8.1", "~/fixtures/": "./fixtures/" },
|
"imports": { "@/": "./src/", "@soapbox/nspec": "jsr:@soapbox/nspec@^0.8.1", "~/fixtures/": "./fixtures/" },
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
import { generateSecretKey, nip19 } from '@/deps.ts';
|
import { generateSecretKey, nip19 } from 'npm:nostr-tools';
|
||||||
|
|
||||||
switch (Deno.args[0]) {
|
const encodedNsec = generateEncodedPrivateKey();
|
||||||
default: {
|
console.log(encodedNsec);
|
||||||
const encodedNsec = generateEncodedPrivateKey();
|
|
||||||
console.log(encodedNsec);
|
|
||||||
Deno.exit(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateEncodedPrivateKey(): string {
|
function generateEncodedPrivateKey(): string {
|
||||||
const sk = generateSecretKey();
|
const sk = generateSecretKey();
|
||||||
|
|
|
@ -19,7 +19,6 @@ export {
|
||||||
nip13,
|
nip13,
|
||||||
nip19,
|
nip19,
|
||||||
nip21,
|
nip21,
|
||||||
generateSecretKey,
|
|
||||||
type UnsignedEvent,
|
type UnsignedEvent,
|
||||||
type VerifiedEvent,
|
type VerifiedEvent,
|
||||||
} from 'npm:nostr-tools@^2.3.1';
|
} from 'npm:nostr-tools@^2.3.1';
|
||||||
|
|
Loading…
Reference in New Issue