Documentation
    Preparing search index...

    Function parseList

    • Parse a NIP-51 list or set event into a structured Nip51List.

      Works for any kind: known list/set kinds get a type and correct family; unknown kinds still parse (family: 'unknown') so forward-compatible callers can handle new list kinds before this table is updated.

      Item-bearing tags (see ITEM_TAGS) become Nip51List.publicItems; metadata tags (d, title, image, description, …) are lifted into named fields. The encrypted content is preserved verbatim in Nip51List.encryptedContent — call decryptPrivateItems with a NIP-44 decryptor to populate Nip51List.privateItems.

      Parameters

      • event: NostrEvent

        A NIP-51 list or set event

      Returns Nip51List

      The structured list/set

      import { parseList, getTagValues } from '@kehto/nip/51';
      const bookmarks = parseList(kind10003Event);
      const notes = getTagValues(bookmarks.publicItems, 'e');