getBlocksRangeByHeight method

Future<List<Block>> getBlocksRangeByHeight(
  1. GetHeightRangeParams getHeightRangeParams
)

Returns a specific range of blocks (up to 20 maximum) based on height.

Implementation

Future<List<Block>> getBlocksRangeByHeight(
  GetHeightRangeParams getHeightRangeParams,
) async {
  final result = await sendRequest(
    DaemonMethod.getBlocksRangeByHeight,
    getHeightRangeParams.toJson(),
  );
  return (result as List)
      .map((e) => Block.fromJson(e as Map<String, dynamic>))
      .toList();
}