AdaStakeCredential constructor

AdaStakeCredential({
  1. required List<int> hash,
  2. required AdaStakeCredType type,
})

Implementation

factory AdaStakeCredential(
    {required List<int> hash, required AdaStakeCredType type}) {
  if (hash.length != QuickCrypto.blake2b224DigestSize) {
    throw AddressConverterException("Invalid credential hash length. ",
        details: {
          "Excepted": QuickCrypto.blake2b224DigestSize,
          "length": hash.length
        });
  }
  return AdaStakeCredential._(type, hash);
}