kalshi-typescript
Version:
OpenAPI client for kalshi-typescript
938 lines (824 loc) • 56.1 kB
text/typescript
/* 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.
*/
import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// URLSearchParams not necessarily used
// @ts-ignore
import { URL, URLSearchParams } from 'url';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError } from '../base';
// @ts-ignore
import type { AcceptQuoteRequest } from '../models';
// @ts-ignore
import type { CreateQuoteRequest } from '../models';
// @ts-ignore
import type { CreateQuoteResponse } from '../models';
// @ts-ignore
import type { CreateRFQRequest } from '../models';
// @ts-ignore
import type { CreateRFQResponse } from '../models';
// @ts-ignore
import type { ErrorResponse } from '../models';
// @ts-ignore
import type { GetCommunicationsIDResponse } from '../models';
// @ts-ignore
import type { GetQuoteResponse } from '../models';
// @ts-ignore
import type { GetQuotesResponse } from '../models';
// @ts-ignore
import type { GetRFQResponse } from '../models';
// @ts-ignore
import type { GetRFQsResponse } from '../models';
/**
* CommunicationsApi - axios parameter creator
*/
export const CommunicationsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Endpoint for accepting a quote. This will require the quoter to confirm
* @summary Accept Quote
* @param {string} quoteId Quote ID
* @param {AcceptQuoteRequest} acceptQuoteRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
acceptQuote: async (quoteId: string, acceptQuoteRequest: AcceptQuoteRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'quoteId' is not null or undefined
assertParamExists('acceptQuote', 'quoteId', quoteId)
// verify required parameter 'acceptQuoteRequest' is not null or undefined
assertParamExists('acceptQuote', 'acceptQuoteRequest', acceptQuoteRequest)
const localVarPath = `/communications/quotes/{quote_id}/accept`
.replace(`{${"quote_id"}}`, encodeURIComponent(String(quoteId)));
// 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 = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication kalshiAccessSignature required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration)
// authentication kalshiAccessKey required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration)
// authentication kalshiAccessTimestamp required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(acceptQuoteRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Endpoint for confirming a quote. This will start a timer for order execution
* @summary Confirm Quote
* @param {string} quoteId Quote ID
* @param {object} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
confirmQuote: async (quoteId: string, body?: object, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'quoteId' is not null or undefined
assertParamExists('confirmQuote', 'quoteId', quoteId)
const localVarPath = `/communications/quotes/{quote_id}/confirm`
.replace(`{${"quote_id"}}`, encodeURIComponent(String(quoteId)));
// 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 = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication kalshiAccessSignature required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration)
// authentication kalshiAccessKey required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration)
// authentication kalshiAccessTimestamp required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Endpoint for creating a quote in response to an RFQ
* @summary Create Quote
* @param {CreateQuoteRequest} createQuoteRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createQuote: async (createQuoteRequest: CreateQuoteRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'createQuoteRequest' is not null or undefined
assertParamExists('createQuote', 'createQuoteRequest', createQuoteRequest)
const localVarPath = `/communications/quotes`;
// 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 = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication kalshiAccessSignature required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration)
// authentication kalshiAccessKey required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration)
// authentication kalshiAccessTimestamp required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(createQuoteRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Endpoint for creating a new RFQ. You can have a maximum of 100 open RFQs at a time.
* @summary Create RFQ
* @param {CreateRFQRequest} createRFQRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createRFQ: async (createRFQRequest: CreateRFQRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'createRFQRequest' is not null or undefined
assertParamExists('createRFQ', 'createRFQRequest', createRFQRequest)
const localVarPath = `/communications/rfqs`;
// 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 = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication kalshiAccessSignature required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration)
// authentication kalshiAccessKey required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration)
// authentication kalshiAccessTimestamp required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(createRFQRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Endpoint for deleting a quote, which means it can no longer be accepted.
* @summary Delete Quote
* @param {string} quoteId Quote ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteQuote: async (quoteId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'quoteId' is not null or undefined
assertParamExists('deleteQuote', 'quoteId', quoteId)
const localVarPath = `/communications/quotes/{quote_id}`
.replace(`{${"quote_id"}}`, encodeURIComponent(String(quoteId)));
// 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 = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication kalshiAccessSignature required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration)
// authentication kalshiAccessKey required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration)
// authentication kalshiAccessTimestamp required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Endpoint for deleting an RFQ by ID
* @summary Delete RFQ
* @param {string} rfqId RFQ ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteRFQ: async (rfqId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'rfqId' is not null or undefined
assertParamExists('deleteRFQ', 'rfqId', rfqId)
const localVarPath = `/communications/rfqs/{rfq_id}`
.replace(`{${"rfq_id"}}`, encodeURIComponent(String(rfqId)));
// 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 = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication kalshiAccessSignature required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration)
// authentication kalshiAccessKey required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration)
// authentication kalshiAccessTimestamp required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Endpoint for getting the communications ID of the logged-in user.
* @summary Get Communications ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCommunicationsID: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/communications/id`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication kalshiAccessSignature required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration)
// authentication kalshiAccessKey required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration)
// authentication kalshiAccessTimestamp required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Endpoint for getting a particular quote
* @summary Get Quote
* @param {string} quoteId Quote ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getQuote: async (quoteId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'quoteId' is not null or undefined
assertParamExists('getQuote', 'quoteId', quoteId)
const localVarPath = `/communications/quotes/{quote_id}`
.replace(`{${"quote_id"}}`, encodeURIComponent(String(quoteId)));
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication kalshiAccessSignature required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration)
// authentication kalshiAccessKey required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration)
// authentication kalshiAccessTimestamp required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Endpoint for getting quotes
* @summary Get Quotes
* @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
* @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported.
* @param {string} [marketTicker] Filter by market ticker
* @param {number} [limit] Parameter to specify the number of results per page. Defaults to 500.
* @param {string} [status] Filter quotes by status
* @param {string} [quoteCreatorUserId] Filter quotes by quote creator user ID
* @param {string} [rfqCreatorUserId] Filter quotes by RFQ creator user ID
* @param {string} [rfqCreatorSubtraderId] Filter quotes by RFQ creator subtrader ID (FCM members only)
* @param {string} [rfqId] Filter quotes by RFQ ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getQuotes: async (cursor?: string, eventTicker?: string, marketTicker?: string, limit?: number, status?: string, quoteCreatorUserId?: string, rfqCreatorUserId?: string, rfqCreatorSubtraderId?: string, rfqId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/communications/quotes`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication kalshiAccessSignature required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration)
// authentication kalshiAccessKey required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration)
// authentication kalshiAccessTimestamp required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration)
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
if (eventTicker !== undefined) {
localVarQueryParameter['event_ticker'] = eventTicker;
}
if (marketTicker !== undefined) {
localVarQueryParameter['market_ticker'] = marketTicker;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (status !== undefined) {
localVarQueryParameter['status'] = status;
}
if (quoteCreatorUserId !== undefined) {
localVarQueryParameter['quote_creator_user_id'] = quoteCreatorUserId;
}
if (rfqCreatorUserId !== undefined) {
localVarQueryParameter['rfq_creator_user_id'] = rfqCreatorUserId;
}
if (rfqCreatorSubtraderId !== undefined) {
localVarQueryParameter['rfq_creator_subtrader_id'] = rfqCreatorSubtraderId;
}
if (rfqId !== undefined) {
localVarQueryParameter['rfq_id'] = rfqId;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Endpoint for getting a single RFQ by id
* @summary Get RFQ
* @param {string} rfqId RFQ ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRFQ: async (rfqId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'rfqId' is not null or undefined
assertParamExists('getRFQ', 'rfqId', rfqId)
const localVarPath = `/communications/rfqs/{rfq_id}`
.replace(`{${"rfq_id"}}`, encodeURIComponent(String(rfqId)));
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication kalshiAccessSignature required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration)
// authentication kalshiAccessKey required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration)
// authentication kalshiAccessTimestamp required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Endpoint for getting RFQs
* @summary Get RFQs
* @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
* @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported.
* @param {string} [marketTicker] Filter by market ticker
* @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts.
* @param {number} [limit] Parameter to specify the number of results per page. Defaults to 100.
* @param {string} [status] Filter RFQs by status
* @param {string} [creatorUserId] Filter RFQs by creator user ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRFQs: async (cursor?: string, eventTicker?: string, marketTicker?: string, subaccount?: number, limit?: number, status?: string, creatorUserId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/communications/rfqs`;
// 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 = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication kalshiAccessSignature required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-SIGNATURE", configuration)
// authentication kalshiAccessKey required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-KEY", configuration)
// authentication kalshiAccessTimestamp required
await setApiKeyToObject(localVarHeaderParameter, "KALSHI-ACCESS-TIMESTAMP", configuration)
if (cursor !== undefined) {
localVarQueryParameter['cursor'] = cursor;
}
if (eventTicker !== undefined) {
localVarQueryParameter['event_ticker'] = eventTicker;
}
if (marketTicker !== undefined) {
localVarQueryParameter['market_ticker'] = marketTicker;
}
if (subaccount !== undefined) {
localVarQueryParameter['subaccount'] = subaccount;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (status !== undefined) {
localVarQueryParameter['status'] = status;
}
if (creatorUserId !== undefined) {
localVarQueryParameter['creator_user_id'] = creatorUserId;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* CommunicationsApi - functional programming interface
*/
export const CommunicationsApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = CommunicationsApiAxiosParamCreator(configuration)
return {
/**
* Endpoint for accepting a quote. This will require the quoter to confirm
* @summary Accept Quote
* @param {string} quoteId Quote ID
* @param {AcceptQuoteRequest} acceptQuoteRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async acceptQuote(quoteId: string, acceptQuoteRequest: AcceptQuoteRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.acceptQuote(quoteId, acceptQuoteRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath: string | undefined = undefined;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Endpoint for confirming a quote. This will start a timer for order execution
* @summary Confirm Quote
* @param {string} quoteId Quote ID
* @param {object} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async confirmQuote(quoteId: string, body?: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.confirmQuote(quoteId, body, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath: string | undefined = undefined;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Endpoint for creating a quote in response to an RFQ
* @summary Create Quote
* @param {CreateQuoteRequest} createQuoteRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createQuote(createQuoteRequest: CreateQuoteRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateQuoteResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createQuote(createQuoteRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath: string | undefined = undefined;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Endpoint for creating a new RFQ. You can have a maximum of 100 open RFQs at a time.
* @summary Create RFQ
* @param {CreateRFQRequest} createRFQRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createRFQ(createRFQRequest: CreateRFQRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateRFQResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createRFQ(createRFQRequest, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath: string | undefined = undefined;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Endpoint for deleting a quote, which means it can no longer be accepted.
* @summary Delete Quote
* @param {string} quoteId Quote ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteQuote(quoteId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteQuote(quoteId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath: string | undefined = undefined;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Endpoint for deleting an RFQ by ID
* @summary Delete RFQ
* @param {string} rfqId RFQ ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteRFQ(rfqId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRFQ(rfqId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath: string | undefined = undefined;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Endpoint for getting the communications ID of the logged-in user.
* @summary Get Communications ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getCommunicationsID(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetCommunicationsIDResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getCommunicationsID(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath: string | undefined = undefined;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Endpoint for getting a particular quote
* @summary Get Quote
* @param {string} quoteId Quote ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getQuote(quoteId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetQuoteResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getQuote(quoteId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath: string | undefined = undefined;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Endpoint for getting quotes
* @summary Get Quotes
* @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
* @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported.
* @param {string} [marketTicker] Filter by market ticker
* @param {number} [limit] Parameter to specify the number of results per page. Defaults to 500.
* @param {string} [status] Filter quotes by status
* @param {string} [quoteCreatorUserId] Filter quotes by quote creator user ID
* @param {string} [rfqCreatorUserId] Filter quotes by RFQ creator user ID
* @param {string} [rfqCreatorSubtraderId] Filter quotes by RFQ creator subtrader ID (FCM members only)
* @param {string} [rfqId] Filter quotes by RFQ ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getQuotes(cursor?: string, eventTicker?: string, marketTicker?: string, limit?: number, status?: string, quoteCreatorUserId?: string, rfqCreatorUserId?: string, rfqCreatorSubtraderId?: string, rfqId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetQuotesResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getQuotes(cursor, eventTicker, marketTicker, limit, status, quoteCreatorUserId, rfqCreatorUserId, rfqCreatorSubtraderId, rfqId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath: string | undefined = undefined;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Endpoint for getting a single RFQ by id
* @summary Get RFQ
* @param {string} rfqId RFQ ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getRFQ(rfqId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetRFQResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getRFQ(rfqId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath: string | undefined = undefined;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/**
* Endpoint for getting RFQs
* @summary Get RFQs
* @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
* @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported.
* @param {string} [marketTicker] Filter by market ticker
* @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts.
* @param {number} [limit] Parameter to specify the number of results per page. Defaults to 100.
* @param {string} [status] Filter RFQs by status
* @param {string} [creatorUserId] Filter RFQs by creator user ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getRFQs(cursor?: string, eventTicker?: string, marketTicker?: string, subaccount?: number, limit?: number, status?: string, creatorUserId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetRFQsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getRFQs(cursor, eventTicker, marketTicker, subaccount, limit, status, creatorUserId, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath: string | undefined = undefined;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
}
};
/**
* CommunicationsApi - factory interface
*/
export const CommunicationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = CommunicationsApiFp(configuration)
return {
/**
* Endpoint for accepting a quote. This will require the quoter to confirm
* @summary Accept Quote
* @param {string} quoteId Quote ID
* @param {AcceptQuoteRequest} acceptQuoteRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
acceptQuote(quoteId: string, acceptQuoteRequest: AcceptQuoteRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.acceptQuote(quoteId, acceptQuoteRequest, options).then((request) => request(axios, basePath));
},
/**
* Endpoint for confirming a quote. This will start a timer for order execution
* @summary Confirm Quote
* @param {string} quoteId Quote ID
* @param {object} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
confirmQuote(quoteId: string, body?: object, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.confirmQuote(quoteId, body, options).then((request) => request(axios, basePath));
},
/**
* Endpoint for creating a quote in response to an RFQ
* @summary Create Quote
* @param {CreateQuoteRequest} createQuoteRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createQuote(createQuoteRequest: CreateQuoteRequest, options?: RawAxiosRequestConfig): AxiosPromise<CreateQuoteResponse> {
return localVarFp.createQuote(createQuoteRequest, options).then((request) => request(axios, basePath));
},
/**
* Endpoint for creating a new RFQ. You can have a maximum of 100 open RFQs at a time.
* @summary Create RFQ
* @param {CreateRFQRequest} createRFQRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createRFQ(createRFQRequest: CreateRFQRequest, options?: RawAxiosRequestConfig): AxiosPromise<CreateRFQResponse> {
return localVarFp.createRFQ(createRFQRequest, options).then((request) => request(axios, basePath));
},
/**
* Endpoint for deleting a quote, which means it can no longer be accepted.
* @summary Delete Quote
* @param {string} quoteId Quote ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteQuote(quoteId: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.deleteQuote(quoteId, options).then((request) => request(axios, basePath));
},
/**
* Endpoint for deleting an RFQ by ID
* @summary Delete RFQ
* @param {string} rfqId RFQ ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteRFQ(rfqId: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
return localVarFp.deleteRFQ(rfqId, options).then((request) => request(axios, basePath));
},
/**
* Endpoint for getting the communications ID of the logged-in user.
* @summary Get Communications ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCommunicationsID(options?: RawAxiosRequestConfig): AxiosPromise<GetCommunicationsIDResponse> {
return localVarFp.getCommunicationsID(options).then((request) => request(axios, basePath));
},
/**
* Endpoint for getting a particular quote
* @summary Get Quote
* @param {string} quoteId Quote ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getQuote(quoteId: string, options?: RawAxiosRequestConfig): AxiosPromise<GetQuoteResponse> {
return localVarFp.getQuote(quoteId, options).then((request) => request(axios, basePath));
},
/**
* Endpoint for getting quotes
* @summary Get Quotes
* @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
* @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported.
* @param {string} [marketTicker] Filter by market ticker
* @param {number} [limit] Parameter to specify the number of results per page. Defaults to 500.
* @param {string} [status] Filter quotes by status
* @param {string} [quoteCreatorUserId] Filter quotes by quote creator user ID
* @param {string} [rfqCreatorUserId] Filter quotes by RFQ creator user ID
* @param {string} [rfqCreatorSubtraderId] Filter quotes by RFQ creator subtrader ID (FCM members only)
* @param {string} [rfqId] Filter quotes by RFQ ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getQuotes(cursor?: string, eventTicker?: string, marketTicker?: string, limit?: number, status?: string, quoteCreatorUserId?: string, rfqCreatorUserId?: string, rfqCreatorSubtraderId?: string, rfqId?: string, options?: RawAxiosRequestConfig): AxiosPromise<GetQuotesResponse> {
return localVarFp.getQuotes(cursor, eventTicker, marketTicker, limit, status, quoteCreatorUserId, rfqCreatorUserId, rfqCreatorSubtraderId, rfqId, options).then((request) => request(axios, basePath));
},
/**
* Endpoint for getting a single RFQ by id
* @summary Get RFQ
* @param {string} rfqId RFQ ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRFQ(rfqId: string, options?: RawAxiosRequestConfig): AxiosPromise<GetRFQResponse> {
return localVarFp.getRFQ(rfqId, options).then((request) => request(axios, basePath));
},
/**
* Endpoint for getting RFQs
* @summary Get RFQs
* @param {string} [cursor] Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
* @param {string} [eventTicker] Event ticker to filter by. Only a single event ticker is supported.
* @param {string} [marketTicker] Filter by market ticker
* @param {number} [subaccount] Subaccount number (0 for primary, 1-32 for subaccounts). If omitted, defaults to all subaccounts.
* @param {number} [limit] Parameter to specify the number of results per page. Defaults to 100.
* @param {string} [status] Filter RFQs by status
* @param {string} [creatorUserId] Filter RFQs by creator user ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRFQs(cursor?: string, eventTicker?: string, marketTicker?: string, subaccount?: number, limit?: number, status?: string, creatorUserId?: string, options?: RawAxiosRequestConfig): AxiosPromise<GetRFQsResponse> {
return localVarFp.getRFQs(cursor, eventTicker, marketTicker, subaccount, limit, status, creatorUserId, options).then((request) => request(axios, basePath));
},
};
};
/**
* CommunicationsApi - object-oriented interface
*/
export class CommunicationsApi extends BaseAPI {
/**
* Endpoint for accepting a quote. This will require the quoter to confirm
* @summary Accept Quote
* @param {string} quoteId Quote ID
* @param {AcceptQuoteRequest} acceptQuoteRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public acceptQuote(quoteId: string, acceptQuoteRequest: AcceptQuoteRequest, options?: RawAxiosRequestConfig) {
return CommunicationsApiFp(this.configuration).acceptQuote(quoteId, acceptQuoteRequest, options).then((request) => request(this.axios, this.basePath));
}
/**
* Endpoint for confirming a quote. This will start a timer for order execution
* @summary Confirm Quote
* @param {string} quoteId Quote ID
* @param {object} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
public confirmQuote(quoteId: string, body?: object, options?: RawAxiosRequestConfig) {
return CommunicationsApiFp(this.configuration).confirmQuote(quoteId, body,