Nip01Event constructor
Nip01Event({})
Creates a new Nostr event.
pubKey is the author's public key. kind is the event kind. tags is a JSON object of event tags. content is an arbitrary string.
Nostr event id
and created_at
fields are calculated automatically.
Implementation
Nip01Event({
required this.pubKey,
required this.kind,
required this.tags,
required this.content,
int? publishAt,
}) {
if (publishAt != null) {
createdAt = publishAt;
} else {
createdAt = _secondsSinceEpoch();
}
id = _calculateId(pubKey, createdAt, kind, tags, content);
}