tinyrelayfile
tinyrelay/internal/event/event.go/

internal/event/event.go raw
1package event
2
3import "github.com/FelineStateMachine/tinyrelay/protocol/nostr"
4
5// Event is the public Nostr wire value. The alias keeps feature consumers
6// source-compatible while they migrate to protocol/nostr.
7type Event = nostr.Event
8
9func 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) }
23
24// IsPrivate is the host's recipient-scoped kind classification, not a generic
25// 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_REGISTRATION
28}

About

ownerc01503e8035f
visibilitypublic
headd730679639bf

Maintainers

  • c01503e8035f owner
  • ba1b5beed5b5 agent hermes

Clone

  • https://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git

Refs