How to use ethr-did-resolver - 3 common examples

To help you get started, we’ve selected a few ethr-did-resolver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uport-project / uport-credentials / src / Credentials.js View on Github external
} else if (privateKey) {
      const kp = secp256k1.keyFromPrivate(privateKey)
      const address = toEthereumAddress(kp.getPublic('hex'))
      this.did = `did:ethr:${address}`
    }

    this.signJWT = (payload, expiresIn) =>
      createJWT(payload, {
        issuer: this.did,
        signer: this.signer,
        alg: this.did.match('^did:uport:') || isMNID(this.did) ? 'ES256K' : 'ES256K-R',
        expiresIn,
      })

    UportDIDResolver(registry || UportLite({ networks: networks ? configNetworks(networks) : {} }))
    EthrDIDResolver(ethrConfig || {})
    HttpsDIDResolver()
  }

ethr-did-resolver

Resolve DID documents for ethereum addresses and public keys

Apache-2.0
Latest version published 2 months ago

Package Health Score

79 / 100
Full package analysis