UNPKG

@barfinex/types

Version:

Core TypeScript type definitions and shared interfaces for the Barfinex ecosystem. Provides strongly-typed contracts for modules, services, and plugins.

46 lines 1.83 kB
import { Candle, MarketType, TimeFrame, ConnectorType, Instrument } from './'; /** * Interface representing options for requesting historical market data. */ export interface History { /** * The type of the connector to fetch data from (e.g., binance, tinkoff). */ connectorType: ConnectorType; /** * The market type for the requested historical data (e.g., spot, futures). */ marketType: MarketType; /** * Array of symbols (e.g., trading pairs like BTC/USD or stock symbols like AAPL) for which the historical data is requested. */ instruments: Instrument[]; /** * The number of days for which historical data is requested. */ days: number; /** * The time frame of the historical data (e.g., min1, h1, d1). */ interval: TimeFrame; /** * The number of gap days to skip in the historical data. * For example, if `gapDays` is 2, the data will skip every 2 days. */ gapDays: number; /** * Optional flag to disable progress tracking during the data retrieval process. */ noProgress?: boolean; } /** * Type representing a function to request historical data for a specific symbol and time frame. * * @param from - The starting timestamp (Unix time) for the historical data. * @param to - The ending timestamp (Unix time) for the historical data. * @param ticker - The symbol or ticker for which the historical data is requested (e.g., BTC/USD, AAPL). * @param interval - The time frame for the historical data (e.g., min1, h1, day). * @returns A Promise resolving to an array of candles containing the requested historical data. */ export type HistoryRequest = (from: number, to: number, ticker: string, interval: TimeFrame) => Promise<Candle[]>; //# sourceMappingURL=history.interface.d.ts.map