kalshi-typescript
Version:
OpenAPI client for kalshi-typescript
131 lines (130 loc) • 6.16 kB
JavaScript
;
/* 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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccountApi = exports.AccountApiFactory = exports.AccountApiFp = exports.AccountApiAxiosParamCreator = void 0;
const axios_1 = require("axios");
// URLSearchParams not necessarily used
// @ts-ignore
const url_1 = require("url");
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
* AccountApi - axios parameter creator
*/
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_1.URL(localVarPath, common_1.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 (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration);
// authentication kalshiAccessKey required
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration);
// authentication kalshiAccessTimestamp required
yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
}),
};
};
exports.AccountApiAxiosParamCreator = AccountApiAxiosParamCreator;
/**
* AccountApi - functional programming interface
*/
const AccountApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.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) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
};
};
exports.AccountApiFp = AccountApiFp;
/**
* AccountApi - factory interface
*/
const AccountApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.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));
},
};
};
exports.AccountApiFactory = AccountApiFactory;
/**
* AccountApi - object-oriented interface
*/
class AccountApi extends base_1.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 (0, exports.AccountApiFp)(this.configuration).getAccountApiLimits(options).then((request) => request(this.axios, this.basePath));
}
}
exports.AccountApi = AccountApi;