cmd/wallet-js-sdk/src/credential/credential-manager.js
/**
   * Reads credential metadata and saves credential metadata data model into wallet content store.
   *
   *  @param {string} auth - authorization token for wallet operations.
   *  @param {Object} options - subjects from which credential metadata will be extracted.
   *  @param {Object} options.credential - credential data model from which basic credential attributes like type, issuer, expiration etc will be read.
   *  @param {String} options.manifestID - ID of the credential manifest of the given credential
   *  @param {String} options.descriptorID - ID of the credential manifest output descriptor of the given credential.
   *  @param {String} options.collection - (optional) ID of the collection to which this credential belongs.
   *
   *  @returns {Promise<Object>} - empty promise or error if operation fails.
   */
Reads credential metadata and saves credential metadata data model into wallet content store.
@param {string} auth - authorization token for wallet operations.
@param {Object} options - subjects from which credential metadata will be extracted.
@param {Object} options.credential - credential data model from which basic credential attributes like type, issuer, expiration etc will be read.
@param {String} options.manifestID - ID of the credential manifest of the given credential
@param {String} options.descriptorID - ID of the credential manifest output descriptor of the given credential.
@param {String} options.collection - (optional) ID of the collection to which this credential belongs.

@returns {Promise} - empty promise or error if operation fails.
Reads credential metadata and saves credential metadata data model into wallet content store . @param { string } auth - authorization token for wallet operations . @param { Object } options - subjects from which credential metadata will be extracted . @param { Object } options . credential - credential data model from which basic credential attributes like type issuer expiration etc will be read . @param { String } options . manifestID - ID of the credential manifest of the given credential @param { String } options . descriptorID - ID of the credential manifest output descriptor of the given credential . @param { String } options . collection - ( optional ) ID of the collection to which this credential belongs . @returns { Promise } - empty promise or error if operation fails .
async saveCredentialMetadata(
    auth,
    { credential, manifest, descriptorID, collection }
  ) {
    const {
      id,
      type,
      issuer,
      name,
      description,
      issuanceDate,
      expirationDate,
    } = credential;
    const resolved = await this.resolveManifest(auth, {
      credential,
      descriptorID,
      manifest,
    });
    await this.wallet.add({
      auth,
      contentType: contentTypes.METADATA,
      collectionID: collection,
      content: {
        "@context": JSONLD_CREDENTIAL_METADATA_MODEL,
        context: credential["@context"],
        type: CREDENTIAL_METADATA_MODEL_TYPE,
        credentialType: type,
        id,
        issuer,
        name,
        description,
        issuanceDate,
        expirationDate,
        resolved,
        collection,
        issuerStyle: manifest.issuer,
      },
    });
  }
async saveCredentialMetadata ( auth , { credential , manifest , descriptorID , collection } ) { const { id , type , issuer , name , description , issuanceDate , expirationDate , } = credential ; const resolved = await this . resolveManifest ( auth , { credential , descriptorID , manifest , } ) ; await this . wallet . add ( { auth , contentType : contentTypes . METADATA , collectionID : collection , content : { "@context" : JSONLD_CREDENTIAL_METADATA_MODEL , context : credential [ "@context" ] , type : CREDENTIAL_METADATA_MODEL_TYPE , credentialType : type , id , issuer , name , description , issuanceDate , expirationDate , resolved , collection , issuerStyle : manifest . issuer , } , } ) ; }
Reads credential metadata and saves credential metadata data model into wallet content store.
Reads credential metadata and saves credential metadata data model into wallet content store .