Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const pinDID = did => {
if (!did) return
// We resolve the DID in order to pin the ipfs object
try {
resolveDID(did)
// if this throws it's not a DID
} catch (e) {}
}
const updated = await syncFromBlockNumber({
didUniqueSuffixes: [parsed.id],
transactionTime,
initialState: {}, // set from cache
reducer,
storage,
blockchain,
});
const record = updated[parsed.id];
if (record) {
return record.doc;
}
return null;
});
return resolver.default(did);
};