/**
 * WalletFacade orchestration — main-thread side (Phase 1: worker-thread aware).
 *
 * The real `WalletFacade` lives in a `worker_threads` worker (see
 * `srv/midnight/wallet-worker.ts`). The wallet SDK's Effect.ts Fiber scheduler
 * monopolises Node's microtask queue while a chain sync is running, so we keep
 * it off the main thread. This builder is now a thin glue layer:
 *
 *   1. Load any persisted sub-state blobs from `midnight.WalletSyncStates`
 *      (standard CAP `db.run`, the main thread is free).
 *   2. Tell the worker to `init(sessionId, seedHex, ..., restoreBlobs?)`.
 *   3. Cache the fact that this session has an active facade in the worker.
 *
 *   Periodic state-save: worker pushes `{state-save, sessionId, blobs}`
 *   events on `parentPort`. The client receives them and writes via CAP
 *   `db.run(UPDATE/INSERT)`. Wiring lives in `wireWorkerStateSaveSink()`
 *   below, called once by the plugin lifecycle.
 *
 * Phase 1 surface — what callers still get from this module:
 *   - `getOrBuildWalletFacade(cacheKey, args)`  initialises the worker-side
 *     facade and resolves once it's ready. The returned object is a stub —
 *     properties (.facade, .keys) exist only to keep the OLD callers from
 *     blowing up at import time. Their methods will throw `Error("phase-2:
 *     migrate to wallet-worker-client")` if called.
 *   - `evictWalletFacade(cacheKey)`  tells the worker to drop and final-save.
 *
 * Phase 2 will rewire `dust-registration.ts` and
 * `wallet-material-factory.ts:createFacadeBackedWalletAdapter` to call the
 * worker-client RPC API directly for `balanceTx` / `submitTx` /
 * `registerNightUtxosForDustGeneration`, removing the stub.
 */
export interface WalletFacadeBuildArgs {
    seedHex: string;
    networkId: 'preprod' | 'testnet' | 'mainnet' | 'undeployed' | 'devnet' | 'qanet' | 'preview';
    indexerHttpUrl: string;
    indexerWsUrl: string;
    proofServerUrl: string;
    /** Substrate node RPC URL (`relayURL` in the SDK config). */
    relayUrl: string;
    /**
     * Passphrase used to encrypt persisted sub-state blobs. Same value the
     * caller would pass as `privateStoragePasswordProvider()`. Required for
     * persistence to function; if omitted, restore/save are skipped.
     */
    syncStatePassphrase?: string;
}
/**
 * Initialise a wallet for the given cacheKey via the worker. Idempotent:
 * subsequent calls for the same cacheKey hit the worker's cache.
 *
 * Returns a placeholder shape compatible with the pre-worker callers; methods
 * on `.facade` and `.keys.*` throw with a Phase 2 migration error if hit, so
 * code paths that haven't been migrated yet fail loudly instead of silently
 * regressing.
 */
export declare function getOrBuildWalletFacade(cacheKey: string, args: WalletFacadeBuildArgs): Promise<{
    facade: any;
    zswapKeys: any;
    dustKey: any;
    unshieldedKeystore: any;
}>;
/**
 * Tell the worker to drop and final-save the facade for this cacheKey.
 */
export declare function evictWalletFacade(cacheKey: string): Promise<void>;
export declare function getCacheSize(): number;
export declare function clearAllFacades(): void;
/**
 * Wire the worker → main-thread `state-save` events to standard CAP
 * `db.run(...)` via `saveSyncState`. Call ONCE at plugin init AFTER
 * `startWalletWorker()` has resolved.
 */
export declare function wireWorkerStateSaveSink(): void;
