nevent property

String get nevent

Encode this event as a nevent (NIP-19 event reference)

Returns a bech32-encoded nevent string that includes:

  • Event ID (required)
  • Author pubkey (included)
  • Kind (included)
  • Relay hints from event.sources (if available)

Usage: final nevent = event.nevent;

Implementation

String get nevent {
  return Nip19.encodeNevent(
    eventId: id,
    author: pubKey,
    kind: kind,
    relays: sources.isEmpty ? null : sources,
  );
}