UNPKG

wallet-storage-client

Version:
37 lines 1.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WalletMonitorTask = void 0; /** * A monitor task performs some periodic or state triggered maintenance function * on the data managed by a wallet (Bitcoin UTXO manager, aka wallet) * * The monitor maintains a collection of tasks. * * It runs each task's non-asynchronous trigger to determine if the runTask method needs to run. * * Tasks that need to be run are run consecutively by awaiting their async runTask override method. * * The monitor then waits a fixed interval before repeating... * * Tasks may use the monitor_events table to persist their execution history. * This is done by accessing the wathman.storage object. */ class WalletMonitorTask { constructor(monitor, name) { this.monitor = monitor; this.name = name; /** * Set by monitor each time runTask completes */ this.lastRunMsecsSinceEpoch = 0; this.storage = monitor.storage; } /** * Override to handle async task setup configuration. * * Called before first call to `trigger` */ async asyncSetup() { } } exports.WalletMonitorTask = WalletMonitorTask; //# sourceMappingURL=WalletMonitorTask.js.map