UNPKG

kalshi-typescript

Version:
340 lines (339 loc) 27.4 kB
/** * Kalshi Trade API Manual Endpoints * Manually defined OpenAPI spec for endpoints being migrated to spec-first approach * * The version of the OpenAPI document: 3.11.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 { type RequestArgs, BaseAPI } from '../base'; import type { GetFillsResponse } from '../models'; import type { GetHistoricalCutoffResponse } from '../models'; import type { GetMarketCandlesticksHistoricalResponse } from '../models'; import type { GetMarketResponse } from '../models'; import type { GetMarketsResponse } from '../models'; import type { GetOrdersResponse } from '../models'; import type { GetTradesResponse } from '../models'; /** * HistoricalApi - axios parameter creator */ export declare const HistoricalApiAxiosParamCreator: (configuration?: Configuration) => { /** * Endpoint for getting all historical fills for the member. A fill is when a trade you have is matched. * @summary Get Historical Fills * @param {string} [ticker] Filter by market ticker * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 200. * @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} */ getFillsHistorical: (ticker?: string, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * Returns the cutoff timestamps that define the boundary between **live** and **historical** data. ## 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`. * @summary Get Historical Cutoff Timestamps * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalCutoff: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * 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) => Promise<RequestArgs>; /** * 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 {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, mveFilter?: GetHistoricalMarketsMveFilterEnum, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * Endpoint for getting orders that have been archived to the historical database. * @summary Get Historical Orders * @param {string} [ticker] Filter by market ticker * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 200. * @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} */ getHistoricalOrders: (ticker?: string, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * 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) => Promise<RequestArgs>; /** * Endpoint for getting all historical trades for all markets. Trades that were filled before the historical cutoff are available via this endpoint. See [Historical Data](https://kalshi.com/docs/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 {*} [options] Override http request option. * @throws {RequiredError} */ getTradesHistorical: (ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; }; /** * HistoricalApi - functional programming interface */ export declare const HistoricalApiFp: (configuration?: Configuration) => { /** * Endpoint for getting all historical fills for the member. A fill is when a trade you have is matched. * @summary Get Historical Fills * @param {string} [ticker] Filter by market ticker * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 200. * @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} */ getFillsHistorical(ticker?: string, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetFillsResponse>>; /** * Returns the cutoff timestamps that define the boundary between **live** and **historical** data. ## 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`. * @summary Get Historical Cutoff Timestamps * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalCutoff(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetHistoricalCutoffResponse>>; /** * 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): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMarketResponse>>; /** * 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 {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, mveFilter?: GetHistoricalMarketsMveFilterEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMarketsResponse>>; /** * Endpoint for getting orders that have been archived to the historical database. * @summary Get Historical Orders * @param {string} [ticker] Filter by market ticker * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 200. * @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} */ getHistoricalOrders(ticker?: string, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetOrdersResponse>>; /** * 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): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMarketCandlesticksHistoricalResponse>>; /** * Endpoint for getting all historical trades for all markets. Trades that were filled before the historical cutoff are available via this endpoint. See [Historical Data](https://kalshi.com/docs/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 {*} [options] Override http request option. * @throws {RequiredError} */ getTradesHistorical(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetTradesResponse>>; }; /** * HistoricalApi - factory interface */ export declare const HistoricalApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Endpoint for getting all historical fills for the member. A fill is when a trade you have is matched. * @summary Get Historical Fills * @param {string} [ticker] Filter by market ticker * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 200. * @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} */ getFillsHistorical(ticker?: string, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise<GetFillsResponse>; /** * Returns the cutoff timestamps that define the boundary between **live** and **historical** data. ## 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`. * @summary Get Historical Cutoff Timestamps * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalCutoff(options?: RawAxiosRequestConfig): AxiosPromise<GetHistoricalCutoffResponse>; /** * 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<GetMarketResponse>; /** * 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 {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, mveFilter?: GetHistoricalMarketsMveFilterEnum, options?: RawAxiosRequestConfig): AxiosPromise<GetMarketsResponse>; /** * Endpoint for getting orders that have been archived to the historical database. * @summary Get Historical Orders * @param {string} [ticker] Filter by market ticker * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 200. * @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} */ getHistoricalOrders(ticker?: string, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise<GetOrdersResponse>; /** * 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<GetMarketCandlesticksHistoricalResponse>; /** * Endpoint for getting all historical trades for all markets. Trades that were filled before the historical cutoff are available via this endpoint. See [Historical Data](https://kalshi.com/docs/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 {*} [options] Override http request option. * @throws {RequiredError} */ getTradesHistorical(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): AxiosPromise<GetTradesResponse>; }; /** * HistoricalApi - object-oriented interface */ export declare class HistoricalApi extends BaseAPI { /** * Endpoint for getting all historical fills for the member. A fill is when a trade you have is matched. * @summary Get Historical Fills * @param {string} [ticker] Filter by market ticker * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 200. * @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} */ getFillsHistorical(ticker?: string, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GetFillsResponse, any, {}>>; /** * Returns the cutoff timestamps that define the boundary between **live** and **historical** data. ## 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`. * @summary Get Historical Cutoff Timestamps * @param {*} [options] Override http request option. * @throws {RequiredError} */ getHistoricalCutoff(options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GetHistoricalCutoffResponse, any, {}>>; /** * 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): Promise<import("axios").AxiosResponse<GetMarketResponse, any, {}>>; /** * 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 {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, mveFilter?: GetHistoricalMarketsMveFilterEnum, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GetMarketsResponse, any, {}>>; /** * Endpoint for getting orders that have been archived to the historical database. * @summary Get Historical Orders * @param {string} [ticker] Filter by market ticker * @param {number} [maxTs] Filter items before this Unix timestamp * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 200. * @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} */ getHistoricalOrders(ticker?: string, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GetOrdersResponse, any, {}>>; /** * 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): Promise<import("axios").AxiosResponse<GetMarketCandlesticksHistoricalResponse, any, {}>>; /** * Endpoint for getting all historical trades for all markets. Trades that were filled before the historical cutoff are available via this endpoint. See [Historical Data](https://kalshi.com/docs/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 {*} [options] Override http request option. * @throws {RequiredError} */ getTradesHistorical(ticker?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GetTradesResponse, any, {}>>; } export declare const GetHistoricalMarketsMveFilterEnum: { readonly Exclude: "exclude"; }; export type GetHistoricalMarketsMveFilterEnum = typeof GetHistoricalMarketsMveFilterEnum[keyof typeof GetHistoricalMarketsMveFilterEnum]; export declare const GetMarketCandlesticksHistoricalPeriodIntervalEnum: { readonly NUMBER_1: 1; readonly NUMBER_60: 60; readonly NUMBER_1440: 1440; }; export type GetMarketCandlesticksHistoricalPeriodIntervalEnum = typeof GetMarketCandlesticksHistoricalPeriodIntervalEnum[keyof typeof GetMarketCandlesticksHistoricalPeriodIntervalEnum];