UNPKG

kalshi-typescript

Version:
124 lines (123 loc) 5.74 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, setApiKeyToObject, setSearchParams, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, BaseAPI } from '../base'; /** * AccountApi - axios parameter creator */ export const AccountApiAxiosParamCreator = function (configuration) { return { /** * Endpoint to retrieve the API tier limits associated with the authenticated user. * @summary Get Account API Limits * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountApiLimits: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { const localVarPath = `/account/limits`; // 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 = {}; // authentication kalshiAccessSignature required yield setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration); // authentication kalshiAccessKey required yield setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration); // authentication kalshiAccessTimestamp required yield setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration); 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, }; }), }; }; /** * AccountApi - functional programming interface */ export const AccountApiFp = function (configuration) { const localVarAxiosParamCreator = AccountApiAxiosParamCreator(configuration); return { /** * Endpoint to retrieve the API tier limits associated with the authenticated user. * @summary Get Account API Limits * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountApiLimits(options) { return __awaiter(this, void 0, void 0, function* () { var _a; const localVarAxiosArgs = yield localVarAxiosParamCreator.getAccountApiLimits(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); }); }, }; }; /** * AccountApi - factory interface */ export const AccountApiFactory = function (configuration, basePath, axios) { const localVarFp = AccountApiFp(configuration); return { /** * Endpoint to retrieve the API tier limits associated with the authenticated user. * @summary Get Account API Limits * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountApiLimits(options) { return localVarFp.getAccountApiLimits(options).then((request) => request(axios, basePath)); }, }; }; /** * AccountApi - object-oriented interface */ export class AccountApi extends BaseAPI { /** * Endpoint to retrieve the API tier limits associated with the authenticated user. * @summary Get Account API Limits * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountApiLimits(options) { return AccountApiFp(this.configuration).getAccountApiLimits(options).then((request) => request(this.axios, this.basePath)); } }