Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Package and minor changes #38

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .env
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
AGENT_PORT=5106
AGENT_DID_NAME="issuer.agent.0235@cord"

CORD_WSS_URL =wss://sparknet-test.cord.network
AUTHOR_URI =0x80d4df66bddbc2b64b0368cb39661c170e9af7c5bd1b6838e9d508900dc3bf24//1
CORD_WSS_URL=wss://proteanx-stage.cord.network
AUTHOR_URI=//proteanx//studio

CHAIN_SPACE_ID=space:cord:c34jdSC1raWhnuKeVzzfC5C8EVYnSw4snDGFfKFqXC6jAhoD8
CHAIN_SPACE_AUTH=auth:cord:a3bq4S2TN7xubffMh8FZtUAadC2nW5oGhH6pvnWk4Cw5QK7Mf
MNEMONIC=steak pencil cream make goose orient blur genuine scout tobacco gift knee mention day curtain balance snake mobile involve tired curtain sort target moment
CHAIN_SPACE_ID=space:cord:c35hPnHNBNHwnLt15bgGMQ8eygFAJSBAuvfu3gd8RNji2ajCm
CHAIN_SPACE_AUTH=auth:cord:a3aht6ks4cTALVXGHWBno1135QZ9Fm1Bg5ZWqKTEd7QFwqVYE
MNEMONIC=kid fiscal someone pledge parrot melody tonight share inside during upgrade laundry ride gorilla maid force pole zebra phone ugly twenty spell smoke umbrella

TYPEORM_PORT=5432

Expand Down
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-1rc7",
"@cord.network/vc-export": "0.9.3-1rc7",
"@cord.network/sdk": "0.9.3-1rc14",
"@cord.network/vc-export": "0.9.3-1rc14",
"body-parser": "^1.20.2",
"dotenv": "^16.0.3",
"express": "^4.18.2",
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 @@ -57,6 +57,7 @@ export async function issueVC(req: express.Request, res: express.Response) {
spaceUri: CHAIN_SPACE_ID as `space:cord:${string}`,
schemaUri: schema?.identifier,
needSDR: true,
needStatementProof: true,
}
);
console.dir(vc, {
Expand All @@ -79,7 +80,7 @@ export async function issueVC(req: express.Request, res: express.Response) {

const cred = new Cred();
cred.schemaId = data.schemaId;
cred.identifier = vc.proof[1].identifier;
cred.identifier = statement;
cred.active = true;
cred.fromDid = issuerDid.uri;
cred.credHash = newCredContent.credentialHash;
Expand Down Expand Up @@ -170,7 +171,8 @@ export async function updateCred(req: express.Request, res: express.Response) {
undefined
);

let updatedVc: any = await Vc.addProof(
let updatedVc: any = await Vc.updateAddProof(
cred.identifier as `stmt:cord:${string}`,
updatedCredContent,
async (data) => ({
signature: await issuerKeysProperty.assertionMethod.sign(data),
Expand All @@ -184,6 +186,7 @@ export async function updateCred(req: express.Request, res: express.Response) {
spaceUri: CHAIN_SPACE_ID as `space:cord:${string}`,
schemaUri: cred.schemaId,
needSDR: true,
needStatementProof: true,
}
);

Expand All @@ -206,7 +209,7 @@ export async function updateCred(req: express.Request, res: express.Response) {
console.log(`✅ UpdatedStatement element registered - ${updatedStatement}`);

if (updatedStatement) {
cred.identifier = updatedVc.proof[1].identifier;
cred.identifier = updatedStatement;
cred.credHash = updatedCredContent.credentialHash;
cred.vc = updatedVc;

Expand Down
4 changes: 2 additions & 2 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function createDid(
const api = Cord.ConfigService.get('api');
const mnemonic = mnemonicGenerate(24);

const delegateKeys = Cord.Utils.Keys.generateKeypairs(mnemonic, 'ed25519');
const delegateKeys = Cord.Utils.Keys.generateKeypairs(mnemonic, 'sr25519');
const {
authentication,
keyAgreement,
Expand Down Expand Up @@ -129,7 +129,7 @@ export async function checkDidAndIdentities(mnemonic: string): Promise<any> {
);
}

const issuerKeys = Cord.Utils.Keys.generateKeypairs(mnemonic, 'ed25519');
const issuerKeys = Cord.Utils.Keys.generateKeypairs(mnemonic, 'sr25519');
const {
authentication,
keyAgreement,
Expand Down
Loading
Loading