asSerializedByteArray

fun asSerializedByteArray(st: SerializationType = SerializationType.UNKNOWN): ByteArray

Wraps this script into a serialized byte array. That is, a byte array of script bytes. This is different than toByteArray which just returns the script bytes.