JsonRpcHttpClient class
JSON RPC HTTP Client
A JSON RPC Client for HTTP methods.
Constructors
-
JsonRpcHttpClient.new(Uri uri, {Duration? timeLimit, Map<
String, String> ? headers, JsonRpcClientEncoder encoder = const JsonToBytesEncoder(), JsonRpcClientDecoder<List< decoder = const JsonToBytesDecoder()})int> > - Creates a JSON RPC Client for HTTP methods.
Properties
-
decoder
→ JsonRpcClientDecoder<
List< int> > -
Converts the incoming responses of type
R
to JSON.finalinherited - encoder → JsonRpcClientEncoder
-
Converts the outgoing requests to byte data.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> ? -
The default request headers applied to all methods. Headers can be provided per request using
the send or sendAll method's JsonRpcClientConfig paramter.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeLimit → Duration?
-
The default timeout duration applied to each request.
finalinherited
- uri → Uri
-
The connecting endpoint.
finalinherited
Methods
-
dispose(
) → void -
Closes the client and disposes of all acquired resources.
override
-
handler<
T> (List< int> encoded, {JsonRpcClientConfig? config, int? id}) → Future<T> -
Sends an
encoded
JSON RPC request to uri and returns thedecoded
JSON response (Map or List of Maps).override -
health(
) → Future< HealthStatus> - Returns the health status of an RPC node.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onTimeout<
T> () → FutureOr< T> -
Creates a TimeoutException.
inherited
-
send<
T> (JsonRpcRequest request, JsonRpcResponseDecoder< Map< decode, {JsonRpcClientConfig? config}) → Future<String, dynamic> , JsonRpcResponse<T> >JsonRpcSuccessResponse< T> > -
Sends a JSON RPC request to uri and returns its response.
inherited
-
sendAll<
T> (List< JsonRpcRequest> request, JsonRpcResponseDecoder<List< decode, {JsonRpcClientConfig? config, bool eagerError = false}) → Future<Map< , List<String, dynamic> >JsonRpcResponse< >T> >List< JsonRpcResponse< >T> > -
Sends a batch JSON RPC request to uri and returns its response.
inherited
-
timeout<
T> (Future< T> request, Duration? timeLimit) → Future<T> -
Creates a new Future that completes with the result of
request
or a TimeoutException iftimeLimit
elapses (default: Client.timeLimit).inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited