Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for NIP-32 Labeling #195

Merged
merged 1 commit into from
Nov 3, 2024
Merged

Add support for NIP-32 Labeling #195

merged 1 commit into from
Nov 3, 2024

Conversation

tyiu
Copy link
Contributor

@tyiu tyiu commented Nov 3, 2024

@@ -10,7 +10,7 @@ import Foundation
/// A structure that describes a Nostr event.
///
/// > Note: [NIP-01 Specification](https://github.com/nostr-protocol/nips/blob/master/01.md#events-and-signatures)
public class NostrEvent: Codable, Equatable, Hashable {
public class NostrEvent: Codable, Equatable, Hashable, LabelTagInterpreting {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although labels can exist on any NostrEvent, I've chosen to separate that part of the class out into a separate protocol/extension so that it's easier to maintain, and provides a logical separation.

@@ -318,7 +318,7 @@ public protocol NostrEventBuilding {

public extension NostrEvent {
/// Builder of a ``NostrEvent`` of type `T`.
class Builder<T: NostrEvent>: NostrEventBuilding {
class Builder<T: NostrEvent>: NostrEventBuilding, LabelBuilding {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although labels can exist on any NostrEvent, I've chosen to separate that part of the class out into a separate protocol/extension so that it's easier to maintain, and provides a logical separation.

@tyiu tyiu merged commit 88593b6 into main Nov 3, 2024
5 checks passed
@tyiu tyiu deleted the tyiu/nip-32-labeling branch November 3, 2024 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant