Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ethr-did-resolver

Package Overview
Dependencies
Maintainers
5
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ethr-did-resolver - npm Package Compare versions

Comparing version 10.1.0 to 10.1.1

20

package.json
{
"name": "ethr-did-resolver",
"version": "10.1.0",
"version": "10.1.1",
"description": "Resolve DID documents for ethereum addresses and public keys",

@@ -83,4 +83,4 @@ "type": "commonjs",

"devDependencies": {
"@babel/core": "7.23.5",
"@babel/preset-env": "7.23.5",
"@babel/core": "7.23.6",
"@babel/preset-env": "7.23.6",
"@babel/preset-typescript": "7.23.3",

@@ -90,7 +90,7 @@ "@ethers-ext/provider-ganache": "6.0.0-beta.2",

"@semantic-release/git": "10.0.1",
"@types/jest": "29.5.10",
"@typescript-eslint/eslint-plugin": "6.13.1",
"@typescript-eslint/parser": "6.13.1",
"@types/jest": "29.5.11",
"@typescript-eslint/eslint-plugin": "6.14.0",
"@typescript-eslint/parser": "6.14.0",
"babel-jest": "29.7.0",
"eslint": "8.55.0",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",

@@ -101,5 +101,5 @@ "eslint-plugin-jest": "27.6.0",

"microbundle": "0.15.1",
"prettier": "3.1.0",
"semantic-release": "22.0.8",
"typescript": "5.3.2"
"prettier": "3.1.1",
"semantic-release": "22.0.12",
"typescript": "5.3.3"
},

@@ -106,0 +106,0 @@ "dependencies": {

@@ -1,2 +0,2 @@

import { Contract, ethers } from 'ethers'
import { Contract, ethers, hexlify, toUtf8Bytes } from 'ethers'
import { Resolvable } from 'did-resolver'

@@ -54,2 +54,34 @@

it('add Bls12381G2Key2020 assertion key', async () => {
expect.assertions(1)
const { address: identity, shortDID: did, signer } = await randomAccount(provider)
const pubKey = hexlify(toUtf8Bytes('public key material here')) // encodes to 0x7075626c6963206b6579206d6174657269616c2068657265 in base16
await new EthrDidController(identity, registryContract, signer).setAttribute(
'did/pub/Bls12381G2Key2020', // attrName must fit into 32 bytes. Anything extra will be truncated.
pubKey, // There's no limit on the size of the public key material
86401
)
const { didDocument } = await didResolver.resolve(did)
expect(didDocument).toEqual({
'@context': expect.anything(),
id: did,
verificationMethod: [
{
id: `${did}#controller`,
type: 'EcdsaSecp256k1RecoveryMethod2020',
controller: did,
blockchainAccountId: `eip155:1337:${identity}`,
},
{
id: `${did}#delegate-1`,
type: 'Bls12381G2Key2020',
controller: did,
publicKeyHex: '7075626c6963206b6579206d6174657269616c2068657265',
},
],
authentication: [`${did}#controller`],
assertionMethod: [`${did}#controller`, `${did}#delegate-1`],
})
})
it('add Ed25519VerificationKey2018 authentication key', async () => {

@@ -56,0 +88,0 @@ expect.assertions(1)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc