kind checking moved to top-level functions on kinds.go

This commit is contained in:
fiatjaf
2024-11-03 15:34:49 -03:00
parent 99c3765092
commit 1d06176c7e
4 changed files with 35 additions and 33 deletions

View File

@@ -132,3 +132,19 @@ const (
KindSimpleGroupAdmins int = 39001
KindSimpleGroupMembers int = 39002
)
func IsRegularKind(kind int) bool {
return kind < 10000 && kind != 0 && kind != 3
}
func IsReplaceableKind(kind int) bool {
return kind == 0 || kind == 3 || (10000 <= kind && kind < 20000)
}
func IsEphemeralKind(kind int) bool {
return 20000 <= kind && kind < 30000
}
func IsAddressableKind(kind int) bool {
return 30000 <= kind && kind < 40000
}