import { TokenBalanceQuery, PreparedTokenBalanceRpcCalls, ParsedBalanceData, TokenBalanceResult } from './types';
/**
 * Encodes the calldata for the balance fetcher contract
 * Format: [uint16 numTokens][uint16 numAccounts][addresses...][tokens...]
 */
export declare function encodeBalanceFetcherCalldata(accounts: string[], tokens: string[]): string;
/**
 * Parses the raw hex response from the balance fetcher contract
 * Handles both ABI-encoded bytes response and raw packed data
 * Returns parsed balance data with block number and per-user balances
 */
export declare function parseBalanceFetcherResult(hexData: string, users: string[], tokens: string[]): ParsedBalanceData;
/**
 * Prepares the RPC call for fetching token balances without executing it
 * Uses the balance fetcher contract for efficient batched balance queries
 *
 * @param chainId - The chain ID
 * @param account - The account address to query balances for
 * @param tokens - Array of token addresses (use zeroAddress for native balance)
 * @param blockTag - Block tag for the RPC call, default is 'latest'
 * @returns The prepared RPC call and metadata needed for parsing
 */
export declare function prepareTokenBalanceRpcCalls(chainId: string, account: string, tokens: string[], blockTag?: string): PreparedTokenBalanceRpcCalls;
/**
 * Converts the raw RPC result into a structured token balance map
 *
 * @param rawResult - The raw hex result from the RPC call
 * @param query - The original query parameters
 * @returns Map of token address to balance data
 */
export declare function parseTokenBalanceResult(rawResult: string, query: TokenBalanceQuery): TokenBalanceResult;
export interface FetchTokenBalancesOptions {
    blockTag?: string;
    rpcUrl?: string;
    rpcUrls?: string[];
    maxRetries?: number;
}
/**
 * End-to-end function that fetches token balances for an account.
 * Combines prepareTokenBalanceRpcCalls and parseTokenBalanceResult
 * with retry logic and RPC URL rotation.
 *
 * @param chainId - The chain ID
 * @param account - The account address to query balances for
 * @param tokens - Array of token addresses
 * @param options - Optional configuration (blockTag, rpcUrl/rpcUrls, maxRetries)
 * @returns Map of token address to balance data
 */
export declare function fetchTokenBalances(chainId: string, account: string, tokens: string[], options?: FetchTokenBalancesOptions): Promise<TokenBalanceResult>;
//# sourceMappingURL=fetchTokenBalance.d.ts.map