Nip01EventModel class
Data model for NIP-01 Event Extends Nip01Event entity with serialization methods to/from JSON and other formats
- Inheritance
-
- Object
- Nip01Event
- Nip01EventModel
Constructors
-
Nip01EventModel({required String? id, required String pubKey, required int createdAt, required int kind, required List<
List< tags, required String content, required String? sig, bool? validSig, List<String> >String> sources = const []}) - creates a new Nip01EventModel instance
- Nip01EventModel.fromEntity(Nip01Event event)
-
creates a new Nip01EventModel instance from a Nip01Event entity
factory
- Nip01EventModel.fromJson(Map data)
-
creates a new Nip01EventModel instance from a JSON object
factory
Properties
- content → String
-
Event content.
finalinherited
- createdAt ↔ int
-
Event creation timestamp in Unix time.
latefinalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String
-
The event ID is a 32-byte SHA256 hash of the serialised event data.
latefinalinherited
- kind → int
-
Event kind identifier (e.g. text_note, set_metadata, etc).
finalinherited
- naddr → String?
-
Encode this event as an naddr (NIP-19 addressable event coordinate)
no setter
- nevent → String
-
Encode this event as a nevent (NIP-19 event reference)
no setter
-
pTags
→ List<
String> -
return all
ptags in eventno setterinherited - pubKey → String
-
The event author's public key.
finalinherited
-
replyETags
→ List<
String> -
return all e tags in event that have a
replymarkerno setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sig → String?
-
64-byte Schnorr signature of Nip01Event.id.
finalinherited
-
sources
→ List<
String> -
Relay that an event was received from
finalinherited
-
A JSON array of event tags.
finalinherited
-
tTags
→ List<
String> -
return all
ttags in eventno setterinherited - validSig → bool?
-
has signature been validated?
finalinherited
Methods
-
copyWith(
{String? id, String? pubKey, int? createdAt, int? kind, List< List< ? tags, String? content, String? sig, bool? validSig, List<String> >String> ? sources}) → Nip01EventModel -
creates a copy of this event with the given fields replaced by the new values
needed so other packages depending on the extened nip01_event.dart can use copyWithoverride -
getDtag(
) → String? -
return first found
dtaginherited -
getEId(
) → String? -
return first
etag foundinherited -
getFirstTag(
String name) → String? -
Get first tag matching given name
inherited
-
getTags(
String tag) → List< String> -
return all tags that match given
tage.g. 'p'inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toBase64(
) → String - Returns the Event object as a base64-encoded JSON string
-
toJson(
) → Map< String, dynamic> - Returns the Event object as a JSON object
-
toJsonString(
) → String - Returns the Event object as a JSON string
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited