/**
 * PrivacyBoost SDK (WASM-powered)
 *
 * Main SDK class that provides a high-level interface for privacy operations.
 * Delegates all cryptographic operations to the Rust WASM module.
 *
 * @example
 * ```typescript
 * const sdk = await PrivacyBoost.create({
 *   serverUrl: 'https://indexer.example.com',
 *   appId: 'my-app',
 * });
 * ```
 */
import type * as Wasm from './wasm/privacy_boost_wasm';
import { type PrivacyBoostConfig } from './core';
import { VaultResource } from './resources/Vault';
import { AuthResource } from './resources/Auth';
import type { SessionRestoredEvent, SessionExpiredEvent } from './types';
import { TransactionsResource } from './resources/Transactions';
import { AuditResource } from './resources/Audit';
import { AppsResource } from './resources/Apps';
import { SDKStores } from './state/stores';
import type { IdentityResult } from './types';
import { ChainClient, type ChainClientConfig } from './ChainClient';
import type { KeyVault } from './keyvault/types';
import { type Logger } from './utils/logger';
export type { PrivacyBoostConfig };
export type SessionEventMap = {
    sessionRestored: SessionRestoredEvent;
    sessionExpired: SessionExpiredEvent;
};
type EventHandler<T> = (data: T) => void;
/**
 * PrivacyBoost SDK
 *
 * The main entry point for using the PrivacyBoost SDK.
 * Provides access to privacy operations including shields, unshields,
 * private transfers.
 */
export declare class PrivacyBoost {
    private config;
    private wasmSDK;
    private _keyVault;
    private _indexerClient;
    private _authClient;
    private _jwt;
    private initialized;
    /** Per-instance logger. Level is controlled by `config.logLevel`. */
    readonly logger: Logger;
    /**
     * Per-instance stores. Each SDK instance gets independent state.
     * @internal
     */
    readonly stores: SDKStores;
    private _vault;
    private _auth;
    private _transactions;
    private _audit;
    private _apps;
    private chainClients;
    private _eventListeners;
    /** @internal Use `PrivacyBoost.create()` instead. */
    constructor(config: PrivacyBoostConfig);
    /**
     * Create and initialize a PrivacyBoost SDK instance.
     *
     * Only `serverUrl` and `appId` are required. `chainId`, `shieldContractAddress`,
     * `tokenRegistryAddress`, and `teePublicKey` are auto-discovered from the
     * indexer's `/api/v1/info` endpoint. Explicit values take precedence.
     *
     * @param config - SDK configuration
     * @returns Initialized SDK instance
     * @throws {PrivacyBoostError} `SDK_INITIALIZATION_FAILED` if initialization fails
     *
     * @example
     * ```typescript
     * const sdk = await PrivacyBoost.create({
     *   serverUrl: 'https://indexer.example.com',
     *   appId: 'my-app',
     * });
     * ```
     */
    static create(config: PrivacyBoostConfig): Promise<PrivacyBoost>;
    /**
     * Check if the SDK can be initialized in the current environment.
     *
     * @returns true if WASM is supported and we're in a browser
     */
    static isSupported(): boolean;
    /**
     * Initialize the SDK by loading the WASM module and setting up the KeyVault.
     *
     * Must be called before any other operations.
     * This is idempotent - calling it multiple times is safe.
     *
     * @throws {PrivacyBoostError} `SDK_INITIALIZATION_FAILED` if initialization fails
     */
    initialize(): Promise<void>;
    /**
     * Ensure SDK is initialized before accessing resources.
     */
    private ensureInitialized;
    /**
     * Update the stored JWT token (called by AuthResource after login).
     * @internal
     */
    setJwt(token: string | null): void;
    /**
     * Get the KeyVault instance.
     * @internal
     */
    get keyVault(): KeyVault;
    /**
     * Vault resource for shield, unshield, and send operations.
     */
    get vault(): VaultResource;
    /**
     * Auth resource for wallet connection and authentication.
     */
    get auth(): AuthResource;
    /**
     * Transactions resource for transaction history.
     */
    get transactions(): TransactionsResource;
    /**
     * Audit resource for auditor-specific operations.
     */
    get audit(): AuditResource;
    /**
     * Apps resource for looking up app metadata.
     */
    get apps(): AppsResource;
    /**
     * Access the underlying WASM SDK instance.
     *
     * For advanced usage only. Only available in local mode.
     * @throws {PrivacyBoostError} `SDK_NOT_INITIALIZED` if not initialized or in iframe mode
     */
    get wasm(): Wasm.PrivacyBoost;
    /**
     * Set an external key manager for use by authenticate().
     *
     * When set, authenticate() will use this key manager's keys
     * instead of its internal one.
     *
     * Only available in local mode.
     */
    setKeyManager(keyManager: unknown): void;
    on<K extends keyof SessionEventMap>(event: K, handler: EventHandler<SessionEventMap[K]>): void;
    off<K extends keyof SessionEventMap>(event: K, handler: EventHandler<SessionEventMap[K]>): void;
    private emit;
    /**
     * Add tokens to track (triggers balance sync for these tokens).
     *
     * @param tokenAddresses - Array of token addresses to track
     */
    addTrackedTokens(tokenAddresses: `0x${string}`[]): void;
    /**
     * Get the current chain ID.
     * Returns the resolved chain ID after initialization (auto-discovered or explicit).
     */
    get chainId(): number;
    /**
     * Check if the SDK is initialized.
     */
    get isInitialized(): boolean;
    /**
     * Get the current configuration (immutable).
     */
    getConfig(): Readonly<PrivacyBoostConfig>;
    /**
     * Whether auth keys are registered on-chain.
     * Checks the store state set during authentication.
     */
    get isRegistered(): boolean;
    /**
     * Create a chain-scoped client for operations on a specific blockchain.
     *
     * The chain client shares this SDK's identity keys but has its own
     * server connection, JWT, and chain state. Call `.authenticate()` on
     * the returned client before performing operations.
     *
     * Returns a cached client if the same `serverUrl` was used before.
     *
     * @param config - Chain configuration (only `serverUrl` required)
     * @returns A chain-scoped client
     *
     * @example
     * ```typescript
     * const op = sdk.forChain({ serverUrl: 'https://op.example.com' });
     * await op.authenticate(walletBridge);
     * await op.vault.shield({ tokenAddress: '0x...', amount: 1000n });
     * ```
     */
    forChain(config: ChainClientConfig): ChainClient;
    /**
     * Dispose the SDK and clean up all resources.
     *
     * After calling this, the SDK instance cannot be used again.
     */
    dispose(): void;
    /**
     * Look up a user's identity by Ethereum address or MPK.
     *
     * Queries the indexer's /identity/{identifier} API to retrieve the user's
     * public keys and derived privacy address. Useful for resolving an
     * Ethereum address to a privacy address before sending a transfer.
     *
     * @param identifier - Ethereum address (0x... 42 chars) or MPK (66 char hex)
     * @returns Identity result with MPK, viewing keys, and privacy address
     * @throws If not authenticated or identifier not found
     *
     * @example
     * ```typescript
     * // Look up by Ethereum address
     * const identity = await sdk.resolveIdentity('0x1234...abcd');
     * console.log('Privacy address:', identity.privacyAddress);
     *
     * // Use for transfer
     * await sdk.vault.send({
     *   to: identity.privacyAddress,
     *   amount: 1000000n,
     *   tokenAddress: '0x...',
     * });
     * ```
     */
    resolveIdentity(identifier: string): Promise<IdentityResult>;
}
//# sourceMappingURL=PrivacyBoost.d.ts.map