summaryrefslogtreecommitdiff
path: root/shim/ws-shim/src/nostr.ts
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-09-17 12:24:41 +0700
committerpolwex <polwex@sortug.com>2025-09-17 12:24:41 +0700
commit387af8fc1603805b02ce03f8adba4fa73a954f7c (patch)
tree6ac4fe9c33a14d9da418a97955a38efb9338d869 /shim/ws-shim/src/nostr.ts
parent31a47ce72255bb56920e417d250541b04be82648 (diff)
relay much more robust
Diffstat (limited to 'shim/ws-shim/src/nostr.ts')
-rw-r--r--shim/ws-shim/src/nostr.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/shim/ws-shim/src/nostr.ts b/shim/ws-shim/src/nostr.ts
index 0b084b6..b123bc8 100644
--- a/shim/ws-shim/src/nostr.ts
+++ b/shim/ws-shim/src/nostr.ts
@@ -1,4 +1,4 @@
-import { finalizeEvent, validateEvent, verifyEvent } from "nostr-tools";
+import { finalizeEvent, nip19, validateEvent, verifyEvent } from "nostr-tools";
import type { NostrEvent } from "./types";
import { hexToBytes } from "nostr-tools/utils";
@@ -22,3 +22,9 @@ export function validate(event: NostrEvent) {
console.log("is verified?", ok2);
return ok && ok2;
}
+
+export function checkPubkey(pubkey: string): boolean {
+ const npub = nip19.npubEncode(pubkey);
+ console.log({ npub, hex: pubkey });
+ return false;
+}