getDigest method

Future<GetDigestResponse> getDigest({
  1. required String name,
})

Returns the digest of a ledger at the latest committed block in the journal. The response includes a 256-bit hash value and a block address.

May throw InvalidParameterException. May throw ResourceNotFoundException. May throw ResourcePreconditionNotMetException.

Parameter name : The name of the ledger.

Implementation

Future<GetDigestResponse> getDigest({
  required String name,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    32,
    isRequired: true,
  );
  final response = await _protocol.send(
    payload: null,
    method: 'POST',
    requestUri: '/ledgers/${Uri.encodeComponent(name)}/digest',
    exceptionFnMap: _exceptionFns,
  );
  return GetDigestResponse.fromJson(response);
}