pub fn wave_obj_to_json<T: WaveObj>(obj: &T) -> Result<Vec<u8>, Error>
Serialize any WaveObj to JSON bytes, including the “otype” field. This matches Go’s obj.ToJson().
obj.ToJson()