import { ChartBundle, ChartRange, PoolPositionChartMetric, StrategyPositionChartMetric } from "../../model/charts.js"; import { Position, PositionKey, PositionTransaction, PositionsTotals, StrategyPositionKey } from "../../model/positions.js"; import { DataResponse } from "../../model/response.js"; import { ListPositionsPropsBase } from "../../onchain/positions/types.js"; import { Address } from "viem"; //#region src/offchain/positions/types.d.ts export type PositionChartMetricFor = { pool: PoolPositionChartMetric; strategy: StrategyPositionChartMetric; }[K["kind"]]; /** * Backend counterpart of the `positions` namespace. **/ export interface IOffchainPositions { /** * Everything a wallet holds, optionally narrowed by the filter on * {@link ListPositionsPropsBase}. **/ list(props: ListPositionsPropsBase): Promise>; /** * Aggregate over everything a wallet holds, see {@link PositionsTotals}. **/ getTotals(wallet: Address): Promise>; /** * Charts of one position: one series per metric, on a shared grid. **/ getCharts[]>(key: K, metrics: Metrics, range: ChartRange): Promise>>; /** * Every transaction that touched the credit account while its current * session was open, newest first. There is no paging, and an account with * no open session answers with an empty list. **/ getTransactions(key: StrategyPositionKey): Promise>; } //#endregion