Event

data class Event(val id: ByteString, @Json(name = "pubkey") val pubKey: ByteString, @Json(name = "created_at") val createdAt: Instant, val kind: Int, val tags: List<List<String>>, val content: String, val sig: ByteString)

The primitive type understood by relays, as per nip-01

Constructors

Link copied to clipboard
constructor(id: ByteString, @Json(name = "pubkey") pubKey: ByteString, @Json(name = "created_at") createdAt: Instant, kind: Int, tags: List<List<String>>, content: String, sig: ByteString)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val id: ByteString
Link copied to clipboard
val kind: Int
Link copied to clipboard
val pubKey: ByteString
Link copied to clipboard
val sig: ByteString
Link copied to clipboard
Link copied to clipboard

Valid is true if id is the hash of this event's fields.

Link copied to clipboard

Valid is true if the event has a valid signature.

Functions

Link copied to clipboard

Deserialise the content string into an instance of EventContent that corresponds with the event kind.

Link copied to clipboard
fun toJson(): String