Skip to main content
Version: 1.3

Class: Resolver

identity_wasm.Resolver

Convenience type for resolving DID documents from different DID methods.

Also provides methods for resolving DID Documents associated with verifiable Credentials and Presentations.

Configuration

The resolver will only be able to resolve DID documents for methods it has been configured for in the constructor.

Table of contents

Constructors

Methods

Constructors

constructor

new Resolver(config)

Constructs a new Resolver.

Errors

If both a client is given and the handlers map contains the "iota" key the construction process will throw an error because the handler for the "iota" method then becomes ambiguous.

Parameters

NameType
configResolverConfig

Methods

resolve

resolve(did): Promise\<IToCoreDocument | CoreDocument>

Fetches the DID Document of the given DID.

Errors

Errors if the resolver has not been configured to handle the method corresponding to the given DID or the resolution process itself fails.

Parameters

NameType
didstring

Returns

Promise\<IToCoreDocument | CoreDocument>


resolveMultiple

resolveMultiple(dids): Promise\<(IToCoreDocument | CoreDocument)[]>

Concurrently fetches the DID Documents of the multiple given DIDs.

Errors

  • If the resolver has not been configured to handle the method of any of the given DIDs.
  • If the resolution process of any DID fails.

Note

  • The order of the documents in the returned array matches that in dids.
  • If dids contains duplicates, these will be resolved only once and the resolved document is copied into the returned array to match the order of dids.

Parameters

NameType
didsstring[]

Returns

Promise\<(IToCoreDocument | CoreDocument)[]>