diff options
| author | bndw <ben@bdw.to> | 2026-02-14 12:03:21 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-02-14 12:03:21 -0800 |
| commit | 4fc493e6d8cc20137f920f8647e39fc5051bb245 (patch) | |
| tree | 69055d7da89ca909e33c66de7a883fdbe2ccbb97 /internal/nostr/kinds.go | |
| parent | 3e0ddc90c8f4ae7658cc07fb183aa0a7ecc338b7 (diff) | |
refactor: remove frivolous comments from auth validation/credentials
Also removed internal/nostr package - now using northwest.io/nostr library.
Diffstat (limited to 'internal/nostr/kinds.go')
| -rw-r--r-- | internal/nostr/kinds.go | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/internal/nostr/kinds.go b/internal/nostr/kinds.go deleted file mode 100644 index cb76e88..0000000 --- a/internal/nostr/kinds.go +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | package nostr | ||
| 2 | |||
| 3 | // Event kind constants as defined in NIP-01 and related NIPs. | ||
| 4 | const ( | ||
| 5 | KindMetadata = 0 | ||
| 6 | KindTextNote = 1 | ||
| 7 | KindContactList = 3 | ||
| 8 | KindEncryptedDM = 4 | ||
| 9 | KindDeletion = 5 | ||
| 10 | KindRepost = 6 | ||
| 11 | KindReaction = 7 | ||
| 12 | ) | ||
| 13 | |||
| 14 | // IsRegular returns true if the kind is a regular event (stored, not replaced). | ||
| 15 | // Regular events: 1000 <= kind < 10000 or kind in {0,1,2,...} except replaceable ones. | ||
| 16 | func IsRegular(kind int) bool { | ||
| 17 | if kind == KindMetadata || kind == KindContactList { | ||
| 18 | return false | ||
| 19 | } | ||
| 20 | if kind >= 10000 && kind < 20000 { | ||
| 21 | return false // replaceable | ||
| 22 | } | ||
| 23 | if kind >= 20000 && kind < 30000 { | ||
| 24 | return false // ephemeral | ||
| 25 | } | ||
| 26 | if kind >= 30000 && kind < 40000 { | ||
| 27 | return false // addressable | ||
| 28 | } | ||
| 29 | return true | ||
| 30 | } | ||
| 31 | |||
| 32 | // IsReplaceable returns true if the kind is replaceable (NIP-01). | ||
| 33 | // Replaceable events: 10000 <= kind < 20000, or kind 0 (metadata) or kind 3 (contact list). | ||
| 34 | func IsReplaceable(kind int) bool { | ||
| 35 | if kind == KindMetadata || kind == KindContactList { | ||
| 36 | return true | ||
| 37 | } | ||
| 38 | return kind >= 10000 && kind < 20000 | ||
| 39 | } | ||
| 40 | |||
| 41 | // IsEphemeral returns true if the kind is ephemeral (not stored). | ||
| 42 | // Ephemeral events: 20000 <= kind < 30000. | ||
| 43 | func IsEphemeral(kind int) bool { | ||
| 44 | return kind >= 20000 && kind < 30000 | ||
| 45 | } | ||
| 46 | |||
| 47 | // IsAddressable returns true if the kind is addressable (parameterized replaceable). | ||
| 48 | // Addressable events: 30000 <= kind < 40000. | ||
| 49 | func IsAddressable(kind int) bool { | ||
| 50 | return kind >= 30000 && kind < 40000 | ||
| 51 | } | ||
