refactor: centralize nostr event schemas

This commit is contained in:
thePR0M3TH3AN committed 2025-10-01 13:21:59 -04:00
1 parent b6e1219d09
commit 0e29b07d5b
6 files changed
+634 -91

No files matched your search

+3 -6
View File
@@ -1,7 +1,6 @@
// js/userBlocks.js
import { nostrClient } from "./nostr.js";
const BLOCK_LIST_IDENTIFIER = "user-blocks";
import { buildBlockListEvent, BLOCK_LIST_IDENTIFIER } from "./nostrEventSchemas.js";
function normalizeHex(pubkey) {
if (typeof pubkey !== "string") {
@@ -250,13 +249,11 @@ class UserBlockListManager {
throw err;
}
const event = {
kind: 30002,
const event = buildBlockListEvent({
pubkey: normalized,
created_at: Math.floor(Date.now() / 1000),
tags: [["d", BLOCK_LIST_IDENTIFIER]],
content: cipherText,
};
});
const signedEvent = await window.nostr.signEvent(event);