Optionalopts: RelayOptionsProtected_Boolean authentication state (will be false if auth failed)
The response to the last AUTH message sent to the relay
The authentication challenge string from the relay
An observable that emits when underlying websocket is closed
An observable that emits when underlying websocket is closing due to unsubscription
Whether the relay is connected
If an EOSE message is not seen in this time, emit one locally (default 10s)
The last connection error
How long to wait for an OK message from the relay (default 10s)
An observable that emits the NIP-11 information document for the relay
How long to keep the connection alive after nothing is subscribed (default 30s)
An observable that emits the limitations for the relay
ProtectedlogA passive observable of all messages from the relay
A passive observable of NOTICE messages from the relay
The notices from the relay
An observable that emits when underlying websocket is opened
How long to wait for a publish to complete (default 30s)
Protectedready$Whether the relay is ready for subscriptions or event publishing. setting this to false will cause all .req and .event observables to hang until the relay is ready
ProtectedreceivedProtectedreceivedA method that returns an Observable that emits when the relay should reconnect
ProtectedsocketAn array of supported NIPs from the NIP-11 information document
ProtectedwatchAn internal observable that is responsible for watching all messages and updating state, subscribing to it will trigger a connection to the relay
Authenticate with the relay using a signer
Force close the connection
Create a COUNT observable that emits a single count response
ProtectedcustomInternal operator for creating the repeat() operator
ProtectedcustomInternal operator for creating the retry() operator
Optionalbase: RetryConfigProtectedcustomInternal operator for creating the timeout() operator
Send an EVENT or AUTH message and return an observable of PublishResponse that completes or errors
An async method that returns the NIP-11 information document for the relay
An async method that returns the NIP-11 limitations for the relay
An async method that returns the supported NIPs for the relay
ProtectedhandleInternal operator for handling auth-required errors from REQ/COUNT operations
Creates an Observable, that when subscribed to, sends a message,
defined by the subMsg function, to the server over the socket to begin a
subscription to data over that socket. Once data arrives, the
messageFilter argument will be used to select the appropriate data for
the resulting Observable. When finalization occurs, either due to
unsubscription, completion, or error, a message defined by the unsubMsg
argument will be sent to the server over the WebSocketSubject.
A function to generate the subscription message to be sent to the server. This will still be processed by the serializer in the WebSocketSubject's config. (Which defaults to JSON serialization)
A function to generate the unsubscription message to be sent to the server at finalization. This will still be processed by the serializer in the WebSocketSubject's config.
A predicate for selecting the appropriate messages from the server for the output stream.
Negentropy sync event ids with the relay and an event store
Optionalopts: NegentropySyncOptionsPublishes an event to the relay and retries when relay errors or responds with auth-required ( default 3 retries )
Optionalopts: PublishOptionsCreate a REQ observable that emits events or "EOSE" or errors
Makes a single request that retires on errors and completes on EOSE
Optionalopts: SubscriptionOptionsProtectedresetSend a message to the relay
ProtectedstartSet ready = false and start the reconnect timer
Creates a REQ that retries when relay errors ( default 3 retries )
Optionalopts: SubscriptionOptionsNegentropy sync events with the relay and an event store
ProtectedwaitWait for authentication state, make connection and then wait for authentication if required
ProtectedwaitWait for the relay to be ready to accept connections
StaticcreateStatic method to create a reconnection method for each relay
StaticfetchStatic method to fetch the NIP-11 information document for a relay
How many times the relay has tried to reconnect