import { WalletError } from '../sdk/WalletError'; import { ProviderCallHistory, ServiceCallHistory } from '../sdk/WalletServices.interfaces'; export declare class ServiceCollection { serviceName: string; services: Array<{ name: string; service: T; }>; _index: number; /** * Start of currentCounts interval. Initially instance construction time. */ readonly since: Date; _historyByProvider: Record; constructor(serviceName: string, services?: Array<{ name: string; service: T; }>); add(s: { name: string; service: T; }): this; remove(name: string): void; get name(): string; get service(): T; getServiceToCall(i: number): ServiceToCall; get serviceToCall(): ServiceToCall; get allServicesToCall(): Array>; /** * Used to de-prioritize a service call by moving it to the end of the list. * @param stc */ moveServiceToLast(stc: ServiceToCall): void; get allServices(): T[]; get count(): number; get index(): number; reset(): void; next(): number; clone(): ServiceCollection; _addServiceCall(providerName: string, call: ServiceCall): ProviderCallHistory; getDuration(since: Date | string): number; addServiceCallSuccess(stc: ServiceToCall, result?: string): void; addServiceCallFailure(stc: ServiceToCall, result?: string): void; addServiceCallError(stc: ServiceToCall, error: WalletError): void; /** * @returns A copy of current service call history */ getServiceCallHistory(reset?: boolean): ServiceCallHistory; } export interface ServiceCall { /** * string value must be Date's toISOString format. */ when: Date | string; msecs: number; /** * true iff service provider successfully processed the request * false iff service provider failed to process the request which includes thrown errors. */ success: boolean; /** * Simple text summary of result. e.g. `not a valid utxo` or `valid utxo` */ result?: string; /** * Error code and message iff success is false and a exception was thrown. */ error?: { message: string; code: string; }; } export interface ServiceToCall { providerName: string; serviceName: string; service: T; call: ServiceCall; } //# sourceMappingURL=ServiceCollection.d.ts.map