import { UserLendingInfo, SuiClientOption, EnvOption, Pool, Transaction as NAVITransaction, AssetIdentifier, TransactionResult, CacheOption, AccountCap, MarketOption, LendingPosition, MarketsOption, EModePool, ServiceOption } from './types.js'; import { Transaction } from '@mysten/sui/transactions'; import { CoinStruct } from '@mysten/sui/jsonRpc'; import { PoolOperator } from './pool.js'; /** * Merges multiple coins into a single coin for transaction building * * This function takes multiple coin objects and merges them into a single coin * that can be used in a transaction. It supports optional splitting to create * a specific balance amount. * * @param tx - Transaction object to add merge operations to * @param coins - Array of coin objects to merge * @param options - Optional parameters for balance splitting and gas coin usage * - `balance` - If provided, splits this amount from the resulting coin object * - `useGasCoin` - If true, uses the gas coin for the operation * - `addressBalance` - Funds held directly at the address level (v2 address * balances) for this coin type. `coins` only carries `Coin` objects, so * when they fall short of `balance` this covers the remainder. Defaults to * `0`, which preserves the legacy coin-object-only behavior exactly. * - `coinType` - Coin type used to withdraw the shortfall from the address * balance via `0x2::coin::redeem_funds`. Required for the address-balance * path; ignored when the owned coin objects already cover `balance`. * @returns Transaction result representing the merged coin */ export declare function mergeCoinsPTB(tx: Transaction, coins: ({ balance: string | number | bigint; coinObjectId: string; coinType: string; } & CoinStruct)[], options?: { balance?: number; useGasCoin?: boolean; addressBalance?: string | number | bigint; coinType?: string; }): any; /** * Calculates dynamic health factor for a user after potential operations * * This function creates a transaction call to calculate the health factor * that would result after performing supply/borrow operations. * * @param tx - Transaction object to append calculation to * @param address - User address or transaction result * @param identifier - Asset identifier * @param estimatedSupply - Estimated supply amount * @param estimatedBorrow - Estimated borrow amount * @param isIncrease - Whether this is an increase operation * @param options - Environment options * @returns Transaction result for health factor calculation */ export declare function getSimulatedHealthFactorPTB(tx: Transaction, address: string | AccountCap | TransactionResult, identifier: AssetIdentifier, estimatedSupply: number | TransactionResult, estimatedBorrow: number | TransactionResult, isIncrease: boolean | TransactionResult, options?: Partial): Promise; /** * Gets the current health factor for a user * * @param tx - The transaction object to add health factor query operation to * @param address - User address or account cap or transaction result * @param options - Environment options * @returns Transaction result for health factor calculation */ export declare function getHealthFactorPTB(tx: Transaction, address: string | AccountCap | TransactionResult, options?: Partial): Promise; /** * Retrieves the current lending state for a user * * This function fetches all active lending positions for a user, including * supply and borrow balances for different assets. * * @param address - User wallet address or account cap * @param options - Options for client, environment, and caching * @returns Promise - Array of user lending positions */ export declare const getLendingState: (address: string | AccountCap, options?: Partial) => Promise; /** * Calculates the current health factor for a user * * @param address - User wallet address or account cap * @param options - Options for client and environment * @returns Promise - Health factor value */ export declare function getHealthFactor(address: string | AccountCap, options?: Partial): Promise; /** * Calculates the health factor after performing lending operations * * This function simulates the health factor that would result after * performing a series of supply, withdraw, borrow, or repay operations. * * @param address - User wallet address or account cap * @param identifier - Asset identifier * @param operations - Array of operations to simulate * @param options - Options for client and environment * @returns Promise - Projected health factor */ export declare function getSimulatedHealthFactor(address: string | AccountCap, identifier: AssetIdentifier, operations: { type: PoolOperator; amount: number; }[], options?: Partial): Promise; /** * Retrieves transaction history for a user from the Navi protocol API * * This function fetches the transaction history for a specific user address * from the Navi protocol's open API. It supports pagination through cursor-based navigation. * * @param address - User wallet address or account cap * @param options - Optional parameters including cursor for pagination * @returns Promise with transaction data and optional cursor for next page */ export declare const getTransactions: (address: string | AccountCap, options?: { cursor?: string; } & ServiceOption) => Promise<{ data: NAVITransaction[]; cursor?: string; }>; /** * Retrieves all coins owned by a user address * * This function fetches all coin objects owned by a specific address from the Sui blockchain. * It supports filtering by coin type and handles pagination automatically to retrieve all coins. * * @param address - User wallet address * @param options - Optional parameters including coin type filter and client options * - `coinType` - If specified, retrieves only coins of this type * - `client` - If provided, uses this `SuiClient` instance instead of the default client * @returns Promise - Array of coin objects owned by the address */ export declare function getCoins(address: string, options?: Partial<{ coinType?: string; } & SuiClientOption>): Promise; export declare const getLendingPositions: (address: string, options?: Partial) => Promise; export type TokenPriceMap = Record; export declare class UserPositions { private _positions; private _priceMap; private _overview; get positions(): LendingPosition[]; get overview(): { hf: number; netVaule: string; netWorthApr: string; totalSupplyValue: string; totalBorrowValue: string; totalsupplyApy: string; totalBorrowApy: string; maxLiquidationValue: string; maxLoanToVaule: string; supply: Record; borrow: Record; }; get priceMap(): TokenPriceMap; set positions(positions: LendingPosition[]); constructor(positions: LendingPosition[], priceMap?: TokenPriceMap); updatePriceMap(priceMap: TokenPriceMap): this; private getPrice; filterPositionsByPool(pool: Pool | EModePool): UserPositions; deposit(pool: Pool | EModePool, amount: number): UserPositions; withdraw(pool: Pool | EModePool, amount: number): UserPositions; borrow(pool: Pool | EModePool, amount: number): UserPositions; repay(pool: Pool | EModePool, amount: number): UserPositions; private resolveValueUSD; getPositionsOverview(positions: LendingPosition[]): { hf: number; netVaule: string; netWorthApr: string; totalSupplyValue: string; totalBorrowValue: string; totalsupplyApy: string; totalBorrowApy: string; maxLiquidationValue: string; maxLoanToVaule: string; supply: Record; borrow: Record; }; } export declare function verifyHealthFactorPTB(tx: Transaction, address: string | AccountCap | TransactionResult, hf: number, options?: Partial): Promise; //# sourceMappingURL=account.d.ts.map