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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bloomprotocol/elem-did-legacy-non-anchored

v0.1.1

Published

Library for creating and resolving non-anchored legacy Element DIDs

Downloads

39

Readme

Legacy Element DID (and non-anchored)

:warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning:

This library is for legacy and non-anchored Element DIDs ONLY! It is a small implementation of [email protected].

:warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning:

Installation

npm i @bloomprotocol/elem-did-legacy-non-anchored

OR

yarn add @bloomprotocol/elem-did-legacy-non-anchored

Usage

Create

You can create an Element DID with either a mnemonic or a set of key pairs

With Mnemonic

import {createDIDFromMnemonic} from '@bloomprotocol/elem-did-legacy-non-anchored'

const {did, didDocument, keyPairs} = await createDIDFromMnemonic('item detail pizza drop any true gossip sick rival replace youth hat')

With KeyPairs

import {createDIDFromKeyPairs} from '@bloomprotocol/elem-did-legacy-non-anchored'

const {did, didDocument} = await createDIDFromKeyPairs({
  primaryKeyPair: {
    privateKeyHex: '10213f164214c50f8fad4699691a455a0844a6f5f6fde7b63dbd5e55b04cf1cc',
    publicKeyHex: '038c435746eb0b6763ca769e8aef6c14067bef97bac44a417764e3946efa70ef8a',
  },
  recoveryKeyPair: {
    privateKeyHex: 'f650724f24d34f19481a7796a949caf77e8c3f829b0f9089ccbf98dff5193a08',
    publicKeyHex: '022285b92a4b29a01fead8a2074ca7b16cd7938e93a6e06a4047a120cd673becd1',
  },
})

Resolve

The provided resolver can only handle Element DIDs with their initial-state matrix parameter.

import {Resolver} from 'did-resolver'
import {resolve, resolverRegistry} from '@bloomprotocol/elem-did-legacy-non-anchored'

const did = 'did:elem:EiC6moFp-ktksdBfyEgd2kS0bcsHJLEjdUBPlYCOrdQiXQ;elem:initial-state=eyJwYXlsb2FkIjoiZXlKQVkyOXVkR1Y0ZENJNkltaDBkSEJ6T2k4dmR6TnBaQzV2Y21jdmMyVmpkWEpwZEhrdmRqSWlMQ0poYzNObGNuUnBiMjVOWlhSb2IyUWlPbHNpSTNCeWFXMWhjbmtpWFN3aVlYVjBhR1Z1ZEdsallYUnBiMjRpT2xzaUkzQnlhVzFoY25raVhTd2ljSFZpYkdsalMyVjVJanBiZXlKcFpDSTZJaU53Y21sdFlYSjVJaXdpY0hWaWJHbGpTMlY1U0dWNElqb2lNRE00WXpRek5UYzBObVZpTUdJMk56WXpZMkUzTmpsbE9HRmxaalpqTVRRd05qZGlaV1k1TjJKaFl6UTBZVFF4TnpjMk5HVXpPVFEyWldaaE56QmxaamhoSWl3aWRIbHdaU0k2SWxObFkzQXlOVFpyTVZabGNtbG1hV05oZEdsdmJrdGxlVEl3TVRnaUxDSjFjMkZuWlNJNkluTnBaMjVwYm1jaWZTeDdJbWxrSWpvaUkzSmxZMjkyWlhKNUlpd2ljSFZpYkdsalMyVjVTR1Y0SWpvaU1ESXlNamcxWWpreVlUUmlNamxoTURGbVpXRmtPR0V5TURjMFkyRTNZakUyWTJRM09UTTRaVGt6WVRabE1EWmhOREEwTjJFeE1qQmpaRFkzTTJKbFkyUXhJaXdpZEhsd1pTSTZJbE5sWTNBeU5UWnJNVlpsY21sbWFXTmhkR2x2Ymt0bGVUSXdNVGdpTENKMWMyRm5aU0k2SW5KbFkyOTJaWEo1SW4xZGZRIiwicHJvdGVjdGVkIjoiZXlKaGJHY2lPaUpGVXpJMU5rc2lMQ0pyYVdRaU9pSWpjSEpwYldGeWVTSXNJbTl3WlhKaGRHbHZiaUk2SW1OeVpXRjBaU0o5Iiwic2lnbmF0dXJlIjoidjVQU1BtQ3FnUnhBVktKajMwY3ltQ0RYdnFONzFfajFaaGllZGhXbEcwb3NLR040cGZISE9JemdvbVdHOS1pNUJOdml6WGFpM2Ixa3d6c0NqX0U2MGcifQ'

const didDocumentResolutionResult = new Resolver(resolverRegistry).resolve(did)
// Or if you don't want to use `new Resolver`
const didDocument = resolve(did)