diff --git a/docs/nostr-event-schemas.md b/docs/nostr-event-schemas.md index 0e745ef3..228615d4 100644 --- a/docs/nostr-event-schemas.md +++ b/docs/nostr-event-schemas.md @@ -17,7 +17,7 @@ import { buildVideoPostEvent, buildRepostEvent, buildShareEvent, - buildProfileMetadataEvent, + buildProfileMetadataEvent } from "./nostrEventSchemas.js"; // Inspect the current schema @@ -25,7 +25,7 @@ console.log(getNostrEventSchema(NOTE_TYPES.VIDEO_POST)); // Temporarily override the kind while debugging setNostrEventSchemaOverrides({ - [NOTE_TYPES.VIDEO_POST]: { kind: 30000 }, + [NOTE_TYPES.VIDEO_POST]: { kind: 30000 } }); // Build an event with the active schema @@ -37,8 +37,8 @@ const event = buildVideoPostEvent({ version: 3, title: "Test", videoRootId: "debug", - infoHash: "0123456789abcdef0123456789abcdef01234567", - }, + infoHash: "0123456789abcdef0123456789abcdef01234567" + } }); ``` @@ -62,10 +62,14 @@ setActiveSigner({ type: "extension", // optional label, used to request NIP-07 permissions pubkey, // hex or npub of the active account signEvent: (event) => extension.signEvent(event), - nip04Encrypt: (targetHex, plaintext) => extension.nip04.encrypt(targetHex, plaintext), - nip04Decrypt: (actorHex, ciphertext) => extension.nip04.decrypt(actorHex, ciphertext), - nip44Encrypt: (targetHex, plaintext) => extension.nip44.encrypt(targetHex, plaintext), - nip44Decrypt: (actorHex, ciphertext) => extension.nip44.decrypt(actorHex, ciphertext), + nip04Encrypt: (targetHex, plaintext) => + extension.nip04.encrypt(targetHex, plaintext), + nip04Decrypt: (actorHex, ciphertext) => + extension.nip04.decrypt(actorHex, ciphertext), + nip44Encrypt: (targetHex, plaintext) => + extension.nip44.encrypt(targetHex, plaintext), + nip44Decrypt: (actorHex, ciphertext) => + extension.nip44.decrypt(actorHex, ciphertext) }); await nostrClient.ensureExtensionPermissions(); @@ -99,7 +103,7 @@ once: ```js const { video, rawEvent } = await nostrClient.getEventById(eventId, { - includeRaw: true, + includeRaw: true }); // `video` is the normalized bitvid object and `rawEvent` is the original @@ -123,7 +127,10 @@ timestamps. through the dedicated facade when you need to run a NIP-07 handshake: ```js -import { nostrClient, requestDefaultExtensionPermissions } from "./nostrClientFacade.js"; +import { + nostrClient, + requestDefaultExtensionPermissions +} from "./nostrClientFacade.js"; ``` The compatibility shim has been removed; import from the facades above to avoid @@ -148,18 +155,18 @@ import { updateWatchHistoryListWithDefaultClient } from "./nostrWatchHistoryFaca ## Event catalogue -| Note | Kind (default) | Tags | Content format | -| --- | --- | --- | --- | -| Video post (`NOTE_TYPES.VIDEO_POST`) | `30078` | `['t','video']`, `['d', ]`, `['s', ]` plus optional schema append tags | JSON payload using Content Schema v3 (`version`, `title`, optional `url`, `magnet`, `thumbnail`, `description`, `mode`, `videoRootId`, `deleted`, `isPrivate`, `isNsfw`, `isForKids`, `enableComments`, `infoHash`, `fileSha256`, `originalFileSha256`, `ws`, `xs`) | -| NIP-94 mirror (`NOTE_TYPES.VIDEO_MIRROR`) | `1063` | Tags forwarded from `publishVideo` (URL, mime type, thumbnail, alt text, magnet) | Plain text alt description | -| Repost (`NOTE_TYPES.REPOST`) | `6` | `['e', , ]` with optional address pointer `['a', , ]`, and `['p', ]` when the origin author is known; inherits schema append tags | JSON-serialized event being reposted (or empty if unavailable) | -| Generic Repost (`NOTE_TYPES.GENERIC_REPOST`) | `16` | Same as Repost; specific for non-text kinds (e.g. videos). | Same as Repost. | -| Share note (`NOTE_TYPES.SHARE`) | `1` | `['e',