import { Address, AccountMeta, Instruction, Option, Slot, TransactionSigner } from '@solana/kit';
import BN from 'bn.js';
import { ObligationType, ScopePriceRefreshConfig } from '../utils';
import { KaminoBorrowOrder } from './borrowOrder';
import { KaminoMarket } from './market';
import { KaminoObligation } from './obligation';
import { KaminoReserve } from './reserve';
import { ProgressCallbackType } from '../@codegen/klend/types';
import { Scope } from '@kamino-finance/scope-sdk';
import { ObligationOrderAtIndex } from './obligationOrder';
import { BuildDepositTxnsProps, BuildBorrowTxnsProps, BuildBorrowRolloverConfigIxsProps, BuildDepositReserveLiquidityTxnsProps, BuildRedeemReserveCollateralTxnsProps, BuildWithdrawTxnsProps, BuildWithdrawFromObligationAndEnqueueTxnsProps, BuildRepayTxnsProps, BuildDepositAndBorrowTxnsProps, BuildRefreshObligationTxnsProps, BuildRequestElevationGroupTxnsProps, BuildDepositAndWithdrawV2TxnsProps, BuildRepayAndWithdrawTxnsProps, BuildRepayAndWithdrawV2TxnsProps, BuildLiquidateTxnsProps, BuildWithdrawReferrerFeeTxnsProps, BuildDepositObligationCollateralTxnsProps, BuildDepositAndSetBorrowOrderTxnsProps, InitializeActionProps } from './actionTypes';
export type ActionType = 'deposit' | 'borrow' | 'withdraw' | 'repay' | 'mint' | 'redeem' | 'depositCollateral' | 'liquidate' | 'depositAndBorrow' | 'repayAndWithdraw' | 'refreshObligation' | 'requestElevationGroup' | 'withdrawReferrerFees' | 'repayAndWithdrawV2' | 'depositAndWithdraw' | 'withdrawAndEnqueue' | 'setBorrowOrder' | 'fillBorrowOrder';
export type AuxiliaryIx = 'setup' | 'inBetween' | 'cleanup';
export declare class KaminoAction {
    kaminoMarket: KaminoMarket;
    reserve: KaminoReserve;
    outflowReserve: KaminoReserve | undefined;
    owner: TransactionSigner;
    payer: TransactionSigner;
    obligation: KaminoObligation | ObligationType;
    referrer: Option<Address>;
    /**
     * Null unless the obligation is not passed
     */
    obligationType: ObligationType | null;
    mint: Address;
    secondaryMint?: Address;
    positions?: number;
    amount: BN;
    outflowAmount?: BN;
    computeBudgetIxs: Array<Instruction>;
    computeBudgetIxsLabels: Array<string>;
    setupIxs: Array<Instruction>;
    setupIxsLabels: Array<string>;
    luts: Array<Address>;
    inBetweenIxs: Array<Instruction>;
    inBetweenIxsLabels: Array<string>;
    lendingIxs: Array<Instruction>;
    lendingIxsLabels: Array<string>;
    postLendingIxs: Array<Instruction>;
    postLendingIxsLabels: Array<string>;
    cleanupIxs: Array<Instruction>;
    cleanupIxsLabels: Array<string>;
    refreshFarmsCleanupTxnIxs: Array<Instruction>;
    refreshFarmsCleanupTxnIxsLabels: Array<string>;
    depositReserves: Array<Address>;
    borrowReserves: Array<Address>;
    preLoadedDepositReservesSameTx: Array<Address>;
    currentSlot: Slot;
    private constructor();
    static initialize(props: InitializeActionProps): Promise<KaminoAction>;
    private static getUserAccountAddresses;
    private static loadObligation;
    static buildRefreshObligationTxns(props: BuildRefreshObligationTxnsProps): Promise<KaminoAction>;
    static buildRequestElevationGroupTxns(props: BuildRequestElevationGroupTxnsProps): Promise<KaminoAction>;
    static buildDepositTxns(props: BuildDepositTxnsProps): Promise<KaminoAction>;
    static buildDepositAndSetBorrowOrderTxns(props: BuildDepositAndSetBorrowOrderTxnsProps): Promise<KaminoAction>;
    addScopeRefreshIxs(scope: Scope, tokens: number[], scopeConfig: Address): Promise<void>;
    /**
     * Add the opt-in borrow support instructions used when creating and filling a borrow order from vaults.
     * These setup instructions mirror the borrow builder's user-metadata initialization, elevation switching,
     * and Scope refresh flow for an existing obligation.
     */
    addBorrowOrderSupportIxs(scopeRefreshConfig: ScopePriceRefreshConfig | undefined, initUserMetadata?: {
        skipInitialization: boolean;
        skipLutCreation: boolean;
    }, requestElevationGroup?: boolean, overrideElevationGroupRequest?: number): Promise<void>;
    static buildBorrowTxns(props: BuildBorrowTxnsProps): Promise<KaminoAction>;
    static buildDepositReserveLiquidityTxns(props: BuildDepositReserveLiquidityTxnsProps): Promise<KaminoAction>;
    static buildRedeemReserveCollateralTxns(props: BuildRedeemReserveCollateralTxnsProps): Promise<KaminoAction>;
    static buildDepositObligationCollateralTxns(props: BuildDepositObligationCollateralTxnsProps): Promise<KaminoAction>;
    static buildDepositAndBorrowTxns(props: BuildDepositAndBorrowTxnsProps): Promise<KaminoAction>;
    static buildDepositAndWithdrawV2Txns(props: BuildDepositAndWithdrawV2TxnsProps): Promise<KaminoAction>;
    static buildRepayAndWithdrawV2Txns(props: BuildRepayAndWithdrawV2TxnsProps): Promise<KaminoAction>;
    static buildRepayAndWithdrawTxns(props: BuildRepayAndWithdrawTxnsProps): Promise<KaminoAction>;
    static buildWithdrawTxns(props: BuildWithdrawTxnsProps): Promise<KaminoAction>;
    static buildWithdrawFromObligationAndEnqueueTxns(props: BuildWithdrawFromObligationAndEnqueueTxnsProps): Promise<KaminoAction>;
    /**
     * Build repay transactions
     * @param props - BuildRepayTxnsProps containing all required and optional parameters
     */
    static buildRepayTxns(props: BuildRepayTxnsProps): Promise<KaminoAction>;
    static buildLiquidateTxns(props: BuildLiquidateTxnsProps): Promise<KaminoAction>;
    static buildWithdrawReferrerFeeTxns(props: BuildWithdrawReferrerFeeTxnsProps): Promise<KaminoAction>;
    /**
     * Builds an instruction for setting the new state of one of the given obligation's orders.
     *
     * In other words: it will overwrite the given slot in the {@link Obligation.orders} array. This possibly includes
     * setting the `null` state (i.e. cancelling the order).
     */
    static buildSetObligationOrderIxn(owner: TransactionSigner, kaminoMarket: KaminoMarket, obligation: KaminoObligation, orderAtIndex: ObligationOrderAtIndex): Instruction;
    /**
     * Builds an instruction for the current obligation owner to initiate an ownership transfer
     * to a new owner. Once this instruction succeeds, the obligation is locked for user-facing
     * operations until the transfer is approved by the global admin and accepted by the new owner
     * (or aborted by the current owner).
     *
     * Four-step flow:
     * 1. Current owner calls this (buildInitiateObligationOwnershipTransferIxn)
     * 2. Global admin calls buildApproveObligationOwnershipTransferIxn
     * 3. New owner calls buildAcceptObligationOwnershipIxn
     *
     * Between steps 1 and 2 the current owner can also call
     * {@link buildAbortObligationOwnershipTransferIxn} to cancel.
     */
    static buildInitiateObligationOwnershipTransferIxn(owner: TransactionSigner, kaminoMarket: KaminoMarket, obligation: KaminoObligation, newOwner: Address): Instruction;
    /**
     * Builds an instruction for the global admin to approve a pending obligation ownership transfer.
     * Must be called after {@link buildInitiateObligationOwnershipTransferIxn} and before
     * {@link buildAcceptObligationOwnershipIxn}.
     *
     * `pendingOwner` must match the pending owner set on the obligation; if omitted it is read from
     * {@link KaminoObligation.state.pendingOwner}.
     */
    static buildApproveObligationOwnershipTransferIxn(globalAdmin: TransactionSigner, kaminoMarket: KaminoMarket, obligation: KaminoObligation, pendingOwner?: Address): Promise<Instruction>;
    /**
     * Builds an instruction for the pending owner (set via
     * {@link buildInitiateObligationOwnershipTransferIxn} and approved via
     * {@link buildApproveObligationOwnershipTransferIxn}) to accept and finalize the ownership transfer.
     */
    static buildAcceptObligationOwnershipIxn(pendingOwner: TransactionSigner, kaminoMarket: KaminoMarket, obligation: KaminoObligation): Instruction;
    /**
     * Builds an instruction for the current obligation owner to abort an in-progress ownership
     * transfer. Valid only while the transfer is in the Initiated state (i.e. has not yet been
     * approved by the global admin).
     */
    static buildAbortObligationOwnershipTransferIxn(owner: TransactionSigner, kaminoMarket: KaminoMarket, obligation: KaminoObligation): Instruction;
    /**
     * Builds an instruction for enqueueing a withdrawal request to the withdraw queue.
     * This is used when there isn't enough liquidity to immediately withdraw.
     */
    static buildEnqueueToWithdrawIx(owner: TransactionSigner, kaminoMarket: KaminoMarket, reserve: KaminoReserve, collateralAmount: BN, userDestinationLiquidityTa: Address, progressCallbackType?: ProgressCallbackType.None | ProgressCallbackType.KlendQueueAccountingHandlerOnKvault, progressCallbackCustomAccount0?: Option<Address>, progressCallbackCustomAccount1?: Option<Address>): Promise<Instruction>;
    /**
     * Builds an instruction for withdrawing queued liquidity (permissionless).
     * This allows anyone to process a withdraw ticket when liquidity becomes available.
     */
    static buildWithdrawQueuedLiquidityIx(payer: TransactionSigner, kaminoMarket: KaminoMarket, reserve: KaminoReserve, withdrawTicket: Address, withdrawTicketOwner: Address, userDestinationLiquidity: Address, progressCallbackProgram?: Option<Address>, progressCallbackCustomAccount0?: Option<Address>, progressCallbackCustomAccount1?: Option<Address>): Promise<Instruction>;
    /**
     * Builds instructions for setting a borrow order on an obligation.
     * Includes an idempotent ATA creation for the filled debt destination when setting an order.
     *
     * @param owner - the obligation owner and signer for the instruction
     * @param kaminoMarket - the lending market that owns the obligation
     * @param obligation - the obligation to attach the borrow order to
     * @param borrowOrder - the order to set, or null to cancel the existing order
     * @param minExpectedCurrentRemainingDebtAmount - minimum expected remaining debt amount
     */
    static buildSetBorrowOrderIxs(owner: TransactionSigner, kaminoMarket: KaminoMarket, obligation: KaminoObligation | Address, borrowOrder: KaminoBorrowOrder | null, minExpectedCurrentRemainingDebtAmount?: BN): Promise<Instruction[]>;
    /**
     * Builds an instruction for filling a borrow order on an obligation.
     * This allows lenders to provide liquidity for fixed-term loan requests.
     * @param payer - the signer paying for the transaction
     * @param kaminoMarket - the lending market that owns the obligation
     * @param obligation - the obligation that holds the borrow order
     * @param reserve - the reserve that provides the borrow liquidity
     */
    static buildFillBorrowOrderIx(payer: TransactionSigner, kaminoMarket: KaminoMarket, obligation: KaminoObligation, reserve: KaminoReserve): Promise<Instruction>;
    addDepositReserveLiquidityIx(): Promise<void>;
    addRedeemReserveCollateralIx(): Promise<void>;
    addDepositIx(): Promise<void>;
    addDepositIxV2(): Promise<void>;
    addDepositObligationCollateralIx(): Promise<void>;
    addDepositObligationCollateralIxV2(): Promise<void>;
    addBorrowIx(): Promise<void>;
    addBorrowIxV2(): Promise<void>;
    /**
     * Creates 4 instructions to configure rollover settings for fixed-rate borrows.
     *
     * @param props - BuildBorrowRolloverConfigIxsProps containing all required parameters
     * @returns Array of update obligation config instructions
     */
    static buildBorrowRolloverConfigIxs(props: BuildBorrowRolloverConfigIxsProps): Instruction[];
    private addBorrowRolloverConfigIxs;
    addWithdrawIx(collateralAmount: BN): Promise<void>;
    addWithdrawIxV2(collateralAmount: BN): Promise<void>;
    addWithdrawObligationCollateralIxV2(collateralAmount: BN): Promise<void>;
    addRepayIx(): Promise<void>;
    addRepayIxV2(): Promise<void>;
    addRepayAndWithdrawV2Ixs(withdrawCollateralAmount: BN): Promise<void>;
    addDepositAndWithdrawV2Ixs(withdrawCollateralAmount: BN): Promise<void>;
    addDepositAndBorrowIx(): Promise<void>;
    addDepositAndBorrowIxV2(): Promise<void>;
    addRepayAndWithdrawIxs(withdrawCollateralAmount: BN): Promise<void>;
    addRepayAndWithdrawIxsV2(withdrawCollateralAmount: BN): Promise<void>;
    addLiquidateIx(maxAllowedLtvOverridePercent?: number): Promise<void>;
    addLiquidateIxV2(maxAllowedLtvOverridePercent?: number): Promise<void>;
    addInBetweenIxs(action: ActionType, includeAtaIxs: boolean, requestElevationGroup: boolean, addInitObligationForFarm: boolean, useV2Ixs: boolean): Promise<void>;
    addRefreshObligation(crank: TransactionSigner): Promise<void>;
    addSupportIxsWithoutInitObligation(action: ActionType, includeAtaIxs: boolean, useV2Ixs: boolean, addAsSupportIx?: AuxiliaryIx, requestElevationGroup?: boolean, addInitObligationForFarm?: boolean, twoTokenAction?: boolean, overrideElevationGroupRequest?: number): Promise<void>;
    addSupportIxs(action: ActionType, includeAtaIxs: boolean, requestElevationGroup: boolean, addInitObligationForFarm: boolean, useV2Ixs: boolean, scopeRefreshConfig: ScopePriceRefreshConfig | undefined, initUserMetadata: {
        skipInitialization: boolean;
        skipLutCreation: boolean;
    }, twoTokenAction?: boolean, overrideElevationGroupRequest?: number): Promise<void>;
    private getSupportScopeRefreshReserves;
    private addSupportScopeRefreshIxs;
    private maybeAddUserMetadataIxs;
    private addBorrowElevationSupportIxs;
    private getBorrowElevationGroupRequest;
    private getPreferredElevationGroupForBorrowPair;
    private static optionalAccount;
    private addRefreshReserveIxs;
    static getRefreshAllReserves(kaminoMarket: KaminoMarket, reserves: Address[]): Instruction[];
    private addRefreshObligationIx;
    private addRequestElevationIx;
    private addRefreshFarmsForReserve;
    private addRefreshFarmsCleanupTxnIxsToCleanupIxs;
    private addInitObligationForFarm;
    private addInitObligationIxs;
    private addInitUserMetadataIxs;
    private addInitReferrerTokenStateIx;
    private addWithdrawReferrerFeesIxs;
    private addComputeBudgetIx;
    private addAtaIxs;
    private updateWSOLAccount;
    static initializeMultiTokenAction(kaminoMarket: KaminoMarket, action: ActionType, inflowAmount: string | BN, inflowReserveAddress: Address, outflowReserveAddress: Address, signer: TransactionSigner, obligationOwner: Address, obligation: KaminoObligation | ObligationType, outflowAmount?: string | BN, referrer?: Option<Address>, currentSlot?: Slot): Promise<KaminoAction>;
    static initializeWithdrawReferrerFees(reserveAddress: Address, owner: TransactionSigner, kaminoMarket: KaminoMarket, currentSlot?: Slot): Promise<{
        axn: KaminoAction;
        createAtaIxs: Instruction<string, readonly (AccountMeta<string> | import("@solana/kit").AccountLookupMeta<string, string>)[]>[];
    }>;
    getWithdrawCollateralAmount(reserve: KaminoReserve, amount: BN): BN;
    getObligationPda(): Promise<Address>;
    isObligationInitialized(): boolean;
    getAdditionalDepositReservesList(): Address[];
    private static getReferrerMetadataAccount;
    private getReferrerTokenStateAccountMeta;
    private getReferrerTokenStateAddress;
    getUserTokenAccountAddress(reserve: KaminoReserve): Promise<Address>;
    getTokenAccountAddressByUser(reserve: KaminoReserve, user: Address): Promise<Address>;
    getUserCollateralAccountAddress(reserve: KaminoReserve): Promise<Address>;
    static actionToIxs(action: KaminoAction): Array<Instruction>;
    static actionToLendingIxs(action: KaminoAction): Array<Instruction>;
    static actionToIxLabels(action: KaminoAction): Array<string>;
    static actionToLendingIxLabels(action: KaminoAction): Array<string>;
    private static getFarmAccountsForReserve;
    private static getReferrerKey;
    private static getReferrerTokenStateAddressImpl;
}
//# sourceMappingURL=action.d.ts.map