Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const resolve = ({
did, reducer, storage, blockchain, transactionTime,
}) => {
if (
did === undefined
|| reducer === undefined
|| storage === undefined
|| blockchain === undefined
|| transactionTime === undefined
) {
throw new Error('Invalid args: resolve({ did, reducer, storage, blockchain, transactionTime})');
}
resolver.registerMethod(method, async (_did, parsed) => {
// {
// method: 'mymethod',
// id: 'abcdefg',
// did: 'did:mymethod:abcdefg/some/path#fragment=123',
// path: '/some/path',
// fragment: 'fragment=123'
// }
// console.log(did, parsed);
// eslint-disable-next-line
const updated = await syncFromBlockNumber({
didUniqueSuffixes: [parsed.id],
transactionTime,
initialState: {}, // set from cache
reducer,
storage,
const register = () => {
registerMethod('tst', resolve);
};