kalshi-typescript
Version:
Official TypeScript SDK for the Kalshi API
165 lines (164 loc) • 9.27 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.6.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.GetIncentiveProgramsTypeEnum = exports.GetIncentiveProgramsStatusEnum = exports.IncentiveProgramsApi = exports.IncentiveProgramsApiFactory = exports.IncentiveProgramsApiFp = exports.IncentiveProgramsApiAxiosParamCreator = 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");
/**
* IncentiveProgramsApi - axios parameter creator
*/
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_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 = {};
if (status !== undefined) {
localVarQueryParameter['status'] = status;
}
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
(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.IncentiveProgramsApiAxiosParamCreator = IncentiveProgramsApiAxiosParamCreator;
/**
* IncentiveProgramsApi - functional programming interface
*/
const IncentiveProgramsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.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) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
});
},
};
};
exports.IncentiveProgramsApiFp = IncentiveProgramsApiFp;
/**
* IncentiveProgramsApi - factory interface
*/
const IncentiveProgramsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.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));
},
};
};
exports.IncentiveProgramsApiFactory = IncentiveProgramsApiFactory;
/**
* IncentiveProgramsApi - object-oriented interface
*/
class IncentiveProgramsApi extends base_1.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 (0, exports.IncentiveProgramsApiFp)(this.configuration).getIncentivePrograms(status, type, limit, cursor, options).then((request) => request(this.axios, this.basePath));
}
}
exports.IncentiveProgramsApi = IncentiveProgramsApi;
exports.GetIncentiveProgramsStatusEnum = {
All: 'all',
Active: 'active',
Upcoming: 'upcoming',
Closed: 'closed',
PaidOut: 'paid_out'
};
exports.GetIncentiveProgramsTypeEnum = {
All: 'all',
Liquidity: 'liquidity',
Volume: 'volume'
};