toBytes method
Implementation
Uint8List toBytes() {
final Uint8List version = Uint8List.fromList([LEAF_VERSION_TAPSCRIPT]);
final Uint8List pubKey = hexToBytes(public.toXOnlyHex());
final Uint8List marklePath = scripts ?? Uint8List(0);
return Uint8List.fromList([...version, ...pubKey, ...marklePath]);
}