Skip to content

Commit 99b11ea

Browse files
committed
a method for identifying nip70 "protected" events.
1 parent 94e8b67 commit 99b11ea

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

nip70/nip70.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package nip70
2+
3+
import "github.com/nbd-wtf/go-nostr"
4+
5+
func IsProtected(event *nostr.Event) bool {
6+
for _, tag := range event.Tags {
7+
if len(tag) == 1 && tag[0] == "-" {
8+
return true
9+
}
10+
}
11+
return false
12+
}

0 commit comments

Comments
 (0)