UNPKG

kalshi-typescript

Version:

Official TypeScript SDK for the Kalshi API

264 lines (263 loc) 21.4 kB
/** * Kalshi Trading API * Complete API for the Kalshi trading platform including all handlers for SDK generation * * The version of the OpenAPI document: 2.0.0 * Contact: support@kalshi.com * * 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 { GetMarketCandlesticksResponse } from '../models'; import type { GetMarketOrderbookResponse } from '../models'; import type { GetMarketResponse } from '../models'; import type { GetMarketsResponse } from '../models'; import type { GetTradesResponse } from '../models'; /** * MarketsApi - axios parameter creator */ export declare const MarketsApiAxiosParamCreator: (configuration?: Configuration) => { /** * Get a single market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. * @summary Get Market * @param {string} ticker Market ticker * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarket: (ticker: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * Get candlestick data for a market within a series * @summary Get Market Candlesticks * @param {string} ticker The series ticker * @param {string} marketTicker The market ticker * @param {number} [startTs] Start timestamp for the range * @param {number} [endTs] End timestamp for the range * @param {string} [periodInterval] Period interval for candlesticks (e.g., 1m, 5m, 1h, 1d) * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarketCandlesticks: (ticker: string, marketTicker: string, startTs?: number, endTs?: number, periodInterval?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * Get the orderbook for a market * @summary Get Market Orderbook * @param {string} ticker Market ticker * @param {number} [depth] Depth of the orderbook to retrieve * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarketOrderbook: (ticker: string, depth?: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * List and discover markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available. * @summary Get 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} [eventTicker] Filter by event ticker * @param {string} [seriesTicker] Filter by series ticker * @param {number} [maxCloseTs] Filter items that close before this Unix timestamp * @param {number} [minCloseTs] Filter items that close after this Unix timestamp * @param {string} [status] Filter by market status. Comma-separated list. Possible values are \&#39;initialized\&#39;, \&#39;open\&#39;, \&#39;closed\&#39;, \&#39;settled\&#39;, \&#39;determined\&#39;. Note that the API accepts \&#39;open\&#39; for filtering but returns \&#39;active\&#39; in the response. Leave empty to return markets with any status. * @param {string} [tickers] Filter by specific market tickers. Comma-separated list of market tickers to retrieve. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarkets: (limit?: number, cursor?: string, eventTicker?: string, seriesTicker?: string, maxCloseTs?: number, minCloseTs?: number, status?: string, tickers?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; /** * Get all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available. * @summary Get Trades * @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} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTrades: (limit?: number, cursor?: string, ticker?: string, minTs?: number, maxTs?: number, options?: RawAxiosRequestConfig) => Promise<RequestArgs>; }; /** * MarketsApi - functional programming interface */ export declare const MarketsApiFp: (configuration?: Configuration) => { /** * Get a single market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. * @summary Get Market * @param {string} ticker Market ticker * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarket(ticker: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMarketResponse>>; /** * Get candlestick data for a market within a series * @summary Get Market Candlesticks * @param {string} ticker The series ticker * @param {string} marketTicker The market ticker * @param {number} [startTs] Start timestamp for the range * @param {number} [endTs] End timestamp for the range * @param {string} [periodInterval] Period interval for candlesticks (e.g., 1m, 5m, 1h, 1d) * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarketCandlesticks(ticker: string, marketTicker: string, startTs?: number, endTs?: number, periodInterval?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMarketCandlesticksResponse>>; /** * Get the orderbook for a market * @summary Get Market Orderbook * @param {string} ticker Market ticker * @param {number} [depth] Depth of the orderbook to retrieve * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarketOrderbook(ticker: string, depth?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMarketOrderbookResponse>>; /** * List and discover markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available. * @summary Get 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} [eventTicker] Filter by event ticker * @param {string} [seriesTicker] Filter by series ticker * @param {number} [maxCloseTs] Filter items that close before this Unix timestamp * @param {number} [minCloseTs] Filter items that close after this Unix timestamp * @param {string} [status] Filter by market status. Comma-separated list. Possible values are \&#39;initialized\&#39;, \&#39;open\&#39;, \&#39;closed\&#39;, \&#39;settled\&#39;, \&#39;determined\&#39;. Note that the API accepts \&#39;open\&#39; for filtering but returns \&#39;active\&#39; in the response. Leave empty to return markets with any status. * @param {string} [tickers] Filter by specific market tickers. Comma-separated list of market tickers to retrieve. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarkets(limit?: number, cursor?: string, eventTicker?: string, seriesTicker?: string, maxCloseTs?: number, minCloseTs?: number, status?: string, tickers?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMarketsResponse>>; /** * Get all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available. * @summary Get Trades * @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} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTrades(limit?: number, cursor?: string, ticker?: string, minTs?: number, maxTs?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetTradesResponse>>; }; /** * MarketsApi - factory interface */ export declare const MarketsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => { /** * Get a single market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. * @summary Get Market * @param {string} ticker Market ticker * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarket(ticker: string, options?: RawAxiosRequestConfig): AxiosPromise<GetMarketResponse>; /** * Get candlestick data for a market within a series * @summary Get Market Candlesticks * @param {string} ticker The series ticker * @param {string} marketTicker The market ticker * @param {number} [startTs] Start timestamp for the range * @param {number} [endTs] End timestamp for the range * @param {string} [periodInterval] Period interval for candlesticks (e.g., 1m, 5m, 1h, 1d) * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarketCandlesticks(ticker: string, marketTicker: string, startTs?: number, endTs?: number, periodInterval?: string, options?: RawAxiosRequestConfig): AxiosPromise<GetMarketCandlesticksResponse>; /** * Get the orderbook for a market * @summary Get Market Orderbook * @param {string} ticker Market ticker * @param {number} [depth] Depth of the orderbook to retrieve * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarketOrderbook(ticker: string, depth?: number, options?: RawAxiosRequestConfig): AxiosPromise<GetMarketOrderbookResponse>; /** * List and discover markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available. * @summary Get 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} [eventTicker] Filter by event ticker * @param {string} [seriesTicker] Filter by series ticker * @param {number} [maxCloseTs] Filter items that close before this Unix timestamp * @param {number} [minCloseTs] Filter items that close after this Unix timestamp * @param {string} [status] Filter by market status. Comma-separated list. Possible values are \&#39;initialized\&#39;, \&#39;open\&#39;, \&#39;closed\&#39;, \&#39;settled\&#39;, \&#39;determined\&#39;. Note that the API accepts \&#39;open\&#39; for filtering but returns \&#39;active\&#39; in the response. Leave empty to return markets with any status. * @param {string} [tickers] Filter by specific market tickers. Comma-separated list of market tickers to retrieve. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarkets(limit?: number, cursor?: string, eventTicker?: string, seriesTicker?: string, maxCloseTs?: number, minCloseTs?: number, status?: string, tickers?: string, options?: RawAxiosRequestConfig): AxiosPromise<GetMarketsResponse>; /** * Get all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available. * @summary Get Trades * @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} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTrades(limit?: number, cursor?: string, ticker?: string, minTs?: number, maxTs?: number, options?: RawAxiosRequestConfig): AxiosPromise<GetTradesResponse>; }; /** * MarketsApi - object-oriented interface */ export declare class MarketsApi extends BaseAPI { /** * Get a single market by its ticker. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. * @summary Get Market * @param {string} ticker Market ticker * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarket(ticker: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GetMarketResponse, any, {}>>; /** * Get candlestick data for a market within a series * @summary Get Market Candlesticks * @param {string} ticker The series ticker * @param {string} marketTicker The market ticker * @param {number} [startTs] Start timestamp for the range * @param {number} [endTs] End timestamp for the range * @param {string} [periodInterval] Period interval for candlesticks (e.g., 1m, 5m, 1h, 1d) * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarketCandlesticks(ticker: string, marketTicker: string, startTs?: number, endTs?: number, periodInterval?: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GetMarketCandlesticksResponse, any, {}>>; /** * Get the orderbook for a market * @summary Get Market Orderbook * @param {string} ticker Market ticker * @param {number} [depth] Depth of the orderbook to retrieve * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarketOrderbook(ticker: string, depth?: number, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GetMarketOrderbookResponse, any, {}>>; /** * List and discover markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available. * @summary Get 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} [eventTicker] Filter by event ticker * @param {string} [seriesTicker] Filter by series ticker * @param {number} [maxCloseTs] Filter items that close before this Unix timestamp * @param {number} [minCloseTs] Filter items that close after this Unix timestamp * @param {string} [status] Filter by market status. Comma-separated list. Possible values are \&#39;initialized\&#39;, \&#39;open\&#39;, \&#39;closed\&#39;, \&#39;settled\&#39;, \&#39;determined\&#39;. Note that the API accepts \&#39;open\&#39; for filtering but returns \&#39;active\&#39; in the response. Leave empty to return markets with any status. * @param {string} [tickers] Filter by specific market tickers. Comma-separated list of market tickers to retrieve. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMarkets(limit?: number, cursor?: string, eventTicker?: string, seriesTicker?: string, maxCloseTs?: number, minCloseTs?: number, status?: string, tickers?: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GetMarketsResponse, any, {}>>; /** * Get all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available. * @summary Get Trades * @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} [ticker] Filter by market ticker * @param {number} [minTs] Filter items after this Unix timestamp * @param {number} [maxTs] Filter items before this Unix timestamp * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTrades(limit?: number, cursor?: string, ticker?: string, minTs?: number, maxTs?: number, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<GetTradesResponse, any, {}>>; }