import { Provider } from '@ethersproject/providers'; import { RequestState } from '../domain/requests'; import { DataService } from '../services/DataService/data-service'; import { Portfolio } from '../services/Portfolio/portfolio'; import { UserRequest } from '../services/UserLending/types'; import { UserLending } from '../services/UserLending/user-lending'; import { UserPositions } from './types'; /** * High-level facade for querying a user's portfolio, positions, and history. * * Orchestrates DataService, UserLending, and Portfolio services so the caller * only needs to provide a wallet address. */ export declare class PortfolioFacade { private _dataService; private _userLending; private _portfolio; constructor(_dataService: DataService, _userLending: UserLending, _portfolio: Portfolio); /** * Fetch a user's complete portfolio: per-pool positions and aggregate summary. * * ```ts * const positions = await kasu.portfolio.getPositions('0xUser...'); * console.log(positions.summary.current.totalLendingPoolInvestments); * ``` * * @param userAddress - Wallet address. * @param provider - Optional separate provider for balance queries (useful when the * SDK was initialised with a Signer but you need a read-only provider). */ getPositions(userAddress: string, provider?: Provider): Promise; /** * Fetch a user's full transaction history (deposits, withdrawals, cancellations). */ getTransactionHistory(userAddress: `0x${string}`): Promise; /** * The same history, already derived into `RequestState` rows — status * code, kind, signed amount, the cancelled-amount recovery, the bundled * submission count and the cycle-open signal. * * ```ts * const rows = await kasu.portfolio.getRequestStates('0xUser...'); * rows.filter((r) => r.statusCode === 'pending'); * ``` * * Every application derives this from `getTransactionHistory` anyway, and * the derivation is the part they were each getting subtly differently. * Words are still the caller's: render `statusCode` in your own * vocabulary, and call `getTrancheDisplayName` on `trancheName` at the * view boundary. */ getRequestStates(userAddress: `0x${string}`): Promise; }