"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertDepositCollFlashCalcs = assertDepositCollFlashCalcs;
exports.assertDepositDebtFlashCalcs = assertDepositDebtFlashCalcs;
exports.assertWithdrawDebtFlashCalcs = assertWithdrawDebtFlashCalcs;
exports.assertWithdrawCollFlashCalcs = assertWithdrawCollFlashCalcs;
exports.assertAdjustIncreaseCollFlashCalcs = assertAdjustIncreaseCollFlashCalcs;
exports.assertAdjustIncreaseDebtFlashCalcs = assertAdjustIncreaseDebtFlashCalcs;
exports.assertAdjustDecreaseDebtFlashCalcs = assertAdjustDecreaseDebtFlashCalcs;
exports.assertAdjustDecreaseCollFlashCalcs = assertAdjustDecreaseCollFlashCalcs;
function assertDepositCollFlashCalcs(calcs) {
    if (!('flashBorrowInCollToken' in calcs)) {
        throw new Error('Expected DepositLeverageCalcsResult for coll flash deposit path');
    }
}
function assertDepositDebtFlashCalcs(calcs) {
    if (!('flashBorrowInDebtToken' in calcs)) {
        throw new Error('Expected DepositLeverageDebtFlashCalcsResult for debt flash deposit path');
    }
}
function assertWithdrawDebtFlashCalcs(calcs) {
    // WithdrawLeverageCalcsResult is the legacy/bare debt-flash shape; coll flash is the only withdraw variant
    // with an explicit discriminator field today.
    if ('flashBorrowInCollToken' in calcs) {
        throw new Error('Expected WithdrawLeverageCalcsResult for debt flash withdraw path');
    }
}
function assertWithdrawCollFlashCalcs(calcs) {
    if (!('flashBorrowInCollToken' in calcs)) {
        throw new Error('Expected WithdrawLeverageCollFlashCalcsResult for coll flash withdraw path');
    }
}
function assertAdjustLeverageCalcs(calcs, message) {
    if (!('borrowAmount' in calcs)) {
        throw new Error(message);
    }
}
function assertAdjustIncreaseCollFlashCalcs(calcs) {
    assertAdjustLeverageCalcs(calcs, 'Expected AdjustLeverageCalcsResult for coll flash increase path');
}
function assertAdjustIncreaseDebtFlashCalcs(calcs) {
    if (!('flashBorrowInDebtToken' in calcs)) {
        throw new Error('Expected AdjustDepositDebtFlashCalcsResult for debt flash increase path');
    }
}
function assertAdjustDecreaseDebtFlashCalcs(calcs) {
    assertAdjustLeverageCalcs(calcs, 'Expected AdjustLeverageCalcsResult for debt flash decrease path');
}
function assertAdjustDecreaseCollFlashCalcs(calcs) {
    if (!('flashBorrowInCollToken' in calcs)) {
        throw new Error('Expected AdjustWithdrawCollFlashCalcsResult for coll flash decrease path');
    }
}
//# sourceMappingURL=operationGuards.js.map