diff --git a/_credentials/equinet.js b/_credentials/equinet.js index cab64c3..ded5622 100644 --- a/_credentials/equinet.js +++ b/_credentials/equinet.js @@ -1,27 +1,28 @@ -import { v4 as uuidv4 } from "uuid"; -import { dockUrl } from "utils/constants"; -import { validateEmail } from "utils/validation"; +import { v4 as uuidv4 } from 'uuid'; +import { dockUrl } from 'utils/constants'; +import { validateEmail } from 'utils/validation'; export function createCreditScoreCredential({ receiverDid, recipientEmail, creditScore }) { - - console.log("Creating EquiNet - Credit Score Credential for:", receiverDid); + console.log('Creating EquiNet - Credit Score Credential for:', receiverDid); const credentialPayload = { url: `${dockUrl}/credentials`, body: { anchor: false, distribute: true, + algorithm: 'bbdt16', credential: { - name: "EquiNet - Credit Score", - description: "This schema represents a Verified Credit Score Credential, issued by EquiNet. It standardizes the presentation of credit scores for reliable and efficient verification processes.", + name: 'EquiNet - Credit Score', + schema: 'https://schema.dock.io/EquiNetCreditScore-V2-1706975901761.json', + description: 'This schema represents a Verified Credit Score Credential, issued by EquiNet. It standardizes the presentation of credit scores for reliable and efficient verification processes.', type: [ - "VerifiableCredential", - "EquiNetCreditScore" + 'VerifiableCredential', + 'EquiNetCreditScore' ], issuer: { - name: "EquiNET", - description: "EquiNet is the credit bureau.", - logo: "https://img.dock.io/9f327cafda3be5f0cff0da2df44c55da", + name: 'EquiNET', + description: 'EquiNet is the credit bureau.', + logo: 'https://img.dock.io/9f327cafda3be5f0cff0da2df44c55da', id: process.env.NEXT_PUBLIC_EQUINET_ISSUER_ID }, subject: { @@ -30,10 +31,10 @@ export function createCreditScoreCredential({ receiverDid, recipientEmail, credi } } } - } + }; if (recipientEmail && recipientEmail.length > 2 && validateEmail(recipientEmail)) { - credentialPayload.recipientEmail = recipientEmail + credentialPayload.recipientEmail = recipientEmail; } return credentialPayload; diff --git a/pages/org/quotient/index.jsx b/pages/org/quotient/index.jsx index 0d723de..1b9dba4 100644 --- a/pages/org/quotient/index.jsx +++ b/pages/org/quotient/index.jsx @@ -99,7 +99,14 @@ const QuotientBankForm = () => { function getBiometricalData() { if (retrievedData !== null) { const credential = retrievedData.credentials.find((obj) => Object.prototype.hasOwnProperty.call(obj.credentialSubject, 'biometric')); - if (credential) return credential.credentialSubject.biometric; + + // TODO: get wallet to return a string rather than a boolean so we don't have to do this hack + const biometric = credential?.credentialSubject?.biometric; + + if (biometric) { + biometric.data = biometric.data?.toString(); + return biometric; + } } return null; } diff --git a/utils/issue-crendentials.js b/utils/issue-crendentials.js index 8217ac3..4fe023e 100644 --- a/utils/issue-crendentials.js +++ b/utils/issue-crendentials.js @@ -9,7 +9,7 @@ export const issueRevokableCredential = async (credential, setRevokableCredentia let registry = null; if (isRevocable) { - const type = credentialPayload.algorithm === 'dockbbs' ? 'DockVBAccumulator2022' : 'StatusList2021Entry'; + const type = credentialPayload.algorithm === ('dockbbs' || 'bbdt16') ? 'DockVBAccumulator2022' : 'StatusList2021Entry'; registry = await getExistingRegistry(_credential.issuer.id, type); if (!registry) {