def METHOD_NAME(self, include_legacy_keys: bool = True, exclude_modern_keys: bool = True) -> Dict[str, Any]:
    if include_legacy_keys is False and exclude_modern_keys is True:
        raise ValueError("`coin_spends` not included in legacy or modern outputs")
    d = recurse_jsonify(self)
    if include_legacy_keys:
        d["coin_solutions"] = d["coin_spends"]
    if exclude_modern_keys:
        del d["coin_spends"]
    return cast(Dict[str, Any], recurse_jsonify(d))