addOutput method

int addOutput(
  1. dynamic data,
  2. int? value
)

Implementation

int addOutput(dynamic data, int? value) {
  var scriptPubKey;
  if (data is String) {
    scriptPubKey = Address.addressToOutputScript(data, network);
  } else if (data is Uint8List) {
    scriptPubKey = data;
  } else {
    throw ArgumentError('Address invalid');
  }
  if (!_canModifyOutputs()) {
    throw ArgumentError('No, this would invalidate signatures');
  }
  return _tx!.addOutput(scriptPubKey, value);
}