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, this.network);
  } else if (data is Uint8List) {
    scriptPubKey = data;
  } else {
    throw new ArgumentError('Address invalid');
  }
  if (!_canModifyOutputs()) {
    throw new ArgumentError('No, this would invalidate signatures');
  }
  return _tx.addOutput(scriptPubKey, value);
}