/**
 * Loan Event Types
 *
 * Type definitions for all loan-related events tracked by the Diamond Hands Protocol.
 * These events are indexed by The Graph subgraph and can be queried via the SDK.
 */
export declare enum PaymentType {
    FULL_REPAYMENT = "FULL_REPAYMENT",
    PARTIAL_PAYMENT = "PARTIAL_PAYMENT",
    EXTENSION_FEE = "EXTENSION_FEE"
}
export declare enum PositionStatus {
    PENDING_DEPOSIT = "PENDING_DEPOSIT",
    PENDING_MINT = "PENDING_MINT",
    ACTIVE = "ACTIVE",
    EXPIRED = "EXPIRED",
    LIQUIDATABLE = "LIQUIDATABLE",
    LIQUIDATED = "LIQUIDATED",
    REPAID = "REPAID",
    CLOSED = "CLOSED"
}
export interface PositionCreatedEvent {
    id: string;
    positionId: string;
    pkpId: string;
    borrower: string;
    requestedCollateralRatio: string;
    selectedTerm: string;
    expiryAt: string;
    timestamp: string;
    blockNumber: string;
    transactionHash: string;
}
export interface PaymentEvent {
    id: string;
    positionId: string;
    payer: string;
    amount: string;
    type: PaymentType;
    transactionHash: string;
    timestamp: string;
    blockNumber: string;
    logIndex: string;
    newDebt: string;
    newCollateralRatio: string;
}
export interface StatusUpdateEvent {
    id: string;
    positionId: string;
    oldStatus: PositionStatus;
    newStatus: PositionStatus;
    reason?: string;
    timestamp: string;
    blockNumber: string;
    transactionHash: string;
}
export interface LiquidationEvent {
    id: string;
    positionId: string;
    liquidator: string;
    liquidatedAmount: string;
    collateralSeized: string;
    transactionHash: string;
    timestamp: string;
    blockNumber: string;
    commitHash?: string;
    commitTimestamp?: string;
    revealDelay?: string;
}
export interface UCDMintEvent {
    id: string;
    positionId: string;
    amount: string;
    proof: string;
    minter: string;
    isCommunityMint: boolean;
    timestamp: string;
    blockNumber: string;
    transactionHash: string;
}
export interface WithdrawalEvent {
    id: string;
    positionId: string;
    withdrawalAmount: string;
    withdrawalAddress: string;
    networkFee?: string;
    timestamp: string;
    blockNumber: string;
    transactionHash: string;
    logIndex: string;
}
export interface RenewalEvent {
    id: string;
    positionId: string;
    extensionTerm: string;
    extensionFee: string;
    newExpiryDate: string;
    timestamp: string;
    blockNumber: string;
    transactionHash: string;
    logIndex: string;
}
export interface OperationFailureEvent {
    id: string;
    positionId: string;
    operationType: string;
    reason: string;
    errorCode?: string;
    amount?: string;
    timestamp: string;
    blockNumber: string;
    transactionHash: string;
    logIndex: string;
}
export interface MintRequestEvent {
    id: string;
    positionId: string;
    pkpId: string;
    borrower: string;
    mintAmount: string;
    originationFee: string;
    newDebt: string;
    newCollateralRatio: string;
    btcPrice: string;
    quantumTimestamp: string;
    opId: string;
    timestamp: string;
    blockNumber: string;
    transactionHash: string;
    logIndex: string;
}
export interface BurnRequestEvent {
    id: string;
    positionId: string;
    pkpId: string;
    borrower: string;
    burnAmount: string;
    remainingDebt: string;
    newCollateralRatio: string;
    opId: string;
    timestamp: string;
    blockNumber: string;
    transactionHash: string;
    logIndex: string;
}
/** Origination fee charged when UCD is minted via LIT Action (mintFee > 0). */
export interface MintingFeeEvent {
    id: string;
    positionId: string;
    borrower: string;
    feeAmount: string;
    mintAmount: string;
    newDebt: string;
    btcPrice: string;
    quantumTimestamp: string;
    timestamp: string;
    blockNumber: string;
    transactionHash: string;
    logIndex: string;
}
/** Extension fee charged when a position term is renewed (extensionFee > 0). */
export interface RenewalFeeEvent {
    id: string;
    positionId: string;
    borrower: string;
    feeAmount: string;
    extensionTerm: string;
    newExpiryDate: string;
    timestamp: string;
    blockNumber: string;
    transactionHash: string;
    logIndex: string;
}
/** Position-level collateral manager outcomes (POSITION_CLOSED, NETWORK_FEE_DEDUCTED) */
export interface CollateralContractEvent {
    id: string;
    positionId: string;
    eventType: string;
    networkFee?: string;
    remainingCollateral?: string;
    collateralRatio?: string;
    timestamp: string;
    blockNumber: string;
    transactionHash: string;
    logIndex: string;
}
/**
 * Aggregate container for all position-scoped loan events.
 * Protocol-global admin events (circuit breaker, term fees, price bounds, etc.)
 * are available via sdk.getAllEvents({ kinds: ['admin'] }).
 */
export interface LoanEvents {
    positionId: string;
    positionCreated?: PositionCreatedEvent;
    payments: PaymentEvent[];
    statusUpdates: StatusUpdateEvent[];
    liquidation?: LiquidationEvent;
    mints: UCDMintEvent[];
    withdrawals: WithdrawalEvent[];
    renewals: RenewalEvent[];
    operationFailures: OperationFailureEvent[];
    mintRequests: MintRequestEvent[];
    burnRequests: BurnRequestEvent[];
    collateralEvents: CollateralContractEvent[];
    /** Origination fees charged on UCD mints. Populated when the subgraph indexes MintingFeeEvent. */
    mintingFees: MintingFeeEvent[];
    /** Extension fees charged on position renewals. Populated when the subgraph indexes RenewalFeeEvent. */
    renewalFees: RenewalFeeEvent[];
    totalEvents: number;
}
export interface LoanEventsFilter {
    eventTypes?: Array<'positionCreated' | 'payment' | 'status' | 'liquidation' | 'mint' | 'withdrawal' | 'renewal' | 'operationFailure' | 'mintRequest' | 'burnRequest' | 'collateralEvent' | 'mintingFee' | 'renewalFee'>;
    fromTimestamp?: string;
    toTimestamp?: string;
    fromBlock?: string;
    toBlock?: string;
    limit?: number;
    orderDirection?: 'asc' | 'desc';
}
export declare function isValidPositionStatus(status: string): status is PositionStatus;
export declare function isValidPaymentType(type: string): type is PaymentType;
export declare function numericToPositionStatus(status: number): PositionStatus;
export declare const EventHelpers: {
    sortByTimestamp<T extends {
        timestamp: string;
    }>(events: T[], direction?: "asc" | "desc"): T[];
    filterByTimestamp<T extends {
        timestamp: string;
    }>(events: T[], fromTimestamp?: string, toTimestamp?: string): T[];
    filterByBlock<T extends {
        blockNumber: string;
    }>(events: T[], fromBlock?: string, toBlock?: string): T[];
    getTotalCount(events: LoanEvents): number;
    getAllEventsSorted(events: LoanEvents, direction?: "asc" | "desc"): Array<(PositionCreatedEvent & {
        eventType: "positionCreated";
    }) | (PaymentEvent & {
        eventType: "payment";
    }) | (StatusUpdateEvent & {
        eventType: "status";
    }) | (LiquidationEvent & {
        eventType: "liquidation";
    }) | (UCDMintEvent & {
        eventType: "mint";
    }) | (WithdrawalEvent & {
        eventType: "withdrawal";
    }) | (RenewalEvent & {
        eventType: "renewal";
    }) | (OperationFailureEvent & {
        eventType: "operationFailure";
    }) | (MintRequestEvent & {
        eventType: "mintRequest";
    }) | (BurnRequestEvent & {
        eventType: "burnRequest";
    }) | (CollateralContractEvent & {
        eventType: "collateralEvent";
    }) | (MintingFeeEvent & {
        eventType: "mintingFee";
    }) | (RenewalFeeEvent & {
        eventType: "renewalFee";
    })>;
};
