From d05a78880a8c884ad3365f8f159f22519ae5a077 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 14 May 2025 12:00:02 -0500 Subject: [PATCH] CONTEXT.md: small correction for nip19 identifiers --- CONTEXT.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTEXT.md b/CONTEXT.md index af4afeb..abeac90 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -234,7 +234,7 @@ NIP-19 identifiers include a prefix, the number "1", then a base32-encoded data ### Use in Filters -The base Nostr protocol uses hex string identifiers for filtering by event IDs, pubkeys, and signatures. Nostr filters only accept hex strings. +The base Nostr protocol uses hex string identifiers when filtering by event IDs and pubkeys. Nostr filters only accept hex strings. ```ts // ❌ Wrong: naddr is not decoded @@ -253,9 +253,9 @@ import { nip19 } from 'nostr-tools'; // Decode a NIP-19 identifier const decoded = nip19.decode(value); -// Optional: guard certain types +// Optional: guard certain types (depending on the use-case) if (decoded.type !== 'naddr') { - throw new Error('Invalid stack ID'); + throw new Error('Unsupported Nostr identifier'); } // Get the addr object