/**
 * Production-Ready Error Handler for PKP Validation and Loan Creation
 */
/**
 * Error categories for SDK operations
 */
export declare enum ErrorCategory {
    CONFIGURATION = "CONFIGURATION",
    INITIALIZATION = "INITIALIZATION",
    NETWORK = "NETWORK",
    CONTRACT = "CONTRACT",
    PKP = "PKP",
    BITCOIN = "BITCOIN",
    AUTHORIZATION = "AUTHORIZATION",
    VALIDATION = "VALIDATION",
    TRANSACTION = "TRANSACTION",
    SUBGRAPH = "SUBGRAPH",
    CACHE = "CACHE",
    UNKNOWN = "UNKNOWN"
}
/**
 * Error severity levels
 */
export declare enum ErrorSeverity {
    LOW = "LOW",
    MEDIUM = "MEDIUM",
    HIGH = "HIGH",
    CRITICAL = "CRITICAL"
}
/**
 * Modern SDK Error class with structured error handling
 */
export declare class SDKError extends Error {
    readonly code: string;
    readonly category: ErrorCategory;
    readonly severity: ErrorSeverity;
    readonly retryable: boolean;
    readonly context?: Record<string, unknown>;
    readonly originalError?: Error;
    readonly cause?: unknown;
    readonly timestamp: number;
    constructor(params: {
        code?: string;
        message: string;
        category: ErrorCategory;
        severity: ErrorSeverity;
        retryable?: boolean;
        context?: Record<string, unknown>;
        originalError?: Error;
        cause?: unknown;
    });
    /**
     * Convert to JSON-serializable format
     */
    toJSON(): {
        name: string;
        code: string;
        message: string;
        category: ErrorCategory;
        severity: ErrorSeverity;
        retryable: boolean;
        context: Record<string, unknown> | undefined;
        timestamp: number;
        stack: string | undefined;
    };
}
export interface ErrorContext {
    operation: string;
    network: string;
    timestamp: number;
    attemptNumber?: number;
    duration?: number;
    additionalInfo?: Record<string, any>;
}
export interface PKPValidationError {
    code: string;
    message: string;
    context: ErrorContext;
    severity: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
    retryable: boolean;
    userMessage?: string;
}
export declare class PKPErrorHandler {
    static classifyError(error: any, context: ErrorContext): PKPValidationError;
    static shouldRetry(error: PKPValidationError, attemptNumber: number, maxAttempts: number): boolean;
    static getRetryDelay(error: PKPValidationError, attemptNumber: number): number;
    static logError(error: PKPValidationError, context?: {
        userId?: string;
        sessionId?: string;
    }): {
        timestamp: string;
        errorCode: string;
        severity: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL";
        operation: string;
        network: string;
        attemptNumber: number | undefined;
        duration: number | undefined;
        retryable: boolean;
        message: string;
        userId: string | undefined;
        sessionId: string | undefined;
    };
    static createUserFriendlyMessage(error: PKPValidationError, context?: {
        isRetrying?: boolean;
    }): string;
}
