import { Transaction, TransactionArgument, TransactionObjectInput, TransactionResult } from '@mysten/sui/transactions';
import type { EnvConfig } from '../../_envs';
export declare function init(tx: Transaction, otw: TransactionObjectInput, options?: {
env?: EnvConfig;
}): TransactionResult;
/**
* Creates a new lending market, and sets the fee receivers.
*
* The function initializes a `LendingMarket` object with empty reserves
* and obligations, a default rate limiter, and the sender as the fee receiver.
*
* It then calls the `set_fee_receivers` function to set the initial fee receiver to the creator of the market with a weight of 100.
*
* # Returns
*
* * `LendingMarketOwnerCap
` - The ownership capability for the newly created lending market.
* * `LendingMarket
` - The newly created lending market object.
*
* # Panics
*
* This function calls `set_fee_receivers`, which can panic under the following conditions:
*
* * If the `receivers` and `weights` vectors do not have the same length (EInvalidFeeReceivers).
* * If the `receivers` vector is empty (EInvalidFeeReceivers).
* * If the sum of `weights` is zero (EInvalidFeeReceivers).
*/
export declare function createLendingMarket(tx: Transaction, typeArg: string, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface RefreshReservePriceArgs {
lendingMarket: TransactionObjectInput;
u64: bigint | TransactionArgument;
clock: TransactionObjectInput;
priceInfoObject: TransactionObjectInput;
}
/**
* Deprecated tombstone — kept only because Sui's upgrade compatibility rules
* freeze a published function's signature. Pyth froze every legacy on-chain
* feed at the 2026-08-26 cutover; nothing has written to one since, so this
* now aborts unconditionally instead of silently refreshing against a
* permanently-stale price. Use `refresh_reserve_price_pro_compatible`.
*/
export declare function refreshReservePrice(tx: Transaction, typeArg: string, args: RefreshReservePriceArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface RefreshReservePriceProCompatibleArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
clock: TransactionObjectInput;
priceInfo: TransactionObjectInput;
}
/**
* `refresh_reserve_price` against the upgraded Pyth package. From the
* 2026-08-18 cutover this is the only working refresh path; the legacy one
* above can no longer be supplied with a verifiable `PriceInfoObject`, and
* is retained only because published signatures are frozen.
*/
export declare function refreshReservePriceProCompatible(tx: Transaction, typeArg: string, args: RefreshReservePriceProCompatibleArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
/** Creates a new obligation. */
export declare function createObligation(tx: Transaction, typeArg: string, lendingMarket: TransactionObjectInput, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface DepositLiquidityAndMintCtokensArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
clock: TransactionObjectInput;
deposit: TransactionObjectInput;
}
/**
* Deposits liquidity into a reserve and mints cTokens in return.
*
* This function allows a user to deposit a certain amount of a token into a reserve
* and receive cTokens, which represent their share of the reserve's assets.
* The amount of cTokens minted is proportional to the amount of liquidity deposited
* and the current cToken ratio of the reserve.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to deposit into.
* * `clock` - A reference to the `Clock` to compound interest before depositing.
* * `deposit` - The `Coin` object representing the liquidity to deposit.
*
* # Returns
*
* * `Coin>` - A `Coin` of cTokens representing the deposited liquidity and accrued interest.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The deposit amount is zero (ETooSmall).
* * The `coin_type` of the reserve does not match the type of the deposited coin (EWrongType).
* * The deposit would exceed the reserve's deposit limit (`EDepositLimitExceeded` from the `reserve` module).
* * If ctokens are outstanding but unclaimed spread fees have consumed the entire total
* supply, leaving them unbacked (`EReserveInDeficit` from the `reserve` module).
* * The minted cToken amount is zero (ETooSmall).
* * `reserve_array_index` is out of bounds.
*/
export declare function depositLiquidityAndMintCtokens(tx: Transaction, typeArgs: [string, string], args: DepositLiquidityAndMintCtokensArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface RedeemCtokensAndWithdrawLiquidityArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
clock: TransactionObjectInput;
ctokens: TransactionObjectInput;
rateLimiterExemption: TransactionObjectInput | null;
}
/**
* Redeems cTokens for the underlying liquidity.
*
* This function allows a user to redeem their cTokens for the underlying asset.
* The amount of the underlying asset received depends on the amount of cTokens redeemed
* and the current cToken ratio of the reserve.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to redeem from.
* * `clock` - A reference to the `Clock` to compound interest before redeeming.
* * `ctokens` - The `Coin` of cTokens to redeem.
* * `rate_limiter_exemption` - An optional exemption from the rate limiter.
*
* # Returns
*
* * `Coin` - A `Coin` of the underlying asset.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The amount of cTokens to redeem is zero (ETooSmall).
* * The `coin_type` of the reserve does not match the type of the cTokens (EWrongType).
* * If ctokens are outstanding but unclaimed spread fees have consumed the entire total
* supply, leaving them unbacked (`EReserveInDeficit` from the `reserve` module).
* * The redemption would violate the minimum available amount of the reserve (`EMinAvailableAmountViolated` from the `reserve` module).
* * The withdrawal amount exceeds the rate limit, and no exemption is provided.
* * The redemption would floor to zero underlying, i.e. this reserve's ctoken ratio is
* below one and the amount redeemed is below its reciprocal (ETooSmall). Refused rather
* than burning the ctokens for nothing, mirroring the deposit-side zero-mint refusal above.
* * `reserve_array_index` is out of bounds.
*/
export declare function redeemCtokensAndWithdrawLiquidity(tx: Transaction, typeArgs: [string, string], args: RedeemCtokensAndWithdrawLiquidityArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface RedeemCtokensAndWithdrawLiquidityRequestArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
clock: TransactionObjectInput;
ctokens: TransactionObjectInput;
rateLimiterExemption: TransactionObjectInput | null;
}
/**
* Creates a liquidity request to withdraw liquidity by redeeming cTokens.
*
* Initiates the process of redeeming cTokens for the underlying asset.
* It checks for rate limit exemptions, processes the withdrawal against the rate limiter if necessary,
* and then creates a `LiquidityRequest` by calling the `redeem_ctokens` function in the `reserve` module.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to redeem from.
* * `clock` - A reference to the `Clock` to compound interest before redeeming.
* * `ctokens` - The `Coin` of cTokens to redeem.
* * `rate_limiter_exemption` - An optional exemption from the rate limiter.
*
* # Returns
*
* * `LiquidityRequest` - A request to withdraw liquidity from the reserve.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The amount of cTokens to redeem is zero (ETooSmall).
* * The `coin_type` of the reserve does not match the type of the cTokens (EWrongType).
* * If ctokens are outstanding but unclaimed spread fees have consumed the entire total
* supply, leaving them unbacked (`EReserveInDeficit` from the `reserve` module).
* * The redemption would violate the minimum available amount of the reserve (`EMinAvailableAmountViolated` from the `reserve` module).
* * The withdrawal amount exceeds the rate limit, and no exemption is provided.
* * The redemption would floor to zero underlying, i.e. this reserve's ctoken ratio is
* below one and the amount redeemed is below its reciprocal (ETooSmall). Refused rather
* than burning the ctokens for nothing, mirroring the deposit-side zero-mint refusal above.
* * `reserve_array_index` is out of bounds.
*/
export declare function redeemCtokensAndWithdrawLiquidityRequest(tx: Transaction, typeArgs: [string, string], args: RedeemCtokensAndWithdrawLiquidityRequestArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface DepositCtokensIntoObligationArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
obligationOwnerCap: TransactionObjectInput;
clock: TransactionObjectInput;
deposit: TransactionObjectInput;
}
/**
* Deposits cTokens into an obligation, which can be used as collateral for borrowing.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve corresponding to the cTokens being deposited.
* * `obligation_owner_cap` - The ownership capability for the obligation.
* * `clock` - A reference to the `Clock`.
* * `deposit` - The `Coin` of cTokens to deposit.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The deposit amount is zero (ETooSmall).
* * The `coin_type` of the reserve does not match the type of the deposited cTokens (EWrongType).
* * `reserve_array_index` is out of bounds.
* * `obligation_id` is not a valid key in the `obligations` table.
*/
export declare function depositCtokensIntoObligation(tx: Transaction, typeArgs: [string, string], args: DepositCtokensIntoObligationArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface BorrowArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
obligationOwnerCap: TransactionObjectInput;
clock: TransactionObjectInput;
amount: bigint | TransactionArgument;
}
/**
* Borrows a specified amount of a token from a reserve. A fee is charged on the borrowed amount.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to borrow from.
* * `obligation_owner_cap` - The ownership capability for the obligation.
* * `clock` - A reference to the `Clock`.
* * `amount` - The amount to borrow.
*
* # Returns
*
* * `Coin` - A `Coin` of the borrowed asset.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The borrow amount is zero (ETooSmall).
* * The `coin_type` of the reserve does not match the type of the asset being borrowed (EWrongType).
* * The reserve's price is stale (`EPriceStale` from the `reserve` module).
* * The borrow would exceed the reserve's borrow limit (`EBorrowLimitExceeded` from the `reserve` module).
* * The borrow would violate the minimum available amount of the reserve (`EMinAvailableAmountViolated` from the `reserve` module).
* * The obligation has stale oracle prices.
* * The borrow amount exceeds the rate limit.
* * `reserve_array_index` is out of bounds.
* * `obligation_id` is not a valid key in the `obligations` table.
*/
export declare function borrow(tx: Transaction, typeArgs: [string, string], args: BorrowArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface CompoundInterestArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
clock: TransactionObjectInput;
}
/** Compound interest for reserve of type T */
export declare function compoundInterest(tx: Transaction, typeArg: string, args: CompoundInterestArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface RefreshObligationArgs {
lendingMarket: TransactionObjectInput;
obligationId: string | TransactionArgument;
clock: TransactionObjectInput;
}
/** Refresh the obligation's state and assert no stale oracles */
export declare function refreshObligation(tx: Transaction, typeArg: string, args: RefreshObligationArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface BorrowRequestArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
obligationOwnerCap: TransactionObjectInput;
clock: TransactionObjectInput;
amount: bigint | TransactionArgument;
}
/**
* Creates a borrow request for a specified amount of a token from a reserve. A fee is charged
* on the borrowed amount. The returned `LiquidityRequest` must be fulfilled by calling
* `fulfill_liquidity_request`.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to borrow from.
* * `obligation_owner_cap` - The ownership capability for the obligation.
* * `clock` - A reference to the `Clock`.
* * `amount` - The amount to borrow.
*
* # Returns
*
* * `LiquidityRequest` - A request that must be fulfilled to complete the borrow.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The borrow amount is zero (ETooSmall).
* * The `coin_type` of the reserve does not match the type of the asset being borrowed (EWrongType).
* * The reserve's price is stale (`EPriceStale` from the `reserve` module).
* * The borrow would exceed the reserve's borrow limit (`EBorrowLimitExceeded` from the `reserve` module).
* * The borrow would violate the minimum available amount of the reserve (`EMinAvailableAmountViolated` from the `reserve` module).
* * The obligation has stale oracle prices.
* * The borrow amount exceeds the rate limit.
* * `reserve_array_index` is out of bounds.
* * `obligation_id` is not a valid key in the `obligations` table.
*/
export declare function borrowRequest(tx: Transaction, typeArgs: [string, string], args: BorrowRequestArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface FulfillLiquidityRequestArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
liquidityRequest: TransactionObjectInput;
}
/**
* Fulfills a liquidity request from a reserve.
*
* This function is called after a liquidity request has been created by either
* `redeem_ctokens_and_withdraw_liquidity_request` or `borrow_request`. It takes the
* `LiquidityRequest` and processes it, returning the requested amount of the
* underlying asset as a `Coin`.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to fulfill the request from.
* * `liquidity_request` - The `LiquidityRequest` to be fulfilled.
*
* # Returns
*
* * `Coin` - A `Coin` of the underlying asset.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The `coin_type` of the reserve does not match the type of the liquidity request (EWrongType).
* * `reserve_array_index` is out of bounds.
*/
export declare function fulfillLiquidityRequest(tx: Transaction, typeArgs: [string, string], args: FulfillLiquidityRequestArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface WithdrawCtokensArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
obligationOwnerCap: TransactionObjectInput;
clock: TransactionObjectInput;
amount: bigint | TransactionArgument;
}
/**
* Withdraws cTokens from an obligation.
*
* This function allows a user to withdraw their cTokens from an obligation,
* making them available for redemption or transfer.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve corresponding to the cTokens being withdrawn.
* * `obligation_owner_cap` - The ownership capability for the obligation.
* * `clock` - A reference to the `Clock`.
* * `amount` - The amount of cTokens to withdraw. If `U64_MAX` is provided, the maximum possible amount will be withdrawn.
*
* # Returns
*
* * `Coin>` - A `Coin` of the withdrawn cTokens.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The withdraw amount is zero (ETooSmall).
* * The `coin_type` of the reserve does not match the type of the cTokens being withdrawn (EWrongType).
* * The obligation has stale oracle prices.
* * The withdrawal would leave the obligation in an unhealthy state.
* * `reserve_array_index` is out of bounds.
* * `obligation_id` is not a valid key in the `obligations` table.
*/
export declare function withdrawCtokens(tx: Transaction, typeArgs: [string, string], args: WithdrawCtokensArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface LiquidateArgs {
lendingMarket: TransactionObjectInput;
obligationId: string | TransactionArgument;
repayReserveArrayIndex: bigint | TransactionArgument;
withdrawReserveArrayIndex: bigint | TransactionArgument;
clock: TransactionObjectInput;
repayCoins: TransactionObjectInput;
}
/**
* Liquidates an unhealthy obligation by repaying a borrow and seizing collateral.
*
* This function allows a liquidator to repay a portion of an unhealthy obligation's
* debt in exchange for a discounted amount of their collateral. Any leftover repay
* coins are returned to the liquidator.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `obligation_id` - The ID of the obligation to liquidate.
* * `repay_reserve_array_index` - The index of the reserve to repay the debt to.
* * `withdraw_reserve_array_index` - The index of the reserve to withdraw collateral from.
* * `clock` - A reference to the `Clock`.
* * `repay_coins` - A mutable reference to the `Coin` used to repay the debt.
*
* # Returns
*
* * `(Coin>, RateLimiterExemption)` - A tuple containing the withdrawn collateral as cTokens and a rate limiter exemption.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The repay amount is zero (ETooSmall).
* * The obligation is not unhealthy.
* * The obligation has stale oracle prices.
* * The `coin_type` of the repay reserve does not match the type of the repay coin.
* * The `coin_type` of the withdraw reserve does not match the type of the withdrawn cTokens.
* * `repay_reserve_array_index` or `withdraw_reserve_array_index` are out of bounds.
* * `obligation_id` is not a valid key in the `obligations` table.
*/
export declare function liquidate(tx: Transaction, typeArgs: [string, string, string], args: LiquidateArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface RepayArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
obligationId: string | TransactionArgument;
clock: TransactionObjectInput;
maxRepayCoins: TransactionObjectInput;
}
/**
* Repays a borrow, reducing the obligation's debt and increasing the reserve's liquidity.
*
* Any leftover repay coins are returned to the caller.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to repay the debt to.
* * `obligation_id` - The ID of the obligation to repay.
* * `clock` - A reference to the `Clock`.
* * `max_repay_coins` - A mutable reference to the `Coin` used to repay the debt.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The `coin_type` of the reserve does not match the type of the repay coin (EWrongType).
* * `reserve_array_index` is out of bounds.
* * `obligation_id` is not a valid key in the `obligations` table.
*/
export declare function repay(tx: Transaction, typeArgs: [string, string], args: RepayArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface ForgiveArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
obligationId: string | TransactionArgument;
clock: TransactionObjectInput;
maxForgiveAmount: bigint | TransactionArgument;
}
/**
* Forgives a debt on an obligation, effectively reducing the borrow amount without requiring repayment.
*
* This is an admin-only function that can be used to handle bad debt or other special circumstances.
* It reduces the borrowed amount for a specific reserve within an obligation.
*
* # Arguments
*
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve for which to forgive the debt.
* * `obligation_id` - The ID of the obligation to forgive the debt for.
* * `clock` - A reference to the `Clock`.
* * `max_forgive_amount` - The maximum amount of debt to forgive.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * `obligation_id` is not a valid key in the `obligations` table.
* * The obligation has stale oracle prices.
* * The `coin_type` of the reserve does not match the type of the debt being forgiven (EWrongType).
* * `reserve_array_index` is out of bounds.
* * If the forgiveness would leave the reserve's total supply below its ctoken supply in
* scaled units (`EForgiveWouldZeroBacking` from the `reserve` module).
*/
export declare function forgive(tx: Transaction, typeArgs: [string, string], args: ForgiveArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface ClaimRewardsArgs {
lendingMarket: TransactionObjectInput;
cap: TransactionObjectInput;
clock: TransactionObjectInput;
reserveId: bigint | TransactionArgument;
rewardIndex: bigint | TransactionArgument;
isDepositReward: boolean | TransactionArgument;
}
/**
* Claims rewards earned by an obligation.
*
* This function allows an obligation owner to claim rewards that have accrued
* from either depositing or borrowing on a reserve.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `cap` - The `ObligationOwnerCap` to authorize the operation.
* * `clock` - A reference to the `Clock`.
* * `reserve_id` - The array index of the reserve that is giving out the rewards.
* * `reward_index` - The index of the reward pool to claim from.
* * `is_deposit_reward` - A boolean indicating whether to claim deposit rewards (true) or borrow rewards (false).
*
* # Returns
*
* * `Coin` - A `Coin` containing the claimed rewards.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * It will also panic if the underlying `claim_rewards_by_obligation_id` panics.
*/
export declare function claimRewards(tx: Transaction, typeArgs: [string, string], args: ClaimRewardsArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface ClaimRewardsAndDepositArgs {
lendingMarket: TransactionObjectInput;
obligationId: string | TransactionArgument;
clock: TransactionObjectInput;
rewardReserveId: bigint | TransactionArgument;
rewardIndex: bigint | TransactionArgument;
isDepositReward: boolean | TransactionArgument;
depositReserveId: bigint | TransactionArgument;
}
/**
* Claims rewards earned by an obligation and deposits them back into the obligation.
*
* This is a permissionless function that can be called by anyone to "crank" rewards for a given obligation.
* It first claims the rewards from the specified reward pool and then, if the obligation has a borrow of the
* same asset, it repays the borrow. The remaining rewards are deposited as liquidity into the specified
* reserve and the resulting CTokens are deposited into the obligation to be used as collateral.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `obligation_id` - The ID of the obligation to claim rewards for and deposit into.
* * `clock` - A reference to the `Clock`.
* * `reward_reserve_id` - The array index of the reserve that is giving out the rewards.
* * `reward_index` - The index of the reward pool to claim from.
* * `is_deposit_reward` - A boolean indicating whether to claim deposit rewards (true) or borrow rewards (false).
* * `deposit_reserve_id` - The array index of the reserve to deposit the claimed rewards into.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The reward period is not over.
* * The `coin_type` of the deposit reserve does not match the type of the reward.
* * It will also panic if the underlying `claim_rewards_by_obligation_id` or `repay` or `deposit_liquidity_and_mint_ctokens` panics.
* * If ctokens are outstanding but unclaimed spread fees have consumed the entire total
* supply, leaving them unbacked (`EReserveInDeficit` from the `reserve` module).
*
* For expired points campaign types: instead of claiming
* and depositing, force-closes the UserReward entry on the obligation. The pool reward must
* have been cancelled and drained first. deposit_reserve_id is ignored.
*/
export declare function claimRewardsAndDeposit(tx: Transaction, typeArgs: [string, string], args: ClaimRewardsAndDepositArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface InitStakerArgs {
lendingMarket: TransactionObjectInput;
lendingMarketOwnerCap: TransactionObjectInput;
suiReserveArrayIndex: bigint | TransactionArgument;
treasuryCap: TransactionObjectInput;
}
/**
* Initializes a staker for a SUI reserve.
*
* This function is used to set up a staker for a SUI reserve, which allows the reserve
* to participate in staking and earn rewards. It can only be called by the owner of the
* lending market.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
* * `sui_reserve_array_index` - The index of the SUI reserve to initialize the staker for.
* * `treasury_cap` - The `TreasuryCap` for the staker.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The reserve at `sui_reserve_array_index` is not a SUI reserve (EWrongType).
* * `sui_reserve_array_index` is out of bounds.
*/
export declare function initStaker(tx: Transaction, typeArgs: [string, string], args: InitStakerArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface RebalanceStakerArgs {
lendingMarket: TransactionObjectInput;
suiReserveArrayIndex: bigint | TransactionArgument;
systemState: TransactionObjectInput;
}
/**
* Rebalances a staker by staking or unstaking SUI to match the target staking amount.
*
* This function is a wrapper around `reserve::rebalance_staker`. It ensures that the
* lending market is on the correct version and that the specified reserve is a SUI
* reserve before proceeding with the rebalancing.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `sui_reserve_array_index` - The index of the SUI reserve to rebalance.
* * `system_state` - A mutable reference to the `SuiSystemState`.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The reserve at `sui_reserve_array_index` is not a SUI reserve (EWrongType).
* * `sui_reserve_array_index` is out of bounds.
*/
export declare function rebalanceStaker(tx: Transaction, typeArg: string, args: RebalanceStakerArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface UnstakeSuiFromStakerArgs {
lendingMarket: TransactionObjectInput;
suiReserveArrayIndex: bigint | TransactionArgument;
liquidityRequest: TransactionObjectInput;
systemState: TransactionObjectInput;
}
/**
* Unstakes SUI from a staker.
*
* This function is a wrapper around `reserve::unstake_sui_from_staker`. It ensures that the
* lending market is on the correct version and that the specified reserve is a SUI
* reserve before proceeding with the unstaking.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `sui_reserve_array_index` - The index of the SUI reserve to unstake from.
* * `liquidity_request` - A reference to the `LiquidityRequest` for the unstake.
* * `system_state` - A mutable reference to the `SuiSystemState`.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * `sui_reserve_array_index` is out of bounds.
*/
export declare function unstakeSuiFromStaker(tx: Transaction, typeArg: string, args: UnstakeSuiFromStakerArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
/** Get a reference to the lending market's reserves vector. */
export declare function reserves(tx: Transaction, typeArg: string, lendingMarket: TransactionObjectInput, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface MaxBorrowAmountArgs {
rateLimiter: TransactionObjectInput;
obligation: TransactionObjectInput;
reserve: TransactionObjectInput;
clock: TransactionObjectInput;
}
export declare function maxBorrowAmount(tx: Transaction, typeArg: string, args: MaxBorrowAmountArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface MaxWithdrawAmountArgs {
rateLimiter: TransactionObjectInput;
obligation: TransactionObjectInput;
reserve: TransactionObjectInput;
clock: TransactionObjectInput;
}
export declare function maxWithdrawAmount(tx: Transaction, typeArg: string, args: MaxWithdrawAmountArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
/** Get the obligation ID from an `ObligationOwnerCap`. */
export declare function obligationId(tx: Transaction, typeArg: string, cap: TransactionObjectInput, options?: {
env?: EnvConfig;
}): TransactionResult;
/**
* Get the array index of a reserve by its coin type.
* slow function. use sparingly.
*/
export declare function reserveArrayIndex(tx: Transaction, typeArgs: [string, string], lendingMarket: TransactionObjectInput, options?: {
env?: EnvConfig;
}): TransactionResult;
/** Get a reference to a reserve by its coin type. */
export declare function reserve(tx: Transaction, typeArgs: [string, string], lendingMarket: TransactionObjectInput, options?: {
env?: EnvConfig;
}): TransactionResult;
/**
* Seeds a `ReserveConfigBuilder` from a reserve's live on-chain config in a
* single call, so the `&ReserveConfig` `reserve::config` returns never has
* to cross a PTB command boundary into `reserve_config::from`.
*/
export declare function reserveConfigBuilder(tx: Transaction, typeArgs: [string, string], lendingMarket: TransactionObjectInput, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface ObligationArgs {
lendingMarket: TransactionObjectInput;
obligationId: string | TransactionArgument;
}
/** Get a reference to an obligation by its ID. */
export declare function obligation(tx: Transaction, typeArg: string, args: ObligationArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
/** Get the fee receiver address. */
export declare function feeReceiver(tx: Transaction, typeArg: string, lendingMarket: TransactionObjectInput, options?: {
env?: EnvConfig;
}): TransactionResult;
/** Get the amount of a rate limiter exemption. */
export declare function rateLimiterExemptionAmount(tx: Transaction, typeArgs: [string, string], exemption: TransactionObjectInput, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface MigrateArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
}
/** Migrates the lending market to the current version. */
export declare function migrate(tx: Transaction, typeArg: string, args: MigrateArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface AddReserveArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
priceInfoObject: TransactionObjectInput;
reserveConfig: TransactionObjectInput;
coinMetadata: TransactionObjectInput;
clock: TransactionObjectInput;
}
/**
* Deprecated tombstone — kept only because Sui's upgrade compatibility rules
* freeze a published function's signature. Pyth froze every legacy on-chain
* feed at the 2026-08-26 cutover; nothing has written to one since, so this
* now aborts unconditionally instead of creating a reserve seeded from a
* permanently-stale price. Use `add_reserve_pro_compatible`.
*/
export declare function addReserve(tx: Transaction, typeArgs: [string, string], args: AddReserveArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface AddReserveV2Args {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
priceInfoObject: TransactionObjectInput;
reserveConfig: TransactionObjectInput;
currency: TransactionObjectInput;
clock: TransactionObjectInput;
}
/**
* Deprecated tombstone, for the same reason as `add_reserve`. Use
* `add_reserve_v2_pro_compatible`.
*/
export declare function addReserveV2(tx: Transaction, typeArgs: [string, string], args: AddReserveV2Args, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface AddReserveProCompatibleArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
priceInfo: TransactionObjectInput;
config: TransactionObjectInput;
coinMetadata: TransactionObjectInput;
clock: TransactionObjectInput;
}
/**
* `add_reserve` against the upgraded Pyth package. Only this path can
* consume payloads after the 2026-08-18 cutover.
*/
export declare function addReserveProCompatible(tx: Transaction, typeArgs: [string, string], args: AddReserveProCompatibleArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface AddReserveV2ProCompatibleArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
priceInfo: TransactionObjectInput;
config: TransactionObjectInput;
currency: TransactionObjectInput;
clock: TransactionObjectInput;
}
/**
* `add_reserve_v2` against the upgraded Pyth package. Only this path can
* consume payloads after the 2026-08-18 cutover.
*/
export declare function addReserveV2ProCompatible(tx: Transaction, typeArgs: [string, string], args: AddReserveV2ProCompatibleArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface UpdateReserveConfigArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
config: TransactionObjectInput;
}
/**
* Updates the configuration of a reserve.
*
* This function allows the owner of the lending market to update the configuration of a specific reserve.
* It can only be called by the owner of the lending market.
*
* # Arguments
*
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to update.
* * `config` - The new configuration for the reserve.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * `reserve_array_index` is out of bounds.
* * The `coin_type` of the reserve does not match the type `T` (EWrongType).
*/
export declare function updateReserveConfig(tx: Transaction, typeArgs: [string, string], args: UpdateReserveConfigArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface SetReservePriceGuardArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
maxPriceChangeBps: bigint | TransactionArgument;
minUpdateIntervalS: bigint | TransactionArgument;
clock: TransactionObjectInput;
}
/**
* Sets a reserve's price guard, bounding how far its price and smoothed price may
* move per `min_update_interval_s`. Seeds both anchors from the reserve's current
* prices, so widening the band and refreshing is how the owner admits a genuine move.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * `reserve_array_index` is out of bounds.
* * The `coin_type` of the reserve does not match the type `T` (EWrongType).
* * The band reaches the reserve's liquidation buffer (EPriceBandAboveLiquidationBuffer).
*/
export declare function setReservePriceGuard(tx: Transaction, typeArgs: [string, string], args: SetReservePriceGuardArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface ChangeReservePriceFeedArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
u64: bigint | TransactionArgument;
priceInfoObject: TransactionObjectInput;
clock: TransactionObjectInput;
}
/**
* Deprecated tombstone — kept only because Sui's upgrade compatibility rules
* freeze a published function's signature. Pyth froze every legacy on-chain
* feed at the 2026-08-26 cutover; nothing has written to one since, so this
* now aborts unconditionally instead of repointing a reserve at a
* permanently-stale feed. Use `change_reserve_price_feed_pro_compatible`.
*/
export declare function changeReservePriceFeed(tx: Transaction, typeArgs: [string, string], args: ChangeReservePriceFeedArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface ChangeReservePriceFeedProCompatibleArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
priceInfoObj: TransactionObjectInput;
clock: TransactionObjectInput;
}
/**
* `change_reserve_price_feed` against the upgraded Pyth package. Same
* owner-cap gate and coin-type check; only the object's package differs.
*/
export declare function changeReservePriceFeedProCompatible(tx: Transaction, typeArgs: [string, string], args: ChangeReservePriceFeedProCompatibleArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface AddPoolRewardArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
isDepositReward: boolean | TransactionArgument;
rewards: TransactionObjectInput;
startTimeMs: bigint | TransactionArgument;
endTimeMs: bigint | TransactionArgument;
clock: TransactionObjectInput;
}
/**
* Adds a new reward pool to a reserve for either deposits or borrows.
*
* This function allows the owner of the lending market to incentivize users by adding rewards
* to a specific reserve. The rewards are distributed over a specified time period.
*
* # Arguments
*
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to add the reward pool to.
* * `is_deposit_reward` - A boolean indicating whether the reward is for deposits (`true`) or borrows (`false`).
* * `rewards` - The `Coin` containing the total amount of rewards to be distributed.
* * `start_time_ms` - The timestamp in milliseconds when the reward distribution starts.
* * `end_time_ms` - The timestamp in milliseconds when the reward distribution ends.
* * `clock` - A reference to the `Clock`.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * `reserve_array_index` is out of bounds.
* * The underlying `liquidity_mining::add_pool_reward` function panics (e.g., if `start_time_ms` >= `end_time_ms` or reward amount is zero).
*/
export declare function addPoolReward(tx: Transaction, typeArgs: [string, string], args: AddPoolRewardArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface CancelPoolRewardArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
isDepositReward: boolean | TransactionArgument;
rewardIndex: bigint | TransactionArgument;
clock: TransactionObjectInput;
}
/**
* Cancels a reward pool from a reserve.
*
* This is an admin-only function that allows the lending market owner to cancel a reward pool
* that is currently active. When a reward pool is cancelled, any unallocated rewards are
* returned to the owner.
*
* # Arguments
*
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to cancel the reward pool from.
* * `is_deposit_reward` - A boolean indicating whether the reward is for deposits (`true`) or borrows (`false`).
* * `reward_index` - The index of the reward pool to cancel.
* * `clock` - A reference to the `Clock`.
*
* # Returns
*
* * `Coin` - A `Coin` containing the unallocated rewards from the cancelled pool.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * `reserve_array_index` is out of bounds.
* * The underlying `liquidity_mining::cancel_pool_reward` function panics.
*/
export declare function cancelPoolReward(tx: Transaction, typeArgs: [string, string], args: CancelPoolRewardArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface ClosePoolRewardArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
isDepositReward: boolean | TransactionArgument;
rewardIndex: bigint | TransactionArgument;
clock: TransactionObjectInput;
}
/**
* Closes a reward pool from a reserve after its distribution period has ended.
*
* This is an admin-only function that allows the lending market owner to close a reward pool
* that has finished distributing rewards. When a reward pool is closed, any unallocated rewards
* due to rounding or other factors are returned to the owner. This function can only be called
* after the pool's `end_time_ms` has passed.
*
* # Arguments
*
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to close the reward pool from.
* * `is_deposit_reward` - A boolean indicating whether the reward is for deposits (`true`) or borrows (`false`).
* * `reward_index` - The index of the reward pool to close.
* * `clock` - A reference to the `Clock`.
*
* # Returns
*
* * `Coin` - A `Coin` containing the unallocated rewards from the closed pool.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * `reserve_array_index` is out of bounds.
* * The underlying `liquidity_mining::close_pool_reward` function panics (e.g., if the reward period is not over).
*/
export declare function closePoolReward(tx: Transaction, typeArgs: [string, string], args: ClosePoolRewardArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface DrainPointsRewardArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
isDepositReward: boolean | TransactionArgument;
rewardIndex: bigint | TransactionArgument;
clock: TransactionObjectInput;
}
/**
* Drains all remaining balance from a Suilend/Steamm points reward after its period has ended.
* UserReward entries are cleaned up when users next interact with the protocol.
* cancel_pool_reward must be called first to stop accumulation, then drain_points_reward to reclaim the remaining balance.
*/
export declare function drainPointsReward(tx: Transaction, typeArgs: [string, string], args: DrainPointsRewardArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface UpdateRateLimiterConfigArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
clock: TransactionObjectInput;
config: TransactionObjectInput;
}
/**
* Updates the rate limiter configuration.
*
* This is an admin-only function that allows the lending market owner to update the rate
* limiter configuration. The new configuration will replace the existing one.
*
* # Arguments
*
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `clock` - A reference to the `Clock` to get the current timestamp.
* * `config` - The new `RateLimiterConfig` to apply.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
*/
export declare function updateRateLimiterConfig(tx: Transaction, typeArg: string, args: UpdateRateLimiterConfigArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface SetFeeReceiversArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
receivers: Array | TransactionArgument;
weights: Array | TransactionArgument;
}
/**
* Sets the fee receivers for the lending market.
*
* This is an admin-only function that allows the lending market owner to set the fee receivers
* and their respective weights for distributing protocol fees. The fees are distributed
* proportionally based on these weights.
*
* # Arguments
*
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `receivers` - A vector of addresses that will receive the fees.
* * `weights` - A vector of weights corresponding to each receiver.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The `receivers` and `weights` vectors do not have the same length (EInvalidFeeReceivers).
* * The `receivers` vector is empty (EInvalidFeeReceivers).
* * The sum of `weights` is zero (EInvalidFeeReceivers).
*/
export declare function setFeeReceivers(tx: Transaction, typeArg: string, args: SetFeeReceiversArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface ClaimFeesArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
systemState: TransactionObjectInput;
}
/**
* Claims the fees from a reserve and distributes them to the fee receivers.
*
* This is a permissionless entry function that can be called by anyone to trigger the
* distribution of accumulated protocol fees from a specific reserve. The fees, which
* can be in both the underlying asset and cTokens, are transferred to the fee receivers
* according to the weights configured via `set_fee_receivers`.
*
* # Arguments
*
* * `lending_market` - A mutable reference to the `LendingMarket`.
* * `reserve_array_index` - The index of the reserve to claim fees from.
* * `system_state` - A mutable reference to the `SuiSystemState`, required for claiming staking rewards.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The generic type `T` does not match the coin type of the reserve at `reserve_array_index` (EWrongType).
* * `reserve_array_index` is out of bounds.
* * The `FeeReceivers` dynamic field has not been set on the lending market.
*/
export declare function claimFees(tx: Transaction, typeArgs: [string, string], args: ClaimFeesArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface NewObligationOwnerCapArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
obligationId: string | TransactionArgument;
}
/**
* Creates a new obligation owner cap for an existing obligation.
*
* This is an admin-only function that allows the lending market owner to create a new
* `ObligationOwnerCap` for an obligation that already exists. This can be useful for
* recovery purposes or administrative actions where a new capability object is needed.
*
* # Arguments
*
* * `_` - The `LendingMarketOwnerCap` to authorize the operation.
* * `lending_market` - A reference to the `LendingMarket`.
* * `obligation_id` - The ID of the obligation to create a new owner cap for.
*
* # Returns
*
* * `ObligationOwnerCap` - The newly created ownership capability for the specified obligation.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * The `obligation_id` is not found in the lending market's obligations (EInvalidObligationId).
*/
export declare function newObligationOwnerCap(tx: Transaction, typeArg: string, args: NewObligationOwnerCapArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface NewPauseCapArgs {
lendingMarketOwnerCap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
recipient: string | TransactionArgument;
}
/**
* Mints a fresh `EmergencyPauseCap` at the next generation, revoking every
* previously-issued cap for this market (their `generation` no longer matches).
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
*/
export declare function newPauseCap(tx: Transaction, typeArg: string, args: NewPauseCapArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface SetMarketPausedArgs {
cap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
paused: boolean | TransactionArgument;
}
/**
* Pauses or resumes the entire market. Gated on possession of the
* current-generation `EmergencyPauseCap`; a cap from a superseded generation aborts.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * `cap` was not minted for this `lending_market` (EWrongLendingMarket).
* * `cap`'s generation has been superseded by a later `new_pause_cap` call (EStalePauseCap).
*/
export declare function setMarketPaused(tx: Transaction, typeArg: string, args: SetMarketPausedArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface SetReservePausedArgs {
cap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
paused: boolean | TransactionArgument;
}
/**
* Pauses or resumes a single reserve. Gated on possession of the current-generation
* `EmergencyPauseCap`; a cap from a superseded generation aborts.
*
* # Panics
*
* This function will panic if:
* * The `lending_market` version is not `CURRENT_VERSION` (EIncorrectVersion).
* * `cap` was not minted for this `lending_market` (EWrongLendingMarket).
* * `cap`'s generation has been superseded by a later `new_pause_cap` call (EStalePauseCap).
* * `reserve_array_index` is out of bounds.
*/
export declare function setReservePaused(tx: Transaction, typeArg: string, args: SetReservePausedArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
/**
* True if the market has been paused. Absent the dynamic field, the market is
* unpaused. Pure: no aborts, no side effects. Public so a UI or bot can check
* pause state before building a PTB, instead of discovering it as an abort.
*/
export declare function isMarketPaused(tx: Transaction, typeArg: string, lendingMarket: TransactionObjectInput, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface AssertValidPauseCapArgs {
cap: TransactionObjectInput;
lendingMarket: TransactionObjectInput;
}
export declare function assertValidPauseCap(tx: Transaction, typeArg: string, args: AssertValidPauseCapArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface AssertNotPausedArgs {
lendingMarket: TransactionObjectInput;
reserve: TransactionObjectInput;
}
export declare function assertNotPaused(tx: Transaction, typeArg: string, args: AssertNotPausedArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface DepositCtokensIntoObligationByIdArgs {
lendingMarket: TransactionObjectInput;
reserveArrayIndex: bigint | TransactionArgument;
obligationId: string | TransactionArgument;
clock: TransactionObjectInput;
deposit: TransactionObjectInput;
}
export declare function depositCtokensIntoObligationById(tx: Transaction, typeArgs: [string, string], args: DepositCtokensIntoObligationByIdArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface ClaimRewardsByObligationIdArgs {
lendingMarket: TransactionObjectInput;
obligationId: string | TransactionArgument;
clock: TransactionObjectInput;
reserveId: bigint | TransactionArgument;
rewardIndex: bigint | TransactionArgument;
isDepositReward: boolean | TransactionArgument;
failIfRewardPeriodNotOver: boolean | TransactionArgument;
}
export declare function claimRewardsByObligationId(tx: Transaction, typeArgs: [string, string], args: ClaimRewardsByObligationIdArgs, options?: {
env?: EnvConfig;
}): TransactionResult;
export interface AddReserveInternalProCompatibleArgs {
lendingMarket: TransactionObjectInput;
priceInfo: TransactionObjectInput;
config: TransactionObjectInput;
decimals: number | TransactionArgument;
clock: TransactionObjectInput;
}
export declare function addReserveInternalProCompatible(tx: Transaction, typeArgs: [string, string], args: AddReserveInternalProCompatibleArgs, options?: {
env?: EnvConfig;
}): TransactionResult;