Skip to main content
Home

latest

Framework for Nostr on Deno and web. 🛸

This package works with Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
94%
Published
3 months ago (0.46.5)
Package root>NKinds.ts
export class NKinds { /** Events are **regular**, which means they're all expected to be stored by relays. */ static regular(kind: number): boolean { return (1000 <= kind && kind < 10000) || [1, 2, 4, 5, 6, 7, 8, 16, 40, 41, 42, 43, 44].includes(kind); } /** Events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded. */ static replaceable(kind: number): boolean { return (10000 <= kind && kind < 20000) || [0, 3].includes(kind); } /** Events are **ephemeral**, which means they are not expected to be stored by relays. */ static ephemeral(kind: number): boolean { return 20000 <= kind && kind < 30000; } /** Events are **addressable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag, only the latest event is expected to be stored by relays, older versions are expected to be discarded. */ static addressable(kind: number): boolean { return 30000 <= kind && kind < 40000; } /** @deprecated Use `NKinds.addressable()` instead. */ static parameterizedReplaceable(kind: number): boolean { return NKinds.addressable(kind); } }