Encode type_sig() to JSON