Welshman Docs / @welshman/domain / ZapReceiptWriter
Class: ZapReceiptWriter
Defined in: kinds/ZapReceipt.ts:61
Extends
Constructors
Constructor
new ZapReceiptWriter(
kind,context,reader?):ZapReceiptWriter
Defined in: core/EventWriter.ts:50
Parameters
kind
number
context
reader?
Returns
ZapReceiptWriter
Inherited from
Properties
content
content:
string=""
Defined in: core/EventWriter.ts:37
Inherited from
context
readonlycontext:KindContext
Defined in: core/EventWriter.ts:52
Inherited from
expirationTag?
optionalexpirationTag:string[]
Defined in: core/EventWriter.ts:40
Inherited from
extraTags
extraTags:
string[][] =[]
Defined in: core/EventWriter.ts:42
Inherited from
forcedRelays?
optionalforcedRelays:string[]
Defined in: core/EventWriter.ts:43
Inherited from
identifierTag?
optionalidentifierTag:string[]
Defined in: core/EventWriter.ts:41
Inherited from
kind
readonlykind:number
Defined in: core/EventWriter.ts:51
Inherited from
pendingResolves
pendingResolves:
Promise<unknown>[] =[]
Defined in: core/EventWriter.ts:44
Inherited from
protectTag?
optionalprotectTag:string[]
Defined in: core/EventWriter.ts:39
Inherited from
reader?
readonlyoptionalreader:ZapReceiptReader
Defined in: core/EventWriter.ts:53
Inherited from
requiresRelays
readonlyrequiresRelays:boolean=false
Defined in: core/EventWriter.ts:48
Inherited from
roomTag?
optionalroomTag:string[]
Defined in: core/EventWriter.ts:38
Inherited from
Methods
addEmoji()
addEmoji(
shortcode,url,address?):ZapReceiptWriter
Defined in: core/EventWriter.ts:187
Parameters
shortcode
string
url
string
address?
string
Returns
ZapReceiptWriter
Inherited from
addMention()
addMention(
pubkey):ZapReceiptWriter
Defined in: core/EventWriter.ts:147
Parameters
pubkey
string
Returns
ZapReceiptWriter
Inherited from
addQuote()
addQuote(
event):ZapReceiptWriter
Defined in: core/EventWriter.ts:159
Parameters
event
Returns
ZapReceiptWriter
Inherited from
addTags()
addTags(...
tags):ZapReceiptWriter
Defined in: core/EventWriter.ts:129
Parameters
tags
...string[][]
Returns
ZapReceiptWriter
Inherited from
addZapSplit()
addZapSplit(
pubkey,split):ZapReceiptWriter
Defined in: core/EventWriter.ts:171
Parameters
pubkey
string
split
number = 1
Returns
ZapReceiptWriter
Inherited from
clearExpiration()
clearExpiration():
ZapReceiptWriter
Defined in: core/EventWriter.ts:111
Returns
ZapReceiptWriter
Inherited from
clearForcedRelays()
clearForcedRelays():
ZapReceiptWriter
Defined in: core/EventWriter.ts:93
Returns
ZapReceiptWriter
Inherited from
clearIdentifier()
clearIdentifier():
ZapReceiptWriter
Defined in: core/EventWriter.ts:123
Returns
ZapReceiptWriter
Inherited from
clearRoom()
clearRoom():
ZapReceiptWriter
Defined in: core/EventWriter.ts:80
Returns
ZapReceiptWriter
Inherited from
dropTags()
dropTags(
pred):ZapReceiptWriter
Defined in: core/EventWriter.ts:141
Parameters
pred
(tag) => boolean
Returns
ZapReceiptWriter
Inherited from
forceRelays()
forceRelays(...
urls):ZapReceiptWriter
Defined in: core/EventWriter.ts:87
Parameters
urls
...string[]
Returns
ZapReceiptWriter
Inherited from
hint()
protectedhint(...routes):Promise<string>
Defined in: core/EventWriter.ts:234
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):ZapReceiptWriter
Defined in: core/EventWriter.ts:135
Parameters
pred
(tag) => boolean
Returns
ZapReceiptWriter
Inherited from
relays()
relays():
Promise<string[]>
Defined in: core/EventWriter.ts:306
Shortcut for getting relays from the router scenario.
Returns
Promise<string[]>
Inherited from
removeEmoji()
removeEmoji(
shortcode):ZapReceiptWriter
Defined in: core/EventWriter.ts:193
Parameters
shortcode
string
Returns
ZapReceiptWriter
Inherited from
removeZapSplit()
removeZapSplit(
pubkey):ZapReceiptWriter
Defined in: core/EventWriter.ts:183
Parameters
pubkey
string
Returns
ZapReceiptWriter
Inherited from
render()
render():
Promise<{event:EventTemplate;relays:string[]; }>
Defined in: core/EventWriter.ts:313
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:241
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:268
Returns the content string as defined by the kind.
Returns
MaybeAsync<string>
Inherited from
renderDomainTags()
protectedrenderDomainTags():MaybeAsync<string[][]>
Defined in: core/EventWriter.ts:248
Returns a list of tags related to the kind.
Returns
MaybeAsync<string[][]>
Inherited from
renderRoutes()
protectedrenderRoutes():Promise<RelaySelection[]>
Defined in: core/EventWriter.ts:289
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:255
Returns the complete tag list for publishing.
Returns
Promise<string[][]>
Inherited from
renderTemplate()
renderTemplate():
Promise<EventTemplate>
Defined in: core/EventWriter.ts:275
Validates and renders an event template.
Returns
Promise<EventTemplate>
Inherited from
scenario()
scenario():
Promise<RelayScenario>
Defined in: core/EventWriter.ts:297
Returns a router scenario for this event. Publishes to forced relays (e.g. a NIP-29 room) when set, otherwise to the rendered routes.
Returns
Promise<RelayScenario>
Inherited from
setBolt11()
setBolt11(
bolt11):ZapReceiptWriter
Defined in: kinds/ZapReceipt.ts:62
Parameters
bolt11
string
Returns
ZapReceiptWriter
setContent()
setContent(
content):ZapReceiptWriter
Defined in: core/EventWriter.ts:67
Parameters
content
string
Returns
ZapReceiptWriter
Inherited from
setDescription()
setDescription(
description):ZapReceiptWriter
Defined in: kinds/ZapReceipt.ts:66
Parameters
description
string
Returns
ZapReceiptWriter
setEventId()
setEventId(
eventId):ZapReceiptWriter
Defined in: kinds/ZapReceipt.ts:74
Parameters
eventId
string
Returns
ZapReceiptWriter
setExpiration()
setExpiration(
expiration):ZapReceiptWriter
Defined in: core/EventWriter.ts:105
Parameters
expiration
number
Returns
ZapReceiptWriter
Inherited from
setIdentifier()
setIdentifier(
identifier):ZapReceiptWriter
Defined in: core/EventWriter.ts:117
Parameters
identifier
string = ...
Returns
ZapReceiptWriter
Inherited from
setPreimage()
setPreimage(
preimage):ZapReceiptWriter
Defined in: kinds/ZapReceipt.ts:78
Parameters
preimage
string
Returns
ZapReceiptWriter
setProtected()
setProtected(
protect):ZapReceiptWriter
Defined in: core/EventWriter.ts:99
Parameters
protect
boolean
Returns
ZapReceiptWriter
Inherited from
setRecipient()
setRecipient(
recipient):ZapReceiptWriter
Defined in: kinds/ZapReceipt.ts:70
Parameters
recipient
string
Returns
ZapReceiptWriter
setRoom()
setRoom(
url,room):ZapReceiptWriter
Defined in: core/EventWriter.ts:73
Parameters
url
string
room
string
Returns
ZapReceiptWriter
Inherited from
validate()
validate():
void
Defined in: core/EventWriter.ts:200
Validates a domain object, throwing an error if invalid.
Returns
void