blockByIndex method

Future<BlockResponse> blockByIndex(
  1. int blockIndex
)

Return the /block response for the block corresponding to the specified block index (i.e., block height). @param {number} blockIndex The index of the block to return. @returns {Promise

Implementation

Future<rosetta.BlockResponse> blockByIndex(int blockIndex) async {
  assert(networkIdentifier != null, "Cannot get networkIdentifier");
  var result = await request('/block', {
    "network_identifier": networkIdentifier,
    "block_identifier": {"index": blockIndex}
  });
  return rosetta.BlockResponse.fromMap(result);
}