MintAssets.deserialize constructor

MintAssets.deserialize(
  1. CborMapValue<CborObject, CborObject> cbor
)

Deserializes a MintAssets instance from a CBOR map value.

Implementation

factory MintAssets.deserialize(CborMapValue<CborObject, CborObject> cbor) {
  final Map<AssetName, BigInt> assets = {};

  for (final i in cbor.value.entries) {
    assets[AssetName.deserialize(i.key.cast())] = i.value.getInteger();
  }
  return MintAssets(assets);
}