/**
 * IframeKeyVault
 *
 * KeyVault implementation that communicates with a cross-origin iframe
 * via postMessage. Private keys never leave the iframe — only signatures,
 * ciphertexts, and commitments cross the boundary.
 */
import type { KeyVault, KeyStatus, PublicKeys, StoredSession, BuildShieldCommitmentParams, ShieldCommitmentResult, EncryptDepositCiphertextParams, DepositCiphertextResult, NullifierInput, DeriveEcdhKeysParams, EcdhKeysResult, EncryptTransferCiphertextParams, TransferCiphertextResult, SpendingSignatureResult, TransferDigestParams, WithdrawalDigestParams, DigestResult, ViewAuthSignatureResult, RegistrationData, AuthenticateResult } from './types';
import type { ShieldRawProgress, UnshieldRawProgress } from '../types/eth';
export declare class IframeKeyVault implements KeyVault {
    private readonly iframeUrl;
    private iframeManager;
    private messageBus;
    private _isAuthenticated;
    private _privacyAddress;
    private _mpk;
    private _disposed;
    private _allowedOrigins;
    private _chainId;
    private _rpcUrl?;
    private _publicClient;
    private _walletBridge;
    private _isDevMode;
    constructor(iframeUrl?: string);
    private ensureBus;
    private send;
    initialize(config: {
        serverUrl: string;
        chainId: number;
        shieldContractAddress: string;
        wethContractAddress?: string;
        appId?: string;
        rpcUrl?: string;
        tokenRegistryAddress?: string;
        persistence?: {
            storage: 'localStorage' | 'indexedDB' | 'osKeychain';
            unlock?: 'none' | 'pin' | 'password';
        };
    }): Promise<void>;
    dispose(): void;
    authenticate(keySource: unknown, tokenProviderCallback: ((payload: unknown) => Promise<{
        token: string;
        expiresIn: number;
    }>) | null): Promise<AuthenticateResult>;
    submitCredential(credential: string, tokenProviderCallback: ((payload: unknown) => Promise<{
        token: string;
        expiresIn: number;
    }>) | null): Promise<AuthenticateResult>;
    proceedAfterMnemonic(credential: string | null, tokenProviderCallback: ((payload: unknown) => Promise<{
        token: string;
        expiresIn: number;
    }>) | null): Promise<AuthenticateResult>;
    logout(): Promise<void>;
    clearSession(): Promise<void>;
    getStoredSession(): Promise<StoredSession | null>;
    getKeyStatus(): Promise<KeyStatus>;
    getPublicKeys(): Promise<PublicKeys>;
    isAuthenticated(): boolean;
    getPrivacyAddress(): string | null;
    getMpk(): string | null;
    deleteVault(): Promise<void>;
    buildShieldCommitment(params: BuildShieldCommitmentParams): Promise<ShieldCommitmentResult>;
    encryptDepositCiphertext(params: EncryptDepositCiphertextParams): Promise<DepositCiphertextResult>;
    computeNullifiers(notes: NullifierInput[]): Promise<string[]>;
    generateNpk(recipientMpk: string, randomIn: string): Promise<string>;
    computeOutputCommitment(npk: string, tokenId: number, amount: string): Promise<string>;
    deriveEcdhKeys(params: DeriveEcdhKeysParams): Promise<EcdhKeysResult>;
    encryptTransferCiphertext(params: EncryptTransferCiphertextParams): Promise<TransferCiphertextResult>;
    signSpending(digestHi: string, digestLo: string): Promise<SpendingSignatureResult>;
    computeTransferDigest(params: TransferDigestParams): Promise<DigestResult>;
    computeWithdrawalDigest(params: WithdrawalDigestParams): Promise<DigestResult>;
    computeWithdrawalCommitment(recipientAddr: string, tokenId: number, amount: string): Promise<string>;
    signViewAuth(mpk: string, nonce: string): Promise<ViewAuthSignatureResult>;
    getRegistrationData(): Promise<RegistrationData>;
    shield(tokenAddress: string, amount: string, _onProgress?: (event: ShieldRawProgress) => void): Promise<unknown>;
    sendTransfer(tokenAddress: string, amount: string, recipientPrivacyAddress: string): Promise<unknown>;
    unshield(tokenAddress: string, amount: string, recipientAddress: string, _onProgress?: (event: UnshieldRawProgress) => void): Promise<unknown>;
    consolidateNotes(tokenAddress: string, maxRounds: number): Promise<unknown>;
    unwrapWeth(amount: string, recipientAddress: string): Promise<string>;
    private getOrCreatePublicClient;
    private handleBridgeRequest;
    private static readonly MAX_PROXY_RESPONSE_SIZE;
    private static readonly MAX_PROXY_REQUEST_BODY_SIZE;
    private static readonly BLOCKED_REQUEST_HEADERS;
    private handleApiFetch;
    /**
     * Proxy an HTTP request through the iframe's WASM encryption layer.
     *
     * In iframe mode, the parent cannot make direct API calls to the server
     * because the server requires encrypted POST envelopes. This method
     * routes the request through the iframe → WASM EncryptedHttpClient →
     * api-bridge → parent (actual HTTP call) → back through the chain.
     */
    proxyFetch(path: string, method: string, body?: unknown, query?: unknown, baseUrl?: string, authToken?: string | null): Promise<unknown>;
    setWalletBridge(bridge: {
        signMessage(message: string): Promise<string>;
        signTypedData(typedData: string): Promise<string>;
        sendTransaction(tx: unknown): Promise<string>;
        getAddress(): Promise<string>;
        getChainId(): Promise<number>;
    }): void;
}
//# sourceMappingURL=IframeKeyVault.d.ts.map