Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.getCredDef = async function(poolHandle, did, schemaId) {
let getCredDefRequest = await indy.buildGetCredDefRequest(did, schemaId);
let getCredDefResponse = await indy.submitRequest(poolHandle, getCredDefRequest);
return await indy.parseGetCredDefResponse(getCredDefResponse);
};
async function waitUntilApplied(ph, req, cond) {
for (let i = 0; i < 3; i++) {
let res = await sdk.submitRequest(ph, req);
if (cond(res)) {
return res;
}
await indy.utils.sleep(5 * 1000);
}
}
exports.getCredDef = async function(poolHandle, did, credDefId) {
let getCredDefRequest = await sdk.buildGetCredDefRequest(did, credDefId);
let getCredDefResponse = await sdk.submitRequest(poolHandle, getCredDefRequest);
return await sdk.parseGetCredDefResponse(getCredDefResponse);
};
async function waitUntilApplied(ph, req, cond) {
for (let i = 0; i < 3; i++) {
let res = await sdk.submitRequest(ph, req);
if (cond(res)) {
return res;
}
await indy.utils.sleep(5 * 1000);
}
}
exports.getSchema = async function(schemaId) {
let getSchemaRequest = await sdk.buildGetSchemaRequest(await indy.did.getEndpointDid(), schemaId);
let getSchemaResponse = await sdk.submitRequest(await indy.pool.get(), getSchemaRequest);
let [, schema] = await sdk.parseGetSchemaResponse(getSchemaResponse);
return schema;
};
exports.getSchema = async function(poolHandle, did, schemaId) {
let getSchemaRequest = await indy.buildGetSchemaRequest(did, schemaId);
let getSchemaResponse = await indy.submitRequest(poolHandle, getSchemaRequest);
return await indy.parseGetSchemaResponse(getSchemaResponse);
};