0.1.1 • Published 4 years ago

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

Weekly downloads
252
License
MIT
Repository
github
Last release
4 years ago

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
0.1.1

4 years ago

0.1.0

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago