The @zcloak/did-resolver module is designed to resolve the DID (Decentralized Identifiers) syntax-like string and fetch the DID Document from the registry. The registry could be a database (test environment) or a blockchain (Arweave). Each resolver should extend the DidResolver class and implement the resolve method that accepts a DID and returns the DidDocument.

Integration steps

  1. Installation: yarn add @zcloak/did-resolver
  2. Import the necessary classes and functions.
 import { ArweaveDidResolver } from '@zcloak/did-resolver';
...

Key Classes and Functions

DidResolver Class

The DidResolver class is an abstract class that provides the base for all DID resolvers.

export abstract class DidResolver {
  public parseDid(did: string): ParsedDid {
    //......
  }

  public resolve(didUrl: string): Promise<DidDocument> {
    //......
  }
}

Key methods include:

parseDid(params)

public parseDid(did: string): ParsedDid {
    //......
}

resolve(params)

public resolve(didUrl: string): Promise<DidDocument> {
    //......
}