feat: zap type

This commit is contained in:
2023-02-18 20:36:42 +00:00
parent 05a363491f
commit b5d7e2c58a
2 changed files with 51 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import { useSelector } from "react-redux";
import * as secp from "@noble/secp256k1";
import { TaggedRawEvent } from "@snort/nostr";
import { EventKind, Tag, Event as NEvent, System, RelaySettings } from "@snort/nostr";
@ -382,6 +383,14 @@ export default function useEventPublisher() {
}
}
},
newKey: () => {
const privKey = secp.utils.bytesToHex(secp.utils.randomPrivateKey());
const pubKey = secp.utils.bytesToHex(secp.schnorr.getPublicKey(privKey));
return {
privateKey: privKey,
publicKey: pubKey,
};
},
};
}