UNPKG

@authereum/resolution

Version:
39 lines (38 loc) 2.3 kB
/// <reference types="jest" /> import { Dictionary } from '../types'; import { ResolutionErrorCode } from '../errors/resolutionError'; import { ConfigurationErrorCode } from '../errors/configurationError'; import { DnsRecordsErrorCode } from '../errors/dnsRecordsError'; export declare const MainnetUrl = "https://mainnet.infura.io"; export declare const ZilliqaUrl = "https://api.zilliqa.com"; export declare const DefaultUrl = "https://unstoppabledomains.com/api/v1"; export declare const CryptoDomainWithoutResolver = "reseller-test-paul2.crypto"; export declare const CryptoDomainWithEmptyResolver = "reseller-test-mago017.crypto"; export declare const CryptoDomainWithIpfsRecords = "reseller-test-paul019.crypto"; export declare const CryptoDomainWithEmail = "reseller-test-paul019.crypto"; export declare const CryptoDomainWithAdaBchAddresses = "reseller-test-mago0.crypto"; export declare const CryptoDomainWithTwitterVerification = "ijustwannatestsomething2.crypto"; export declare function mockAsyncMethod(object: any, method: string, value: any): jest.SpyInstance; export declare function mockAsyncMethods(object: any, methods: Dictionary<any>): jest.SpyInstance[]; export declare function isLive(): boolean; export declare function pendingInLive(): void; export declare function expectSpyToBeCalled(spies: jest.SpyInstance[], times?: number): void; export declare function expectResolutionErrorCode(callback: Promise<any> | Function, code: ResolutionErrorCode): Promise<void>; export declare function expectConfigurationErrorCode(callback: Promise<any> | Function, code: ConfigurationErrorCode): Promise<void>; export declare function expectDnsRecordErrorCode(callback: Promise<any> | Function, code: DnsRecordsErrorCode): Promise<void>; export declare function mockAPICalls(testName: string, url?: string): void; /** * returns either a standard mainnet linkpool url * @see https://docs.linkpool.io/docs/rpc_main * or the one with attached INFURA SECRET key from * UNSTOPPABLE_RESOLUTION_INFURA_PROJECTID env variable if any */ export declare function protocolLink(providerProtocol?: ProviderProtocol): string; export declare enum ProviderProtocol { 'http' = 0, 'wss' = 1 } export declare const caseMock: <T, U>(params: T, cases: { request: T; response: U; }[]) => U;