UNPKG

wallet-storage-client

Version:
53 lines 2.08 kB
import { table } from '../../index.client'; import { Monitor } from '../Monitor'; import { WalletMonitorTask } from './WalletMonitorTask'; /** * `TaskCheckForProofs` is a WalletMonitor task that retreives merkle proofs for * transactions. * * It is normally triggered by the Chaintracks new block header event. * * When a new block is found, cwi-external-services are used to obtain proofs for * any transactions that are currently in the 'unmined' or 'unknown' state. * * If a proof is obtained and validated, a new ProvenTx record is created and * the original ProvenTxReq status is advanced to 'notifying'. */ export declare class TaskCheckForProofs extends WalletMonitorTask { triggerMsecs: number; static taskName: string; /** * An external service such as the chaintracks new block header * listener can set this true to cause */ static checkNow: boolean; constructor(monitor: Monitor, triggerMsecs?: number); /** * Normally triggered by checkNow getting set by new block header found event from chaintracks */ trigger(nowMsecsSinceEpoch: number): { run: boolean; }; runTask(): Promise<string>; /** * Process an array of table.ProvenTxReq (typically with status 'unmined' or 'unknown') * * If req is invalid, set status 'invalid' * * Verify the requests are valid, lookup proofs or updated transaction status using the array of getProofServices, * * When proofs are found, create new ProvenTxApi records and transition the requests' status to 'unconfirmed' or 'notifying', * depending on chaintracks succeeding on proof verification. * * Increments attempts if proofs where requested. * * @param reqs * @returns reqs partitioned by status */ getProofs(reqs: table.ProvenTxReq[], indent?: number, countsAsAttempt?: boolean, ignoreStatus?: boolean): Promise<{ proven: table.ProvenTxReq[]; invalid: table.ProvenTxReq[]; log: string; }>; } //# sourceMappingURL=TaskCheckForProofs.d.ts.map