From b65c5bcf7dc96ef52614cffa415ebd93e816bf0c Mon Sep 17 00:00:00 2001 From: RCCodeBase Date: Fri, 2 Aug 2024 12:40:24 +0530 Subject: [PATCH] feat: genesishahswith issuer agent --- package.json | 4 ++-- src/controller/credential_controller.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5eb62d6..a9635ed 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "author": "", "license": "ISC", "dependencies": { - "@cord.network/sdk": "0.9.3-1rc14", - "@cord.network/vc-export": "0.9.3-1rc14", + "@cord.network/sdk": "0.9.1-1rc18", + "@cord.network/vc-export": "0.9.1-1rc18", "body-parser": "^1.20.2", "cors": "^2.8.5", "dotenv": "^16.0.3", diff --git a/src/controller/credential_controller.ts b/src/controller/credential_controller.ts index 77020a5..312d4eb 100644 --- a/src/controller/credential_controller.ts +++ b/src/controller/credential_controller.ts @@ -20,7 +20,7 @@ const { CHAIN_SPACE_ID, CHAIN_SPACE_AUTH } = process.env; export async function issueVC(req: express.Request, res: express.Response) { const data = req.body; - + const api = Cord.ConfigService.get('api'); if (!authorIdentity) { await addDelegateAsRegistryDelegate(); } @@ -53,6 +53,7 @@ export async function issueVC(req: express.Request, res: express.Response) { }` as Cord.DidResourceUri, }), issuerDid, + api, { spaceUri: CHAIN_SPACE_ID as `space:cord:${string}`, schemaUri: schema?.identifier, @@ -147,7 +148,7 @@ export async function getCredById(req: express.Request, res: express.Response) { export async function updateCred(req: express.Request, res: express.Response) { const data = req.body; - + const api = Cord.ConfigService.get('api'); if (!data.properties || typeof data.properties !== 'object') { return res.status(400).json({ error: '"property" is a required field and should be an object', @@ -182,6 +183,7 @@ export async function updateCred(req: express.Request, res: express.Response) { }` as Cord.DidResourceUri, }), issuerDid, + api, { spaceUri: CHAIN_SPACE_ID as `space:cord:${string}`, schemaUri: cred.schemaId, @@ -265,7 +267,7 @@ export async function documentHashOnChain( ) { try { const data = req.body; - + const api = Cord.ConfigService.get('api'); // const content: any = fs.readFileSync('./package.json'); const content = JSON.stringify(data); @@ -276,6 +278,7 @@ export async function documentHashOnChain( const docProof = await Vc.getCordProofForDigest( digest as `0x${string}`, issuerDid, + api, { spaceUri: CHAIN_SPACE_ID as `space:cord:${string}`, }