CONTEXT.md: small correction for nip19 identifiers

This commit is contained in:
Alex Gleason committed 2025-05-14 12:00:02 -05:00
1 parent 750c165c05
commit d05a78880a
1 file changed
+3 -3
+3 -3
View File
@@ -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