UNPKG

kalshi-typescript

Version:
606 lines (605 loc) 38.1 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, assertParamExists, setApiKeyToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, BaseAPI } from '../base'; /** * OrderGroupsApi - axios parameter creator */ export const OrderGroupsApiAxiosParamCreator = function (configuration) { return { /** * Creates a new order group with a contracts limit measured over a rolling 15-second window. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset. * @summary Create Order Group * @param {CreateOrderGroupRequest} createOrderGroupRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createOrderGroup: (createOrderGroupRequest_1, ...args_1) => __awaiter(this, [createOrderGroupRequest_1, ...args_1], void 0, function* (createOrderGroupRequest, options = {}) { // verify required parameter 'createOrderGroupRequest' is not null or undefined assertParamExists('createOrderGroup', 'createOrderGroupRequest', createOrderGroupRequest); const localVarPath = `/portfolio/order_groups/create`; // 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: 'POST' }, 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); localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(createOrderGroupRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Deletes an order group and cancels all orders within it. This permanently removes the group. * @summary Delete Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteOrderGroup: (orderGroupId_1, subaccount_1, ...args_1) => __awaiter(this, [orderGroupId_1, subaccount_1, ...args_1], void 0, function* (orderGroupId, subaccount, options = {}) { // verify required parameter 'orderGroupId' is not null or undefined assertParamExists('deleteOrderGroup', 'orderGroupId', orderGroupId); const localVarPath = `/portfolio/order_groups/{order_group_id}` .replace(`{${"order_group_id"}}`, encodeURIComponent(String(orderGroupId))); // 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: 'DELETE' }, 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); if (subaccount !== undefined) { localVarQueryParameter['subaccount'] = subaccount; } 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, }; }), /** * Retrieves details for a single order group including all order IDs and auto-cancel status. * @summary Get Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderGroup: (orderGroupId_1, subaccount_1, ...args_1) => __awaiter(this, [orderGroupId_1, subaccount_1, ...args_1], void 0, function* (orderGroupId, subaccount, options = {}) { // verify required parameter 'orderGroupId' is not null or undefined assertParamExists('getOrderGroup', 'orderGroupId', orderGroupId); const localVarPath = `/portfolio/order_groups/{order_group_id}` .replace(`{${"order_group_id"}}`, encodeURIComponent(String(orderGroupId))); // 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); if (subaccount !== undefined) { localVarQueryParameter['subaccount'] = subaccount; } 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, }; }), /** * Retrieves all order groups for the authenticated user. * @summary Get Order Groups * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderGroups: (subaccount_1, ...args_1) => __awaiter(this, [subaccount_1, ...args_1], void 0, function* (subaccount, options = {}) { const localVarPath = `/portfolio/order_groups`; // 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); if (subaccount !== undefined) { localVarQueryParameter['subaccount'] = subaccount; } 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, }; }), /** * Resets the order group\'s matched contracts counter to zero, allowing new orders to be placed again after the limit was hit. * @summary Reset Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {object} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ resetOrderGroup: (orderGroupId_1, subaccount_1, body_1, ...args_1) => __awaiter(this, [orderGroupId_1, subaccount_1, body_1, ...args_1], void 0, function* (orderGroupId, subaccount, body, options = {}) { // verify required parameter 'orderGroupId' is not null or undefined assertParamExists('resetOrderGroup', 'orderGroupId', orderGroupId); const localVarPath = `/portfolio/order_groups/{order_group_id}/reset` .replace(`{${"order_group_id"}}`, encodeURIComponent(String(orderGroupId))); // 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: 'PUT' }, 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); if (subaccount !== undefined) { localVarQueryParameter['subaccount'] = subaccount; } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Triggers the order group, canceling all orders in the group and preventing new orders until the group is reset. * @summary Trigger Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {object} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ triggerOrderGroup: (orderGroupId_1, subaccount_1, body_1, ...args_1) => __awaiter(this, [orderGroupId_1, subaccount_1, body_1, ...args_1], void 0, function* (orderGroupId, subaccount, body, options = {}) { // verify required parameter 'orderGroupId' is not null or undefined assertParamExists('triggerOrderGroup', 'orderGroupId', orderGroupId); const localVarPath = `/portfolio/order_groups/{order_group_id}/trigger` .replace(`{${"order_group_id"}}`, encodeURIComponent(String(orderGroupId))); // 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: 'PUT' }, 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); if (subaccount !== undefined) { localVarQueryParameter['subaccount'] = subaccount; } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Updates the order group contracts limit (rolling 15-second window). If the updated limit would immediately trigger the group, all orders in the group are canceled and the group is triggered. * @summary Update Order Group Limit * @param {string} orderGroupId Order group ID * @param {UpdateOrderGroupLimitRequest} updateOrderGroupLimitRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOrderGroupLimit: (orderGroupId_1, updateOrderGroupLimitRequest_1, ...args_1) => __awaiter(this, [orderGroupId_1, updateOrderGroupLimitRequest_1, ...args_1], void 0, function* (orderGroupId, updateOrderGroupLimitRequest, options = {}) { // verify required parameter 'orderGroupId' is not null or undefined assertParamExists('updateOrderGroupLimit', 'orderGroupId', orderGroupId); // verify required parameter 'updateOrderGroupLimitRequest' is not null or undefined assertParamExists('updateOrderGroupLimit', 'updateOrderGroupLimitRequest', updateOrderGroupLimitRequest); const localVarPath = `/portfolio/order_groups/{order_group_id}/limit` .replace(`{${"order_group_id"}}`, encodeURIComponent(String(orderGroupId))); // 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: 'PUT' }, 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); localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = serializeDataIfNeeded(updateOrderGroupLimitRequest, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; /** * OrderGroupsApi - functional programming interface */ export const OrderGroupsApiFp = function (configuration) { const localVarAxiosParamCreator = OrderGroupsApiAxiosParamCreator(configuration); return { /** * Creates a new order group with a contracts limit measured over a rolling 15-second window. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset. * @summary Create Order Group * @param {CreateOrderGroupRequest} createOrderGroupRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createOrderGroup(createOrderGroupRequest, options) { return __awaiter(this, void 0, void 0, function* () { var _a; const localVarAxiosArgs = yield localVarAxiosParamCreator.createOrderGroup(createOrderGroupRequest, 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); }); }, /** * Deletes an order group and cancels all orders within it. This permanently removes the group. * @summary Delete Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteOrderGroup(orderGroupId, subaccount, options) { return __awaiter(this, void 0, void 0, function* () { var _a; const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteOrderGroup(orderGroupId, subaccount, 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); }); }, /** * Retrieves details for a single order group including all order IDs and auto-cancel status. * @summary Get Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderGroup(orderGroupId, subaccount, options) { return __awaiter(this, void 0, void 0, function* () { var _a; const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrderGroup(orderGroupId, subaccount, 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); }); }, /** * Retrieves all order groups for the authenticated user. * @summary Get Order Groups * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderGroups(subaccount, options) { return __awaiter(this, void 0, void 0, function* () { var _a; const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrderGroups(subaccount, 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); }); }, /** * Resets the order group\'s matched contracts counter to zero, allowing new orders to be placed again after the limit was hit. * @summary Reset Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {object} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ resetOrderGroup(orderGroupId, subaccount, body, options) { return __awaiter(this, void 0, void 0, function* () { var _a; const localVarAxiosArgs = yield localVarAxiosParamCreator.resetOrderGroup(orderGroupId, subaccount, body, 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); }); }, /** * Triggers the order group, canceling all orders in the group and preventing new orders until the group is reset. * @summary Trigger Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {object} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ triggerOrderGroup(orderGroupId, subaccount, body, options) { return __awaiter(this, void 0, void 0, function* () { var _a; const localVarAxiosArgs = yield localVarAxiosParamCreator.triggerOrderGroup(orderGroupId, subaccount, body, 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); }); }, /** * Updates the order group contracts limit (rolling 15-second window). If the updated limit would immediately trigger the group, all orders in the group are canceled and the group is triggered. * @summary Update Order Group Limit * @param {string} orderGroupId Order group ID * @param {UpdateOrderGroupLimitRequest} updateOrderGroupLimitRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOrderGroupLimit(orderGroupId, updateOrderGroupLimitRequest, options) { return __awaiter(this, void 0, void 0, function* () { var _a; const localVarAxiosArgs = yield localVarAxiosParamCreator.updateOrderGroupLimit(orderGroupId, updateOrderGroupLimitRequest, 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); }); }, }; }; /** * OrderGroupsApi - factory interface */ export const OrderGroupsApiFactory = function (configuration, basePath, axios) { const localVarFp = OrderGroupsApiFp(configuration); return { /** * Creates a new order group with a contracts limit measured over a rolling 15-second window. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset. * @summary Create Order Group * @param {CreateOrderGroupRequest} createOrderGroupRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createOrderGroup(createOrderGroupRequest, options) { return localVarFp.createOrderGroup(createOrderGroupRequest, options).then((request) => request(axios, basePath)); }, /** * Deletes an order group and cancels all orders within it. This permanently removes the group. * @summary Delete Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteOrderGroup(orderGroupId, subaccount, options) { return localVarFp.deleteOrderGroup(orderGroupId, subaccount, options).then((request) => request(axios, basePath)); }, /** * Retrieves details for a single order group including all order IDs and auto-cancel status. * @summary Get Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderGroup(orderGroupId, subaccount, options) { return localVarFp.getOrderGroup(orderGroupId, subaccount, options).then((request) => request(axios, basePath)); }, /** * Retrieves all order groups for the authenticated user. * @summary Get Order Groups * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderGroups(subaccount, options) { return localVarFp.getOrderGroups(subaccount, options).then((request) => request(axios, basePath)); }, /** * Resets the order group\'s matched contracts counter to zero, allowing new orders to be placed again after the limit was hit. * @summary Reset Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {object} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ resetOrderGroup(orderGroupId, subaccount, body, options) { return localVarFp.resetOrderGroup(orderGroupId, subaccount, body, options).then((request) => request(axios, basePath)); }, /** * Triggers the order group, canceling all orders in the group and preventing new orders until the group is reset. * @summary Trigger Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {object} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ triggerOrderGroup(orderGroupId, subaccount, body, options) { return localVarFp.triggerOrderGroup(orderGroupId, subaccount, body, options).then((request) => request(axios, basePath)); }, /** * Updates the order group contracts limit (rolling 15-second window). If the updated limit would immediately trigger the group, all orders in the group are canceled and the group is triggered. * @summary Update Order Group Limit * @param {string} orderGroupId Order group ID * @param {UpdateOrderGroupLimitRequest} updateOrderGroupLimitRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOrderGroupLimit(orderGroupId, updateOrderGroupLimitRequest, options) { return localVarFp.updateOrderGroupLimit(orderGroupId, updateOrderGroupLimitRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * OrderGroupsApi - object-oriented interface */ export class OrderGroupsApi extends BaseAPI { /** * Creates a new order group with a contracts limit measured over a rolling 15-second window. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset. * @summary Create Order Group * @param {CreateOrderGroupRequest} createOrderGroupRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createOrderGroup(createOrderGroupRequest, options) { return OrderGroupsApiFp(this.configuration).createOrderGroup(createOrderGroupRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Deletes an order group and cancels all orders within it. This permanently removes the group. * @summary Delete Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteOrderGroup(orderGroupId, subaccount, options) { return OrderGroupsApiFp(this.configuration).deleteOrderGroup(orderGroupId, subaccount, options).then((request) => request(this.axios, this.basePath)); } /** * Retrieves details for a single order group including all order IDs and auto-cancel status. * @summary Get Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderGroup(orderGroupId, subaccount, options) { return OrderGroupsApiFp(this.configuration).getOrderGroup(orderGroupId, subaccount, options).then((request) => request(this.axios, this.basePath)); } /** * Retrieves all order groups for the authenticated user. * @summary Get Order Groups * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderGroups(subaccount, options) { return OrderGroupsApiFp(this.configuration).getOrderGroups(subaccount, options).then((request) => request(this.axios, this.basePath)); } /** * Resets the order group\'s matched contracts counter to zero, allowing new orders to be placed again after the limit was hit. * @summary Reset Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {object} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ resetOrderGroup(orderGroupId, subaccount, body, options) { return OrderGroupsApiFp(this.configuration).resetOrderGroup(orderGroupId, subaccount, body, options).then((request) => request(this.axios, this.basePath)); } /** * Triggers the order group, canceling all orders in the group and preventing new orders until the group is reset. * @summary Trigger Order Group * @param {string} orderGroupId Order group ID * @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). Defaults to 0. * @param {object} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ triggerOrderGroup(orderGroupId, subaccount, body, options) { return OrderGroupsApiFp(this.configuration).triggerOrderGroup(orderGroupId, subaccount, body, options).then((request) => request(this.axios, this.basePath)); } /** * Updates the order group contracts limit (rolling 15-second window). If the updated limit would immediately trigger the group, all orders in the group are canceled and the group is triggered. * @summary Update Order Group Limit * @param {string} orderGroupId Order group ID * @param {UpdateOrderGroupLimitRequest} updateOrderGroupLimitRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateOrderGroupLimit(orderGroupId, updateOrderGroupLimitRequest, options) { return OrderGroupsApiFp(this.configuration).updateOrderGroupLimit(orderGroupId, updateOrderGroupLimitRequest, options).then((request) => request(this.axios, this.basePath)); } }