Client<R> class abstract

JSON RPC Client

JSON RPC client interface.

Implementers

Constructors

Client.new(Uri uri, {Duration? timeLimit, required JsonRpcClientEncoder encoder, required JsonRpcClientDecoder<R> decoder})
Creates a JSON RPC client.
const

Properties

decoder JsonRpcClientDecoder<R>
Converts the incoming responses of type R to JSON.
final
encoder JsonRpcClientEncoder
Converts the outgoing requests to byte data.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeLimit Duration?
The default timeout duration applied to each request.
final
uri Uri
The connecting endpoint.
final

Methods

dispose() FutureOr<void>
Closes the client and disposes of all acquired resources.
handler<T>(List<int> encoded, {JsonRpcClientConfig? config, int? id}) Future<T>
Sends an encoded JSON RPC request to uri and returns the decoded JSON response (Map or List of Maps).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onTimeout<T>() FutureOr<T>
Creates a TimeoutException.
send<T>(JsonRpcRequest request, JsonRpcResponseDecoder<Map<String, dynamic>, JsonRpcResponse<T>> decode, {JsonRpcClientConfig? config}) Future<JsonRpcSuccessResponse<T>>
Sends a JSON RPC request to uri and returns its response.
sendAll<T>(List<JsonRpcRequest> request, JsonRpcResponseDecoder<List<Map<String, dynamic>>, List<JsonRpcResponse<T>>> decode, {JsonRpcClientConfig? config, bool eagerError = false}) Future<List<JsonRpcResponse<T>>>
Sends a batch JSON RPC request to uri and returns its response.
timeout<T>(Future<T> request, Duration? timeLimit) Future<T>
Creates a new Future that completes with the result of request or a TimeoutException if timeLimit elapses (default: Client.timeLimit).
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited