Enum nostr_types::TagV1
source · #[repr(u32)]pub enum TagV1 {
Show 18 variants
Address {
kind: EventKind,
pubkey: PublicKeyHex,
d: String,
relay_url: Option<UncheckedUrl>,
trailing: Vec<String>,
},
ContentWarning {
warning: String,
trailing: Vec<String>,
},
Delegation {
pubkey: PublicKeyHex,
conditions: DelegationConditions,
sig: SignatureHex,
trailing: Vec<String>,
},
Event {
id: Id,
recommended_relay_url: Option<UncheckedUrl>,
marker: Option<String>,
trailing: Vec<String>,
},
Expiration {
time: Unixtime,
trailing: Vec<String>,
},
Pubkey {
pubkey: PublicKeyHex,
recommended_relay_url: Option<UncheckedUrl>,
petname: Option<String>,
trailing: Vec<String>,
},
Hashtag {
hashtag: String,
trailing: Vec<String>,
},
Reference {
url: UncheckedUrl,
marker: Option<String>,
trailing: Vec<String>,
},
Geohash {
geohash: String,
trailing: Vec<String>,
},
Identifier {
d: String,
trailing: Vec<String>,
},
Subject {
subject: String,
trailing: Vec<String>,
},
Nonce {
nonce: String,
target: Option<String>,
trailing: Vec<String>,
},
Parameter {
param: String,
trailing: Vec<String>,
},
Title {
title: String,
trailing: Vec<String>,
},
Other {
tag: String,
data: Vec<String>,
},
Empty = 15,
EventParent {
id: Id,
recommended_relay_url: Option<UncheckedUrl>,
trailing: Vec<String>,
},
Kind {
kind: EventKind,
trailing: Vec<String>,
},
}
Expand description
A tag on an Event
Variants§
Address
Address ‘a’ tag to a parameterized replaceable event
ContentWarning
Content Warning to alert client to hide content until user approves
Delegation
Fields
pubkey: PublicKeyHex
Public key of the delegator
conditions: DelegationConditions
Conditions query string
sig: SignatureHex
64-byte schnorr signature of the sha256 hash of the delegation token
Delegation (Delegated Event Signing)
Event
Fields
recommended_relay_url: Option<UncheckedUrl>
A recommended relay URL to find that other event
This is a reference to an event, where the first string is the event Id. The second string is defined in NIP-01 as an optional URL, but subsequent ‘e’ NIPs define more data and interpretations.
Expiration
A time when the event should be considered expired
Pubkey
Fields
pubkey: PublicKeyHex
The public key of the identity that this event refers to
recommended_relay_url: Option<UncheckedUrl>
A recommended relay URL to find information on that public key
‘p’ This is a reference to a user by public key, where the first string is the PublicKey. The second string is defined in NIP-01 as an optional URL, but subsqeuent NIPs define more data and interpretations.
Hashtag
‘t’ A hashtag
Reference
Fields
url: UncheckedUrl
A relay url
‘r’ A reference to a URL
Geohash
‘g’ A geohash
Identifier
‘d’ Identifier tag
Subject
A subject. The first string is the subject. Should only be in TextNote events.
Nonce
Fields
A nonce tag for Proof of Work
Parameter
There is no known nostr tag like this. This was a mistake, but we can’t remove it or deserialization of data serialized with this in mind will break.
Title
Title (30023 long form)
Other
Any other tag
Empty = 15
An empty array (kept so signature remains valid across ser/de)
EventParent
Fields
recommended_relay_url: Option<UncheckedUrl>
A recommended relay URL to find that other event
Direct parent of an event, ‘E’ tag This is from https://github.com/nostr-protocol/nips/pull/830 which may not happen We should not create these, but we can support them if we encounter them.
Kind
Kind number ‘k’