UNPKG

kalshi-typescript

Version:
158 lines (157 loc) 8.68 kB
/* 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.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. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; import globalAxios from 'axios'; // URLSearchParams not necessarily used // @ts-ignore import { URL } from 'url'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, setSearchParams, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, BaseAPI } from '../base'; /** * IncentiveProgramsApi - axios parameter creator */ export const IncentiveProgramsApiAxiosParamCreator = function (configuration) { return { /** * List incentives with optional filters. Incentives are rewards programs for trading activity on specific markets. * @summary Get Incentives * @param {GetIncentiveProgramsStatusEnum} [status] Status filter. Can be \"all\", \"active\", \"upcoming\", \"closed\", or \"paid_out\". Default is \"all\". * @param {GetIncentiveProgramsTypeEnum} [type] Type filter. Can be \"all\", \"liquidity\", or \"volume\". Default is \"all\". * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 10000. * @param {string} [cursor] Cursor for pagination * @param {*} [options] Override http request option. * @throws {RequiredError} */ getIncentivePrograms: (status_1, type_1, limit_1, cursor_1, ...args_1) => __awaiter(this, [status_1, type_1, limit_1, cursor_1, ...args_1], void 0, function* (status, type, limit, cursor, options = {}) { const localVarPath = `/incentive_programs`; // 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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (status !== undefined) { localVarQueryParameter['status'] = status; } if (type !== undefined) { localVarQueryParameter['type'] = type; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; /** * IncentiveProgramsApi - functional programming interface */ export const IncentiveProgramsApiFp = function (configuration) { const localVarAxiosParamCreator = IncentiveProgramsApiAxiosParamCreator(configuration); return { /** * List incentives with optional filters. Incentives are rewards programs for trading activity on specific markets. * @summary Get Incentives * @param {GetIncentiveProgramsStatusEnum} [status] Status filter. Can be \"all\", \"active\", \"upcoming\", \"closed\", or \"paid_out\". Default is \"all\". * @param {GetIncentiveProgramsTypeEnum} [type] Type filter. Can be \"all\", \"liquidity\", or \"volume\". Default is \"all\". * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 10000. * @param {string} [cursor] Cursor for pagination * @param {*} [options] Override http request option. * @throws {RequiredError} */ getIncentivePrograms(status, type, limit, cursor, options) { return __awaiter(this, void 0, void 0, function* () { var _a; const localVarAxiosArgs = yield localVarAxiosParamCreator.getIncentivePrograms(status, type, limit, cursor, options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = undefined; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, }; }; /** * IncentiveProgramsApi - factory interface */ export const IncentiveProgramsApiFactory = function (configuration, basePath, axios) { const localVarFp = IncentiveProgramsApiFp(configuration); return { /** * List incentives with optional filters. Incentives are rewards programs for trading activity on specific markets. * @summary Get Incentives * @param {GetIncentiveProgramsStatusEnum} [status] Status filter. Can be \"all\", \"active\", \"upcoming\", \"closed\", or \"paid_out\". Default is \"all\". * @param {GetIncentiveProgramsTypeEnum} [type] Type filter. Can be \"all\", \"liquidity\", or \"volume\". Default is \"all\". * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 10000. * @param {string} [cursor] Cursor for pagination * @param {*} [options] Override http request option. * @throws {RequiredError} */ getIncentivePrograms(status, type, limit, cursor, options) { return localVarFp.getIncentivePrograms(status, type, limit, cursor, options).then((request) => request(axios, basePath)); }, }; }; /** * IncentiveProgramsApi - object-oriented interface */ export class IncentiveProgramsApi extends BaseAPI { /** * List incentives with optional filters. Incentives are rewards programs for trading activity on specific markets. * @summary Get Incentives * @param {GetIncentiveProgramsStatusEnum} [status] Status filter. Can be \"all\", \"active\", \"upcoming\", \"closed\", or \"paid_out\". Default is \"all\". * @param {GetIncentiveProgramsTypeEnum} [type] Type filter. Can be \"all\", \"liquidity\", or \"volume\". Default is \"all\". * @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 10000. * @param {string} [cursor] Cursor for pagination * @param {*} [options] Override http request option. * @throws {RequiredError} */ getIncentivePrograms(status, type, limit, cursor, options) { return IncentiveProgramsApiFp(this.configuration).getIncentivePrograms(status, type, limit, cursor, options).then((request) => request(this.axios, this.basePath)); } } export const GetIncentiveProgramsStatusEnum = { All: 'all', Active: 'active', Upcoming: 'upcoming', Closed: 'closed', PaidOut: 'paid_out' }; export const GetIncentiveProgramsTypeEnum = { All: 'all', Liquidity: 'liquidity', Volume: 'volume' };