/* tslint:disable */ /* eslint-disable */ /** * Kalshi Trade API Manual Endpoints * Manually defined OpenAPI spec for endpoints being migrated to spec-first approach * * The version of the OpenAPI document: 3.36.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from 'url'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore import type { ErrorResponse } from '../models'; // @ts-ignore import type { GetFillsResponse } from '../models'; // @ts-ignore import type { GetHistoricalCutoffResponse } from '../models'; // @ts-ignore import type { GetMarketCandlesticksHistoricalResponse } from '../models'; // @ts-ignore import type { GetMarketResponse } from '../models'; // @ts-ignore import type { GetMarketsResponse } from '../models'; // @ts-ignore import type { GetOrdersResponse } from '../models'; // @ts-ignore import type { GetPositionsResponse } from '../models'; // @ts-ignore import type { GetTradesResponse } from '../models'; /** * HistoricalApi - axios parameter creator */ export const HistoricalApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Endpoint for getting all historical fills for the member. A fill is when a trade you have is matched. API keys restricted to a subaccount return only that subaccount\'s fills. If supplied, `subaccount` must match the key\'s restriction. Registered partners may also use a user OAuth access token with the explicitly granted read::compliance_partner scope. * @summary Get Historical Fills * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getFillsHistorical: async (ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, subaccount?: number, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/historical/fills`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication kalshiAccessSignature required await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration) // authentication kalshiAccessKey required await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration) // authentication kalshiAccessTimestamp required await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration) // authentication kalshiOauthAccessToken required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) if (ticker !== undefined) { localVarQueryParameter['ticker'] = ticker; } if (minTs !== undefined) { localVarQueryParameter['min_ts'] = minTs; } if (maxTs !== undefined) { localVarQueryParameter['max_ts'] = maxTs; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } if (subaccount !== undefined) { localVarQueryParameter['subaccount'] = subaccount; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns the archive\'s cutoff timestamps. For positions, the cutoff is the backfill horizon; visibility in the historical API waits for a buffered, whole-event handoff. ## Cutoff fields - `market_settled_ts` : Markets that **settled** before this timestamp, and their candlesticks, must be accessed via `GET /historical/markets` and `GET /historical/markets/{ticker}/candlesticks`. - `trades_created_ts` : Trades that were **filled** before this timestamp must be accessed via `GET /historical/fills`. - `orders_updated_ts` : Orders that were **canceled or fully executed** before this timestamp must be accessed via `GET /historical/orders`. Resting (active) orders are always available in `GET /portfolio/orders`. - `market_positions_last_updated_ts` : Backfill horizon for settled positions, not a guaranteed archive-visibility boundary. An event moves to `GET /historical/positions` only after its buffered handoff completes. Until then, its settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. Unsettled positions remain available in `GET /portfolio/positions`. * @summary Get Historical Cutoff Timestamps * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalCutoff: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/historical/cutoff`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Endpoint for getting data about a specific market by its ticker from the historical database. * @summary Get Historical Market * @param {string} ticker Market ticker * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalMarket: async (ticker: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'ticker' is not null or undefined assertParamExists('getHistoricalMarket', 'ticker', ticker) const localVarPath = `/historical/markets/{ticker}` .replace(`{${"ticker"}}`, encodeURIComponent(String(ticker))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Endpoint for getting markets that have been archived to the historical database. Filters are mutually exclusive. * @summary Get Historical Markets * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {string} [tickers] Filter by specific market tickers. Comma-separated list of market tickers to retrieve. * @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported. * @param {string} [seriesTicker] Filter by series ticker * @param {GetHistoricalMarketsMveFilterEnum} [mveFilter] Filter by multivariate events (combos). By default, MVE markets are included. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalMarkets: async (limit?: number, cursor?: string, tickers?: string, eventTicker?: string, seriesTicker?: string, mveFilter?: GetHistoricalMarketsMveFilterEnum, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/historical/markets`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } if (tickers !== undefined) { localVarQueryParameter['tickers'] = tickers; } if (eventTicker !== undefined) { localVarQueryParameter['event_ticker'] = eventTicker; } if (seriesTicker !== undefined) { localVarQueryParameter['series_ticker'] = seriesTicker; } if (mveFilter !== undefined) { localVarQueryParameter['mve_filter'] = mveFilter; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Endpoint for getting orders that have been archived to the historical database. API keys restricted to a subaccount return only that subaccount\'s orders. If supplied, `subaccount` must match the key\'s restriction. * @summary Get Historical Orders * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalOrders: async (ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, subaccount?: number, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/historical/orders`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication kalshiAccessSignature required await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration) // authentication kalshiAccessKey required await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration) // authentication kalshiAccessTimestamp required await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration) if (ticker !== undefined) { localVarQueryParameter['ticker'] = ticker; } if (minTs !== undefined) { localVarQueryParameter['min_ts'] = minTs; } if (maxTs !== undefined) { localVarQueryParameter['max_ts'] = maxTs; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } if (subaccount !== undefined) { localVarQueryParameter['subaccount'] = subaccount; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns settled market positions after their event completes the live-to-historical handoff. Until then, settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. The `market_positions_last_updated_ts` value on `GET /historical/cutoff` is the backfill horizon, not a guarantee that every older position has moved. Unsettled positions are available via `GET /portfolio/positions`. * @summary Get Historical Positions * @param {string} [ticker] Filter by market ticker * @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). Defaults to 0. Subaccount-restricted API keys default to their locked subaccount and must omit this parameter or pass their locked subaccount. * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalPositions: async (ticker?: string, eventTicker?: string, subaccount?: number, limit?: number, cursor?: string, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/historical/positions`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication kalshiAccessSignature required await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration) // authentication kalshiAccessKey required await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration) // authentication kalshiAccessTimestamp required await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration) if (ticker !== undefined) { localVarQueryParameter['ticker'] = ticker; } if (eventTicker !== undefined) { localVarQueryParameter['event_ticker'] = eventTicker; } if (subaccount !== undefined) { localVarQueryParameter['subaccount'] = subaccount; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Endpoint for fetching historical candlestick data for markets that have been archived from the live data set. Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day). * @summary Get Historical Market Candlesticks * @param {string} ticker Market ticker - unique identifier for the specific market * @param {number} startTs Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time. * @param {number} endTs End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time. * @param {GetMarketCandlesticksHistoricalPeriodIntervalEnum} periodInterval Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day). * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarketCandlesticksHistorical: async (ticker: string, startTs: number, endTs: number, periodInterval: GetMarketCandlesticksHistoricalPeriodIntervalEnum, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'ticker' is not null or undefined assertParamExists('getMarketCandlesticksHistorical', 'ticker', ticker) // verify required parameter 'startTs' is not null or undefined assertParamExists('getMarketCandlesticksHistorical', 'startTs', startTs) // verify required parameter 'endTs' is not null or undefined assertParamExists('getMarketCandlesticksHistorical', 'endTs', endTs) // verify required parameter 'periodInterval' is not null or undefined assertParamExists('getMarketCandlesticksHistorical', 'periodInterval', periodInterval) const localVarPath = `/historical/markets/{ticker}/candlesticks` .replace(`{${"ticker"}}`, encodeURIComponent(String(ticker))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (startTs !== undefined) { localVarQueryParameter['start_ts'] = startTs; } if (endTs !== undefined) { localVarQueryParameter['end_ts'] = endTs; } if (periodInterval !== undefined) { localVarQueryParameter['period_interval'] = periodInterval; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Endpoint for getting all historical trades for all markets. Trades that were filled before the historical cutoff are available via this endpoint. Block trades are included by default and identified by the `is_block_trade` field; use the `is_block_trade` query parameter to filter by block / non-block. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details. * @summary Get Historical Trades * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {boolean} [isBlockTrade] Filter trades by whether they are block trades. Omit to return all trades. Set to `true` to return only block trades. Set to `false` to return only non-block trades. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTradesHistorical: async (ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, isBlockTrade?: boolean, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/historical/trades`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; if (ticker !== undefined) { localVarQueryParameter['ticker'] = ticker; } if (minTs !== undefined) { localVarQueryParameter['min_ts'] = minTs; } if (maxTs !== undefined) { localVarQueryParameter['max_ts'] = maxTs; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } if (isBlockTrade !== undefined) { localVarQueryParameter['is_block_trade'] = isBlockTrade; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * HistoricalApi - functional programming interface */ export const HistoricalApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = HistoricalApiAxiosParamCreator(configuration) return { /** * Endpoint for getting all historical fills for the member. A fill is when a trade you have is matched. API keys restricted to a subaccount return only that subaccount\'s fills. If supplied, `subaccount` must match the key\'s restriction. Registered partners may also use a user OAuth access token with the explicitly granted read::compliance_partner scope. * @summary Get Historical Fills * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getFillsHistorical(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, subaccount?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getFillsHistorical(ticker, minTs, maxTs, limit, cursor, subaccount, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Returns the archive\'s cutoff timestamps. For positions, the cutoff is the backfill horizon; visibility in the historical API waits for a buffered, whole-event handoff. ## Cutoff fields - `market_settled_ts` : Markets that **settled** before this timestamp, and their candlesticks, must be accessed via `GET /historical/markets` and `GET /historical/markets/{ticker}/candlesticks`. - `trades_created_ts` : Trades that were **filled** before this timestamp must be accessed via `GET /historical/fills`. - `orders_updated_ts` : Orders that were **canceled or fully executed** before this timestamp must be accessed via `GET /historical/orders`. Resting (active) orders are always available in `GET /portfolio/orders`. - `market_positions_last_updated_ts` : Backfill horizon for settled positions, not a guaranteed archive-visibility boundary. An event moves to `GET /historical/positions` only after its buffered handoff completes. Until then, its settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. Unsettled positions remain available in `GET /portfolio/positions`. * @summary Get Historical Cutoff Timestamps * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getHistoricalCutoff(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getHistoricalCutoff(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Endpoint for getting data about a specific market by its ticker from the historical database. * @summary Get Historical Market * @param {string} ticker Market ticker * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getHistoricalMarket(ticker: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getHistoricalMarket(ticker, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Endpoint for getting markets that have been archived to the historical database. Filters are mutually exclusive. * @summary Get Historical Markets * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {string} [tickers] Filter by specific market tickers. Comma-separated list of market tickers to retrieve. * @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported. * @param {string} [seriesTicker] Filter by series ticker * @param {GetHistoricalMarketsMveFilterEnum} [mveFilter] Filter by multivariate events (combos). By default, MVE markets are included. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getHistoricalMarkets(limit?: number, cursor?: string, tickers?: string, eventTicker?: string, seriesTicker?: string, mveFilter?: GetHistoricalMarketsMveFilterEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getHistoricalMarkets(limit, cursor, tickers, eventTicker, seriesTicker, mveFilter, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Endpoint for getting orders that have been archived to the historical database. API keys restricted to a subaccount return only that subaccount\'s orders. If supplied, `subaccount` must match the key\'s restriction. * @summary Get Historical Orders * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getHistoricalOrders(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, subaccount?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getHistoricalOrders(ticker, minTs, maxTs, limit, cursor, subaccount, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Returns settled market positions after their event completes the live-to-historical handoff. Until then, settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. The `market_positions_last_updated_ts` value on `GET /historical/cutoff` is the backfill horizon, not a guarantee that every older position has moved. Unsettled positions are available via `GET /portfolio/positions`. * @summary Get Historical Positions * @param {string} [ticker] Filter by market ticker * @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). Defaults to 0. Subaccount-restricted API keys default to their locked subaccount and must omit this parameter or pass their locked subaccount. * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getHistoricalPositions(ticker?: string, eventTicker?: string, subaccount?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getHistoricalPositions(ticker, eventTicker, subaccount, limit, cursor, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Endpoint for fetching historical candlestick data for markets that have been archived from the live data set. Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day). * @summary Get Historical Market Candlesticks * @param {string} ticker Market ticker - unique identifier for the specific market * @param {number} startTs Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time. * @param {number} endTs End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time. * @param {GetMarketCandlesticksHistoricalPeriodIntervalEnum} periodInterval Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day). * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMarketCandlesticksHistorical(ticker: string, startTs: number, endTs: number, periodInterval: GetMarketCandlesticksHistoricalPeriodIntervalEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getMarketCandlesticksHistorical(ticker, startTs, endTs, periodInterval, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Endpoint for getting all historical trades for all markets. Trades that were filled before the historical cutoff are available via this endpoint. Block trades are included by default and identified by the `is_block_trade` field; use the `is_block_trade` query parameter to filter by block / non-block. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details. * @summary Get Historical Trades * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {boolean} [isBlockTrade] Filter trades by whether they are block trades. Omit to return all trades. Set to `true` to return only block trades. Set to `false` to return only non-block trades. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getTradesHistorical(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, isBlockTrade?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getTradesHistorical(ticker, minTs, maxTs, limit, cursor, isBlockTrade, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath: string | undefined = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * HistoricalApi - factory interface */ export const HistoricalApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = HistoricalApiFp(configuration) return { /** * Endpoint for getting all historical fills for the member. A fill is when a trade you have is matched. API keys restricted to a subaccount return only that subaccount\'s fills. If supplied, `subaccount` must match the key\'s restriction. Registered partners may also use a user OAuth access token with the explicitly granted read::compliance_partner scope. * @summary Get Historical Fills * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getFillsHistorical(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, subaccount?: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getFillsHistorical(ticker, minTs, maxTs, limit, cursor, subaccount, options).then((request) => request(axios, basePath)); }, /** * Returns the archive\'s cutoff timestamps. For positions, the cutoff is the backfill horizon; visibility in the historical API waits for a buffered, whole-event handoff. ## Cutoff fields - `market_settled_ts` : Markets that **settled** before this timestamp, and their candlesticks, must be accessed via `GET /historical/markets` and `GET /historical/markets/{ticker}/candlesticks`. - `trades_created_ts` : Trades that were **filled** before this timestamp must be accessed via `GET /historical/fills`. - `orders_updated_ts` : Orders that were **canceled or fully executed** before this timestamp must be accessed via `GET /historical/orders`. Resting (active) orders are always available in `GET /portfolio/orders`. - `market_positions_last_updated_ts` : Backfill horizon for settled positions, not a guaranteed archive-visibility boundary. An event moves to `GET /historical/positions` only after its buffered handoff completes. Until then, its settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. Unsettled positions remain available in `GET /portfolio/positions`. * @summary Get Historical Cutoff Timestamps * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalCutoff(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getHistoricalCutoff(options).then((request) => request(axios, basePath)); }, /** * Endpoint for getting data about a specific market by its ticker from the historical database. * @summary Get Historical Market * @param {string} ticker Market ticker * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalMarket(ticker: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getHistoricalMarket(ticker, options).then((request) => request(axios, basePath)); }, /** * Endpoint for getting markets that have been archived to the historical database. Filters are mutually exclusive. * @summary Get Historical Markets * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {string} [tickers] Filter by specific market tickers. Comma-separated list of market tickers to retrieve. * @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported. * @param {string} [seriesTicker] Filter by series ticker * @param {GetHistoricalMarketsMveFilterEnum} [mveFilter] Filter by multivariate events (combos). By default, MVE markets are included. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalMarkets(limit?: number, cursor?: string, tickers?: string, eventTicker?: string, seriesTicker?: string, mveFilter?: GetHistoricalMarketsMveFilterEnum, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getHistoricalMarkets(limit, cursor, tickers, eventTicker, seriesTicker, mveFilter, options).then((request) => request(axios, basePath)); }, /** * Endpoint for getting orders that have been archived to the historical database. API keys restricted to a subaccount return only that subaccount\'s orders. If supplied, `subaccount` must match the key\'s restriction. * @summary Get Historical Orders * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalOrders(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, subaccount?: number, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getHistoricalOrders(ticker, minTs, maxTs, limit, cursor, subaccount, options).then((request) => request(axios, basePath)); }, /** * Returns settled market positions after their event completes the live-to-historical handoff. Until then, settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. The `market_positions_last_updated_ts` value on `GET /historical/cutoff` is the backfill horizon, not a guarantee that every older position has moved. Unsettled positions are available via `GET /portfolio/positions`. * @summary Get Historical Positions * @param {string} [ticker] Filter by market ticker * @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). Defaults to 0. Subaccount-restricted API keys default to their locked subaccount and must omit this parameter or pass their locked subaccount. * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalPositions(ticker?: string, eventTicker?: string, subaccount?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getHistoricalPositions(ticker, eventTicker, subaccount, limit, cursor, options).then((request) => request(axios, basePath)); }, /** * Endpoint for fetching historical candlestick data for markets that have been archived from the live data set. Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day). * @summary Get Historical Market Candlesticks * @param {string} ticker Market ticker - unique identifier for the specific market * @param {number} startTs Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time. * @param {number} endTs End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time. * @param {GetMarketCandlesticksHistoricalPeriodIntervalEnum} periodInterval Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day). * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarketCandlesticksHistorical(ticker: string, startTs: number, endTs: number, periodInterval: GetMarketCandlesticksHistoricalPeriodIntervalEnum, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getMarketCandlesticksHistorical(ticker, startTs, endTs, periodInterval, options).then((request) => request(axios, basePath)); }, /** * Endpoint for getting all historical trades for all markets. Trades that were filled before the historical cutoff are available via this endpoint. Block trades are included by default and identified by the `is_block_trade` field; use the `is_block_trade` query parameter to filter by block / non-block. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details. * @summary Get Historical Trades * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {boolean} [isBlockTrade] Filter trades by whether they are block trades. Omit to return all trades. Set to `true` to return only block trades. Set to `false` to return only non-block trades. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTradesHistorical(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, isBlockTrade?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getTradesHistorical(ticker, minTs, maxTs, limit, cursor, isBlockTrade, options).then((request) => request(axios, basePath)); }, }; }; /** * HistoricalApi - object-oriented interface */ export class HistoricalApi extends BaseAPI { /** * Endpoint for getting all historical fills for the member. A fill is when a trade you have is matched. API keys restricted to a subaccount return only that subaccount\'s fills. If supplied, `subaccount` must match the key\'s restriction. Registered partners may also use a user OAuth access token with the explicitly granted read::compliance_partner scope. * @summary Get Historical Fills * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getFillsHistorical(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, subaccount?: number, options?: RawAxiosRequestConfig) { return HistoricalApiFp(this.configuration).getFillsHistorical(ticker, minTs, maxTs, limit, cursor, subaccount, options).then((request) => request(this.axios, this.basePath)); } /** * Returns the archive\'s cutoff timestamps. For positions, the cutoff is the backfill horizon; visibility in the historical API waits for a buffered, whole-event handoff. ## Cutoff fields - `market_settled_ts` : Markets that **settled** before this timestamp, and their candlesticks, must be accessed via `GET /historical/markets` and `GET /historical/markets/{ticker}/candlesticks`. - `trades_created_ts` : Trades that were **filled** before this timestamp must be accessed via `GET /historical/fills`. - `orders_updated_ts` : Orders that were **canceled or fully executed** before this timestamp must be accessed via `GET /historical/orders`. Resting (active) orders are always available in `GET /portfolio/orders`. - `market_positions_last_updated_ts` : Backfill horizon for settled positions, not a guaranteed archive-visibility boundary. An event moves to `GET /historical/positions` only after its buffered handoff completes. Until then, its settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. Unsettled positions remain available in `GET /portfolio/positions`. * @summary Get Historical Cutoff Timestamps * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getHistoricalCutoff(options?: RawAxiosRequestConfig) { return HistoricalApiFp(this.configuration).getHistoricalCutoff(options).then((request) => request(this.axios, this.basePath)); } /** * Endpoint for getting data about a specific market by its ticker from the historical database. * @summary Get Historical Market * @param {string} ticker Market ticker * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getHistoricalMarket(ticker: string, options?: RawAxiosRequestConfig) { return HistoricalApiFp(this.configuration).getHistoricalMarket(ticker, options).then((request) => request(this.axios, this.basePath)); } /** * Endpoint for getting markets that have been archived to the historical database. Filters are mutually exclusive. * @summary Get Historical Markets * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {string} [tickers] Filter by specific market tickers. Comma-separated list of market tickers to retrieve. * @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported. * @param {string} [seriesTicker] Filter by series ticker * @param {GetHistoricalMarketsMveFilterEnum} [mveFilter] Filter by multivariate events (combos). By default, MVE markets are included. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getHistoricalMarkets(limit?: number, cursor?: string, tickers?: string, eventTicker?: string, seriesTicker?: string, mveFilter?: GetHistoricalMarketsMveFilterEnum, options?: RawAxiosRequestConfig) { return HistoricalApiFp(this.configuration).getHistoricalMarkets(limit, cursor, tickers, eventTicker, seriesTicker, mveFilter, options).then((request) => request(this.axios, this.basePath)); } /** * Endpoint for getting orders that have been archived to the historical database. API keys restricted to a subaccount return only that subaccount\'s orders. If supplied, `subaccount` must match the key\'s restriction. * @summary Get Historical Orders * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getHistoricalOrders(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, subaccount?: number, options?: RawAxiosRequestConfig) { return HistoricalApiFp(this.configuration).getHistoricalOrders(ticker, minTs, maxTs, limit, cursor, subaccount, options).then((request) => request(this.axios, this.basePath)); } /** * Returns settled market positions after their event completes the live-to-historical handoff. Until then, settled positions remain available via `GET /portfolio/positions?settlement_status=settled`. The `market_positions_last_updated_ts` value on `GET /historical/cutoff` is the backfill horizon, not a guarantee that every older position has moved. Unsettled positions are available via `GET /portfolio/positions`. * @summary Get Historical Positions * @param {string} [ticker] Filter by market ticker * @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported. * @param {number} [subaccount] Subaccount number (0 for primary, 1-63 for subaccounts). Defaults to 0. Subaccount-restricted API keys default to their locked subaccount and must omit this parameter or pass their locked subaccount. * @param {number} [limit] Number of results per page. Defaults to 100. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getHistoricalPositions(ticker?: string, eventTicker?: string, subaccount?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) { return HistoricalApiFp(this.configuration).getHistoricalPositions(ticker, eventTicker, subaccount, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } /** * Endpoint for fetching historical candlestick data for markets that have been archived from the live data set. Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day). * @summary Get Historical Market Candlesticks * @param {string} ticker Market ticker - unique identifier for the specific market * @param {number} startTs Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time. * @param {number} endTs End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time. * @param {GetMarketCandlesticksHistoricalPeriodIntervalEnum} periodInterval Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day). * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getMarketCandlesticksHistorical(ticker: string, startTs: number, endTs: number, periodInterval: GetMarketCandlesticksHistoricalPeriodIntervalEnum, options?: RawAxiosRequestConfig) { return HistoricalApiFp(this.configuration).getMarketCandlesticksHistorical(ticker, startTs, endTs, periodInterval, options).then((request) => request(this.axios, this.basePath)); } /** * Endpoint for getting all historical trades for all markets. Trades that were filled before the historical cutoff are available via this endpoint. Block trades are included by default and identified by the `is_block_trade` field; use the `is_block_trade` query parameter to filter by block / non-block. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details. * @summary Get Historical Trades * @param {string} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000. * @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page. * @param {boolean} [isBlockTrade] Filter trades by whether they are block trades. Omit to return all trades. Set to `true` to return only block trades. Set to `false` to return only non-block trades. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getTradesHistorical(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, isBlockTrade?: boolean, options?: RawAxiosRequestConfig) { return HistoricalApiFp(this.configuration).getTradesHistorical(ticker, minTs, maxTs, limit, cursor, isBlockTrade, options).then((request) => request(this.axios, this.basePath)); } } export const GetHistoricalMarketsMveFilterEnum = { Exclude: 'exclude' } as const; export type GetHistoricalMarketsMveFilterEnum = typeof GetHistoricalMarketsMveFilterEnum[keyof typeof GetHistoricalMarketsMveFilterEnum]; export const GetMarketCandlesticksHistoricalPeriodIntervalEnum = { NUMBER_1: 1, NUMBER_60: 60, NUMBER_1440: 1440 } as const; export type GetMarketCandlesticksHistoricalPeriodIntervalEnum = typeof GetMarketCandlesticksHistoricalPeriodIntervalEnum[keyof typeof GetMarketCandlesticksHistoricalPeriodIntervalEnum];