dragonchain/webserver/lib/smart_contracts.py
def list_contracts_v1() -> Dict[str, List[Dict[str, Any]]]:
    """ Function used by the smartcontract endpoint with method GET.
        Returns a list of all smart contracts.
    Returns:
        The search results of the query specified.
    """
    sc_list = smart_contract_dao.list_all_contract_ids()
    sc_metadata = []
    for sc_id in sc_list:
        try:
            sc_metadata.append(storage.get_json_from_object(f"{smart_contract_dao.FOLDER}/{sc_id}/metadata.json"))
        except exceptions.NotFound:  # If smart contract metadata is not found, simply ignore it and don't add it to the list
            pass
    return {"smart_contracts": sc_metadata}
 Function used by the smartcontract endpoint with method GET.
        Returns a list of all smart contracts.
    Returns:
        The search results of the query specified.
    
Function used by the smartcontract endpoint with method GET.
Returns a list of all smart contracts.
Function used by the smartcontract endpoint with method GET . Returns a list of all smart contracts .
def list_contracts_v1() -> Dict[str, List[Dict[str, Any]]]:
    sc_list = smart_contract_dao.list_all_contract_ids()
    sc_metadata = []
    for sc_id in sc_list:
        try:
            sc_metadata.append(storage.get_json_from_object(f"{smart_contract_dao.FOLDER}/{sc_id}/metadata.json"))
        except exceptions.NotFound:  
            pass
    return {"smart_contracts": sc_metadata}
def list_contracts_v1 ( ) -> Dict [ str , List [ Dict [ str , Any ] ] ] : sc_list = smart_contract_dao . list_all_contract_ids ( ) sc_metadata = [ ] for sc_id in sc_list : try : sc_metadata . append ( storage . get_json_from_object ( f"{smart_contract_dao.FOLDER}/{sc_id}/metadata.json" ) ) except exceptions . NotFound : pass return { "smart_contracts" : sc_metadata }
Function used by the smartcontract endpoint with method GET.
Function used by the smartcontract endpoint with method GET .
""" Function used by the smartcontract endpoint with method GET.
        Returns a list of all smart contracts.
    Returns:
        The search results of the query specified.
    """ # If smart contract metadata is not found, simply ignore it and don't add it to the list
The search results of the query specified.
The search results of the query specified .