toBytes method
serializes TxInput to bytes
Implementation
Uint8List toBytes() {
final amountBytes = packBigIntToLittleEndian(amount);
Uint8List scriptBytes = scriptPubKey.toBytes();
final data = Uint8List.fromList(
[...amountBytes, ...encodeVarint(scriptBytes.length), ...scriptBytes]);
return data;
}