UNPKG

@unstoppabledomains/resolution

Version:
56 lines (55 loc) 2.31 kB
import { ResolutionMethod, UnsLocation, ResolutionConfig } from '../types/publicTypes'; /** Explains Resolution Error options */ declare type ResolutionErrorOptions = { providerMessage?: string; errorMessage?: string; method?: ResolutionMethod; methodName?: string; domain?: string; currencyTicker?: string; recordName?: string; namingService?: string; location?: UnsLocation; tokenUri?: string; config?: ResolutionConfig; }; export declare enum ResolutionErrorCode { UnregisteredDomain = "UnregisteredDomain", UnspecifiedResolver = "UnspecifiedResolver", UnsupportedDomain = "UnsupportedDomain", UnsupportedService = "UnsupportedService", UnsupportedMethod = "UnsupportedMethod", UnspecifiedCurrency = "UnspecifiedCurrency", UnsupportedCurrency = "UnsupportedCurrency", IncorrectResolverInterface = "IncorrectResolverInterface", RecordNotFound = "RecordNotFound", MetadataEndpointError = "MetadataEndpointError", ServiceProviderError = "ServiceProviderError", InvalidTwitterVerification = "InvalidTwitterVerification", InconsistentDomainArray = "InconsistentDomainArray", InvalidDomainAddress = "InvalidDomainAddress", InvalidUnsResolutionConfiguration = "InvalidResolutionConfiguration" } /** * Resolution Error class is designed to control every error being thrown by Resolution * @param code - Error Code * - UnsupportedDomain - domain is not supported by current Resolution instance * - UnregisteredDomain - domain is not owned by any address * - UnspecifiedResolver - domain has no resolver specified * - UnspecifiedCurrency - domain resolver doesn't have any address of specified currency * - UnsupportedCurrency - currency is not supported * - IncorrectResolverInterface - ResolverInterface is incorrected * - RecordNotFound - No record was found * @param domain - Domain name that was being used * @param method */ export declare class ResolutionError extends Error { readonly code: ResolutionErrorCode; readonly domain?: string; readonly method?: string; readonly methodName?: string; readonly recordName?: string; readonly currencyTicker?: string; constructor(code: ResolutionErrorCode, options?: ResolutionErrorOptions); } export default ResolutionError;