import type { AccountWalletId } from "@metamask/account-api"; import type { AccountGroupMultichainAccountObject } from "../../group.cjs"; import type { AccountTreeControllerState } from "../../types.cjs"; import type { AccountWalletEntropyObject } from "../../wallet.cjs"; import type { BackupAndSyncContext } from "../types.cjs"; /** * Gets all local entropy wallets that can be synced. * * @param context - The backup and sync context. * @returns Array of entropy wallet objects. */ export declare function getLocalEntropyWallets(context: BackupAndSyncContext): AccountWalletEntropyObject[]; /** * Gets the local group for a specific entropy wallet by its source ID and group index. * * @param context - The backup and sync context. * @param entropySourceId - The entropy source ID. * @param groupIndex - The group index. * @returns The local group object if it exists, undefined otherwise. */ export declare const getLocalGroupForEntropyWallet: (context: BackupAndSyncContext, entropySourceId: string, groupIndex: number) => AccountGroupMultichainAccountObject | undefined; /** * Gets all groups for a specific entropy wallet. * * @param context - The backup and sync context. * @param walletId - The wallet ID to get groups for. * @returns Array of multichain account group objects. */ export declare function getLocalGroupsForEntropyWallet(context: BackupAndSyncContext, walletId: AccountWalletId): AccountGroupMultichainAccountObject[]; /** * State snapshot type for rollback operations. * Captures all the state that needs to be restored in case of sync failures. */ export type StateSnapshot = { accountGroupsMetadata: AccountTreeControllerState['accountGroupsMetadata']; accountWalletsMetadata: AccountTreeControllerState['accountWalletsMetadata']; selectedAccountGroup: AccountTreeControllerState['selectedAccountGroup']; accountTreeWallets: AccountTreeControllerState['accountTree']['wallets']; }; /** * Creates a snapshot of the current controller state for rollback purposes. * Captures all state including the account tree structure. * * @param context - The backup and sync context containing controller and messenger. * @returns A deep copy of relevant state that can be restored later. */ export declare function createStateSnapshot(context: BackupAndSyncContext): StateSnapshot; /** * Restores state using an update callback. * Restores both persisted metadata and the complete account tree structure. * Uses the controller's init() method to rebuild internal maps correctly. * * @param context - The backup and sync context containing controller and messenger. * @param snapshot - The state snapshot to restore. */ export declare function restoreStateFromSnapshot(context: BackupAndSyncContext, snapshot: StateSnapshot): void; //# sourceMappingURL=controller.d.cts.map