feat: upgrade bot
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@snort/system",
|
||||
"version": "1.5.1",
|
||||
"version": "1.5.2",
|
||||
"description": "Snort nostr system package",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
@ -4,6 +4,7 @@ import { EventExt } from "./event-ext";
|
||||
import { Nip4WebCryptoEncryptor } from "./impl/nip4";
|
||||
import { Nip44Encryptor } from "./impl/nip44";
|
||||
import { NostrEvent, NotSignedNostrEvent } from "./nostr";
|
||||
import { randomBytes } from "@noble/hashes/utils";
|
||||
|
||||
export type SignerSupports = "nip04" | "nip44" | string;
|
||||
|
||||
@ -31,6 +32,14 @@ export class PrivateKeySigner implements EventSigner {
|
||||
this.#publicKey = getPublicKey(this.#privateKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a new private key
|
||||
*/
|
||||
static random() {
|
||||
const k = randomBytes(32);
|
||||
return new PrivateKeySigner(k);
|
||||
}
|
||||
|
||||
get supports(): string[] {
|
||||
return ["nip04", "nip44"];
|
||||
}
|
||||
|
Reference in New Issue
Block a user