npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@adorsys-gis/did-resolver-lib

v1.0.1

Published

A library or tool that allows applications to resolve Decentralized Identifiers (DIDs) into their corresponding DID Documents.

Readme

didcomm-peer-did-resolver

A lightweight Peer DID and secrets resolver for DIDComm written in TypeScript, compatible with both browser and Node.js environments.

This library supports resolving did:peer:2 identifiers to DIDDoc instances and retrieving associated secrets from an in-memory store. Perfect for DIDComm development, testing, and simulation.

✨ Features

  • ✅ Resolve did:peer:2 formatted DIDs into DIDDoc objects
  • ✅ In-memory secrets resolver for test/dev use
  • ✅ Browser and Node.js compatible
  • ✅ Minimal and extensible API

📦 Installation

npm install @adorsys-gis/did-resolver-lib
# or
yarn add @adorsys-gis/did-resolver-lib

📚 Usage

Importing

import {
  PeerDIDResolver,
  ExampleDIDResolver,
  ExampleSecretsResolver,
} from '@adorsys-gis/did-resolver-lib';

🧩 Resolving Peer DIDs

const peerResolver = new PeerDIDResolver();

const didDoc = await peerResolver.resolve('did:peer:2...');
console.log(didDoc); // Returns DIDDoc or null

📄 Resolving from ExampleDIDResolver

Use this if you already have DIDDocs and want to simulate DIDComm resolution:

import { DIDDoc } from 'didcomm';

const doc: DIDDoc = { /* your DIDDoc */ };
const resolver = new ExampleDIDResolver([doc]);

const result = await resolver.resolve(doc.id);
console.log(result); // DIDDoc or null

🔐 Secrets Resolver

import { Secret } from 'didcomm';

const secret: Secret = { /* your secret */ };
const resolver = new ExampleSecretsResolver([secret]);

const found = await resolver.get_secret(secret.id);
console.log(found); // Secret or null

const foundIds = await resolver.find_secrets([secret.id]);
console.log(foundIds); // Array of matching IDs

🔧 Example with DIDComm Encryption

import { Message } from 'didcomm';
import {
  PeerDIDResolver,
  ExampleDIDResolver,
  ExampleSecretsResolver,
} from '@adorsys-gis/did-resolver-lib';
import { SENDER_SECRETS } from './secrets/client';

const MEDIATOR_DID = 'did:peer:2...';
const SENDER_DID = 'did:peer:2...';

const peerResolver = new PeerDIDResolver();

const mediatorDoc = await peerResolver.resolve(MEDIATOR_DID);
const senderDoc = await peerResolver.resolve(SENDER_DID);

const didResolver = new ExampleDIDResolver([mediatorDoc, senderDoc]);
const secretsResolver = new ExampleSecretsResolver(SENDER_SECRETS);

const msg = new Message({
  id: '123',
  type: 'https://didcomm.org/custom-protocol/1.0/message',
  from: SENDER_DID,
  to: [MEDIATOR_DID],
  body: { hello: 'world' },
});

const [packedMessage] = await msg.pack_encrypted(
  MEDIATOR_DID,
  SENDER_DID,
  null,
  didResolver,
  secretsResolver,
  { forward: false },
);

📁 File Structure

  • ExampleDIDResolver.ts – In-memory DIDDoc resolver
  • ExampleSecretsResolver.ts – In-memory secrets resolver
  • resolver.ts – Peer DID resolution logic for did:peer:2
  • resolver.test.ts – Unit tests for DID resolution logic