feat: nwc

This commit is contained in:
2023-05-08 15:36:43 +01:00
parent 7baa85ca11
commit 9d67da3b6f
9 changed files with 272 additions and 18 deletions

View File

@ -1,6 +1,6 @@
import { EventKind, HexKey, NostrPrefix, RawEvent } from "@snort/nostr";
import { HashtagRegex } from "Const";
import { parseNostrLink, unixNow } from "Util";
import { getPublicKey, parseNostrLink, unixNow } from "Util";
import { EventExt } from "./EventExt";
export class EventBuilder {
@ -68,7 +68,7 @@ export class EventBuilder {
* @param pk Private key to sign event with
*/
async buildAndSign(pk: HexKey) {
const ev = this.build();
const ev = this.pubKey(getPublicKey(pk)).build();
await EventExt.sign(ev, pk);
return ev;
}