clone

a self-hosted multitenant nostr relay with sites, file storage, git hosting, and inbox and outbox delivery

feat/tinyagent
tinyrelay / internal / event / event.go
event.go 1.6K
1package event23import "github.com/FelineStateMachine/tinyrelay/protocol/nostr"45// Event is the public Nostr wire value. The alias keeps feature consumers6// source-compatible while they migrate to protocol/nostr.7type Event = nostr.Event89func Validate(e Event) error { return nostr.Validate(e) }10func Parse(raw []byte) (Event, error) { return nostr.Parse(raw) }11func Canonical(e Event) ([]byte, error) { return nostr.Canonical(e) }12func Tag(e Event, name string) string { return nostr.Tag(e, name) }13func TagValues(e Event, name string) []string { return nostr.TagValues(e, name) }14func Expiration(e Event) int64 { return nostr.Expiration(e) }15func Difficulty(id string) int { return nostr.Difficulty(id) }16func CommittedDifficulty(e Event) int { return nostr.CommittedDifficulty(e) }17func Sign(e *Event, secretHex string) error { return nostr.Sign(e, secretHex) }18func GenerateKey() (string, error) { return nostr.GenerateKey() }19func PublicKey(secretHex string) (string, error) { return nostr.PublicKey(secretHex) }20func IsEphemeral(k int) bool { return nostr.IsEphemeral(k) }21func IsReplaceable(k int) bool { return nostr.IsReplaceable(k) }22func IsAddressable(k int) bool { return nostr.IsAddressable(k) }2324// IsPrivate is the host's recipient-scoped kind classification, not a generic25// Nostr range. Keep feature privacy decisions outside protocol/nostr.26func IsPrivate(k int) bool {27 return k == 4 || k == 13 || k == KIND_WRAP || k == 21059 || k == KIND_NOSTR_CONNECT || k == KIND_PUSH_REGISTRATION28}