addOutput method
void
addOutput(
{ - required Uint8List scriptPubKey,
- required BigInt value,
})
override
Implementation
@override
void addOutput({
required Uint8List scriptPubKey,
required BigInt value,
}) {
_ensureSections();
final newOutput = TxOutput(value: value, scriptPubKey: scriptPubKey);
final inputs = _unsignedTx?.inputs ?? [];
final outputs = _unsignedTx?.outputs ?? [];
_unsignedTx = Tx(
version: _unsignedTx?.version ?? Tx.currentVersion,
inputs: inputs,
outputs: [...outputs, newOutput],
locktime: _unsignedTx?.locktime ?? 0,
);
_sections.add(<PsbtKeyValue>[]);
}