Resolver
@iota/identity-wasm API documentation
Class: Resolver<T>
Convenience type for resolving DID documents from different DID methods.
DID documents resolved with resolve
will have the type specified as generic type parameter T.
With the default being CoreDocument | IToCoreDocument
.
Also provides methods for resolving DID Documents associated with verifiable identity_wasm/node/identity_wasm.Credential | Credentials and identity_wasm/node/identity_wasm.Presentation | Presentations.
Configuration
The resolver will only be able to resolve DID documents for methods it has been configured for in the constructor.
Extends
Type Parameters
• T extends CoreDocument
| IToCoreDocument
Constructors
new Resolver()
new Resolver<
T
>(config
):Resolver
<T
>
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
config
Returns
Resolver
<T
>
Inherited from
Methods
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 ofdids
.
Parameters
dids
string
[]
Returns
Promise
<(IToCoreDocument
| CoreDocument
)[]>
Inherited from
resolve()
resolve(
did
):Promise
<T
>
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
did
string
Returns
Promise
<T
>