kernl API
    Preparing search index...

    Function parsePerson

    • Read an identity out of what someone typed, pasted or was sent.

      Every NIP-19 form of a person is one: 64 hex characters, an npub, or an nprofile, with or without a nostr: prefix and in any case. An nprofile carries the servers its data is on, which come back as relays.

      Parameters

      • input: string

        The text.

      Returns PersonPointer | undefined

      The person, or undefined when the text is none of those.

      parsePerson('npub1…'); // { pubkey: '3bf0…', relays: [] }
      parsePerson('nostr:nprofile1…'); // { pubkey: '3bf0…', relays: ['wss://relay.example'] }
      parsePerson('hello'); // undefined