Welshman Docs / @welshman/domain / RepostWriter
Class: RepostWriter ​
Defined in: kinds/Repost.ts:50
Extends ​
Constructors ​
Constructor ​
new RepostWriter(
kind,context,reader?):RepostWriter
Defined in: core/EventWriter.ts:53
Parameters ​
kind ​
number
context ​
reader? ​
Returns ​
RepostWriter
Inherited from ​
Properties ​
clientTag? ​
optionalclientTag:string[]
Defined in: core/EventWriter.ts:43
Inherited from ​
content ​
content:
string=""
Defined in: core/EventWriter.ts:38
Inherited from ​
contentWarningTag? ​
optionalcontentWarningTag:string[]
Defined in: core/EventWriter.ts:42
Inherited from ​
context ​
readonlycontext:KindContext
Defined in: core/EventWriter.ts:55
Inherited from ​
expirationTag? ​
optionalexpirationTag:string[]
Defined in: core/EventWriter.ts:41
Inherited from ​
extraTags ​
extraTags:
string[][] =[]
Defined in: core/EventWriter.ts:45
Inherited from ​
forcedRoutes? ​
optionalforcedRoutes:RelaySelection[]
Defined in: core/EventWriter.ts:46
Inherited from ​
identifierTag? ​
optionalidentifierTag:string[]
Defined in: core/EventWriter.ts:44
Inherited from ​
kind ​
readonlykind:number
Defined in: core/EventWriter.ts:54
Inherited from ​
pendingResolves ​
pendingResolves:
Promise<unknown>[] =[]
Defined in: core/EventWriter.ts:47
Inherited from ​
protectTag? ​
optionalprotectTag:string[]
Defined in: core/EventWriter.ts:40
Inherited from ​
reader? ​
readonlyoptionalreader:RepostReader
Defined in: core/EventWriter.ts:56
Inherited from ​
requiresRelays ​
readonlyrequiresRelays:boolean=false
Defined in: core/EventWriter.ts:51
Inherited from ​
roomTag? ​
optionalroomTag:string[]
Defined in: core/EventWriter.ts:39
Inherited from ​
Methods ​
addEmoji() ​
addEmoji(
shortcode,url,address?):RepostWriter
Defined in: core/EventWriter.ts:235
Parameters ​
shortcode ​
string
url ​
string
address? ​
string
Returns ​
RepostWriter
Inherited from ​
addMention() ​
addMention(
pubkey):RepostWriter
Defined in: core/EventWriter.ts:195
Parameters ​
pubkey ​
string
Returns ​
RepostWriter
Inherited from ​
addQuote() ​
addQuote(
event):RepostWriter
Defined in: core/EventWriter.ts:207
Parameters ​
event ​
Returns ​
RepostWriter
Inherited from ​
addTags() ​
addTags(...
tags):RepostWriter
Defined in: core/EventWriter.ts:177
Parameters ​
tags ​
...string[][]
Returns ​
RepostWriter
Inherited from ​
addZapSplit() ​
addZapSplit(
pubkey,split):RepostWriter
Defined in: core/EventWriter.ts:219
Parameters ​
pubkey ​
string
split ​
number = 1
Returns ​
RepostWriter
Inherited from ​
clearClient() ​
clearClient():
RepostWriter
Defined in: core/EventWriter.ts:159
Returns ​
RepostWriter
Inherited from ​
clearContentWarning() ​
clearContentWarning():
RepostWriter
Defined in: core/EventWriter.ts:134
Returns ​
RepostWriter
Inherited from ​
EventWriter.clearContentWarning
clearExpiration() ​
clearExpiration():
RepostWriter
Defined in: core/EventWriter.ts:121
Returns ​
RepostWriter
Inherited from ​
clearForcedRoutes() ​
clearForcedRoutes():
RepostWriter
Defined in: core/EventWriter.ts:103
Returns ​
RepostWriter
Inherited from ​
clearIdentifier() ​
clearIdentifier():
RepostWriter
Defined in: core/EventWriter.ts:171
Returns ​
RepostWriter
Inherited from ​
clearRoom() ​
clearRoom():
RepostWriter
Defined in: core/EventWriter.ts:85
Returns ​
RepostWriter
Inherited from ​
dropTags() ​
dropTags(
pred):RepostWriter
Defined in: core/EventWriter.ts:189
Parameters ​
pred ​
(tag) => boolean
Returns ​
RepostWriter
Inherited from ​
forceRoutes() ​
forceRoutes(...
routes):RepostWriter
Defined in: core/EventWriter.ts:97
Replaces the rendered routes. These are routes rather than urls, so forceRoutes(userInbox()) pins an event to the user's read relays without resolving them first.
Parameters ​
routes ​
...RelaySelection[]
Returns ​
RepostWriter
Inherited from ​
hint() ​
protectedhint(...routes):Promise<string>
Defined in: core/EventWriter.ts:282
Resolves one or more relay selections to a single hint url, tracking the in-flight promise so renderTags can wait for it. Callers backfill the resolved url into a tag's hint slot.
Parameters ​
routes ​
...RelaySelection[]
Returns ​
Promise<string>
Inherited from ​
keepTags() ​
keepTags(
pred):RepostWriter
Defined in: core/EventWriter.ts:183
Parameters ​
pred ​
(tag) => boolean
Returns ​
RepostWriter
Inherited from ​
relays() ​
relays():
Promise<string[]>
Defined in: core/EventWriter.ts:361
Shortcut for getting relays from the router scenario.
Returns ​
Promise<string[]>
Inherited from ​
removeEmoji() ​
removeEmoji(
shortcode):RepostWriter
Defined in: core/EventWriter.ts:241
Parameters ​
shortcode ​
string
Returns ​
RepostWriter
Inherited from ​
removeZapSplit() ​
removeZapSplit(
pubkey):RepostWriter
Defined in: core/EventWriter.ts:231
Parameters ​
pubkey ​
string
Returns ​
RepostWriter
Inherited from ​
render() ​
render():
Promise<{event:EventTemplate;relays:string[]; }>
Defined in: core/EventWriter.ts:368
Returns a rendered event template along with its relays.
Returns ​
Promise<{ event: EventTemplate; relays: string[]; }>
Inherited from ​
renderBehaviorTags() ​
protectedrenderBehaviorTags():MaybeAsync<string[][]>
Defined in: core/EventWriter.ts:289
Returns a list of tags that may be attached to any kind.
Returns ​
MaybeAsync<string[][]>
Inherited from ​
EventWriter.renderBehaviorTags
renderContent() ​
renderContent():
MaybeAsync<string>
Defined in: core/EventWriter.ts:323
Returns the content string as defined by the kind.
Returns ​
MaybeAsync<string>
Inherited from ​
renderDomainTags() ​
protectedrenderDomainTags():MaybeAsync<string[][]>
Defined in: core/EventWriter.ts:303
Returns a list of tags related to the kind.
Returns ​
MaybeAsync<string[][]>
Inherited from ​
renderRoutes() ​
protectedrenderRoutes():Promise<RelaySelection[]>
Defined in: core/EventWriter.ts:344
Returns the list of routes this event should be published to. Defaults to the outbox model. Override to implement custom behavior.
Returns ​
Promise<RelaySelection[]>
Inherited from ​
renderTags() ​
renderTags():
Promise<string[][]>
Defined in: core/EventWriter.ts:310
Returns the complete tag list for publishing.
Returns ​
Promise<string[][]>
Inherited from ​
renderTemplate() ​
renderTemplate():
Promise<EventTemplate>
Defined in: core/EventWriter.ts:330
Validates and renders an event template.
Returns ​
Promise<EventTemplate>
Inherited from ​
scenario() ​
scenario():
Promise<RelayScenario>
Defined in: core/EventWriter.ts:352
Returns a router scenario for this event. Publishes to the forced routes (e.g. a NIP-29 room's relay) when set, otherwise to the rendered routes.
Returns ​
Promise<RelayScenario>
Inherited from ​
setClient() ​
setClient(
name,address?):RepostWriter
Defined in: core/EventWriter.ts:145
Attributes the event to the NIP-89 client that produced it. address is an optional 31990:pubkey:d-tag pointer to the client's handler information event; when given, its author's outbox fills in the tag's relay hint slot.
Parameters ​
name ​
string
address? ​
string
Returns ​
RepostWriter
Inherited from ​
setContent() ​
setContent(
content):RepostWriter
Defined in: core/EventWriter.ts:72
Parameters ​
content ​
string
Returns ​
RepostWriter
Inherited from ​
setContentWarning() ​
setContentWarning(
reason?):RepostWriter
Defined in: core/EventWriter.ts:128
Parameters ​
reason? ​
string
Returns ​
RepostWriter
Inherited from ​
setEvent() ​
setEvent(
event):RepostWriter
Defined in: kinds/Repost.ts:52
Parameters ​
event ​
Returns ​
RepostWriter
setExpiration() ​
setExpiration(
expiration):RepostWriter
Defined in: core/EventWriter.ts:115
Parameters ​
expiration ​
number
Returns ​
RepostWriter
Inherited from ​
setIdentifier() ​
setIdentifier(
identifier):RepostWriter
Defined in: core/EventWriter.ts:165
Parameters ​
identifier ​
string = ...
Returns ​
RepostWriter
Inherited from ​
setProtected() ​
setProtected(
protect):RepostWriter
Defined in: core/EventWriter.ts:109
Parameters ​
protect ​
boolean
Returns ​
RepostWriter
Inherited from ​
setRoom() ​
setRoom(
url,room):RepostWriter
Defined in: core/EventWriter.ts:78
Parameters ​
url ​
string
room ​
string
Returns ​
RepostWriter
Inherited from ​
validate() ​
validate():
void
Defined in: kinds/Repost.ts:83
Validates a domain object, throwing an error if invalid.
Returns ​
void