/**
 * Vault Resource
 *
 * Handles shield, unshield, send, and balance operations.
 * Delegates crypto/transaction ops to KeyVault and queries to IndexerClient.
 */
import type { ResolvedPrivacyBoostConfig } from '../core/types';
import type { ShieldParams, ShieldResult, UnshieldParams, UnshieldResult, SendParams, TransactionResult, TokenBalance, TokenMetadata, FeeRates, Hex } from '../types';
import type { SDKStores } from '../state/stores';
import type { AuthResource } from './Auth';
import type { KeyVault } from '../keyvault/types';
import type { IndexerClient } from '../api/indexer-client';
import type { Logger } from '../utils/logger';
export declare class VaultResource {
    private keyVault;
    private indexer;
    private config;
    private auth;
    private publicClient;
    private _stores;
    private log;
    constructor(keyVault: KeyVault, indexer: IndexerClient, config: ResolvedPrivacyBoostConfig, auth: AuthResource | null, stores: SDKStores, logger?: Logger);
    private get balanceStore();
    private get transactionStore();
    private get tokenStore();
    private get walletStoreRef();
    private getMpk;
    /**
     * Shield tokens into the privacy vault.
     *
     * Wraps ETH→WETH if the token is native ETH, approves the spend,
     * and creates a shielded note. Progress is reported via `onProgress`.
     *
     * @param params - Shield parameters (tokenAddress, amount, optional recipientMpk, onProgress)
     * @returns Shield result with txHash, commitment, fee, and requestId
     * @throws {PrivacyBoostError} `INVALID_CONFIG` if shielding native ETH without wethContractAddress configured
     *
     * @example
     * ```typescript
     * const result = await sdk.vault.shield({
     *   tokenAddress: '0x...', // ERC-20 token or NATIVE_ETH_ADDRESS for ETH
     *   amount: 1000000n,
     *   onProgress: (p) => console.log(p.message),
     * });
     * console.log('Shielded:', result.txHash);
     * ```
     */
    shield(params: ShieldParams): Promise<ShieldResult>;
    /**
     * Unshield tokens from the privacy vault back to an on-chain address.
     *
     * Verifies sufficient shielded balance, generates a ZK proof, and submits
     * the unshield request. For native ETH, call `unwrapWeth()` after the
     * unshield is confirmed on-chain.
     *
     * @param params - Unshield parameters (tokenAddress, amount, recipientAddress, onProgress)
     * @returns Unshield result with requestId, placeholder txHash, and amount
     * @throws {PrivacyBoostError} `INSUFFICIENT_BALANCE` if shielded balance is too low
     *
     * @example
     * ```typescript
     * const result = await sdk.vault.unshield({
     *   tokenAddress: '0x...',
     *   amount: 500000n,
     *   recipientAddress: '0xMyWallet...',
     * });
     * ```
     */
    unshield(params: UnshieldParams): Promise<UnshieldResult>;
    /**
     * Wait for an unshield to complete on-chain, then unwrap WETH to ETH.
     */
    private waitAndUnwrapWeth;
    /**
     * Unwrap WETH to ETH after a unshield has been confirmed on-chain.
     *
     * Call this after `getUnshieldStatus()` confirms the unshield has settled.
     * The connected wallet must be the same address that received the unshield.
     *
     * @param amount - Amount of WETH to unwrap (in wei)
     * @param recipientAddress - The address the withdrawal was sent to (must match connected wallet)
     * @throws {PrivacyBoostError} if the unwrap transaction fails or wallet doesn't match recipient
     */
    unwrapWeth(amount: bigint, recipientAddress: Hex): Promise<Hex>;
    /**
     * Send a private transfer to another user.
     *
     * The recipient is identified by their privacy address. The transfer
     * is encrypted and submitted as a ZK proof — the on-chain transaction
     * reveals no link between sender and receiver.
     *
     * @param params - Send parameters (to: privacy address, amount, tokenAddress)
     * @returns Transaction result with requestId and placeholder txHash
     * @throws {PrivacyBoostError} `INSUFFICIENT_BALANCE` if shielded balance is too low
     *
     * @example
     * ```typescript
     * const result = await sdk.vault.send({
     *   to: recipientPrivacyAddress,
     *   amount: 100000n,
     *   tokenAddress: '0x...',
     * });
     * ```
     */
    send(params: SendParams): Promise<TransactionResult>;
    /**
     * Get or create a viem public client for on-chain reads
     */
    private getPublicClient;
    /**
     * Get token metadata (symbol, decimals)
     * Falls back to defaults for known tokens, otherwise fetches from blockchain
     */
    private getTokenMetadata;
    /**
     * Get wallet (on-chain) balance for a token.
     *
     * Fetches the ERC-20 balanceOf (or native ETH balance) for the
     * connected wallet address. Returns 0n if no wallet is connected.
     *
     * @param tokenAddress - ERC-20 token address or NATIVE_ETH_ADDRESS
     * @returns On-chain balance as bigint
     */
    getWalletBalance(tokenAddress: string): Promise<bigint>;
    /**
     * Get shielded balance for a token.
     *
     * Returns a cached value if available. Call `refreshBalance()` to force
     * a fresh fetch from the indexer.
     *
     * @param tokenAddress - ERC-20 token address or NATIVE_ETH_ADDRESS
     * @returns Token balance including shielded and wallet amounts
     */
    getBalance(tokenAddress: string): Promise<TokenBalance>;
    /**
     * Get all balances (shielded from indexer + wallet from chain) for every
     * token the user has a shielded balance in.
     *
     * @returns Array of token balances with both shielded and on-chain amounts
     */
    getAllBalances(): Promise<TokenBalance[]>;
    private getRegisteredTokens;
    /**
     * Get registered tokens with full metadata (symbol, decimals, name).
     *
     * Fetches the token list from the on-chain registry via the indexer,
     * then resolves ERC20 metadata for each token (with caching).
     */
    getTokens(): Promise<TokenMetadata[]>;
    getFees(tokenAddress: Hex): Promise<FeeRates>;
    /**
     * Refresh balance for a specific token (both shielded and wallet)
     */
    refreshBalance(tokenAddress: Hex): Promise<void>;
    /**
     * Refresh all balances (both shielded and wallet for tracked tokens)
     */
    refreshBalances(): Promise<void>;
    /**
     * Consolidate fragmented notes for a token.
     *
     * Performs self-transfers to merge many small notes into fewer notes.
     * Each round consolidates up to 15 input notes into 1-2 output notes.
     * Useful when a user has accumulated many small notes from deposits.
     *
     * @param tokenAddress - Token address to consolidate
     * @param maxRounds - Maximum consolidation rounds. Pass 0 for unlimited;
     *   default is 3. Unlimited is risky because inter-round state relies on
     *   the indexer having ingested the previous round's outputs, which may
     *   not yet be true when the next round fetches notes.
     * @returns Consolidation result with rounds executed and remaining note count
     */
    consolidateNotes(tokenAddress: string, maxRounds?: number): Promise<{
        rounds: number;
        transfers: Array<{
            requestId: string;
            txHash: string;
            fee: number;
        }>;
        remainingNotes: number;
    }>;
    /**
     * Refresh wallet (on-chain) balances for all registered tokens.
     *
     * Unlike `refreshBalances()` which refreshes both shielded and wallet balances,
     * this method only fetches on-chain wallet balances. Useful when you need
     * wallet balances for tokens the user hasn't shielded yet (e.g. to show
     * available amounts for deposit).
     *
     * Updates the balance store: for tokens already present, updates the wallet
     * field; for new tokens, creates an entry with shieldedBalance: 0n.
     */
    private refreshAllWalletBalances;
    /**
     * Get token metadata
     */
    getToken(address: string): Promise<TokenMetadata>;
}
//# sourceMappingURL=Vault.d.ts.map