import { IConnection } from './Connection'; import { Messaging } from '@iamo/notification'; import { TaskManager, Task, TaskState, IDataStorage } from '@iamo/utils'; export declare enum EthEventTypes { ExecutionFailure = "ExecutionFailure", ExecutionSuccess = "ExecutionSuccess", ExecutionFromModuleSuccess = "ExecutionFromModuleSuccess", ExecutionFromModuleFailure = "ExecutionFromModuleFailure", ApproveHash = "ApproveHash", ChangedMasterCopy = "ChangedMasterCopy", ChangedThreshold = "ChangedThreshold", AddedOwner = "AddedOwner", RemovedOwner = "RemovedOwner", EnabledModule = "EnabledModule", DisabledModule = "DisabledModule", EthTransferred = "EthTransferred", /** --- Module events --- */ TransactionUnderLimitExecuted = "TransactionUnderLimitExecuted", ChallengeInitiated = "ChallengeInitiated", ChallengeJoined = "ChallengeJoined", HeartbeatSuccessful = "HeartbeatSuccessful", HeartbeatFailed = "HeartbeatFailed" } /** * The TaskManagerWallet-class of the wallet */ export declare class TaskManagerWallet { connection: IConnection; /** * initializes the class * @param connection The backend connection object. */ constructor(connection: IConnection); /** * Force stop all tasks running. * @param waitInSecAfterStop The sleep time after all task stopped. (default to 5) */ stopAll(waitInSecAfterStop?: number): Promise; /** * Stop a task by name * @param taskName The task name */ stop(taskName: string): void; /** * Checks whether a task is running * @param name The task name * @returns true if the task is running */ isRunning(name: string): boolean; /** * Checks whether a task is completed * @param name The task name * @returns true if task is completed */ isTaskCompleted(name: string): boolean; /** * Gets all task states * @returns all task states */ getAllState(): Array<{ name: string; state: TaskState; }>; /** * Adds a task with a name * @param name The task name * @param task The task to register */ addTask(name: string, task: Task): void; /** * Starts the polling task to observe a message type * @param name The task name * @param address THe address * @param callbackMap the callback function-map * @param accessTokenRecovery The function to renew the access token * @param waitForInSec The interval to observe */ startReceiveNotificationProcess(name: string, address: string, callbackMap: Map Promise>, accessTokenRecovery: (error: Error) => Promise, waitForInSec?: number): Promise; /** * Starts a polling task to observe a message type * @param name The task name * @param contracts The contracts to observe * @param storage The data storage to store the last blocknumber * @param eventCallbackMap The event callback map for each contracts * @param initialBlockNumber The initial blocknumber to start the event observation * @param waitForInSec The observation interval * @param chunkSize The chunk size for event processing */ startEthEventObserver(name: string, contracts: any[], storage: IDataStorage, eventCallbackMap: Map Promise>>, initialBlockNumber?: number, waitForInSec?: number, chunkSize?: number): Promise; } export default TaskManager;