/**
 * Ethers v5/v6 Interop Utilities
 * Systematic normalization of BigNumber fields for cross-version compatibility
 */
/**
 * Normalize a single BigNumberish value to string
 * Handles ethers v5 BigNumber, native bigint, hex strings, and numbers
 * @param value BigNumberish value to normalize
 * @returns Normalized string representation
 */
export declare function normalizeBigNumberish(value: unknown): string;
/**
 * Normalize transaction receipt for cross-version compatibility
 * Converts all BigNumber fields to strings
 * @param receipt Transaction receipt to normalize
 * @returns Normalized transaction receipt
 */
export declare function normalizeTransactionReceipt(receipt: unknown): Record<string, unknown> | null | undefined;
/**
 * Normalize transaction response for cross-version compatibility
 * Converts all BigNumber fields to strings and preserves methods
 * @param tx Transaction response to normalize
 * @returns Normalized transaction response
 */
export declare function normalizeTransactionResponse(tx: unknown): Record<string, unknown> | null | undefined;
/**
 * Normalize contract method result for cross-version compatibility
 * Recursively converts all BigNumber fields to strings
 * @param result Contract method result to normalize
 * @returns Normalized result
 */
export declare function normalizeContractResult(result: unknown): unknown;
/**
 * Normalize event logs for cross-version compatibility
 * @param logs Array of event logs to normalize
 * @returns Normalized logs
 */
export declare function normalizeLogs(logs: unknown): unknown[] | unknown;
/**
 * Normalize loan data for cross-version compatibility
 * Specifically handles loan-related BigNumber fields
 * @param loanData Loan data to normalize
 * @returns Normalized loan data
 */
export declare function normalizeLoanData(loanData: unknown): Record<string, unknown> | null | undefined;
/**
 * Normalize position data for cross-version compatibility
 * Specifically handles position-related BigNumber fields
 * @param positionData Position data to normalize
 * @returns Normalized position data
 */
export declare function normalizePositionData(positionData: unknown): Record<string, unknown> | null | undefined;
/**
 * Create a comprehensive normalizer for any data structure
 * Automatically detects and normalizes BigNumber fields
 * @param data Data to normalize
 * @returns Normalized data
 */
export declare function normalizeForEthersInterop(data: unknown): unknown;
/**
 * BigInt Utility Functions for Ethers v6 Compatibility
 * Native bigint doesn't have methods like BigNumber did in ethers v5
 */
/**
 * Convert bigint to number (like BigNumber.toNumber())
 * @param value bigint value
 * @returns number representation
 * @throws if value is too large for safe integer
 */
export declare function toNumber(value: bigint): number;
/**
 * Greater than comparison (like BigNumber.gt())
 * @param a First value
 * @param b Second value
 * @returns true if a > b
 */
export declare function gt(a: bigint, b: bigint): boolean;
/**
 * Less than comparison (like BigNumber.lt())
 * @param a First value
 * @param b Second value
 * @returns true if a < b
 */
export declare function lt(a: bigint, b: bigint): boolean;
/**
 * Addition (like BigNumber.add())
 * @param a First value
 * @param b Second value
 * @returns Sum of a and b
 */
export declare function add(a: bigint, b: bigint): bigint;
/**
 * Subtraction (like BigNumber.sub())
 * @param a First value
 * @param b Second value
 * @returns Difference of a and b
 */
export declare function sub(a: bigint, b: bigint): bigint;
/**
 * Multiplication (like BigNumber.mul())
 * @param a First value
 * @param b Second value
 * @returns Product of a and b
 */
export declare function mul(a: bigint, b: bigint): bigint;
/**
 * Division (like BigNumber.div())
 * @param a First value
 * @param b Second value
 * @returns Quotient of a and b
 */
export declare function div(a: bigint, b: bigint): bigint;
/**
 * Equals comparison (like BigNumber.eq())
 * @param a First value
 * @param b Second value
 * @returns true if a equals b
 */
export declare function eq(a: bigint, b: bigint): boolean;
/**
 * Safe wait for transaction confirmation with ethers v5/v6 compatibility
 *
 * The issue: ethers v5 uses receipt.confirmations() as a function
 * while ethers v6 uses receipt.confirmations as a property (number).
 * When v5 and v6 are mixed in the dependency tree, the internal
 * polling mechanism can fail with "receipt.confirmations is not a function".
 *
 * This wrapper provides a safe way to wait for transactions that handles
 * the version incompatibility gracefully.
 *
 * @param tx Transaction response with wait() method
 * @param confirmations Number of confirmations to wait for (default: 1)
 * @param timeout Timeout in milliseconds (default: 60000)
 * @returns Normalized transaction receipt
 */
export declare function safeWaitForTransaction(tx: {
    wait?: (confirmations?: number) => Promise<unknown>;
    hash?: string;
    provider?: unknown;
}, confirmations?: number, timeout?: number): Promise<Record<string, unknown>>;
/**
 * Check if an error is related to ethers v5/v6 compatibility issues
 * @param error Error to check
 * @returns true if this is an ethers compatibility error
 */
export declare function isEthersCompatibilityError(error: unknown): boolean;
