Skip to content

Welshman Docs / @welshman/net / getDefaultNetContext

Function: getDefaultNetContext() ​

getDefaultNetContext(overrides): object

Defined in: packages/net/src/Context.ts:57

Parameters ​

overrides ​

Partial<NetContext> = {}

Returns ​

object

authMode ​

authMode: AuthMode = AuthMode.Implicit

getExecutor() ​

getExecutor: (relays) => Executor

Parameters ​

relays ​

string[]

Returns ​

Executor

isDeleted() ​

isDeleted: (url, event) => boolean

Parameters ​

url ​

string

event ​

TrustedEvent

Returns ​

boolean

isValid() ​

isValid: (url, event) => boolean = isEventValid

Parameters ​

url ​

string

event ​

TrustedEvent

Returns ​

boolean

matchFilters() ​

matchFilters: (url, filters, event) => boolean

Parameters ​

url ​

string

filters ​

Filter[]

event ​

TrustedEvent

Returns ​

boolean

onEvent ​

onEvent: (...args) => undefined | (url, event) => void = noop

Type declaration ​

(...args) => undefined

Function that does nothing and returns undefined

Parameters ​

args ​

...unknown[]

Returns ​

undefined

(url, event) => void

Parameters ​

url ​

string

event ​

TrustedEvent

Returns ​

void

optimizeSubscriptions() ​

optimizeSubscriptions: (subs) => RelaysAndFilters[] = defaultOptimizeSubscriptions

Parameters ​

subs ​

Subscription[]

Returns ​

RelaysAndFilters[]

pool ​

pool: Pool

signEvent ​

signEvent: (...args) => undefined | (event) => Promise<undefined | SignedEvent> = noop

Type declaration ​

(...args) => undefined

Function that does nothing and returns undefined

Parameters ​

args ​

...unknown[]

Returns ​

undefined

(event) => Promise<undefined | SignedEvent>

Parameters ​

event ​

StampedEvent

Returns ​

Promise<undefined | SignedEvent>