JSPM

@ew-did-registry/did-ethr-resolver

0.9.1-alpha.1577.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 406
    • Score
      100M100P100Q102432F
    • License GPL-3.0-or-later

    The package resolve CRUD operations on DID Documents

    Package Exports

    • @ew-did-registry/did-ethr-resolver
    • @ew-did-registry/did-ethr-resolver/dist/index.esm.js
    • @ew-did-registry/did-ethr-resolver/dist/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ew-did-registry/did-ethr-resolver) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Resolver Package

    1056 Resolver

    Resolver is the implementation of ERC1056 standard. It only exposes the Read functionality of the DID document. The class is implemented with caching. Recurring calls will execute significantly faster.

    The design goal of EW DID is to support different DID methods on Energy Web Chain. The resolver currently has the support for ERC1056 standard (ethr DID method). In future, we will have support for ERC725 standard which enables erc725 DID method.

    • Importing required modules
    import { Resolver, DelegateTypes } from '@ew-did-registry/did-ethr-resolver';
    • Reading the DID Document for particular id
        const resolver = new Resolver(provider, resolverSettings);
        const did = 'did:ethr:0xe2e457aB987BEd9AbdEE9410FC985E46e28a3947';
        const didDocument = await resolver.read(did);
    • Reading the current owner of the did

    This method doesn't require full document fetching. Returns did of the current owner.

        const did = 'did:ethr:0xe2e457aB987BEd9AbdEE9410FC985E46e28a3947';
        const owner = await resolver.identityOwner(did);
    • Checking if delegate is present in the DID Document

    This read doesn't require full document fetching. Returns boolean if the delegate is present.

        const did = 'did:ethr:0xe2e457aB987BEd9AbdEE9410FC985E46e28a3947';
        const didDelegate = 'did:ewc:0xe2e457aods7BEd9AbdEE9410xt985E46e28a3947';
        const validDelegate = await resolver.validDelegate(did, DelegateTypes.verification, didDelegate);