toBytes method

Uint8List toBytes()

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;
}