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 id, required int kind, required String content, required String sig, required String pubkey, required DateTime createdAt, required List<
List< tags, String? subscriptionId, String? ots})String> > -
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..
const
-
NostrEvent.deleteEvent({required NostrKeyPairs keyPairs, required List<
String> eventIdsToBeDeleted, String reasonOfDeletion = "", DateTime? createdAt}) -
Creates a new NostrEvent with the given content.
factory
-
NostrEvent.fromPartialData({required int kind, required String content, required NostrKeyPairs keyPairs, List<
List< ? tags, DateTime? createdAt, String? ots})String> > -
Creates a new NostrEvent with less fields and lower complexity.
it requires only to set the fields which can be used
factory
- NostrEvent.fromRelayMessage(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
, thetoString
method will be overridden to output this instance'sprops
.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
-
The tags of the event.
final
Methods
-
copyWith(
{String? id, int? kind, String? content, String? sig, String? pubkey, DateTime? createdAt, List< List< ? tags, String? subscriptionId, String? ots}) → NostrEventString> > - 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..
-
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
-
canBeDeserializedEvent(
String dataFromRelay) → bool -
deserialized(
String serialized) → NostrEvent -
Returns a deserialized NostrEvent from the given
serialized
string. -
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.