build static method
Implementation
static RawTransaction build({
required int version,
required List<Output> outputs,
required Map<ElectrumOutput, Input> inputMap,
int? lockTime,
int? validFrom,
int? validUntil,
}) {
final inputs = inputMap.values;
final btcInputs = inputs.whereType<BTCInput>();
final btcOutputs = outputs.whereType<BTCOutput>();
if (btcInputs.isNotEmpty && btcOutputs.isNotEmpty && lockTime != null) {
return BTCRawTransaction(
version: version,
inputs: btcInputs.toList(),
outputs: btcOutputs.toList(),
inputMap: inputMap,
lockTime: lockTime,
);
}
final ec8Inputs = inputs.whereType<EC8Input>();
final ec8Outputs = outputs.whereType<EC8Output>();
if (ec8Inputs.isNotEmpty &&
ec8Outputs.isNotEmpty &&
validFrom != null &&
validUntil != null) {
return EC8RawTransaction(
version: version,
inputs: ec8Inputs.toList(),
outputs: ec8Outputs.toList(),
inputMap: inputMap,
validFrom: validFrom,
validUntil: validUntil,
);
}
throw UnimplementedError();
}