pub fn to_json_string<T: Serialize>(val: &T) -> Result<String, ContractError>
Serialize a contract data structure to deterministic, pretty or compact JSON.