request<T> method

Future<T> request<T>(
  1. ETHRPCRequest<T> request, [
  2. Duration? timeout
])

Sends a JSON-RPC request to the EVM node and returns the result after processing the response.

request: The JSON-RPC request to be sent. timeout: The maximum duration for waiting for the response.

Implementation

Future<T> request<T>(ETHRPCRequest<T> request, [Duration? timeout]) async {
  final id = ++_id;
  final params = request.toRequest(id);
  final data = await rpc.call(params, timeout);
  return request.onResonse(_findResult(data, params));
}