serialize method
Serialize transaction output
Implementation
Uint8List serialize() {
final bytes = <int>[];
// Value (8 bytes, little endian)
bytes.addAll(_uint64ToBytes(value));
// Public key script length (varint)
VarInt.write(bytes, pkScript.length);
// Public key script
bytes.addAll(pkScript);
return Uint8List.fromList(bytes);
}