Skip to content

Welshman Docs / @welshman/router / Router

Class: Router ​

Defined in: router/src/index.ts:127

Constructors ​

Constructor ​

new Router(options): Router

Defined in: router/src/index.ts:138

Parameters ​

options ​

RouterOptions

Returns ​

Router

Properties ​

options ​

readonly options: RouterOptions

Defined in: router/src/index.ts:128

Methods ​

Default() ​

Default(): RouterScenario

Defined in: router/src/index.ts:171

Returns ​

RouterScenario


Event() ​

Event(event): RouterScenario

Defined in: router/src/index.ts:192

Parameters ​

event ​

TrustedEvent

Returns ​

RouterScenario


EventParents() ​

EventParents(event): RouterScenario

Defined in: router/src/index.ts:217

Parameters ​

event ​

TrustedEvent

Returns ​

RouterScenario


EventRoots() ​

EventRoots(event): RouterScenario

Defined in: router/src/index.ts:231

Parameters ​

event ​

TrustedEvent

Returns ​

RouterScenario


ForPubkey() ​

ForPubkey(pubkey): RouterScenario

Defined in: router/src/index.ts:179

Parameters ​

pubkey ​

string

Returns ​

RouterScenario


ForPubkeys() ​

ForPubkeys(pubkeys): RouterScenario

Defined in: router/src/index.ts:186

Parameters ​

pubkeys ​

string[]

Returns ​

RouterScenario


ForUser() ​

ForUser(): RouterScenario

Defined in: router/src/index.ts:173

Returns ​

RouterScenario


FromPubkey() ​

FromPubkey(pubkey): RouterScenario

Defined in: router/src/index.ts:181

Parameters ​

pubkey ​

string

Returns ​

RouterScenario


FromPubkeys() ​

FromPubkeys(pubkeys): RouterScenario

Defined in: router/src/index.ts:188

Parameters ​

pubkeys ​

string[]

Returns ​

RouterScenario


FromRelays() ​

FromRelays(relays): RouterScenario

Defined in: router/src/index.ts:165

Parameters ​

relays ​

string[]

Returns ​

RouterScenario


FromUser() ​

FromUser(): RouterScenario

Defined in: router/src/index.ts:175

Returns ​

RouterScenario


getRelaysForPubkey() ​

getRelaysForPubkey(pubkey, mode?): string[]

Defined in: router/src/index.ts:144

Parameters ​

pubkey ​

string

mode? ​

RelayMode

Returns ​

string[]


getRelaysForPubkeys() ​

getRelaysForPubkeys(pubkeys, mode?): string[][]

Defined in: router/src/index.ts:147

Parameters ​

pubkeys ​

string[]

mode? ​

RelayMode

Returns ​

string[][]


getRelaysForUser() ​

getRelaysForUser(mode?): string[]

Defined in: router/src/index.ts:150

Parameters ​

mode? ​

RelayMode

Returns ​

string[]


Index() ​

Index(): RouterScenario

Defined in: router/src/index.ts:169

Returns ​

RouterScenario


merge() ​

merge(scenarios): RouterScenario

Defined in: router/src/index.ts:160

Parameters ​

scenarios ​

RouterScenario[]

Returns ​

RouterScenario


PubkeyInbox() ​

PubkeyInbox(pubkey): RouterScenario

Defined in: router/src/index.ts:183

Parameters ​

pubkey ​

string

Returns ​

RouterScenario


PubkeyInboxes() ​

PubkeyInboxes(pubkeys): RouterScenario

Defined in: router/src/index.ts:190

Parameters ​

pubkeys ​

string[]

Returns ​

RouterScenario


PublishEvent() ​

PublishEvent(event): RouterScenario

Defined in: router/src/index.ts:245

Parameters ​

event ​

TrustedEvent

Returns ​

RouterScenario


Quote() ​

Quote(event, value, relays): RouterScenario

Defined in: router/src/index.ts:198

Parameters ​

event ​

TrustedEvent

value ​

string

relays ​

string[] = []

Returns ​

RouterScenario


Replies() ​

Replies(event): RouterScenario

Defined in: router/src/index.ts:195

Parameters ​

event ​

TrustedEvent

Returns ​

RouterScenario


scenario() ​

scenario(selections): RouterScenario

Defined in: router/src/index.ts:158

Parameters ​

selections ​

Selection[]

Returns ​

RouterScenario


Search(): RouterScenario

Defined in: router/src/index.ts:167

Returns ​

RouterScenario


UserInbox() ​

UserInbox(): RouterScenario

Defined in: router/src/index.ts:177

Returns ​

RouterScenario


configure() ​

static configure(options): void

Defined in: router/src/index.ts:130

Parameters ​

options ​

RouterOptions

Returns ​

void


get() ​

static get(): Router

Defined in: router/src/index.ts:134

Returns ​

Router