Skip to content

Welshman Docs / @welshman/app / RouterOptions

Type Alias: RouterOptions ​

RouterOptions = object

Defined in: app/src/router.ts:62

Properties ​

getDefaultRelays()? ​

optional getDefaultRelays: () => string[]

Defined in: app/src/router.ts:81

Retrieves default relays, for use as fallbacks when no other relays can be selected.

Returns ​

string[]

An array of relay URLs as strings.


getIndexerRelays()? ​

optional getIndexerRelays: () => string[]

Defined in: app/src/router.ts:87

Retrieves relays that index profiles and relay selections.

Returns ​

string[]

An array of relay URLs as strings.


getLimit()? ​

optional getLimit: () => number

Defined in: app/src/router.ts:107

Retrieves the limit setting, which is the maximum number of relays that should be returned from getUrls and getSelections.

Returns ​

number

The limit setting as a number.


getPubkeyRelays()? ​

optional getPubkeyRelays: (pubkey, mode?) => string[]

Defined in: app/src/router.ts:75

Retrieves relays for the specified public key and mode.

Parameters ​

pubkey ​

string

The public key to retrieve relays for.

mode? ​

RelayMode

The relay mode (optional). May be "read", "write", or "inbox".

Returns ​

string[]

An array of relay URLs as strings.


getRelayQuality()? ​

optional getRelayQuality: (url) => number

Defined in: app/src/router.ts:100

Retrieves the quality of the specified relay.

Parameters ​

url ​

string

The URL of the relay to retrieve quality for.

Returns ​

number

The quality of the relay as a number between 0 and 1 inclusive.


getSearchRelays()? ​

optional getSearchRelays: () => string[]

Defined in: app/src/router.ts:93

Retrieves relays likely to support NIP-50 search.

Returns ​

string[]

An array of relay URLs as strings.


getUserPubkey()? ​

optional getUserPubkey: () => string | undefined

Defined in: app/src/router.ts:67

Retrieves the user's public key.

Returns ​

string | undefined

The user's public key as a string, or null if not available.