@identity.com/solid-did-client
@identity.com/solid-did-client
npm i @identity.com/solid-did-client
Deprecated!
This package has been renamed to @identity.com/sol-did-client
@identity.com/solid-did-client

@identity.com/solid-did-client

Specification for the SOLID DID method

by identity-com

0.1.1 (see all)License:MITTypeScript:Built-In
npm i @identity.com/solid-did-client
Readme

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

Downloads/wk

21

GitHub Stars

10

LAST COMMIT

NaNyrs ago

MAINTAINERS

3

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
0.1.1
latest
2yrs ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate