pointers.go raw
1 // Package pointers is a set of basic nip-19 data types for generating bech32
2 // encoded nostr entities.
3 package pointers
4
5 import (
6 "next.orly.dev/pkg/nostr/encoders/kind"
7 )
8
9 // Profile pointer is a combination of pubkey and relay list.
10 type Profile struct {
11 PublicKey []byte `json:"pubkey"`
12 Relays [][]byte `json:"relays,omitempty"`
13 }
14
15 // Event pointer is the combination of an event ID, relay hints, author, pubkey,
16 // and kind.
17 type Event struct {
18 ID []byte `json:"id"`
19 Relays [][]byte `json:"relays,omitempty"`
20 Author []byte `json:"author,omitempty"`
21 Kind *kind.K `json:"kind,omitempty"`
22 }
23
24 // Entity is the combination of a pubkey, kind, arbitrary identifier, and relay
25 // hints.
26 type Entity struct {
27 PublicKey []byte `json:"pubkey"`
28 Kind *kind.K `json:"kind,omitempty"`
29 Identifier []byte `json:"identifier,omitempty"`
30 Relays [][]byte `json:"relays,omitempty"`
31 }
32