diff --git a/src/algokit/core/typed_client_generation.py b/src/algokit/core/typed_client_generation.py index 4d838f56..556145f2 100644 --- a/src/algokit/core/typed_client_generation.py +++ b/src/algokit/core/typed_client_generation.py @@ -58,15 +58,10 @@ def create_for_extension(cls, extension: str, version: str | None) -> "ClientGen def resolve_output_path(self, app_spec: Path, output_path_pattern: str | None) -> Path | None: try: application_json = json.loads(app_spec.read_text()) - contract_name: str = ( - application_json["name"] - if "name" in application_json - else application_json["contract"]["name"] - if "contract" in application_json and "name" in application_json["contract"] - else "" - ) - if contract_name == "": - raise ValueError("Contract name not found") + try: + contract_name: str = application_json["name"] # ARC-56 + except KeyError: + contract_name = application_json["contract"]["name"] # ARC-32 except Exception: logger.error(f"Couldn't parse contract name from {app_spec}", exc_info=True) return None