AuthEvent class

auth event to send to relays

Inheritance

Constructors

AuthEvent({required String pubKey, required List<List<String>> tags})
Zap Request

Properties

content String
Event content.
getter/setter pairinherited
createdAt int
Event creation timestamp in Unix time.
getter/setter pairinherited
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.
getter/setter pairinherited
isIdValid bool
is Id valid?
no setterinherited
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 setterinherited
nevent String
Encode this event as a nevent (NIP-19 event reference)
no setterinherited
powCommitment int
Calculate the commitment (work done) for this event
no setterinherited
powDifficulty int
Get the proof of work difficulty of this event
no setterinherited
pTags List<String>
return all p tags in event
no setterinherited
pubKey String
The event author's public key.
finalinherited
replyETags List<String>
return all e tags in event that have a reply marker
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sig String
64-byte Schnorr signature of Nip01Event.id.
getter/setter pairinherited
sources List<String>
Relay that an event was received from
getter/setter pairinherited
tags List<List<String>>
A JSON array of event tags.
getter/setter pairinherited
targetPoWDifficulty int?
Get the target difficulty from nonce tag if present
no setterinherited
tTags List<String>
return all t tags in event
no setterinherited
validSig bool?
has signature been validated?
getter/setter pairinherited

Methods

checkPoWDifficulty(int targetDifficulty) bool
Check if this event meets a specific difficulty target
inherited
copyWith({String? pubKey, int? createdAt, int? kind, List<List<String>>? tags, String? content, String? sig, List<String>? sources}) Nip01Event
inherited
getDtag() String?
return first found d tag
inherited
getEId() String?
return first e tag found
inherited
getFirstTag(String name) String?
Get first tag matching given name
inherited
getTags(String tag) List<String>
return all tags that match given tag e.g. 'p'
inherited
minePoW(int targetDifficulty, {int? maxIterations}) Nip01Event
Mine this event with proof of work
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sign(String privateKey) → void
sign the event with given privateKey WARN only for testing! Use EventSigner to sign events in production
inherited
toBase64() String
Returns the Event object as a base64-encoded JSON string
inherited
toJson() Map<String, dynamic>
Returns the Event object as a JSON object
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

KIND → const int
auth kind