async def build_req_creds_json(self, creds: dict, filt: dict = None, filt_dflt_incl: bool = False) -> str:
LOGGER.debug('<STR_LIT>', creds, filt)<EOL>req_creds = {<EOL>'<STR_LIT>': {},<EOL>'<STR_LIT>': {},<EOL>'<STR_LIT>': {}<EOL>}<EOL>def _add_cred(cred, uuid, key):<EOL><INDENT>nonlocal req_creds<EOL>req_creds[key][uuid] = {<EOL>'<STR_LIT>': cred['<STR_LIT>']['<STR_LIT>'],<EOL>'<STR_LIT>': True<EOL>}<EOL>if cred.get('<STR_LIT>', None):<EOL><INDENT>req_creds[key][uuid]['<STR_LIT>'] = cred['<STR_LIT>']['<STR_LIT:to>']<EOL><DEDENT>if key == '<STR_LIT>':<EOL><INDENT>req_creds[key][uuid]['<STR_LIT>'] = True<EOL><DEDENT><DEDENT>if filt:<EOL><INDENT>for cd_id in filt:<EOL><INDENT>try:<EOL><INDENT>json.loads(await self.get_cred_def(cd_id))<EOL><DEDENT>except AbsentCredDef:<EOL><INDENT>LOGGER.warning(<EOL>'<STR_LIT>', cd_id)<EOL>filt.pop(cd_id)<EOL><DEDENT><DEDENT><DEDENT>for attr_uuid in creds.get('<STR_LIT>', {}):<EOL><INDENT>for cred in creds['<STR_LIT>'][attr_uuid]:<EOL><INDENT>if attr_uuid in req_creds['<STR_LIT>']:<EOL><INDENT>continue<EOL><DEDENT>cred_info = cred['<STR_LIT>']<EOL>cred_cd_id = cred_info['<STR_LIT>']<EOL>if filt:<EOL><INDENT>if cred_cd_id not in filt:<EOL><INDENT>if filt_dflt_incl:<EOL><INDENT>_add_cred(cred, attr_uuid, '<STR_LIT>')<EOL><DEDENT>continue<EOL><DEDENT>if cred_cd_id in filt and '<STR_LIT>' in (filt[cred_cd_id] or {}):  <EOL><INDENT>if not {k: str(filt[cred_cd_id].get('<STR_LIT>', {})[k])<EOL>for k in filt[cred_cd_id].get('<STR_LIT>', {})}.items() <= cred_info['<STR_LIT>'].items():<EOL><INDENT>continue<EOL><DEDENT><DEDENT>_add_cred(cred, attr_uuid, '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>_add_cred(cred, attr_uuid, '<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>for pred_uuid in creds.get('<STR_LIT>', {}):<EOL><INDENT>for cred in creds['<STR_LIT>'][pred_uuid]:<EOL><INDENT>if pred_uuid in req_creds['<STR_LIT>']:<EOL><INDENT>continue<EOL><DEDENT>cred_info = cred['<STR_LIT>']<EOL>cred_cd_id = cred_info['<STR_LIT>']<EOL>if filt:<EOL><INDENT>if cred_cd_id not in filt:<EOL><INDENT>if filt_dflt_incl:<EOL><INDENT>_add_cred(cred, pred_uuid, '<STR_LIT>')<EOL><DEDENT>continue<EOL><DEDENT>if cred_cd_id in filt and '<STR_LIT>' in (filt[cred_cd_id] or {}):  <EOL><INDENT>minima = filt[cred_cd_id].get('<STR_LIT>', {})<EOL>try:<EOL><INDENT>if any((attr not in cred_info['<STR_LIT>'])<EOL>or (int(cred_info['<STR_LIT>'][attr]) < int(minima[attr]))<EOL>for attr in minima):<EOL><INDENT>continue<EOL><DEDENT><DEDENT>except ValueError:<EOL><INDENT>continue  <EOL><DEDENT><DEDENT>_add_cred(cred, pred_uuid, '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>_add_cred(cred, pred_uuid, '<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>rv_json = json.dumps(req_creds)<EOL>LOGGER.debug('<STR_LIT>', rv_json)<EOL>return rv_json<EOL>
Build and return indy-sdk requested credentials json from input indy-sdk creds structure
through specified filter.

:param creds: indy-sdk creds structure
:param filt: filter  mapping cred def ids to:
    - (optionally) 'attr-match': dict mapping attributes to values (omit, empty dict, or None to match all);
    - (optionally) 'minima': (pred) integer lower-bounds of interest (omit, empty dict, or None to match all);
    omit parameter or specify empty dict or None for no filter, matching all; e.g.,

::

    {
        'Vx4E82R17q...:3:CL:16:0': {
            'attr-match': {
                'name': 'Alex',
                'sex': 'M',
                'favouriteDrink': None
            },
            'minima': {  # if both attr-match and minima present, combined conjunctively (i.e., via AND)
                'favouriteNumber' : 10,
                'score': 100  # if more than one minimum present, combined conjunctively (i.e., via AND)
            }
        },
        'R17v42T4pk...:3:CL:19:0': {
            'attr-match': {
                'height': 175,
                'birthdate': '1975-11-15'  # combined conjunctively (i.e., via AND)
            }
        },
        'Z9ccax812j...:3:CL:27:0': {
            'attr-match': {}  # match all attributes on this cred def
        },
        '9cHbp54C8n...:3:CL:37:0': {
            'minima': {  # request all attributes on this cred def, request preds specifying employees>=50
                'employees' : 50,
            }
        }
        ...
    }

:param filt_dflt_incl: whether to request (True) all creds by attribute/predicate
    that filter does not identify by cred def, or (False) to exclude them. Note that
    if the filter is None or {}, this parameter is unnecessary - it applies to a filter,
    not a non-filter.
:return: indy_sdk requested_credentials json for use in proof creation