/**
 * Loan Creator Module
 *
 * Responsible for:
 * - Orchestrating the multi-step loan creation flow
 * - Creating PKP for custody
 * - Authorizing loan creation
 * - Submitting loan creation transaction
 * - Building comprehensive audit trail
 *
 * Flow: PKP Creation → Authorization → Contract Call → Verification
 */
import { type Wallet } from "ethers";
import { Result } from "../../types/result";
import { SDKError } from "../../utils/error-handler";
import type { PKPManager } from "../pkp/pkp-manager.module";
import type { ContractManager } from "../contract/contract-manager.module";
import type { BitcoinOperations } from "../bitcoin/bitcoin-operations.module";
import type { CreateLoanRequest, CreateLoanResult } from "../../interfaces/chunks/loan-operations.i";
import type { LitOps } from "@gvnrdao/dh-lit-ops";
/**
 * Loan Creator configuration
 */
export interface LoanCreatorConfig {
    /** LitOps instance for PKP operations */
    litOps: LitOps;
    /** PKP Manager for PKP operations */
    pkpManager: PKPManager;
    /** Contract Manager for contract interactions */
    contractManager: ContractManager;
    /** Bitcoin Operations for address derivation */
    bitcoinOperations: BitcoinOperations;
    /** Wallet for contract transactions (Ethereum mainnet/Sepolia) */
    wallet: Wallet;
    /** Wallet for LIT Protocol operations (Yellowstone signer, capacity credits owner) - standalone mode only */
    litOpsSigner?: Wallet;
    /** SDK mode: 'service' or 'standalone' */
    mode?: "service" | "standalone";
    /** LIT Action CID for loan creation */
    litActionCid: string;
    /** User ID (typically wallet address) */
    userId: string;
    /** Lit Protocol network (e.g. 'chipotle') */
    litNetwork?: string;
    /** Enable debug logging */
    debug?: boolean;
    /** Transaction timeout (ms) */
    transactionTimeoutMs?: number;
    /** Validator version for loan creation (createPosition) - REQUIRED */
    loanCreationValidatorVersion: number;
    /** EVM JSON-RPC URL for service-mode PKP flow (forwards to lit-ops-server) */
    ethRpcUrl?: string;
    /** Security testing: Temper signatures to test contract validation */
    temperSignaturesTest?: boolean;
}
/**
 * Loan creation audit trail
 */
export interface LoanCreationAudit {
    /** PKP creation details */
    pkpCreation: {
        tokenId: string;
        publicKey: string;
        ethAddress: string;
        timestamp: number;
    };
    /** Bitcoin addresses derived */
    bitcoinAddresses: {
        mainnet: string;
        testnet: string;
        regtest: string;
    };
    /** Authorization details */
    authorization: {
        signature: string;
        timestamp: number;
    };
    /** Contract call details */
    contractCall: {
        transactionHash: string;
        blockNumber: number;
        gasUsed: string;
        timestamp: number;
    };
}
/**
 * Loan Creator Module
 *
 * Orchestrates the complete loan creation flow with comprehensive error handling
 */
export declare class LoanCreator {
    private readonly config;
    private readonly transactionTimeoutMs;
    private pkpValidationRegistryAddressCache;
    constructor(config: LoanCreatorConfig);
    /**
     * Create a new loan
     *
     * Complete flow:
     * 1. Create PKP for Bitcoin custody
     * 2. Derive Bitcoin addresses
     * 3. Build authorization signature
     * 4. Authorize loan creation (LIT Action)
     * 5. Submit loan creation transaction
     * 6. Wait for confirmation
     * 7. Build audit trail
     *
     * @param request - Loan creation request
     * @returns Loan creation result with audit trail
     */
    createLoan(request: CreateLoanRequest): Promise<Result<CreateLoanResult, SDKError>>;
    /**
     * Step 2: Derive Bitcoin addresses from PKP public key
     */
    private deriveBitcoinAddresses;
    /**
     * Step 3: Submit loan creation transaction
     */
    private submitLoanCreation;
    /**
     * Extract position ID from transaction receipt
     */
    private extractPositionId;
    /**
     * Get vault address for current network
     */
    private getVaultAddressForNetwork;
}
/**
 * Factory function to create a LoanCreator instance
 */
export declare function createLoanCreator(config: LoanCreatorConfig): Result<LoanCreator, SDKError>;
