This package has been deprecated

Author message:

This package has been renamed to @identity.com/sol-did-client

@identity.com/solid-did-client
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

SOLID DID Client

A typescript client library for registering and resolving DIDs using the SOLID method

Getting Started

Command line tool

yarn global add @identity.com/solid-did-client # or npm install -g @identity.com/solid-did-client
solid did:solid:devnet:HxzSJWiK9R4bpRu2YPgg47s2x2D4zT8AK5ziqoQqkzAo

Client library

import { register, resolve } from '@identity.com/solid-did-client';

// generate an X25519 key, eg using 'tweetnacl'
import nacl from 'tweetnacl';

const keyPair = nacl.sign.keyPair();

// register a DID
const identifier = await register({
  payer: keyPair.secretKey,
});

// resolve a DID
const document = await resolve(identifier);

// update a DID
const request = {
  payer: keyPair.secretKey,
  identifier,
  document: {
    service: [{
      description: 'Messaging Service',
      id: `${identifier}#service1`,
      serviceEndpoint: `https://dummmy.dummy/${identifier}`,
      type: 'Messaging',
    }],
  },
};
await update(request);

// deactivate a DID
await deactivate({
  payer: keyPair.secretKey,
  identifier: did,
});

Contributing

Note: Before contributing to this project, please check out the code of conduct and contributing guidelines.

Solid-DID uses nvm and yarn

nvm i
yarn

Running the tests

Unit tests

yarn test

E2E tests

Install Solana locally by following the steps described here.

In one shell, run:

yarn build-program
yarn start-test-validator

In another shell:

yarn test-e2e

/@identity.com/solid-did-client/

    Package Sidebar

    Install

    npm i @identity.com/solid-did-client

    Weekly Downloads

    1

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    515 kB

    Total Files

    43

    Last publish

    Collaborators

    • rleonard333
    • tbarri
    • chriteixeira
    • rado0x54
    • mitchcivic
    • dankelleher
    • flippiescholtz
    • kevinhcolgan
    • pbshoemaker
    • tyronemichael
    • lucmir