ShelleyTransactionOutput.deserialize constructor

ShelleyTransactionOutput.deserialize({
  1. required List cList,
})

Implementation

factory ShelleyTransactionOutput.deserialize({required List cList}) {
  final address = bech32ShelleyAddressFromBytes(cList[0] as Uint8Buffer);
  if (cList[1] is int) {
    return ShelleyTransactionOutput(
        address: address,
        value: ShelleyValue(coin: cList[1] as int, multiAssets: []));
  } else if (cList[1] is List) {
    final ShelleyValue value =
        ShelleyValue.deserialize(cList: cList[1] as List);
    return ShelleyTransactionOutput(address: address, value: value);
  } else {
    throw CborDeserializationException();
  }
}