getBlockById method

Future<BlockResponse> getBlockById({
  1. required int blockId,
  2. double? confidence,
  3. CallOptions? options,
})

Returns a BlockResponse object for the block at the given blockId and confidence.

blockId is a List<int> representing the block id to retrieve

confidence is a double representing the confidence factor of the block to retrieve.

options is a CallOptions object that can be used to set additional options for the RPC request.

Throws an Exception if an error occurs during the RPC request.

Implementation

Future<BlockResponse> getBlockById({
  required int blockId,
  double? confidence,
  CallOptions? options,
}) async {
  final GetBlockByIdRequest request = GetBlockByIdRequest(
    blockId: getBlockIdFromInt(blockId),
    confidenceFactor: getConfidenceFactorFromDouble(confidence),
  );
  final BlockResponse response = await genusBlockStub.getBlockById(
    request,
    options: options,
  );
  return response;
}