Transaction constructor

Transaction({
  1. int version = currentVersion,
  2. required Iterable<Input> inputs,
  3. required Iterable<Output> outputs,
  4. int locktime = 0,
})

Constructs a transaction with the given inputs and outputs. TransactionTooLarge will be thrown if the resulting transction exceeds maxSize (1MB).

Implementation

Transaction({
  this.version = currentVersion,
  required Iterable<Input> inputs,
  required Iterable<Output> outputs,
  this.locktime = 0,
})
: inputs = List.unmodifiable(inputs),
outputs = List.unmodifiable(outputs)
{
  checkInt32(version);
  checkUint32(locktime);
  if (size > maxSize) throw TransactionTooLarge();
}