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<any>} The response body that was provided by the server. @private

Implementation

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