Optional
opts: RelayOptionsProtected
_nip11Whether the client is authenticated with the relay
Protected
authProtected
authThe authentication challenge string from the relay
Whether the relay is connected
If an EOSE message is not seen in this time, emit one locally
The last connection error
How long to wait for an OK message from the relay
An observable that emits the NIP-11 information document for the relay
How long to keep the connection alive after nothing is subscribed
An observable that emits the limitations for the relay
Protected
logA passive observable of all messages from the relay
A passive observable of NOTICE messages from the relay
The notices from the relay
Protected
ready$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
Protected
receivedProtected
receivedA method that returns an Observable that emits when the relay should reconnect
Protected
socketProtected
watchAn internal observable that is responsible for watching all messages and updating state
Authenticate with the relay using a signer
Send an EVENT or AUTH message and return an observable of PublishResponse that completes or errors
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.
Send a message to the relay
Publishes an event to the relay and retries when relay errors or responds with auth-required ( default 3 retries )
Optional
opts: PublishOptionsCreate a REQ observable that emits events or "EOSE" or errors
Makes a single request that retires on errors and completes on EOSE
Optional
opts: RequestOptionsProtected
resetProtected
startSet ready = false and start the reconnect timer
Creates a REQ that retries when relay errors ( default 3 retries )
Optional
opts: SubscriptionOptionsProtected
waitProtected
waitStatic
createStatic
fetchStatic method to fetch the NIP-11 information document for a relay
How many times the relay has tried to reconnect