NostrEvent class

This represents a low level Nostr event that requires setting all fields manually, which requires you to doo all encodings... You can use NostrEvent.fromPartialData to create an event with less fields and lower complexity..

Constructors

NostrEvent({required String content, required DateTime createdAt, required String id, required int kind, required String? ots, required String pubkey, required String sig, required List<List<String>> tags, String? subscriptionId})
const
NostrEvent.deserialized(String data)
This represents a nostr event that is received from the relays, it takes directly the relay message which is serialized, and handles all internally
factory

Properties

content String
The content of the event.
final
createdAt DateTime
The creation date of the event.
final
hashCode int
The hash code for this object.
no setterinherited
id String
The id of the event.
final
kind int
The kind of the event.
final
ots String?
The ots of the event.
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
pubkey String
The public key of the event creator.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sig String
The signature of the event.
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
subscriptionId String?
The subscription id of the event This is meant for events that are got from the relays, and not for events that are created by you.
final
tags List<List<String>>
The tags of the event.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialized() String
Returns a serialized NostrEvent from this event.
toString() String
A string representation of this object.
inherited
uniqueKey() NostrEventKey
Returns a unique tag for this event that you can use to identify it.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

canBeDeserialized(String dataFromRelay) bool
Wether the given dataFromRelay can be deserialized into a NostrEvent.
deleteEvent({required NostrKeyPairs keyPairs, required List<String> eventIdsToBeDeleted, String reasonOfDeletion = '', DateTime? createdAt}) NostrEvent
Creates a new NostrEvent with the given content.
fromPartialData({required int kind, required String content, required NostrKeyPairs keyPairs, List<List<String>>? tags, DateTime? createdAt, String? ots}) NostrEvent
getEventId({required int kind, required String content, required DateTime createdAt, required List tags, required String pubkey}) String
Creates the id of an event, based on Nostr specs.