getWork method

Future<EthereumWork?> getWork()

Get work Returns the hash of the current block, the seedHash, and the boundary condition to be met ('target'). Returns an EthereumWork object or null

Implementation

Future<EthereumWork?> getWork() async {
  final paramBlock = <dynamic>[];
  const method = EthereumRpcMethods.getWork;
  final dynamic res = await _client.rpcClient.request(method, paramBlock);
  if (res != null && res.containsKey(EthereumConstants.ethResultKey)) {
    return EthereumWork.fromList(res[EthereumConstants.ethResultKey]);
  }
  _client.processError(method, res);
  return null;
}