addOutputAt method

int addOutputAt(
  1. dynamic data,
  2. int value,
  3. int at
)

Implementation

int addOutputAt(dynamic data, int value, int at) {
  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.addOutputAt(scriptPubKey, value, at);
}