output method
void
output({
- ShelleyAddress? shelleyAddress,
- String? address,
- MultiAssetBuilder? multiAssetBuilder,
- ShelleyValue? value,
- bool autoAddMinting = true,
build a single ShelleyTransactionOutput, handle complex output construction
Implementation
void output({
ShelleyAddress? shelleyAddress,
String? address,
MultiAssetBuilder? multiAssetBuilder,
ShelleyValue? value,
bool autoAddMinting = true,
}) {
assert(address != null || shelleyAddress != null);
assert(!(address != null && shelleyAddress != null));
final String addr =
shelleyAddress != null ? shelleyAddress.toBech32() : address!;
assert(multiAssetBuilder != null || value != null);
assert(!(multiAssetBuilder != null && value != null));
final val = value ?? multiAssetBuilder!.build();
final output = ShelleyTransactionOutput(address: addr, value: val);
_outputs.add(output);
if (autoAddMinting) {
_mint.addAll(val.multiAssets);
}
}