Skip to content

Commit

Permalink
feat: genesishahswith issuer agent
Browse files Browse the repository at this point in the history
  • Loading branch information
RCCodeBase committed Aug 2, 2024
1 parent bc07b3f commit b65c5bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 6 additions & 3 deletions src/controller/credential_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);

Expand All @@ -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}`,
}
Expand Down

0 comments on commit b65c5bc

Please sign in to comment.