blockTxs method

Future<BlockTxsResponse> blockTxs(
  1. String hashOrHeight, {
  2. int page = 0,
  3. int pageSize = 10,
})

Get transactions in a block

Implementation

Future<BlockTxsResponse> blockTxs(
  String hashOrHeight, {
  int page = 0,
  int pageSize = 10,
}) async {
  if (pageSize <= 0) {
    throw ValidationException('pageSize must be positive');
  }

  final data = await _proxy.get(
    '/block-txs/$hashOrHeight?page=$page&page_size=$pageSize',
  );

  final txsPage = pb.TxHistoryPage()..mergeFromBuffer(data);
  return BlockTxsResponse(page: page, pageSize: pageSize, txs: txsPage.txs);
}