Skip to content

Welshman Docs / @welshman/domain

@welshman/domain ​

Classes ​

Type Aliases ​

BadgeImage ​

BadgeImage = object

Defined in: domain/src/kinds/BadgeDefinition.ts:9

Properties ​

dim? ​

optional dim?: string

Defined in: domain/src/kinds/BadgeDefinition.ts:11

url ​

url: string

Defined in: domain/src/kinds/BadgeDefinition.ts:10


Bolt12ZapClaim ​

Bolt12ZapClaim = object

Defined in: domain/src/kinds/Bolt12Zap.ts:43

What Bolt12ZapReader.validate returns: the three events, the amount in millisats, and what the payer proof has to bind to. The target is the zapped event's id or address, and undefined for a zap of the recipient themselves. Only getBolt12ZapPaymentHash reads the proof, so a claim on its own is not yet a paid zap.

Properties ​

amount ​

amount: number

Defined in: domain/src/kinds/Bolt12Zap.ts:49

event ​

event: TrustedEvent

Defined in: domain/src/kinds/Bolt12Zap.ts:44

intent ​

intent: TrustedEvent

Defined in: domain/src/kinds/Bolt12Zap.ts:45

offer ​

offer: TrustedEvent

Defined in: domain/src/kinds/Bolt12Zap.ts:46

offers ​

offers: string[]

Defined in: domain/src/kinds/Bolt12Zap.ts:47

payerNote ​

payerNote: string

Defined in: domain/src/kinds/Bolt12Zap.ts:51

proof ​

proof: string

Defined in: domain/src/kinds/Bolt12Zap.ts:50

target? ​

optional target?: string

Defined in: domain/src/kinds/Bolt12Zap.ts:48


ClassifiedPrice ​

ClassifiedPrice = object

Defined in: domain/src/kinds/Classified.ts:8

Properties ​

amount ​

amount: number

Defined in: domain/src/kinds/Classified.ts:9

currency ​

currency: string

Defined in: domain/src/kinds/Classified.ts:10

frequency ​

frequency: string

Defined in: domain/src/kinds/Classified.ts:11


Client ​

Client = object

Defined in: domain/src/behaviors/Client.ts:10

The NIP-89 client an event was published with, parsed from a ["client", <name>, <address>, <relay hint>] tag. address is an optional 31990:pubkey:d-tag pointer to the client's handler information event, and relay an optional hint for where to find it.

Properties ​

address? ​

optional address?: string

Defined in: domain/src/behaviors/Client.ts:12

name ​

name: string

Defined in: domain/src/behaviors/Client.ts:11

relay? ​

optional relay?: string

Defined in: domain/src/behaviors/Client.ts:13


ContentWarning ​

ContentWarning = object

Defined in: domain/src/behaviors/ContentWarning.ts:9

A NIP-36 content warning, parsed from a ["content-warning", <reason>] tag. The reason is optional: a bare tag flags the content without saying why.

Properties ​

reason? ​

optional reason?: string

Defined in: domain/src/behaviors/ContentWarning.ts:10


Emoji ​

Emoji = object

Defined in: domain/src/behaviors/Emoji.ts:8

A NIP-30 custom emoji, parsed from an ["emoji", <shortcode>, <url>, <address>] tag. address is an optional kind:pubkey:d-tag pointer to the kind-30030 emoji set (NIP-51) the emoji belongs to.

Properties ​

address? ​

optional address?: string

Defined in: domain/src/behaviors/Emoji.ts:11

shortcode ​

shortcode: string

Defined in: domain/src/behaviors/Emoji.ts:9

url ​

url: string

Defined in: domain/src/behaviors/Emoji.ts:10


ExternalRef ​

ExternalRef = object

Defined in: domain/src/kinds/Pin.ts:22

Properties ​

external ​

external: string

Defined in: domain/src/kinds/Pin.ts:22

kind? ​

optional kind?: string

Defined in: domain/src/kinds/Pin.ts:22


HandlerMeta ​

HandlerMeta = object

Defined in: domain/src/kinds/Handler.ts:9

Properties ​

about? ​

optional about?: string

Defined in: domain/src/kinds/Handler.ts:11

lud16? ​

optional lud16?: string

Defined in: domain/src/kinds/Handler.ts:14

name? ​

optional name?: string

Defined in: domain/src/kinds/Handler.ts:10

nip05? ​

optional nip05?: string

Defined in: domain/src/kinds/Handler.ts:15

picture? ​

optional picture?: string

Defined in: domain/src/kinds/Handler.ts:12

website? ​

optional website?: string

Defined in: domain/src/kinds/Handler.ts:13


HighlightAttribution ​

HighlightAttribution = object

Defined in: domain/src/kinds/Highlight.ts:33

Properties ​

pubkey ​

pubkey: string

Defined in: domain/src/kinds/Highlight.ts:34

relay ​

relay: string

Defined in: domain/src/kinds/Highlight.ts:35

role? ​

optional role?: string

Defined in: domain/src/kinds/Highlight.ts:36


HighlightSource ​

HighlightSource = { id: string; relay: string; type: "event"; } | { address: string; relay: string; type: "address"; } | { id: string; type: "external"; } | { type: "reference"; value: string; }

Defined in: domain/src/kinds/Highlight.ts:25


Imeta ​

Imeta = object

Defined in: domain/src/behaviors/Imeta.ts:10

A NIP-92 media attachment, parsed from an ["imeta", "url …", "m …", …] tag. fallbacks and extra are always present when parsed; extra holds the key value entries this type doesn't model (NIP-68's annotate-user, say) so editing an event doesn't drop what another client wrote.

Properties ​

alt? ​

optional alt?: string

Defined in: domain/src/behaviors/Imeta.ts:15

blurhash? ​

optional blurhash?: string

Defined in: domain/src/behaviors/Imeta.ts:13

dim? ​

optional dim?: string

Defined in: domain/src/behaviors/Imeta.ts:14

extra? ​

optional extra?: string[]

Defined in: domain/src/behaviors/Imeta.ts:18

fallbacks? ​

optional fallbacks?: string[]

Defined in: domain/src/behaviors/Imeta.ts:17

hash? ​

optional hash?: string

Defined in: domain/src/behaviors/Imeta.ts:16

mimeType? ​

optional mimeType?: string

Defined in: domain/src/behaviors/Imeta.ts:12

url ​

url: string

Defined in: domain/src/behaviors/Imeta.ts:11


KindConfig ​

KindConfig<Reader, Writer, Query> = object

Defined in: domain/src/core/Kind.ts:12

Type Parameters ​

Reader ​

Reader extends BaseEventReader

Writer ​

Writer extends EventWriter<Reader>

Query ​

Query extends EventQuery

Properties ​

kind ​

kind: number

Defined in: domain/src/core/Kind.ts:17

query ​

query: (kind, context) => Query

Defined in: domain/src/core/Kind.ts:20

Parameters ​
kind ​

number

context ​

KindContext

Returns ​

Query

reader ​

reader: (kind, context, event) => Reader

Defined in: domain/src/core/Kind.ts:18

Parameters ​
kind ​

number

context ​

KindContext

event ​

TrustedEvent

Returns ​

Reader

writer ​

writer: (kind, context, reader?) => Writer

Defined in: domain/src/core/Kind.ts:19

Parameters ​
kind ​

number

context ​

KindContext

reader? ​

Reader

Returns ​

Writer


KindContext ​

KindContext = object

Defined in: domain/src/core/Kind.ts:7

Properties ​

resolver ​

resolver: Resolver

Defined in: domain/src/core/Kind.ts:8

signer? ​

optional signer?: ISigner

Defined in: domain/src/core/Kind.ts:9


Parsed ​

Parsed<R> = ReturnType<R["parse"]>

Defined in: domain/src/core/EventReader.ts:132

What reader.parse() yields for a given reader — the reader for sync kinds, a promise of it for kinds that decrypt. await works either way.

Type Parameters ​

R ​

R extends BaseEventReader


PinReference ​

PinReference = EventRef | ExternalRef

Defined in: domain/src/kinds/Pin.ts:25


PollOption ​

PollOption = object

Defined in: domain/src/kinds/Poll.ts:11

Properties ​

id ​

id: string

Defined in: domain/src/kinds/Poll.ts:12

label ​

label: string

Defined in: domain/src/kinds/Poll.ts:13


PollResult ​

PollResult = object

Defined in: domain/src/kinds/Poll.ts:16

Properties ​

options ​

options: object[]

Defined in: domain/src/kinds/Poll.ts:17

id ​

id: string

label ​

label: string

votes ​

votes: number

voters ​

voters: number

Defined in: domain/src/kinds/Poll.ts:18


PollType ​

PollType = "singlechoice" | "multiplechoice"

Defined in: domain/src/kinds/Poll.ts:9


ProfileBadge ​

ProfileBadge = object

Defined in: domain/src/kinds/ProfileBadges.ts:13

Properties ​

address ​

address: string

Defined in: domain/src/kinds/ProfileBadges.ts:14

awardId ​

awardId: string

Defined in: domain/src/kinds/ProfileBadges.ts:15

relay? ​

optional relay?: string

Defined in: domain/src/kinds/ProfileBadges.ts:16


Quote ​

Quote = object

Defined in: domain/src/behaviors/Quote.ts:12

An event quoted by another, parsed from a NIP-18 q tag of the form ["q", <event id or address>, <relay hint>, <pubkey>]. value is whichever of the two the tag names — an address for a replaceable event, an id for anything else, matching getIdOrAddress. The hint and the quoted event's author are optional either way.

Properties ​

pubkey? ​

optional pubkey?: string

Defined in: domain/src/behaviors/Quote.ts:15

relay? ​

optional relay?: string

Defined in: domain/src/behaviors/Quote.ts:14

value ​

value: string

Defined in: domain/src/behaviors/Quote.ts:13


RelayFee ​

RelayFee = object

Defined in: domain/src/other/Relay.ts:12

One entry in a NIP-11 fees category. unit is either msats or an ISO 4217 currency code, in which case amount is in that currency's minor unit, so it stays an integer. period is in seconds.

Properties ​

amount ​

amount: number

Defined in: domain/src/other/Relay.ts:13

kinds? ​

optional kinds?: number[]

Defined in: domain/src/other/Relay.ts:16

period? ​

optional period?: number

Defined in: domain/src/other/Relay.ts:15

unit ​

unit: string

Defined in: domain/src/other/Relay.ts:14


RelayFees ​

RelayFees = object

Defined in: domain/src/other/Relay.ts:19

Properties ​

admission? ​

optional admission?: RelayFee[]

Defined in: domain/src/other/Relay.ts:20

publication? ​

optional publication?: RelayFee[]

Defined in: domain/src/other/Relay.ts:22

subscription? ​

optional subscription?: RelayFee[]

Defined in: domain/src/other/Relay.ts:21


RelayInfo ​

RelayInfo = object

Defined in: domain/src/other/Relay.ts:25

Properties ​

optional banner?: string

Defined in: domain/src/other/Relay.ts:27

contact? ​

optional contact?: string

Defined in: domain/src/other/Relay.ts:31

description? ​

optional description?: string

Defined in: domain/src/other/Relay.ts:35

fees? ​

optional fees?: RelayFees

Defined in: domain/src/other/Relay.ts:40

icon? ​

optional icon?: string

Defined in: domain/src/other/Relay.ts:26

limitation? ​

optional limitation?: object

Defined in: domain/src/other/Relay.ts:41

auth_required? ​

optional auth_required?: boolean

min_pow_difficulty? ​

optional min_pow_difficulty?: number

payment_required? ​

optional payment_required?: boolean

name? ​

optional name?: string

Defined in: domain/src/other/Relay.ts:28

negentropy? ​

optional negentropy?: number

Defined in: domain/src/other/Relay.ts:34

payments_url? ​

optional payments_url?: string

Defined in: domain/src/other/Relay.ts:39

privacy_policy? ​

optional privacy_policy?: string

Defined in: domain/src/other/Relay.ts:37

pubkey? ​

optional pubkey?: string

Defined in: domain/src/other/Relay.ts:30

redirect_to? ​

optional redirect_to?: string

Defined in: domain/src/other/Relay.ts:48

self? ​

optional self?: string

Defined in: domain/src/other/Relay.ts:29

software? ​

optional software?: string

Defined in: domain/src/other/Relay.ts:32

supported_nips? ​

optional supported_nips?: string[]

Defined in: domain/src/other/Relay.ts:36

terms_of_service? ​

optional terms_of_service?: string

Defined in: domain/src/other/Relay.ts:38

version? ​

optional version?: string

Defined in: domain/src/other/Relay.ts:33


RsvpFreebusy ​

RsvpFreebusy = "free" | "busy"

Defined in: domain/src/kinds/CalendarRsvp.ts:21


RsvpStatus ​

RsvpStatus = "accepted" | "declined" | "tentative"

Defined in: domain/src/kinds/CalendarRsvp.ts:19


WikiVersion ​

WikiVersion = object

Defined in: domain/src/kinds/Wiki.ts:23

Properties ​

address? ​

optional address?: string

Defined in: domain/src/kinds/Wiki.ts:24

id? ​

optional id?: string

Defined in: domain/src/kinds/Wiki.ts:25

relay ​

relay: string

Defined in: domain/src/kinds/Wiki.ts:26


Zap ​

Zap = object

Defined in: domain/src/other/Zapper.ts:9

Properties ​

invoiceAmount ​

invoiceAmount: number

Defined in: domain/src/other/Zapper.ts:12

request ​

request: TrustedEvent

Defined in: domain/src/other/Zapper.ts:10

response ​

response: TrustedEvent

Defined in: domain/src/other/Zapper.ts:11


ZapGoalProgress ​

ZapGoalProgress = object

Defined in: domain/src/kinds/ZapGoal.ts:12

Properties ​

amount ​

amount: number

Defined in: domain/src/kinds/ZapGoal.ts:14

contributors ​

contributors: string[]

Defined in: domain/src/kinds/ZapGoal.ts:16

target ​

target: number

Defined in: domain/src/kinds/ZapGoal.ts:15

zaps ​

zaps: Zap[]

Defined in: domain/src/kinds/ZapGoal.ts:13


ZapperValues ​

ZapperValues = object

Defined in: domain/src/other/Zapper.ts:20

Properties ​

allowsNostr? ​

optional allowsNostr?: boolean

Defined in: domain/src/other/Zapper.ts:27

callback? ​

optional callback?: string

Defined in: domain/src/other/Zapper.ts:24

lnurl ​

lnurl: string

Defined in: domain/src/other/Zapper.ts:21

maxSendable? ​

optional maxSendable?: number

Defined in: domain/src/other/Zapper.ts:26

minSendable? ​

optional minSendable?: number

Defined in: domain/src/other/Zapper.ts:25

nostrPubkey ​

nostrPubkey: string

Defined in: domain/src/other/Zapper.ts:23

pubkey ​

pubkey: string

Defined in: domain/src/other/Zapper.ts:22


ZapSplit ​

ZapSplit = object

Defined in: domain/src/behaviors/ZapSplits.ts:8

A single recipient of an event's zaps, parsed from a NIP-57 Appendix G zap tag of the form ["zap", <pubkey>, <relay hint>, <weight>].

Properties ​

pubkey ​

pubkey: string

Defined in: domain/src/behaviors/ZapSplits.ts:9

relay? ​

optional relay?: string

Defined in: domain/src/behaviors/ZapSplits.ts:10

weight ​

weight: number

Defined in: domain/src/behaviors/ZapSplits.ts:11


ZapSplitAmount ​

ZapSplitAmount = ZapSplit & object

Defined in: domain/src/behaviors/ZapSplits.ts:14

Type Declaration ​

amount ​

amount: number

Variables ​

AppData ​

const AppData: KindFactory<AppDataReader, AppDataWriter, AppDataQuery>

Defined in: domain/src/kinds/AppData.ts:114


Article ​

const Article: KindFactory<ArticleReader, ArticleWriter, ArticleQuery>

Defined in: domain/src/kinds/Article.ts:63


BadgeAward ​

const BadgeAward: KindFactory<BadgeAwardReader, BadgeAwardWriter, BadgeAwardQuery>

Defined in: domain/src/kinds/BadgeAward.ts:53


BadgeDefinition ​

const BadgeDefinition: KindFactory<BadgeDefinitionReader, BadgeDefinitionWriter, BadgeDefinitionQuery>

Defined in: domain/src/kinds/BadgeDefinition.ts:73


BlockedRelayList ​

const BlockedRelayList: KindFactory<BlockedRelayListReader, BlockedRelayListWriter, BlockedRelayListQuery>

Defined in: domain/src/kinds/BlockedRelayList.ts:51


BlossomServerList ​

const BlossomServerList: KindFactory<BlossomServerListReader, BlossomServerListWriter, BlossomServerListQuery>

Defined in: domain/src/kinds/BlossomServerList.ts:45


Bolt12Offer ​

const Bolt12Offer: KindFactory<Bolt12OfferReader, Bolt12OfferWriter, Bolt12OfferQuery>

Defined in: domain/src/kinds/Bolt12Offer.ts:74


Bolt12Zap ​

const Bolt12Zap: KindFactory<Bolt12ZapReader, Bolt12ZapWriter, Bolt12ZapQuery>

Defined in: domain/src/kinds/Bolt12Zap.ts:322


Bolt12ZapIntent ​

const Bolt12ZapIntent: KindFactory<Bolt12ZapIntentReader, Bolt12ZapIntentWriter, Bolt12ZapIntentQuery>

Defined in: domain/src/kinds/Bolt12ZapIntent.ts:152


BookmarkList ​

const BookmarkList: KindFactory<BookmarkListReader, BookmarkListWriter<BookmarkListReader>, BookmarkListQuery>

Defined in: domain/src/kinds/BookmarkList.ts:57


BookmarkSet ​

const BookmarkSet: KindFactory<BookmarkSetReader, BookmarkSetWriter, BookmarkSetQuery>

Defined in: domain/src/kinds/BookmarkSet.ts:42


CalendarRsvp ​

const CalendarRsvp: KindFactory<CalendarRsvpReader, CalendarRsvpWriter, CalendarRsvpQuery>

Defined in: domain/src/kinds/CalendarRsvp.ts:127


Classified ​

const Classified: KindFactory<ClassifiedReader, ClassifiedWriter, ClassifiedQuery>

Defined in: domain/src/kinds/Classified.ts:92


Command ​

const Command: KindFactory<CommandReader, CommandWriter, CommandQuery>

Defined in: domain/src/kinds/Command.ts:124


CommandList ​

const CommandList: KindFactory<CommandListReader, CommandListWriter, CommandListQuery>

Defined in: domain/src/kinds/CommandList.ts:39


Comment ​

const Comment: KindFactory<CommentReader, CommentWriter, CommentQuery>

Defined in: domain/src/kinds/Comment.ts:215


CommunityList ​

const CommunityList: KindFactory<CommunityListReader, CommunityListWriter, CommunityListQuery>

Defined in: domain/src/kinds/CommunityList.ts:32


DateEvent ​

const DateEvent: KindFactory<DateEventReader, DateEventWriter, DateEventQuery>

Defined in: domain/src/kinds/DateEvent.ts:87


DEFER ​

const DEFER: "defer" = "defer"

Defined in: domain/src/kinds/Wiki.ts:31


Delete ​

const Delete: KindFactory<DeleteReader, DeleteWriter, DeleteQuery>

Defined in: domain/src/kinds/Delete.ts:105


DirectMessage ​

const DirectMessage: KindFactory<DirectMessageReader, DirectMessageWriter, DirectMessageQuery>

Defined in: domain/src/kinds/DirectMessage.ts:88


EmojiList ​

const EmojiList: KindFactory<EmojiListReader, EmojiListWriter, EmojiListQuery>

Defined in: domain/src/kinds/EmojiList.ts:31


Feed ​

const Feed: KindFactory<FeedReader, FeedWriter, FeedQuery>

Defined in: domain/src/kinds/Feed.ts:45


FeedList ​

const FeedList: KindFactory<FeedListReader, FeedListWriter, FeedListQuery>

Defined in: domain/src/kinds/FeedList.ts:39


FollowList ​

const FollowList: KindFactory<FollowListReader, FollowListWriter, FollowListQuery>

Defined in: domain/src/kinds/FollowList.ts:61


FORK ​

const FORK: "fork" = "fork"

Defined in: domain/src/kinds/Wiki.ts:29


GenericRepost ​

const GenericRepost: KindFactory<RepostReader, RepostWriter, RepostQuery>

Defined in: domain/src/kinds/Repost.ts:152


Handler ​

const Handler: KindFactory<HandlerReader, HandlerWriter, HandlerQuery>

Defined in: domain/src/kinds/Handler.ts:132


HandlerRecommendation ​

const HandlerRecommendation: KindFactory<HandlerRecommendationReader, HandlerRecommendationWriter, HandlerRecommendationQuery>

Defined in: domain/src/kinds/HandlerRecommendation.ts:44


Highlight ​

const Highlight: KindFactory<HighlightReader, HighlightWriter, HighlightQuery>

Defined in: domain/src/kinds/Highlight.ts:189


Label ​

const Label: KindFactory<LabelReader, LabelWriter, LabelQuery>

Defined in: domain/src/kinds/Label.ts:142


Message ​

const Message: KindFactory<MessageReader, MessageWriter, MessageQuery>

Defined in: domain/src/kinds/Message.ts:89


MessagingRelayList ​

const MessagingRelayList: KindFactory<MessagingRelayListReader, MessagingRelayListWriter, MessagingRelayListQuery>

Defined in: domain/src/kinds/MessagingRelayList.ts:48


MuteList ​

const MuteList: KindFactory<MuteListReader, MuteListWriter, MuteListQuery>

Defined in: domain/src/kinds/MuteList.ts:67


Note ​

const Note: KindFactory<NoteReader, NoteWriter, NoteQuery>

Defined in: domain/src/kinds/Note.ts:162


Picture ​

const Picture: KindFactory<PictureReader, PictureWriter, PictureQuery>

Defined in: domain/src/kinds/Picture.ts:81


Pin ​

const Pin: KindFactory<PinReader, PinWriter, PinQuery>

Defined in: domain/src/kinds/Pin.ts:141


Pinboard ​

const Pinboard: KindFactory<PinboardReader, PinboardWriter, PinboardQuery>

Defined in: domain/src/kinds/Pinboard.ts:70


PinList ​

const PinList: KindFactory<PinListReader, PinListWriter, PinListQuery>

Defined in: domain/src/kinds/PinList.ts:39


Poll ​

const Poll: KindFactory<PollReader, PollWriter, PollQuery>

Defined in: domain/src/kinds/Poll.ts:120


PollResponse ​

const PollResponse: KindFactory<PollResponseReader, PollResponseWriter, PollResponseQuery>

Defined in: domain/src/kinds/PollResponse.ts:43


Profile ​

const Profile: KindFactory<ProfileReader, ProfileWriter, ProfileQuery>

Defined in: domain/src/kinds/Profile.ts:147


PROFILE_BADGES_IDENTIFIER ​

const PROFILE_BADGES_IDENTIFIER: "profile_badges" = "profile_badges"

Defined in: domain/src/kinds/ProfileBadges.ts:11


ProfileBadges ​

const ProfileBadges: KindFactory<ProfileBadgesReader, ProfileBadgesWriter, ProfileBadgesQuery>

Defined in: domain/src/kinds/ProfileBadges.ts:84


Reaction ​

const Reaction: KindFactory<ReactionReader, ReactionWriter, ReactionQuery>

Defined in: domain/src/kinds/Reaction.ts:83


RelayAddMember ​

const RelayAddMember: KindFactory<RelayAddMemberReader, RelayAddMemberWriter, RelayAddMemberQuery>

Defined in: domain/src/kinds/RelayAddMember.ts:29


RelayInvite ​

const RelayInvite: KindFactory<RelayInviteReader, RelayInviteWriter, RelayInviteQuery>

Defined in: domain/src/kinds/RelayInvite.ts:29


RelayJoin ​

const RelayJoin: KindFactory<RelayJoinReader, RelayJoinWriter, RelayJoinQuery>

Defined in: domain/src/kinds/RelayJoin.ts:44


RelayLeave ​

const RelayLeave: KindFactory<RelayLeaveReader, RelayLeaveWriter, RelayLeaveQuery>

Defined in: domain/src/kinds/RelayLeave.ts:27


RelayList ​

const RelayList: KindFactory<RelayListReader, RelayListWriter, RelayListQuery>

Defined in: domain/src/kinds/RelayList.ts:139


RelayMembers ​

const RelayMembers: KindFactory<RelayMembersReader, RelayMembersWriter, RelayMembersQuery>

Defined in: domain/src/kinds/RelayMembers.ts:77


RelayRemoveMember ​

const RelayRemoveMember: KindFactory<RelayRemoveMemberReader, RelayRemoveMemberWriter, RelayRemoveMemberQuery>

Defined in: domain/src/kinds/RelayRemoveMember.ts:29


RelayRole ​

const RelayRole: KindFactory<RelayRoleReader, RelayRoleWriter, RelayRoleQuery>

Defined in: domain/src/kinds/RelayRole.ts:60


RelaySet ​

const RelaySet: KindFactory<RelaySetReader, RelaySetWriter, RelaySetQuery>

Defined in: domain/src/kinds/RelaySet.ts:73


Report ​

const Report: KindFactory<ReportReader, ReportWriter, ReportQuery>

Defined in: domain/src/kinds/Report.ts:86


Repost ​

const Repost: KindFactory<RepostReader, RepostWriter, RepostQuery>

Defined in: domain/src/kinds/Repost.ts:145


RoomAddMember ​

const RoomAddMember: KindFactory<RoomAddMemberReader, RoomAddMemberWriter, RoomAddMemberQuery>

Defined in: domain/src/kinds/RoomAddMember.ts:37


RoomAdmins ​

const RoomAdmins: KindFactory<RoomAdminsReader, RoomAdminsWriter, RoomAdminsQuery>

Defined in: domain/src/kinds/RoomAdmins.ts:61


RoomCreate ​

const RoomCreate: KindFactory<RoomCreateReader, RoomCreateWriter, RoomCreateQuery>

Defined in: domain/src/kinds/RoomCreate.ts:28


RoomCreateInvite ​

const RoomCreateInvite: KindFactory<RoomCreateInviteReader, RoomCreateInviteWriter, RoomCreateInviteQuery>

Defined in: domain/src/kinds/RoomCreateInvite.ts:37


RoomCreatePermission ​

const RoomCreatePermission: KindFactory<RoomCreatePermissionReader, RoomCreatePermissionWriter, RoomCreatePermissionQuery>

Defined in: domain/src/kinds/RoomCreatePermission.ts:41


RoomDelete ​

const RoomDelete: KindFactory<RoomDeleteReader, RoomDeleteWriter, RoomDeleteQuery>

Defined in: domain/src/kinds/RoomDelete.ts:28


RoomDeleteEvent ​

const RoomDeleteEvent: KindFactory<RoomDeleteEventReader, RoomDeleteEventWriter, RoomDeleteEventQuery>

Defined in: domain/src/kinds/RoomDeleteEvent.ts:42


RoomEdit ​

const RoomEdit: KindFactory<RoomEditReader, RoomEditWriter, RoomEditQuery>

Defined in: domain/src/kinds/RoomEdit.ts:109


RoomJoin ​

const RoomJoin: KindFactory<RoomJoinReader, RoomJoinWriter, RoomJoinQuery>

Defined in: domain/src/kinds/RoomJoin.ts:37


RoomLeave ​

const RoomLeave: KindFactory<RoomLeaveReader, RoomLeaveWriter, RoomLeaveQuery>

Defined in: domain/src/kinds/RoomLeave.ts:28


RoomList ​

const RoomList: KindFactory<RoomListReader, RoomListWriter, RoomListQuery>

Defined in: domain/src/kinds/RoomList.ts:166


RoomMembers ​

const RoomMembers: KindFactory<RoomMembersReader, RoomMembersWriter, RoomMembersQuery>

Defined in: domain/src/kinds/RoomMembers.ts:41


RoomMeta ​

const RoomMeta: KindFactory<RoomMetaReader, RoomMetaWriter, RoomMetaQuery>

Defined in: domain/src/kinds/RoomMeta.ts:101


RoomPins ​

const RoomPins: KindFactory<RoomPinsReader, RoomPinsWriter<RoomPinsReader>, RoomPinsQuery>

Defined in: domain/src/kinds/RoomPins.ts:52


RoomRemoveMember ​

const RoomRemoveMember: KindFactory<RoomRemoveMemberReader, RoomRemoveMemberWriter, RoomRemoveMemberQuery>

Defined in: domain/src/kinds/RoomRemoveMember.ts:45


RoomUpdatePins ​

const RoomUpdatePins: KindFactory<RoomUpdatePinsReader, RoomUpdatePinsWriter, RoomUpdatePinsQuery>

Defined in: domain/src/kinds/RoomUpdatePins.ts:26


SearchRelayList ​

const SearchRelayList: KindFactory<SearchRelayListReader, SearchRelayListWriter, SearchRelayListQuery>

Defined in: domain/src/kinds/SearchRelayList.ts:51


SOURCE ​

const SOURCE: "source" = "source"

Defined in: domain/src/kinds/WikiMergeRequest.ts:17


Thread ​

const Thread: KindFactory<ThreadReader, ThreadWriter, ThreadQuery>

Defined in: domain/src/kinds/Thread.ts:27


TimeEvent ​

const TimeEvent: KindFactory<TimeEventReader, TimeEventWriter, TimeEventQuery>

Defined in: domain/src/kinds/TimeEvent.ts:80


TopicList ​

const TopicList: KindFactory<TopicListReader, TopicListWriter, TopicListQuery>

Defined in: domain/src/kinds/TopicList.ts:47


Wiki ​

const Wiki: KindFactory<WikiReader, WikiWriter, WikiQuery>

Defined in: domain/src/kinds/Wiki.ts:152


WikiMergeRequest ​

const WikiMergeRequest: KindFactory<WikiMergeRequestReader, WikiMergeRequestWriter, WikiMergeRequestQuery>

Defined in: domain/src/kinds/WikiMergeRequest.ts:122


WikiRedirect ​

const WikiRedirect: KindFactory<WikiRedirectReader, WikiRedirectWriter, WikiRedirectQuery>

Defined in: domain/src/kinds/WikiRedirect.ts:85


ZapGoal ​

const ZapGoal: KindFactory<ZapGoalReader, ZapGoalWriter, ZapGoalQuery>

Defined in: domain/src/kinds/ZapGoal.ts:136


ZapReceipt ​

const ZapReceipt: KindFactory<ZapReceiptReader, ZapReceiptWriter, ZapReceiptQuery>

Defined in: domain/src/kinds/ZapReceipt.ts:90


ZapRequest ​

const ZapRequest: KindFactory<ZapRequestReader, ZapRequestWriter, ZapRequestQuery>

Defined in: domain/src/kinds/ZapRequest.ts:169

Functions ​

displayPubkey() ​

displayPubkey(pubkey): string

Defined in: domain/src/kinds/Profile.ts:23

Parameters ​

pubkey ​

string

Returns ​

string


getBolt12ZapIntentError() ​

getBolt12ZapIntentError(tags): string | undefined

Defined in: domain/src/kinds/Bolt12ZapIntent.ts:30

The first NIP-B1 rule a zap intent's tags break, or undefined if they keep them all.

Parameters ​

tags ​

string[][]

Returns ​

string | undefined


getBolt12ZapPaymentHash() ​

getBolt12ZapPaymentHash(claim): string | undefined

Defined in: domain/src/kinds/Bolt12Zap.ts:123

The lightning half of NIP-B1 validation, which Bolt12ZapReader.validate leaves alone and Bolt12ZapWriter.validate runs before publishing: the payer proof settles, it pays one of the offers the recipient announced, and it carries the payer note and amount this claim says it does. Returns the proof's invoice_payment_hash, which is how two claims of one payment are told apart.

Parameters ​

claim ​

Pick<Bolt12ZapClaim, "proof" | "payerNote" | "amount" | "offers">

Returns ​

string | undefined


getClient() ​

getClient(event): Client | undefined

Defined in: domain/src/behaviors/Client.ts:21

Parse an event's NIP-89 client tag, or undefined if it has none. An address or relay hint that doesn't parse is dropped. A plain function so it can read the client off any event, regardless of kind, without a kind-specific reader.

Parameters ​

event ​

TrustedEvent

Returns ​

Client | undefined


getCommentTags() ​

getCommentTags(tags): object

Defined in: domain/src/kinds/Comment.ts:24

Parameters ​

tags ​

string[][]

Returns ​

object

replies ​

replies: string[][]

roots ​

roots: string[][]


getCommentTagValues() ​

getCommentTagValues(tags): Record<string, string[]>

Defined in: domain/src/kinds/Comment.ts:34

Parameters ​

tags ​

string[][]

Returns ​

Record<string, string[]>


getContentWarning() ​

getContentWarning(event): ContentWarning | undefined

Defined in: domain/src/behaviors/ContentWarning.ts:18

Parse an event's NIP-36 content-warning tag, or undefined if it has none. A plain function so it can read the warning off any event, regardless of kind, without a kind-specific reader.

Parameters ​

event ​

TrustedEvent

Returns ​

ContentWarning | undefined


getEmojis() ​

getEmojis(event): Emoji[]

Defined in: domain/src/behaviors/Emoji.ts:19

Parse an event's NIP-30 emoji tags. Tags missing a shortcode or url are skipped. A plain function so it can read emojis off any event, regardless of kind, without a kind-specific reader.

Parameters ​

event ​

TrustedEvent

Returns ​

Emoji[]


getExpiration() ​

getExpiration(event): number | undefined

Defined in: util/src/Tags.ts:87

An event's NIP-40 expiration timestamp, or undefined if it has none that parses.

Parameters ​

event ​
tags ​

string[][]

Returns ​

number | undefined


getImeta() ​

getImeta(event): Imeta[]

Defined in: domain/src/behaviors/Imeta.ts:105

Parse an event's NIP-92 imeta tags. A plain function so it can read attachments off any event, regardless of kind, without a kind-specific reader.

Parameters ​

event ​

TrustedEvent

Returns ​

Imeta[]


getQuotes() ​

getQuotes(event): Quote[]

Defined in: domain/src/behaviors/Quote.ts:47

Parse an event's NIP-18 q tags, in the order they appear — kinds that treat one of them specially (a NIP-C7 reply quotes the message it answers) pick it out of the list. A plain function so it can read quotes off any event, regardless of kind, without a kind-specific reader.

Parameters ​

event ​

TrustedEvent

Returns ​

Quote[]


getZapSplits() ​

getZapSplits(event): ZapSplit[]

Defined in: domain/src/behaviors/ZapSplits.ts:36

Resolve an event's zap-split recipients per NIP-57 Appendix G:

  • With no zap tags the whole zap goes to the event's author.
  • If no recipient carries a weight, the zap is split equally (weight 1 each).
  • If weights are only partially present, unweighted recipients drop to weight 0 (i.e. they should not be zapped).

Weight-0 recipients are still returned so callers have the full recipient set; they simply receive 0 from splitZapAmount.

A plain function so it can read splits off any event, regardless of kind, without a kind-specific reader.

Parameters ​

event ​

TrustedEvent

Returns ​

ZapSplit[]


isProtected() ​

isProtected(event): boolean

Defined in: domain/src/behaviors/Protected.ts:9

Whether an event carries the NIP-70 ["-"] marker, which asks relays to accept it only from its author. A plain function so it can read the marker off any event, regardless of kind, without a kind-specific reader.

Parameters ​

event ​

TrustedEvent

Returns ​

boolean


parseImeta() ​

parseImeta(tag): Imeta | undefined

Defined in: domain/src/behaviors/Imeta.ts:33

Parse a single imeta tag, or undefined for any other tag. url is empty for an attachment that names none, which a content-addressed one need not.

Parameters ​

tag ​

string[]

Returns ​

Imeta | undefined


parseImetas() ​

parseImetas(tags): Imeta[]

Defined in: domain/src/behaviors/Imeta.ts:77

Parse every imeta tag in a tag list. Writers use this to read the attachments they're carrying, since they hold tags rather than an event.

Parameters ​

tags ​

string[][]

Returns ​

Imeta[]


parseLnUrl() ​

parseLnUrl(values?): Maybe<string>

Defined in: domain/src/kinds/Profile.ts:11

Parameters ​

values? ​

Record<string, any> = {}

Returns ​

Maybe<string>


parseQuote() ​

parseQuote(tag): Quote | undefined

Defined in: domain/src/behaviors/Quote.ts:23

Parse a single q tag, or undefined for any other tag and for a q tag whose value is neither an event id nor an address. A pubkey that isn't one is dropped rather than passed on as an author.

Parameters ​

tag ​

string[]

Returns ​

Quote | undefined


parseQuotes() ​

parseQuotes(tags): Quote[]

Defined in: domain/src/behaviors/Quote.ts:39

Parameters ​

tags ​

string[][]

Returns ​

Quote[]


renderImeta() ​

renderImeta(imeta): string[]

Defined in: domain/src/behaviors/Imeta.ts:83

Render an attachment as an imeta tag. The entries this type doesn't model are written back verbatim, so a round trip through parseImeta is lossless.

Parameters ​

imeta ​

Imeta

Returns ​

string[]


renderQuote() ​

renderQuote(__namedParameters): string[]

Defined in: domain/src/behaviors/Quote.ts:53

Render a quote as a q tag, dropping the trailing elements it doesn't carry. A pubkey with no hint keeps the hint slot empty, since both are positional.

Parameters ​

__namedParameters ​

Quote

Returns ​

string[]


splitZapAmount() ​

splitZapAmount(event, total): ZapSplitAmount[]

Defined in: domain/src/behaviors/ZapSplits.ts:58

Divide total (in any integer unit, e.g. millisats) across an event's zap-split recipients proportionally to their weights. Any rounding remainder is handed to the highest-weighted recipient so the parts sum back to exactly total. If every weight is 0, nobody is zapped.

Parameters ​

event ​

TrustedEvent

total ​

number

Returns ​

ZapSplitAmount[]


sumBolt12Zaps() ​

sumBolt12Zaps(claims, paymentHash?): number

Defined in: domain/src/kinds/Bolt12Zap.ts:142

Sums a target's zaps in millisats, counting each lightning payment once. Two claims sharing a target and a payment hash count as the lower of their amounts. A profile total is the claims whose target is undefined, since a #p query answers with zaps of that pubkey's events too.

Parameters ​

claims ​

Bolt12ZapClaim[]

paymentHash? ​

(claim) => string | undefined

Returns ​

number