import { ChartBundle, ChartRange, ProtocolChartMetric } from "../../model/charts.js"; import { ChainScopedFilter } from "../../model/filters.js"; import { DataResponse } from "../../model/response.js"; import { IOffchainAnalyticsPositions } from "../../offchain/analytics/types.js"; import "../../offchain/index.js"; //#region src/sdk/analytics/types.d.ts /** Backend-only protocol analytics, grouped by subject. */ export interface IAnalytics { readonly positions: IOffchainAnalyticsPositions; /** * Charts of the protocol as a whole: one series per metric named, onto the * one grid that lets them be compared at an index. * * ```ts * const { data } = await sdk.analytics.charts(["tvlUsd"], "1m"); * ``` * * The series sums the chains the read covers, which are this instance's own * narrowed by `filter` — so an SDK built for one chain charts that chain, * not the protocol. **/ charts(metrics: Metrics, range: ChartRange, filter?: ChainScopedFilter): Promise>>; } /** `sdk.analytics` per mode: absent when the SDK has no backend source. */ export interface IAnalyticsByMode { onchain: undefined; offchain: IAnalytics; both: IAnalytics; } //#endregion