Credential.deserialize constructor
Credential.deserialize(
- CborListValue<
CborObject> cbor
Deserializes a Credential from a CBOR list value cbor.
Implementation
factory Credential.deserialize(CborListValue cbor) {
final type = CredentialType.deserialize(cbor.elementAt<CborIntValue>(0));
switch (type) {
case CredentialType.key:
return CredentialKey.deserialize(cbor.elementAt<CborBytesValue>(1));
default:
return CredentialScript.deserialize(cbor.elementAt<CborBytesValue>(1));
}
}