Documentation
    Preparing search index...

    Function parseNip65RelayList

    • Parse a NIP-65 kind-10002 relay-list event into structured RelayEntry objects.

      Keeps tags where tag[0] === 'r' and tag[1] is a string URL. The optional third element is the marker ('read', 'write', or absent for both). Any marker other than the two canonical strings is treated as "unmarked" (read + write), matching how lenient NIP-65 consumers behave in practice.

      No URL normalization or hostname de-duplication is performed — the relay URL is preserved verbatim. Normalize with a NIP-66 dataset (@kehto/nip/66) or a dedicated relay-URL normalizer if you need canonical hostnames.

      Parameters

      • event: NostrEvent

        A kind-10002 relay-list event (kind is not re-validated; pass the right event)

      Returns RelayEntry[]

      Array of relay entries in tag order; duplicate URLs are preserved

      import { parseNip65RelayList } from '@kehto/nip/65';
      const entries = parseNip65RelayList(kind10002Event);
      // [{ url: 'wss://a', read: true, write: true }, { url: 'wss://b', read: true, write: false }]