import { KaminoMarket, KaminoObligation } from '../classes';
import { FlashBorrowType, FlashLoanInfo, SwapInputs, SwapIxsProvider, SwapQuote, SwapQuoteProvider } from '../leverage/types';
import { AddressLookupTable } from '@solana-program/address-lookup-table';
import { Account, Address, Instruction, Option, Slot, TransactionSigner } from '@solana/kit';
import Decimal from 'decimal.js';
export type RepayWithCollIxsResponse<QuoteResponse> = {
    ixs: Instruction[];
    lookupTables: Account<AddressLookupTable>[];
    flashLoanInfo: FlashLoanInfo;
    swapInputs: SwapInputs;
    initialInputs: RepayWithCollInitialInputs<QuoteResponse>;
    quote?: QuoteResponse;
};
interface RepayWithCollInitialInputsCommon<QuoteResponse> {
    /** Debt-token-denominated amount being repaid to the obligation. */
    debtRepayAmountLamports: Decimal;
    /**
     * Flash-loan repay amount in the lamports of the FLASH-BORROWED reserve.
     *  - debt-flash: debt lamports = `debtRepayAmountLamports` + flash fee.
     *  - coll-flash: coll lamports = `collSwapInLamports * (1 + collFlashLoanFee)`.
     * Use the `flashBorrowType` discriminant on the parent type to know which denomination.
     */
    flashRepayAmountLamports: Decimal;
    /**
     * The amount of collateral available to withdraw, if this is less than the swap input amount, then the swap may fail due to slippage, or tokens may be debited from the user's ATA, so the caller needs to check this
     */
    maxCollateralWithdrawLamports: Decimal;
    /**
     * The quote from the provided quoter
     */
    swapQuote: SwapQuote<QuoteResponse>;
    currentSlot: Slot;
    klendAccounts: Array<Address>;
}
export interface DebtFlashRepayWithCollInitialInputs<QuoteResponse> extends RepayWithCollInitialInputsCommon<QuoteResponse> {
    flashBorrowType: 'debt';
}
export interface CollFlashRepayWithCollInitialInputs<QuoteResponse> extends RepayWithCollInitialInputsCommon<QuoteResponse> {
    flashBorrowType: 'coll';
}
export type RepayWithCollInitialInputs<QuoteResponse> = DebtFlashRepayWithCollInitialInputs<QuoteResponse> | CollFlashRepayWithCollInitialInputs<QuoteResponse>;
interface RepayWithCollSwapInputsProps<QuoteResponse> {
    kaminoMarket: KaminoMarket;
    debtReserveAddress: Address;
    collReserveAddress: Address;
    owner: TransactionSigner;
    obligation: KaminoObligation;
    referrer: Option<Address>;
    currentSlot: Slot;
    repayAmount: Decimal;
    isClosingPosition: boolean;
    budgetAndPriorityFeeIxs?: Instruction[];
    scopeRefreshIx: Instruction[];
    useV2Ixs: boolean;
    quoter: SwapQuoteProvider<QuoteResponse>;
    /**
     * Which side to flash borrow on:
     *  - `'debt'` (default): flash borrow debt → repay+withdraw → swap coll→debt → flash repay debt.
     *  - `'coll'`: flash borrow coll → swap coll→debt → repay+withdraw → flash repay coll.
     * Useful when the default reserve has flash loans disabled or insufficient liquidity.
     */
    flashBorrowType?: FlashBorrowType;
}
export declare function getRepayWithCollSwapInputs<QuoteResponse>({ collReserveAddress, currentSlot, debtReserveAddress, kaminoMarket, owner, obligation, quoter, referrer, repayAmount, isClosingPosition, budgetAndPriorityFeeIxs, scopeRefreshIx, useV2Ixs, flashBorrowType, }: RepayWithCollSwapInputsProps<QuoteResponse>): Promise<{
    swapInputs: SwapInputs;
    flashLoanInfo: FlashLoanInfo;
    initialInputs: RepayWithCollInitialInputs<QuoteResponse>;
}>;
interface RepayWithCollIxsProps<QuoteResponse> extends RepayWithCollSwapInputsProps<QuoteResponse> {
    swapper: SwapIxsProvider<QuoteResponse>;
    logger?: (msg: string, ...extra: any[]) => void;
}
export declare function getRepayWithCollIxs<QuoteResponse>({ repayAmount, isClosingPosition, budgetAndPriorityFeeIxs, collReserveAddress, currentSlot, debtReserveAddress, kaminoMarket, owner, obligation, quoter, swapper, referrer, scopeRefreshIx, useV2Ixs, flashBorrowType, logger, }: RepayWithCollIxsProps<QuoteResponse>): Promise<Array<RepayWithCollIxsResponse<QuoteResponse>>>;
export {};
//# sourceMappingURL=repay_with_collateral_operations.d.ts.map