import { CustomError } from "ts-custom-error"; import { IContract } from "../../chain/contract"; import { ShielderTransaction, StateManager } from "../../shielder/state"; import { Mutex } from "async-mutex"; export declare class UnexpectedVersionInEvent extends CustomError { constructor(message: string); } export declare class StateSynchronizer { contract: IContract; stateManager: StateManager; syncCallback?: (shielderTransaction: ShielderTransaction) => unknown; mutex: Mutex; constructor(stateManager: StateManager, contract: IContract, syncCallback?: (shielderTransaction: ShielderTransaction) => unknown); /** * Syncs the shielder state with the blockchain. * Emits the synced shielder transactions to the callback. * Locks to prevent concurrent storage changes. */ syncAccountState(): Promise; /** * Returns all the shielder transactions of the private account. * Note: This method is not efficient and should be used carefully. */ getShielderTransactions(): AsyncGenerator; private getNullifier; private getNoteEventForBlock; /** * Finds the next state transition event for the given state, emitted in shielder contract. * @param state - account state * @returns the next state transition event * @throws UnexpectedVersionInEvent */ private findStateTransitionEvent; }