diff --git a/CHANGELOG.md b/CHANGELOG.md index d91ae6476..d734a46a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ * nostr: add `Tags::challenge` method ([Yuki Kishimoto]) * nostr: add `RelayUrl::is_local_addr` ([Yuki Kishimoto]) +* nostr: add `TagKind::k` constructor ([Yuki Kishimoto]) * database: impl PartialEq and Eq for `Events` ([Yuki Kishimoto]) * database: add `SaveEventStatus` enum ([Yuki Kishimoto]) * pool: add `ReceiverStream` ([Yuki Kishimoto]) diff --git a/crates/nostr/src/event/tag/kind.rs b/crates/nostr/src/event/tag/kind.rs index 323bc9121..2dd91c379 100644 --- a/crates/nostr/src/event/tag/kind.rs +++ b/crates/nostr/src/event/tag/kind.rs @@ -164,6 +164,14 @@ impl<'a> TagKind<'a> { Self::SingleLetter(SingleLetterTag::lowercase(Alphabet::H)) } + /// Construct `k` kind + /// + /// Shorthand for `TagKind::SingleLetter(SingleLetterTag::lowercase(Alphabet::K))`. + #[inline] + pub fn k() -> Self { + Self::SingleLetter(SingleLetterTag::lowercase(Alphabet::K)) + } + /// Construct `p` kind /// /// Shorthand for `TagKind::SingleLetter(SingleLetterTag::lowercase(Alphabet::P))`.