The endpoint url. Usually ws://ip:9944 or wss://ip:9944, may provide an array of endpoint strings.
Whether to connect automatically or not (default). Provided value is used as a delay between retries.
The headers provided to the underlying WebSocket
Optionaltimeout: number
Custom timeout value used per request . Defaults to DEFAULT_TIMEOUT_MS
OptionalcacheCapacity: number
Custom size of the WsProvider LRUCache. Defaults to DEFAULT_CAPACITY (1024)
OptionalcacheTtl: number | null
Custom TTL of the WsProvider LRUCache. Determines how long an object can live in the cache. Defaults to DEFAULT_TTL` (30000)
true if connected
Event
Callback
unsubscribe function
ProtectedselectThe RPC methods to execute
Encoded parameters as applicable for the method
OptionalisCacheable: booleanOptionalsubscription: SubscriptionHandler
Subscription details (internally used)
@pezkuwi/rpc-provider/ws
Name
WsProvider
Description
The WebSocket Provider allows sending requests using WebSocket to a WebSocket RPC server TCP port. Unlike the [[HttpProvider]], it does support subscriptions and allows listening to events such as new blocks or balance changes.
Example
See
[[HttpProvider]]