@trustalliance/did
v0.0.1-alpha.24
Published
Decentralized Identifiers (DIDs) SDK
Downloads
8
Maintainers
Readme
TrustAlliance DID SDK
The library is intended to be used as a common template for resolving a DID.
Supports Decentralized Identifiers spec.
IMPORTANT!
- This is a minimum viable product suite with limited functionality.
- Please do not use this for production
- This is a part of SDKs for Verifiable Credentials, Verifiable Credential Presentations, DID Keys, Self Sovereign Identity and Decentralised Identifiers
TrustAlliance DID
Installation
yarn install
Usage
importing DID builder and resolver
ES Modules import
import { Builder, DIDResolver } from '@trustalliance/did'
CommonJS import
const { Builder, DIDResolver } = require('@trustalliance/did');
Example
Following shows how to resolve a DID using different libraries
const { DIDResolver } = require('@trustalliance/did');
const { Connector } = require('@trustalliance/agent');
const customWebResolver = {resolve:(didUri)=>{...}}
const connector = new Connector();
const agent = new TrustAllianceAgent(connector);
const resolver = new DIDResolver();
resolver.add('web', customWebResolver);
resolver.add('trustalliance', agent.procedure);
const result: DIDResolutionResult = await resolver.resolve(
'did:web:test1234'
);
// {
// didResolutionMetadata: {...},
// didDocument: {...},
// didDocumentMetadata: {...},
// };