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

@dyne/did

v1.15.1

Published

Create and manage did:dyne identifiers

Downloads

14

Readme

Create and manage Dyne.org's W3C-DID in JavaScript

🚀 Quick start

Start by reading the documentation to understand better how Dyne.org's W3C-DID works

https://dyne.org/W3C-DID

💾 Install

Stable releases are published on https://www.npmjs.com/package/dyne-did that have a slow pace release schedule that you can install with

yarn add @dyne/did
# or if you use npm
npm install @dyne/did

🎮 Usage

The bindings are composed of four main functions:

  • createKeyring: takes as input a string that will be used as description inside the did document and return the string under the key controller along with your keyring.
  • createRequest: takes as input the output of the above function along with a string containg the domain and a DidActions value and return an unsigned request that will later be signed by an admin.
  • signRequest: takes as input an unsigned request, the signer keyring and the signer domain and return the signed request ready to be sent in order to create, update or deactivate a did document.
  • sendRequest: takes as input an endpoint and a request and sends the latter to did.dyne.org/*endpoint*.

There are other functions related to particular domains as well, but the functioning is almost identical.

All functions return a Promise.

To start using the Dyne.org's W3C-DID you have to create a domain admin request and send it to us. This can be created by using:

import { createKeyring, createRequest, DidActions } from "@dyne/did";
// or if you don't use >ES6
// const { createKeyring, createRequest, DidActions } = require('@dyne/did')

// Create a new did document request
const keyring = await createKeyring("new_domain_admin_request");
const request = await createRequest(keyring, "domain_A", DidActions.CREATE);
console.log(request);

Once your request has been accepted people can create a request for a special context of your domain in the following way:

import { createKeyring, createRequest, DidActions } from "@dyne/did";
// or if you don't use >ES6
// const { createKeyring, createRequest, DidActions } = require('@dyne/did')

// Create a new did document request
const keyring = await createKeyring("new_domain_context_admin_request");
const request = await createRequest(keyring, "domain.context_A", DidActions.CREATE);
console.log(request);

This request will be sent to you and you will have to sign it and you or the participant will send the result to did.dyne.org in order to create the new did document.

import { signRequest, sendRequest } from "@dyne/did";
// or if you don't use >ES6
// const { signRequest, sendRequest } = require('@dyne/did')

//Sign and send did document request
const signedRequest = await signRequest(request, keyring, "domain_A");
const result = await sendRequest("api/v1/domain/pubkeys-accept.chain", signedRequest);

Update and deactivate procedure follow the same idea.

😍 Acknowledgements

Copyright (C) 2022-2023 by Dyne.org foundation, Amsterdam

Designed, written and maintained by Denis Jaromil, Puria Nafisi Azizi, Andrea D'Intino, Alberto Lerda and Matteo Cristino.


👤 Contributing

Please first take a look at the Dyne.org - Contributor License Agreement then

  1. 🔀 FORK IT
  2. Create your feature branch git checkout -b feature/branch
  3. Commit your changes git commit -am 'Add some fooBar'
  4. Push to the branch git push origin feature/branch
  5. Create a new Pull Request
  6. Thank you

💼 License

dyne-did js - a javascript wrapper of Dyne.org's W3C-DID
Copyright (C) 2022-2023 Dyne.org foundation

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.