getBlockByHash method

Future<Block> getBlockByHash({
  1. BlockTag? blockTag,
  2. bool? includeTransactions,
})

Implementation

Future<Block> getBlockByHash({
  BlockTag? blockTag,
  bool? includeTransactions,
}) async {
  final bt = blockTag?.toParam() ?? const BlockTag.latest().toParam();
  // TODO: Verify hash value.
  final res = await _makeRPCCall<Map<String, dynamic>>(
    'eth_getBlockByHash',
    [bt, includeTransactions ?? false],
  );
  return Block(transactions: res['transactions']);
}