From 99b11ea3be0a62bf310f52c6d0f2f1b6841c321d Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 10 Mar 2025 02:26:20 -0300 Subject: [PATCH] a method for identifying nip70 "protected" events. --- nip70/nip70.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 nip70/nip70.go diff --git a/nip70/nip70.go b/nip70/nip70.go new file mode 100644 index 0000000..4cb0755 --- /dev/null +++ b/nip70/nip70.go @@ -0,0 +1,12 @@ +package nip70 + +import "github.com/nbd-wtf/go-nostr" + +func IsProtected(event *nostr.Event) bool { + for _, tag := range event.Tags { + if len(tag) == 1 && tag[0] == "-" { + return true + } + } + return false +}