getBlockByHash method
Implementation
Future<RpcBlock> getBlockByHash(
String hash, {
bool includeTransactions = true,
}) async {
final message = KaspadMessage(
getBlockRequest: GetBlockRequestMessage(
hash: hash,
includeTransactions: includeTransactions,
),
);
final result = await _singleRequest(message);
final error = result.getBlockResponse.error;
if (error.message.isNotEmpty) {
throw RpcException(error);
}
return result.getBlockResponse.block;
}