Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.setEndpointForDid = async function (did, endpoint) {
let attributeRequest = await sdk.buildAttribRequest(await indy.did.getEndpointDid(), did, null, {endpoint: {ha: endpoint}}, null);
await sdk.signAndSubmitRequest(await indy.pool.get(), await indy.wallet.get(), await indy.did.getEndpointDid(), attributeRequest);
};
exports.sendNym = async function(poolHandle, walletHandle, Did, newDid, newKey, role) {
let nymRequest = await sdk.buildNymRequest(Did, newDid, newKey, null, role);
await sdk.signAndSubmitRequest(poolHandle, walletHandle, Did, nymRequest);
};
exports.sendSchema = async function(poolHandle, walletHandle, Did, schema) {
let schemaRequest = await sdk.buildSchemaRequest(Did, schema);
await sdk.signAndSubmitRequest(poolHandle, walletHandle, Did, schemaRequest)
};
exports.sendCredDef = async function (poolHandle, walletHandle, did, credDef) {
let credDefRequest = await sdk.buildCredDefRequest(did, credDef);
await sdk.signAndSubmitRequest(poolHandle, walletHandle, did, credDefRequest);
};
exports.createCredDef = async function (schemaId, tag) {
let schema = await exports.getSchema(schemaId);
let [credDefId, credDefJson] = await sdk.issuerCreateAndStoreCredentialDef(await indy.wallet.get(), await indy.did.getEndpointDid(), schema, tag, 'CL', '{"support_revocation": false}');
let credDefRequest = await sdk.buildCredDefRequest(await indy.did.getEndpointDid(), credDefJson);
await sdk.signAndSubmitRequest(await indy.pool.get(), await indy.wallet.get(), await indy.did.getEndpointDid(), credDefRequest);
credDefJson.schemaId_long = schemaId;
await indy.did.pushEndpointDidAttribute('credential_definitions', credDefJson);
};
exports.createSchema = async function (name, version, attributes) {
let [id, schema] = await sdk.issuerCreateSchema(await indy.did.getEndpointDid(), name, version, attributes);
let schemaRequest = await sdk.buildSchemaRequest(await indy.did.getEndpointDid(), schema);
await sdk.signAndSubmitRequest(await indy.pool.get(), await indy.wallet.get(), await indy.did.getEndpointDid(), schemaRequest);
await indy.did.pushEndpointDidAttribute('schemas', id);
};
exports.sendCredDef = async function (poolHandle, walletHandle, did, credDef) {
let credDefRequest = await indy.buildCredDefRequest(did, credDef);
await indy.signAndSubmitRequest(poolHandle, walletHandle, did, credDefRequest);
};
exports.sendNym = async function(poolHandle, walletHandle, Did, newDid, newKey, role) {
let nymRequest = await sdk.buildNymRequest(Did, newDid, newKey, null, role);
await sdk.signAndSubmitRequest(poolHandle, walletHandle, Did, nymRequest);
};
exports.setEndpointForDid = async function (did, endpoint) {
let attributeRequest = await sdk.buildAttribRequest(await indy.did.getEndpointDid(), did, null, {endpoint: {ha: endpoint}}, null);
await sdk.signAndSubmitRequest(await indy.pool.get(), await indy.wallet.get(), await indy.did.getEndpointDid(), attributeRequest);
};
exports.sendNym = async function(poolHandle, walletHandle, Did, newDid, newKey, role) {
let nymRequest = await indy.buildNymRequest(Did, newDid, newKey, null, role);
await indy.signAndSubmitRequest(poolHandle, walletHandle, Did, nymRequest);
};