3030import tarfile
3131import time
3232from pprint import pformat
33+ from typing import List , Tuple , Union
3334from urllib .parse import urlparse
3435
3536import requests # type: ignore
@@ -48,7 +49,7 @@ class APIError(Exception):
4849
4950 DEFAULT_SINDRI_API_URL = "https://sindri.app/api/v1/"
5051
51- VERBOSE_LEVELS : list [ int ] = [0 , 1 , 2 ]
52+ VERBOSE_LEVELS = [0 , 1 , 2 ]
5253
5354 def __init__ (self , api_key : str , verbose_level : int = 0 , ** kwargs ):
5455 """Initialize an instance of the Sindri SDK.
@@ -256,7 +257,9 @@ def _get_verbose_1_proof_detail(self, proof_detail: dict) -> dict:
256257 "compute_time" : proof_detail .get ("compute_time" , None ),
257258 }
258259
259- def _hit_api (self , method : str , path : str , data = None , files = None ) -> tuple [int , dict | list ]:
260+ def _hit_api (
261+ self , method : str , path : str , data = None , files = None
262+ ) -> Tuple [int , Union [dict , list ]]:
260263 """
261264 Hit the Sindri API.
262265
@@ -352,9 +355,9 @@ def _set_json_request_headers(self) -> None:
352355 def create_circuit (
353356 self ,
354357 circuit_upload_path : str ,
355- tags : list [ str ] | None = None ,
358+ tags : Union [ List [ str ], None ] = None ,
356359 wait : bool = True ,
357- meta : dict | None = None ,
360+ meta : Union [ dict , None ] = None ,
358361 ) -> str :
359362 """Create a circuit. For information, refer to the
360363 [API docs](https://sindri.app/docs/reference/api/circuit-create/).
@@ -510,7 +513,7 @@ def delete_proof(self, proof_id: str) -> None:
510513 f" status={ response_status_code } response={ response_json } "
511514 )
512515
513- def get_all_circuit_proofs (self , circuit_id : str ) -> list [dict ]:
516+ def get_all_circuit_proofs (self , circuit_id : str ) -> List [dict ]:
514517 """Return a list of proof infos for the provided circuit_id. For information, refer to the
515518 [API docs](https://sindri.app/docs/reference/api/circuit-proofs/).
516519
@@ -550,7 +553,7 @@ def get_all_circuit_proofs(self, circuit_id: str) -> list[dict]:
550553
551554 return response_json
552555
553- def get_all_circuits (self ) -> list [dict ]:
556+ def get_all_circuits (self ) -> List [dict ]:
554557 """Return a list of all circuit infos. For information, refer to the
555558 [API docs](https://sindri.app/docs/reference/api/circuit-list/).
556559
@@ -752,7 +755,7 @@ def prove_circuit(
752755 proof_input : str ,
753756 perform_verify : bool = False ,
754757 wait : bool = True ,
755- meta : dict | None = None ,
758+ meta : Union [ dict , None ] = None ,
756759 ** kwargs ,
757760 ) -> str :
758761 """Prove a circuit with specified inputs. For information, refer to the
0 commit comments