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 createdAt = 0,
}) {
this.createdAt = (createdAt == 0)
? DateTime.now().millisecondsSinceEpoch ~/ 1000
: createdAt;
id = _calculateId(pubKey, this.createdAt, kind, tags, content);
}