import { Address } from '@solana/kit'; import type { LedgerInstant } from '../utils/ledger'; import BN from 'bn.js'; import { Obligation } from '../@codegen/klend/accounts'; import { BorrowOrder, BorrowOrderConfigArgs } from '../@codegen/klend/types'; /** How many borrow orders an obligation holds, as returned by {@link borrowOrdersFromObligationState}. */ export declare const MAX_BORROW_ORDERS = 3; /** * The borrow-order slots an obligation holds, active or not. Their count is fixed by the account layout - one head * order and a two-element tail array. */ export type BorrowOrderSlots = readonly [T, T, T]; /** * The obligation's borrow orders in the index order the on-chain instructions use: the head order followed by the * tail ones. */ export declare function borrowOrdersFromObligationState(obligation: Obligation): BorrowOrderSlots; /** * Wrapper class for working with borrow orders on obligations. * Borrow orders allow users to request fixed-term loans with specific parameters. */ export declare class KaminoBorrowOrder { readonly debtLiquidityMint: Address; readonly remainingDebtAmount: BN; readonly filledDebtDestination: Address; readonly minDebtTermSeconds: BN; readonly fillableUntilTimestamp: BN; readonly maxBorrowRateBps: number; readonly enableAutoRolloverOnFilledBorrows?: boolean | undefined; readonly placedAtTimestamp?: BN | undefined; readonly lastUpdatedAtTimestamp?: BN | undefined; readonly requestedDebtAmount?: BN | undefined; constructor(debtLiquidityMint: Address, remainingDebtAmount: BN, filledDebtDestination: Address, minDebtTermSeconds: BN, fillableUntilTimestamp: BN, maxBorrowRateBps: number, enableAutoRolloverOnFilledBorrows?: boolean | undefined, placedAtTimestamp?: BN | undefined, lastUpdatedAtTimestamp?: BN | undefined, requestedDebtAmount?: BN | undefined); /** * Creates a borrow order config args for setting on an obligation */ toConfigArgs(): BorrowOrderConfigArgs; /** * Creates a KaminoBorrowOrder from existing borrow order state */ static fromExistingBorrowOrderState(borrowOrder: BorrowOrder): KaminoBorrowOrder; /** * Creates a fixed-term borrow order with common parameters */ static createFixedTermBorrowOrder(params: { debtMint: Address; amount: BN; destination: Address; termSeconds: BN; expirySeconds: BN; maxRateBps: number; enableAutoRolloverOnFilledBorrows?: boolean; currentLedgerInstant: LedgerInstant; }): KaminoBorrowOrder; /** * Creates an open-term borrow order */ static createOpenTermBorrowOrder(params: { debtMint: Address; amount: BN; destination: Address; expirySeconds: BN; currentLedgerInstant: LedgerInstant; }): KaminoBorrowOrder; /** * Creates a cancel order from an existing borrow order. * This removes the existing order */ static createCancelBorrowOrder(existing: KaminoBorrowOrder): KaminoBorrowOrder; /** * Check if the borrow order is active (has remaining debt to be filled) */ isActive(): boolean; /** * Check if the borrow order is fixed-term (has a non-zero minimum debt term), as opposed to open-term. */ isFixedTerm(): boolean; /** * Check if the borrow order has expired */ isExpired(currentTimestamp: BN): boolean; } //# sourceMappingURL=borrowOrder.d.ts.map