import { AddressState, Transaction, Utxo } from "./interfaces"; /** * Utility class for keeping track of address state * via idempotent "add" and "remove" transaction events */ export declare class AddressTracker { protected address: string; protected transactions: Map; protected balance: { total: number; confirmed: number; mempool: number; }; protected utxos: Map; private spent; private loadingApi; private pending; constructor(address: string); static from(state: AddressState): AddressTracker; /** * Returns the current state of the address in a JSON-friendly format */ getState(): AddressState; hasTransaction(txid: string): boolean; /** * Update the address state with the effect of a transaction * * Idempotent, but the most recent confirmation status applies, * so ordering matters */ addTransaction(tx: Transaction, fromWs?: boolean): void; /** * Undo the effect of a previously added transaction */ removeTransaction(txid: string, fromWs?: boolean): void; /** * Call after all API transactions have been processed * * Drains any pending websocket events */ onApiLoaded(): Promise; /** * Prepares for API transactions to be loaded */ onApiLoading(): void; }