/**
 * Typed responses for critical Diamond Hands LIT Actions.
 *
 * These mirror the JSON payloads passed to `Lit.Actions.setResponse(...)`
 * in the lit-actions package and are intended to be used as the `TData`
 * parameter on `LitActionResult<TData>`.
 */
import type { PositionId } from "../../types/branded/ids";
/**
 * Base shape for approval-style validator responses.
 */
export interface BaseValidatorResponse {
    approved: boolean;
    positionId?: PositionId | string;
    reason?: string;
    failedStep?: string;
    timestamp: number | string;
    /**
     * Optional low-level execution error from lit-ops / LIT runtime.
     */
    error?: string;
    /**
     * Some flows attach the raw signature JSON here (service wrappers).
     */
    signature?: string;
}
/**
 * UCD Mint Validator response (ucdMintValidator).
 * Source: lit-actions/src/ucd-mint-validator.ts
 */
export interface UcdMintValidatorResponse extends BaseValidatorResponse {
    approved: true;
    mintAmount: string;
    mintFee: string;
    newDebt: string;
    newCollateral: string;
    newCollateralRatioBps: number;
    btcPrice: string;
    authorizedSpendsHash: string;
    ucdDebtHash: string;
    contractBundleHash: string;
    signature: string;
    validatorPkp: string;
    /**
     * Optional: Exact parameter values used for signing.
     * If present, SDK should use these values instead of response values
     * to ensure contract receives identical parameters that were signed.
     */
    signingParams?: {
        positionId: string;
        actionHash: string;
        authorizedSpendsHash: string;
        ucdDebtHash: string;
        contractBundleHash: string;
        btcPrice: string;
        mintAmount: string;
        mintFee: string;
        newCollateral: string;
        newDebt: string;
        timestamp: string;
    };
}
export interface UcdMintValidatorErrorResponse extends BaseValidatorResponse {
    approved: false;
}
export type UcdMintValidatorResult = UcdMintValidatorResponse | UcdMintValidatorErrorResponse;
/**
 * BTC Withdrawal Validator response (btcWithdrawal).
 * Source: lit-actions/src/btc-withdrawal.ts
 */
export interface BtcWithdrawalValidatorResponse extends BaseValidatorResponse {
    approved: true;
    actionHash: string;
    authorizedSpendsHash: string;
    ucdDebtHash: string;
    totalDeduction: string;
    remainingCollateral: string;
    newCollateralRatioBps?: number;
    destinationAddress: string;
    signature: string;
    btcPrice: string;
    /**
     * Optional UTXO fields used by enhanced BTC withdrawal flow.
     * These are populated by the LIT Action when BIP-143 validation is enabled.
     */
    utxoTxid?: string;
    utxoVout?: number;
}
export interface BtcWithdrawalValidatorErrorResponse extends BaseValidatorResponse {
    approved: false;
}
export type BtcWithdrawalValidatorResult = BtcWithdrawalValidatorResponse | BtcWithdrawalValidatorErrorResponse;
/**
 * Liquidation Validator response (liquidationValidator).
 * Source: lit-actions/src/liquidation-validator.ts
 */
export interface LiquidationValidatorResponse extends BaseValidatorResponse {
    approved: true;
    btcPrice: string;
    btcAmountSats: string;
    signature: string;
    signatureBonus: string;
    validatorPkp: string;
}
export interface LiquidationValidatorErrorResponse extends BaseValidatorResponse {
    approved: false;
}
export type LiquidationValidatorResult = LiquidationValidatorResponse | LiquidationValidatorErrorResponse;
/**
 * Extend Position Validator response (extendPositionValidator).
 * Source: lit-actions/src/extend-position-validator.ts
 */
export interface ExtendPositionValidatorResponse extends BaseValidatorResponse {
    approved: true;
    selectedTerm: number;
    btcPrice: string;
    availableBTCBalance: string;
    extensionFee: string;
    newTotalDebt: string;
    newCollateralRatioBps: string;
    signature: string;
    timestamp: number;
    quantumTimestamp: number;
    validatorPkp: string;
}
export interface ExtendPositionValidatorErrorResponse extends BaseValidatorResponse {
    approved: false;
}
export type ExtendPositionValidatorResult = ExtendPositionValidatorResponse | ExtendPositionValidatorErrorResponse;
/**
 * Process Payment Validator response (processPaymentValidator).
 * Source: lit-actions/src/process-payment-validator.ts
 */
export interface ProcessPaymentValidatorResponse extends BaseValidatorResponse {
    approved: true;
    paymentAmount: string;
    btcPrice: string;
    btcAmountSats: string;
    signature: string;
    timestamp: number;
    validatorPkp: string;
}
export interface ProcessPaymentValidatorErrorResponse extends BaseValidatorResponse {
    approved: false;
}
export type ProcessPaymentValidatorResult = ProcessPaymentValidatorResponse | ProcessPaymentValidatorErrorResponse;
/**
 * Loan vault BTC balance / deposit validator response (loanVaultBtcBalance).
 * Source: lit-actions/src/loan-vault-btc-balance.ts
 */
export interface LoanVaultBtcBalanceValidatorResponse {
    vaultAddress: string;
    vaultBalance: string;
    positionId: PositionId | string;
    btcPrice: string;
    signature: string;
    timestamp: number;
    validatorPkp: string;
}
export interface LoanVaultBtcBalanceValidatorErrorResponse {
    error: string;
    positionId: PositionId | string | null;
    timestamp: number;
}
export type LoanVaultBtcBalanceValidatorResult = LoanVaultBtcBalanceValidatorResponse | LoanVaultBtcBalanceValidatorErrorResponse;
