Skip to main content

getUniversalResolverFor() function

Creates a mapping of DID methods to a DIDResolver instance that can be used with did-resolver

Signature:

export declare function getUniversalResolverFor(methods: string[], url?: string): Record<string, DIDResolver>

Parameters

ParameterTypeDescription
methodsstring[]an array of DID methods that should be resolved by this universal resolver
urlstring(Optional) the URL for the universal resolver instance (See https://uniresolver.io )

Returns:

Record<string, DIDResolver>

Record<string, DIDResolver> a mapping of the given methods to an instance of DIDResolver

Example

const uniResolver = getUniversalResolverFor(['web', 'key', 'elem'])
const resolver = new Resolver({
...uniResolver,
// other resolvers
})