getEpochSummary method
Summary of the current epoch, or epochId when provided.
Implementation
Future<EpochSummary> getEpochSummary({int? epochId}) async {
final data = await executeData(
_epochSummaryOperation,
generated.Variables$Query$EpochSummary(epochId: epochId),
);
final epoch = _required(data.epoch, 'EpochSummary.epoch');
return EpochSummary(
epochId: epoch.epochId,
referenceGasPrice: BigInt.parse(
_required(
epoch.referenceGasPrice,
'EpochSummary.epoch.referenceGasPrice',
),
),
totalTransactions: epoch.totalTransactions,
startTimestamp: epoch.startTimestamp,
endTimestamp: epoch.endTimestamp,
);
}