def box_ids(creds: dict, cred_ids: list = None) -> dict:
rv = {}<EOL>for inner_creds in {**creds.get('<STR_LIT>', {}), **creds.get('<STR_LIT>', {})}.values():<EOL><INDENT>for cred in inner_creds:  <EOL><INDENT>cred_info = cred['<STR_LIT>']<EOL>cred_id = cred_info['<STR_LIT>']<EOL>if (cred_id not in rv) and (not cred_ids or cred_id in cred_ids):<EOL><INDENT>rv[cred_id] = {<EOL>'<STR_LIT>': cred_info['<STR_LIT>'],<EOL>'<STR_LIT>': cred_info['<STR_LIT>'],<EOL>'<STR_LIT>': cred_info['<STR_LIT>']<EOL>}<EOL><DEDENT><DEDENT><DEDENT>return rv<EOL>
Given a credentials structure and an optional list of credential identifiers
(aka wallet cred-ids, referents; specify None to include all), return dict mapping each
credential identifier to a box ids structure (i.e., a dict specifying its corresponding
schema identifier, credential definition identifier, and revocation registry identifier,
the latter being None if cred def does not support revocation).

:param creds: creds structure returned by (HolderProver agent) get_creds()
:param cred_ids: list of credential identifiers for which to find corresponding schema identifiers, None for all
:return: dict mapping each credential identifier to its corresponding box ids (empty dict if
    no matching credential identifiers present)