EventModel<T extends EventBodyModel> class

Inheritance

Constructors

EventModel({required String? nonce, required String deviceKey, required int sequence, required DateTime? timestamp, required T body, required String? prevHash, required String hash, required String signature})

Properties

body → T
finalinherited
deviceKey String
The device's public signing key used to sign the event.
finalinherited
hash String
The hash of the signed event. Used as the primary key.
final
hashCode int
The hash code for this object.
no setterinherited
isCurrentDevice bool
no setter
nonce String
finalinherited
prevHash String?
The hash of the previous event in the sender's event chain. Not present for the device's genesis event.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sequence int
A sequence number used to order events from this sender.
finalinherited
signature String
The signature of the event signed using the deviceKey of the unsignedMessage. Event bodies that require peer-level authority carry their own peer signature in the typed payload.
final
timestamp DateTime
finalinherited
type EventType
no setterinherited
unsignedMessage String
latefinalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Json
toString() String
A string representation of this object.
inherited
verify() Future<bool>
Verifies that the event body was signed by the device key.

Operators

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

Static Methods

create<T extends EventBodyModel>({required String deviceKey, required int sequence, required String? prevHash, required T body}) Future<EventModel<T>>
draft<T extends EventBodyModel>({required String deviceKey, required int sequence, required String? prevHash, required T body}) DraftEventModel<T>
fromJson<T extends EventBodyModel>(Json json) EventModel<T>