dominus

One damus client to rule them all
git clone git://jb55.com/dominus
Log | Files | Refs | README

event.rs (708B)


      1 use serde_derive::{Deserialize, Serialize};
      2 
      3 /// Event is the struct used to represent a Nostr event
      4 #[derive(Serialize, Deserialize, Debug, Clone)]
      5 pub struct Event {
      6     /// 32-bytes sha256 of the the serialized event data
      7     pub id: String,
      8     /// 32-bytes hex-encoded public key of the event creator
      9     #[serde(rename = "pubkey")]
     10     pub pub_key: String,
     11     /// unix timestamp in seconds
     12     pub created_at: u64,
     13     /// integer
     14     /// 0: NostrEvent
     15     pub kind: u8,
     16     /// Tags
     17     pub tags: Vec<Vec<String>>,
     18     /// arbitrary string
     19     pub content: String,
     20     /// 64-bytes signature of the sha256 hash of the serialized event data, which is the same as the "id" field
     21     pub sig: String,
     22 }