fetchEpochData method

Future<FetchEpochDataRes> fetchEpochData({
  1. required int epoch,
  2. CallOptions? options,
})

Returns a FetchEpochDataRes object for the given epoch.

epoch is an int representing the epoch to retrieve

options is an CallOptions for runtime options with RPC

Throws an Exception if an error occurs during the RPC request.

Implementation

Future<FetchEpochDataRes> fetchEpochData({
  required int epoch,
  CallOptions? options,
}) async {
  final FetchEpochDataReq request = FetchEpochDataReq(
    epoch: UInt64Value(value: Int64(epoch)),
  );
  final FetchEpochDataRes response = await nodeStub.fetchEpochData(
    request,
    options: options,
  );
  return response;
}