UNPKG

@microsoft/useragent-sdk

Version:

SDK for building decentralized identity wallets and enterprise agents.

28 lines (27 loc) 943 B
import 'isomorphic-fetch'; import Identifier from '../Identifier'; import IdentifierDocument from '../IdentifierDocument'; import IResolver from './IResolver'; import UserAgentOptions from '../UserAgentOptions'; /** * Fetches DID Documents from remote resolvers over http * @class * @implements Resolver */ export default class HttpResolver implements IResolver { url: string; options?: UserAgentOptions | undefined; private timeoutInMilliseconds; /** * Constructs an instance of the HttpResolver class. * @param url of the remote resolver. * @param [options] for configuring the resolver. */ constructor(url: string, options?: UserAgentOptions | undefined); /** * Sends a fetch request to the resolver URL including the * specified identifier. * @param identifier to resolve. */ resolve(identifier: Identifier): Promise<IdentifierDocument>; }