JsonRpcWebsocketClient<R> constructor

JsonRpcWebsocketClient<R>(
  1. Uri uri, {
  2. Duration? timeLimit,
  3. int? maxAttempts,
  4. List<int>? backoffSchedule,
  5. List<String>? protocols,
  6. JsonRpcWebsocketClientOnConnect<R>? onConnect,
  7. JsonRpcWebsocketClientOnDisconnect? onDisconnect,
  8. JsonRpcWebsocketClientOnData<R>? onData,
  9. JsonRpcWebsocketClientOnError? onError,
  10. JsonRpcWebsocketClientOnPing<R>? onPing,
  11. required JsonRpcWebsocketClientIsPing<R> isPing,
  12. JsonRpcClientEncoder? encoder,
  13. required JsonRpcClientDecoder<R> decoder,
})

Creates a JSON RPC Client for Websocket methods.

Implementation

JsonRpcWebsocketClient(
  super.uri, {
  super.timeLimit,
  final int? maxAttempts,
  final List<int>? backoffSchedule,
  this.protocols,
  this.onConnect,
  this.onDisconnect,
  this.onData,
  this.onError,
  this.onPing,
  required this.isPing,
  final JsonRpcClientEncoder? encoder,
  required super.decoder,
})  : maxAttempts = maxAttempts ?? 1,
      backoffSchedule = backoffSchedule ?? const [],
      super(encoder: encoder ?? const JsonToBytesEncoder());