Skip to content

Commit

Permalink
update equinet with schema and kvack
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-parkhill committed Jul 30, 2024
1 parent 3058758 commit 59e13ed
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
29 changes: 15 additions & 14 deletions _credentials/equinet.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion utils/issue-crendentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 59e13ed

Please sign in to comment.