kalshi-typescript 2.1.1 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +4 -1
- package/.openapi-generator-ignore +9 -2
- package/README.md +200 -29
- package/api/api-keys-api.ts +5 -5
- package/api/communications-api.ts +12 -12
- package/api/events-api.ts +4 -4
- package/api/exchange-api.ts +9 -9
- package/api/markets-api.ts +10 -10
- package/api/milestones-api.ts +3 -3
- package/api/multivariate-collections-api.ts +4 -4
- package/api/portfolio-api.ts +95 -21
- package/api/series-api.ts +3 -3
- package/api/structured-targets-api.ts +3 -3
- package/auth.ts +38 -0
- package/base.ts +51 -17
- package/common.ts +1 -1
- package/configuration.ts +1 -1
- package/dist/api/api-keys-api.d.ts +4 -4
- package/dist/api/api-keys-api.js +8 -8
- package/dist/api/communications-api.d.ts +11 -11
- package/dist/api/communications-api.js +22 -22
- package/dist/api/events-api.d.ts +3 -3
- package/dist/api/events-api.js +6 -6
- package/dist/api/exchange-api.d.ts +8 -8
- package/dist/api/exchange-api.js +12 -12
- package/dist/api/markets-api.d.ts +9 -9
- package/dist/api/markets-api.js +14 -14
- package/dist/api/milestones-api.d.ts +2 -2
- package/dist/api/milestones-api.js +4 -4
- package/dist/api/multivariate-collections-api.d.ts +3 -3
- package/dist/api/multivariate-collections-api.js +6 -6
- package/dist/api/portfolio-api.d.ts +52 -19
- package/dist/api/portfolio-api.js +107 -39
- package/dist/api/series-api.d.ts +2 -2
- package/dist/api/series-api.js +4 -4
- package/dist/api/structured-targets-api.d.ts +2 -2
- package/dist/api/structured-targets-api.js +4 -4
- package/dist/auth.d.ts +7 -0
- package/dist/auth.js +33 -0
- package/dist/base.d.ts +25 -10
- package/dist/base.js +37 -6
- package/dist/esm/api/api-keys-api.d.ts +4 -4
- package/dist/esm/api/api-keys-api.js +9 -9
- package/dist/esm/api/communications-api.d.ts +11 -11
- package/dist/esm/api/communications-api.js +23 -23
- package/dist/esm/api/events-api.d.ts +3 -3
- package/dist/esm/api/events-api.js +7 -7
- package/dist/esm/api/exchange-api.d.ts +8 -8
- package/dist/esm/api/exchange-api.js +13 -13
- package/dist/esm/api/markets-api.d.ts +9 -9
- package/dist/esm/api/markets-api.js +15 -15
- package/dist/esm/api/milestones-api.d.ts +2 -2
- package/dist/esm/api/milestones-api.js +5 -5
- package/dist/esm/api/multivariate-collections-api.d.ts +3 -3
- package/dist/esm/api/multivariate-collections-api.js +7 -7
- package/dist/esm/api/portfolio-api.d.ts +52 -19
- package/dist/esm/api/portfolio-api.js +108 -40
- package/dist/esm/api/series-api.d.ts +2 -2
- package/dist/esm/api/series-api.js +5 -5
- package/dist/esm/api/structured-targets-api.d.ts +2 -2
- package/dist/esm/api/structured-targets-api.js +5 -5
- package/dist/esm/auth.d.ts +7 -0
- package/dist/esm/auth.js +29 -0
- package/dist/esm/base.d.ts +25 -10
- package/dist/esm/base.js +36 -5
- package/dist/esm/models/amend-order-request.d.ts +30 -0
- package/dist/esm/models/amend-order-request.js +8 -1
- package/dist/esm/models/create-order-group-request.d.ts +4 -1
- package/dist/esm/models/create-order-group-response.d.ts +4 -2
- package/dist/esm/models/create-order-request.d.ts +8 -0
- package/dist/esm/models/error-response-error.d.ts +1 -1
- package/dist/esm/models/event-position.d.ts +53 -0
- package/dist/esm/models/event-position.js +14 -0
- package/dist/esm/models/get-order-group-response.d.ts +21 -0
- package/dist/esm/models/get-order-group-response.js +14 -0
- package/dist/esm/models/get-order-response.d.ts +1 -1
- package/dist/esm/models/get-positions-response.d.ts +3 -1
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/esm/models/order-group.d.ts +8 -4
- package/dist/esm/models/order.d.ts +16 -0
- package/dist/models/amend-order-request.d.ts +30 -0
- package/dist/models/amend-order-request.js +9 -0
- package/dist/models/create-order-group-request.d.ts +4 -1
- package/dist/models/create-order-group-response.d.ts +4 -2
- package/dist/models/create-order-request.d.ts +8 -0
- package/dist/models/error-response-error.d.ts +1 -1
- package/dist/models/event-position.d.ts +53 -0
- package/dist/models/event-position.js +15 -0
- package/dist/models/get-order-group-response.d.ts +21 -0
- package/dist/models/get-order-group-response.js +15 -0
- package/dist/models/get-order-response.d.ts +1 -1
- package/dist/models/get-positions-response.d.ts +3 -1
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/order-group.d.ts +8 -4
- package/dist/models/order.d.ts +16 -0
- package/docs/AcceptQuoteRequest.md +1 -1
- package/docs/AmendOrderRequest.md +11 -1
- package/docs/AmendOrderResponse.md +1 -1
- package/docs/Announcement.md +1 -1
- package/docs/ApiKey.md +1 -1
- package/docs/ApiKeysApi.md +20 -8
- package/docs/BatchCancelOrdersRequest.md +1 -1
- package/docs/BatchCancelOrdersResponse.md +1 -1
- package/docs/BatchCancelOrdersResponseResponsesInner.md +1 -1
- package/docs/BatchCreateOrdersRequest.md +1 -1
- package/docs/BatchCreateOrdersResponse.md +1 -1
- package/docs/BatchCreateOrdersResponseResponsesInner.md +1 -1
- package/docs/CancelOrderResponse.md +1 -1
- package/docs/Candlestick.md +1 -1
- package/docs/CommunicationsApi.md +55 -22
- package/docs/CreateApiKeyRequest.md +1 -1
- package/docs/CreateApiKeyResponse.md +1 -1
- package/docs/CreateOrderGroupRequest.md +3 -3
- package/docs/CreateOrderGroupResponse.md +3 -3
- package/docs/CreateOrderRequest.md +5 -1
- package/docs/CreateOrderResponse.md +1 -1
- package/docs/CreateQuoteRequest.md +1 -1
- package/docs/CreateQuoteResponse.md +1 -1
- package/docs/CreateRFQRequest.md +1 -1
- package/docs/CreateRFQResponse.md +1 -1
- package/docs/DailySchedule.md +1 -1
- package/docs/DecreaseOrderRequest.md +1 -1
- package/docs/DecreaseOrderResponse.md +1 -1
- package/docs/ErrorResponse.md +1 -1
- package/docs/ErrorResponseError.md +2 -2
- package/docs/Event.md +1 -1
- package/docs/EventPosition.md +38 -0
- package/docs/EventsApi.md +15 -6
- package/docs/ExchangeApi.md +21 -9
- package/docs/ExchangeStatus.md +1 -1
- package/docs/Fill.md +1 -1
- package/docs/GenerateApiKeyRequest.md +1 -1
- package/docs/GenerateApiKeyResponse.md +1 -1
- package/docs/GetApiKeysResponse.md +1 -1
- package/docs/GetBalanceResponse.md +1 -1
- package/docs/GetCommunicationsIDResponse.md +1 -1
- package/docs/GetEventMetadataResponse.md +1 -1
- package/docs/GetEventResponse.md +1 -1
- package/docs/GetEventsResponse.md +1 -1
- package/docs/GetExchangeAnnouncementsResponse.md +1 -1
- package/docs/GetExchangeScheduleResponse.md +1 -1
- package/docs/GetExchangeScheduleResponseSchedule.md +1 -1
- package/docs/GetFillsResponse.md +1 -1
- package/docs/GetMarketCandlesticksResponse.md +1 -1
- package/docs/GetMarketOrderbookResponse.md +1 -1
- package/docs/GetMarketOrderbookResponseOrderbook.md +1 -1
- package/docs/GetMarketResponse.md +1 -1
- package/docs/GetMarketsResponse.md +1 -1
- package/docs/GetMilestoneResponse.md +1 -1
- package/docs/GetMilestonesResponse.md +1 -1
- package/docs/GetMultivariateEventCollectionResponse.md +1 -1
- package/docs/GetMultivariateEventCollectionsResponse.md +1 -1
- package/docs/GetOrderGroupResponse.md +22 -0
- package/docs/GetOrderGroupsResponse.md +1 -1
- package/docs/GetOrderQueuePositionResponse.md +1 -1
- package/docs/GetOrderResponse.md +2 -2
- package/docs/GetOrdersResponse.md +1 -1
- package/docs/GetPositionsResponse.md +5 -3
- package/docs/GetQueuePositionsRequest.md +1 -1
- package/docs/GetQueuePositionsResponse.md +1 -1
- package/docs/GetQuoteResponse.md +1 -1
- package/docs/GetQuotesResponse.md +1 -1
- package/docs/GetRFQResponse.md +1 -1
- package/docs/GetRFQsResponse.md +1 -1
- package/docs/GetSeriesByTickerResponse.md +1 -1
- package/docs/GetSeriesResponse.md +1 -1
- package/docs/GetSettlementsResponse.md +1 -1
- package/docs/GetStructuredTargetResponse.md +1 -1
- package/docs/GetStructuredTargetsResponse.md +1 -1
- package/docs/GetTotalRestingOrderValueResponse.md +1 -1
- package/docs/GetTradesResponse.md +1 -1
- package/docs/GetUserDataTimestampResponse.md +1 -1
- package/docs/LookupBundleRequest.md +1 -1
- package/docs/LookupBundleRequestBundleInner.md +1 -1
- package/docs/LookupBundleResponse.md +1 -1
- package/docs/Market.md +1 -1
- package/docs/MarketsApi.md +26 -11
- package/docs/Milestone.md +1 -1
- package/docs/MilestonesApi.md +10 -4
- package/docs/MultivariateCollectionsApi.md +15 -6
- package/docs/MultivariateEventCollection.md +1 -1
- package/docs/MultivariateEventCollectionEventsInner.md +1 -1
- package/docs/Order.md +9 -1
- package/docs/OrderGroup.md +5 -9
- package/docs/OrderbookLevel.md +1 -1
- package/docs/PortfolioApi.md +154 -39
- package/docs/Position.md +1 -1
- package/docs/Quote.md +1 -1
- package/docs/RFQ.md +1 -1
- package/docs/Series.md +1 -1
- package/docs/SeriesApi.md +10 -4
- package/docs/Settlement.md +1 -1
- package/docs/StructuredTarget.md +1 -1
- package/docs/StructuredTargetsApi.md +10 -4
- package/docs/Trade.md +1 -1
- package/models/amend-order-request.ts +34 -0
- package/models/create-order-group-request.ts +4 -1
- package/models/create-order-group-response.ts +4 -4
- package/models/create-order-request.ts +8 -0
- package/models/error-response-error.ts +1 -1
- package/models/event-position.ts +59 -0
- package/models/get-order-group-response.ts +27 -0
- package/models/get-order-response.ts +1 -1
- package/models/get-positions-response.ts +5 -1
- package/models/index.ts +2 -0
- package/models/order-group.ts +8 -4
- package/models/order.ts +16 -0
- package/package.json +4 -4
package/api/markets-api.ts
CHANGED
|
@@ -23,7 +23,7 @@ import { URL, URLSearchParams } from 'url';
|
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError
|
|
26
|
+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
import type { ErrorResponse } from '../models';
|
|
29
29
|
// @ts-ignore
|
|
@@ -180,7 +180,7 @@ export const MarketsApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
180
180
|
};
|
|
181
181
|
},
|
|
182
182
|
/**
|
|
183
|
-
* List and discover markets on Kalshi.
|
|
183
|
+
* List and discover markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.
|
|
184
184
|
* @summary Get Markets
|
|
185
185
|
* @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000.
|
|
186
186
|
* @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.
|
|
@@ -327,7 +327,7 @@ export const MarketsApiFp = function(configuration?: Configuration) {
|
|
|
327
327
|
async getMarket(ticker: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMarketResponse>> {
|
|
328
328
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getMarket(ticker, options);
|
|
329
329
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
330
|
-
const localVarOperationServerBasePath =
|
|
330
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
331
331
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
332
332
|
},
|
|
333
333
|
/**
|
|
@@ -344,7 +344,7 @@ export const MarketsApiFp = function(configuration?: Configuration) {
|
|
|
344
344
|
async getMarketCandlesticks(ticker: string, marketTicker: string, startTs?: number, endTs?: number, periodInterval?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMarketCandlesticksResponse>> {
|
|
345
345
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getMarketCandlesticks(ticker, marketTicker, startTs, endTs, periodInterval, options);
|
|
346
346
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
347
|
-
const localVarOperationServerBasePath =
|
|
347
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
348
348
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
349
349
|
},
|
|
350
350
|
/**
|
|
@@ -358,11 +358,11 @@ export const MarketsApiFp = function(configuration?: Configuration) {
|
|
|
358
358
|
async getMarketOrderbook(ticker: string, depth?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMarketOrderbookResponse>> {
|
|
359
359
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getMarketOrderbook(ticker, depth, options);
|
|
360
360
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
361
|
-
const localVarOperationServerBasePath =
|
|
361
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
362
362
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
363
363
|
},
|
|
364
364
|
/**
|
|
365
|
-
* List and discover markets on Kalshi.
|
|
365
|
+
* List and discover markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.
|
|
366
366
|
* @summary Get Markets
|
|
367
367
|
* @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000.
|
|
368
368
|
* @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.
|
|
@@ -378,7 +378,7 @@ export const MarketsApiFp = function(configuration?: Configuration) {
|
|
|
378
378
|
async getMarkets(limit?: number, cursor?: string, eventTicker?: string, seriesTicker?: string, maxCloseTs?: number, minCloseTs?: number, status?: string, tickers?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMarketsResponse>> {
|
|
379
379
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getMarkets(limit, cursor, eventTicker, seriesTicker, maxCloseTs, minCloseTs, status, tickers, options);
|
|
380
380
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
381
|
-
const localVarOperationServerBasePath =
|
|
381
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
382
382
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
383
383
|
},
|
|
384
384
|
/**
|
|
@@ -395,7 +395,7 @@ export const MarketsApiFp = function(configuration?: Configuration) {
|
|
|
395
395
|
async getTrades(limit?: number, cursor?: string, ticker?: string, minTs?: number, maxTs?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetTradesResponse>> {
|
|
396
396
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getTrades(limit, cursor, ticker, minTs, maxTs, options);
|
|
397
397
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
398
|
-
const localVarOperationServerBasePath =
|
|
398
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
399
399
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
400
400
|
},
|
|
401
401
|
}
|
|
@@ -443,7 +443,7 @@ export const MarketsApiFactory = function (configuration?: Configuration, basePa
|
|
|
443
443
|
return localVarFp.getMarketOrderbook(ticker, depth, options).then((request) => request(axios, basePath));
|
|
444
444
|
},
|
|
445
445
|
/**
|
|
446
|
-
* List and discover markets on Kalshi.
|
|
446
|
+
* List and discover markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.
|
|
447
447
|
* @summary Get Markets
|
|
448
448
|
* @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000.
|
|
449
449
|
* @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.
|
|
@@ -519,7 +519,7 @@ export class MarketsApi extends BaseAPI {
|
|
|
519
519
|
}
|
|
520
520
|
|
|
521
521
|
/**
|
|
522
|
-
* List and discover markets on Kalshi.
|
|
522
|
+
* List and discover markets on Kalshi. A market represents a specific binary outcome within an event that users can trade on (e.g., \"Will candidate X win?\"). Markets have yes/no positions, current prices, volume, and settlement rules. This endpoint returns a paginated response. Use the \'limit\' parameter to control page size (1-1000, defaults to 100). The response includes a \'cursor\' field - pass this value in the \'cursor\' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.
|
|
523
523
|
* @summary Get Markets
|
|
524
524
|
* @param {number} [limit] Number of results per page. Defaults to 100. Maximum value is 1000.
|
|
525
525
|
* @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.
|
package/api/milestones-api.ts
CHANGED
|
@@ -23,7 +23,7 @@ import { URL, URLSearchParams } from 'url';
|
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError
|
|
26
|
+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
import type { ErrorResponse } from '../models';
|
|
29
29
|
// @ts-ignore
|
|
@@ -136,7 +136,7 @@ export const MilestonesApiFp = function(configuration?: Configuration) {
|
|
|
136
136
|
async getMilestone(milestoneId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMilestoneResponse>> {
|
|
137
137
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getMilestone(milestoneId, options);
|
|
138
138
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
139
|
-
const localVarOperationServerBasePath =
|
|
139
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
140
140
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
141
141
|
},
|
|
142
142
|
/**
|
|
@@ -150,7 +150,7 @@ export const MilestonesApiFp = function(configuration?: Configuration) {
|
|
|
150
150
|
async getMilestones(status?: string, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMilestonesResponse>> {
|
|
151
151
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getMilestones(status, limit, options);
|
|
152
152
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
153
|
-
const localVarOperationServerBasePath =
|
|
153
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
154
154
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
155
155
|
},
|
|
156
156
|
}
|
|
@@ -23,7 +23,7 @@ import { URL, URLSearchParams } from 'url';
|
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError
|
|
26
|
+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
import type { ErrorResponse } from '../models';
|
|
29
29
|
// @ts-ignore
|
|
@@ -179,7 +179,7 @@ export const MultivariateCollectionsApiFp = function(configuration?: Configurati
|
|
|
179
179
|
async getMultivariateEventCollection(collectionTicker: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMultivariateEventCollectionResponse>> {
|
|
180
180
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getMultivariateEventCollection(collectionTicker, options);
|
|
181
181
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
182
|
-
const localVarOperationServerBasePath =
|
|
182
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
183
183
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
184
184
|
},
|
|
185
185
|
/**
|
|
@@ -192,7 +192,7 @@ export const MultivariateCollectionsApiFp = function(configuration?: Configurati
|
|
|
192
192
|
async getMultivariateEventCollections(status?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetMultivariateEventCollectionsResponse>> {
|
|
193
193
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getMultivariateEventCollections(status, options);
|
|
194
194
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
195
|
-
const localVarOperationServerBasePath =
|
|
195
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
196
196
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
197
197
|
},
|
|
198
198
|
/**
|
|
@@ -206,7 +206,7 @@ export const MultivariateCollectionsApiFp = function(configuration?: Configurati
|
|
|
206
206
|
async lookupMultivariateEventCollectionBundle(collectionTicker: string, lookupBundleRequest: LookupBundleRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<LookupBundleResponse>> {
|
|
207
207
|
const localVarAxiosArgs = await localVarAxiosParamCreator.lookupMultivariateEventCollectionBundle(collectionTicker, lookupBundleRequest, options);
|
|
208
208
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
209
|
-
const localVarOperationServerBasePath =
|
|
209
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
210
210
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
211
211
|
},
|
|
212
212
|
}
|
package/api/portfolio-api.ts
CHANGED
|
@@ -23,7 +23,7 @@ import { URL, URLSearchParams } from 'url';
|
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError
|
|
26
|
+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
import type { AmendOrderRequest } from '../models';
|
|
29
29
|
// @ts-ignore
|
|
@@ -57,6 +57,8 @@ import type { GetBalanceResponse } from '../models';
|
|
|
57
57
|
// @ts-ignore
|
|
58
58
|
import type { GetFillsResponse } from '../models';
|
|
59
59
|
// @ts-ignore
|
|
60
|
+
import type { GetOrderGroupResponse } from '../models';
|
|
61
|
+
// @ts-ignore
|
|
60
62
|
import type { GetOrderGroupsResponse } from '../models';
|
|
61
63
|
// @ts-ignore
|
|
62
64
|
import type { GetOrderQueuePositionResponse } from '../models';
|
|
@@ -530,6 +532,44 @@ export const PortfolioApiAxiosParamCreator = function (configuration?: Configura
|
|
|
530
532
|
|
|
531
533
|
|
|
532
534
|
|
|
535
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
536
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
537
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
538
|
+
|
|
539
|
+
return {
|
|
540
|
+
url: toPathString(localVarUrlObj),
|
|
541
|
+
options: localVarRequestOptions,
|
|
542
|
+
};
|
|
543
|
+
},
|
|
544
|
+
/**
|
|
545
|
+
* Get details of a specific order group
|
|
546
|
+
* @summary Get Order Group
|
|
547
|
+
* @param {string} orderGroupId Order group ID
|
|
548
|
+
* @param {*} [options] Override http request option.
|
|
549
|
+
* @throws {RequiredError}
|
|
550
|
+
*/
|
|
551
|
+
getOrderGroup: async (orderGroupId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
552
|
+
// verify required parameter 'orderGroupId' is not null or undefined
|
|
553
|
+
assertParamExists('getOrderGroup', 'orderGroupId', orderGroupId)
|
|
554
|
+
const localVarPath = `/portfolio/order_groups/{order_group_id}`
|
|
555
|
+
.replace(`{${"order_group_id"}}`, encodeURIComponent(String(orderGroupId)));
|
|
556
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
557
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
558
|
+
let baseOptions;
|
|
559
|
+
if (configuration) {
|
|
560
|
+
baseOptions = configuration.baseOptions;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
564
|
+
const localVarHeaderParameter = {} as any;
|
|
565
|
+
const localVarQueryParameter = {} as any;
|
|
566
|
+
|
|
567
|
+
// authentication bearerAuth required
|
|
568
|
+
// http bearer authentication required
|
|
569
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
|
|
533
573
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
534
574
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
535
575
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
@@ -896,7 +936,7 @@ export const PortfolioApiAxiosParamCreator = function (configuration?: Configura
|
|
|
896
936
|
baseOptions = configuration.baseOptions;
|
|
897
937
|
}
|
|
898
938
|
|
|
899
|
-
const localVarRequestOptions = { method: '
|
|
939
|
+
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
|
|
900
940
|
const localVarHeaderParameter = {} as any;
|
|
901
941
|
const localVarQueryParameter = {} as any;
|
|
902
942
|
|
|
@@ -935,7 +975,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
935
975
|
async amendOrder(orderId: string, amendOrderRequest: AmendOrderRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AmendOrderResponse>> {
|
|
936
976
|
const localVarAxiosArgs = await localVarAxiosParamCreator.amendOrder(orderId, amendOrderRequest, options);
|
|
937
977
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
938
|
-
const localVarOperationServerBasePath =
|
|
978
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
939
979
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
940
980
|
},
|
|
941
981
|
/**
|
|
@@ -948,7 +988,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
948
988
|
async batchCancelOrders(batchCancelOrdersRequest: BatchCancelOrdersRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<BatchCancelOrdersResponse>> {
|
|
949
989
|
const localVarAxiosArgs = await localVarAxiosParamCreator.batchCancelOrders(batchCancelOrdersRequest, options);
|
|
950
990
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
951
|
-
const localVarOperationServerBasePath =
|
|
991
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
952
992
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
953
993
|
},
|
|
954
994
|
/**
|
|
@@ -961,7 +1001,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
961
1001
|
async batchCreateOrders(batchCreateOrdersRequest: BatchCreateOrdersRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<BatchCreateOrdersResponse>> {
|
|
962
1002
|
const localVarAxiosArgs = await localVarAxiosParamCreator.batchCreateOrders(batchCreateOrdersRequest, options);
|
|
963
1003
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
964
|
-
const localVarOperationServerBasePath =
|
|
1004
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
965
1005
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
966
1006
|
},
|
|
967
1007
|
/**
|
|
@@ -974,7 +1014,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
974
1014
|
async cancelOrder(orderId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CancelOrderResponse>> {
|
|
975
1015
|
const localVarAxiosArgs = await localVarAxiosParamCreator.cancelOrder(orderId, options);
|
|
976
1016
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
977
|
-
const localVarOperationServerBasePath =
|
|
1017
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
978
1018
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
979
1019
|
},
|
|
980
1020
|
/**
|
|
@@ -987,7 +1027,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
987
1027
|
async createOrder(createOrderRequest: CreateOrderRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateOrderResponse>> {
|
|
988
1028
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createOrder(createOrderRequest, options);
|
|
989
1029
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
990
|
-
const localVarOperationServerBasePath =
|
|
1030
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
991
1031
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
992
1032
|
},
|
|
993
1033
|
/**
|
|
@@ -1000,7 +1040,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1000
1040
|
async createOrderGroup(createOrderGroupRequest: CreateOrderGroupRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateOrderGroupResponse>> {
|
|
1001
1041
|
const localVarAxiosArgs = await localVarAxiosParamCreator.createOrderGroup(createOrderGroupRequest, options);
|
|
1002
1042
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1003
|
-
const localVarOperationServerBasePath =
|
|
1043
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1004
1044
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1005
1045
|
},
|
|
1006
1046
|
/**
|
|
@@ -1014,7 +1054,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1014
1054
|
async decreaseOrder(orderId: string, decreaseOrderRequest: DecreaseOrderRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DecreaseOrderResponse>> {
|
|
1015
1055
|
const localVarAxiosArgs = await localVarAxiosParamCreator.decreaseOrder(orderId, decreaseOrderRequest, options);
|
|
1016
1056
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1017
|
-
const localVarOperationServerBasePath =
|
|
1057
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1018
1058
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1019
1059
|
},
|
|
1020
1060
|
/**
|
|
@@ -1027,7 +1067,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1027
1067
|
async deleteOrderGroup(orderGroupId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
1028
1068
|
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrderGroup(orderGroupId, options);
|
|
1029
1069
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1030
|
-
const localVarOperationServerBasePath =
|
|
1070
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1031
1071
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1032
1072
|
},
|
|
1033
1073
|
/**
|
|
@@ -1039,7 +1079,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1039
1079
|
async getBalance(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetBalanceResponse>> {
|
|
1040
1080
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getBalance(options);
|
|
1041
1081
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1042
|
-
const localVarOperationServerBasePath =
|
|
1082
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1043
1083
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1044
1084
|
},
|
|
1045
1085
|
/**
|
|
@@ -1057,7 +1097,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1057
1097
|
async getFills(ticker?: string, orderId?: string, minTs?: number, maxTs?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetFillsResponse>> {
|
|
1058
1098
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getFills(ticker, orderId, minTs, maxTs, limit, cursor, options);
|
|
1059
1099
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1060
|
-
const localVarOperationServerBasePath =
|
|
1100
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1061
1101
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1062
1102
|
},
|
|
1063
1103
|
/**
|
|
@@ -1070,7 +1110,20 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1070
1110
|
async getOrder(orderId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetOrderResponse>> {
|
|
1071
1111
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getOrder(orderId, options);
|
|
1072
1112
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1073
|
-
const localVarOperationServerBasePath =
|
|
1113
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1114
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1115
|
+
},
|
|
1116
|
+
/**
|
|
1117
|
+
* Get details of a specific order group
|
|
1118
|
+
* @summary Get Order Group
|
|
1119
|
+
* @param {string} orderGroupId Order group ID
|
|
1120
|
+
* @param {*} [options] Override http request option.
|
|
1121
|
+
* @throws {RequiredError}
|
|
1122
|
+
*/
|
|
1123
|
+
async getOrderGroup(orderGroupId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetOrderGroupResponse>> {
|
|
1124
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderGroup(orderGroupId, options);
|
|
1125
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1126
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1074
1127
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1075
1128
|
},
|
|
1076
1129
|
/**
|
|
@@ -1085,7 +1138,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1085
1138
|
async getOrderGroups(status?: string, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetOrderGroupsResponse>> {
|
|
1086
1139
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderGroups(status, limit, cursor, options);
|
|
1087
1140
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1088
|
-
const localVarOperationServerBasePath =
|
|
1141
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1089
1142
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1090
1143
|
},
|
|
1091
1144
|
/**
|
|
@@ -1098,7 +1151,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1098
1151
|
async getOrderQueuePosition(orderId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetOrderQueuePositionResponse>> {
|
|
1099
1152
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderQueuePosition(orderId, options);
|
|
1100
1153
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1101
|
-
const localVarOperationServerBasePath =
|
|
1154
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1102
1155
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1103
1156
|
},
|
|
1104
1157
|
/**
|
|
@@ -1117,7 +1170,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1117
1170
|
async getOrders(ticker?: string, eventTicker?: string, minTs?: number, maxTs?: number, status?: string, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetOrdersResponse>> {
|
|
1118
1171
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getOrders(ticker, eventTicker, minTs, maxTs, status, limit, cursor, options);
|
|
1119
1172
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1120
|
-
const localVarOperationServerBasePath =
|
|
1173
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1121
1174
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1122
1175
|
},
|
|
1123
1176
|
/**
|
|
@@ -1135,7 +1188,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1135
1188
|
async getPositions(ticker?: string, eventTicker?: string, countDown?: number, countUp?: number, limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetPositionsResponse>> {
|
|
1136
1189
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getPositions(ticker, eventTicker, countDown, countUp, limit, cursor, options);
|
|
1137
1190
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1138
|
-
const localVarOperationServerBasePath =
|
|
1191
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1139
1192
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1140
1193
|
},
|
|
1141
1194
|
/**
|
|
@@ -1148,7 +1201,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1148
1201
|
async getQueuePositions(getQueuePositionsRequest: GetQueuePositionsRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetQueuePositionsResponse>> {
|
|
1149
1202
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getQueuePositions(getQueuePositionsRequest, options);
|
|
1150
1203
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1151
|
-
const localVarOperationServerBasePath =
|
|
1204
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1152
1205
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1153
1206
|
},
|
|
1154
1207
|
/**
|
|
@@ -1162,7 +1215,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1162
1215
|
async getSettlements(limit?: number, cursor?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetSettlementsResponse>> {
|
|
1163
1216
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getSettlements(limit, cursor, options);
|
|
1164
1217
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1165
|
-
const localVarOperationServerBasePath =
|
|
1218
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1166
1219
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1167
1220
|
},
|
|
1168
1221
|
/**
|
|
@@ -1174,7 +1227,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1174
1227
|
async getTotalRestingOrderValue(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetTotalRestingOrderValueResponse>> {
|
|
1175
1228
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getTotalRestingOrderValue(options);
|
|
1176
1229
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1177
|
-
const localVarOperationServerBasePath =
|
|
1230
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1178
1231
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1179
1232
|
},
|
|
1180
1233
|
/**
|
|
@@ -1187,7 +1240,7 @@ export const PortfolioApiFp = function(configuration?: Configuration) {
|
|
|
1187
1240
|
async resetOrderGroup(orderGroupId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
1188
1241
|
const localVarAxiosArgs = await localVarAxiosParamCreator.resetOrderGroup(orderGroupId, options);
|
|
1189
1242
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1190
|
-
const localVarOperationServerBasePath =
|
|
1243
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
1191
1244
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1192
1245
|
},
|
|
1193
1246
|
}
|
|
@@ -1315,6 +1368,16 @@ export const PortfolioApiFactory = function (configuration?: Configuration, base
|
|
|
1315
1368
|
getOrder(orderId: string, options?: RawAxiosRequestConfig): AxiosPromise<GetOrderResponse> {
|
|
1316
1369
|
return localVarFp.getOrder(orderId, options).then((request) => request(axios, basePath));
|
|
1317
1370
|
},
|
|
1371
|
+
/**
|
|
1372
|
+
* Get details of a specific order group
|
|
1373
|
+
* @summary Get Order Group
|
|
1374
|
+
* @param {string} orderGroupId Order group ID
|
|
1375
|
+
* @param {*} [options] Override http request option.
|
|
1376
|
+
* @throws {RequiredError}
|
|
1377
|
+
*/
|
|
1378
|
+
getOrderGroup(orderGroupId: string, options?: RawAxiosRequestConfig): AxiosPromise<GetOrderGroupResponse> {
|
|
1379
|
+
return localVarFp.getOrderGroup(orderGroupId, options).then((request) => request(axios, basePath));
|
|
1380
|
+
},
|
|
1318
1381
|
/**
|
|
1319
1382
|
* Get order groups for the logged-in user
|
|
1320
1383
|
* @summary Get Order Groups
|
|
@@ -1542,6 +1605,17 @@ export class PortfolioApi extends BaseAPI {
|
|
|
1542
1605
|
return PortfolioApiFp(this.configuration).getOrder(orderId, options).then((request) => request(this.axios, this.basePath));
|
|
1543
1606
|
}
|
|
1544
1607
|
|
|
1608
|
+
/**
|
|
1609
|
+
* Get details of a specific order group
|
|
1610
|
+
* @summary Get Order Group
|
|
1611
|
+
* @param {string} orderGroupId Order group ID
|
|
1612
|
+
* @param {*} [options] Override http request option.
|
|
1613
|
+
* @throws {RequiredError}
|
|
1614
|
+
*/
|
|
1615
|
+
public getOrderGroup(orderGroupId: string, options?: RawAxiosRequestConfig) {
|
|
1616
|
+
return PortfolioApiFp(this.configuration).getOrderGroup(orderGroupId, options).then((request) => request(this.axios, this.basePath));
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1545
1619
|
/**
|
|
1546
1620
|
* Get order groups for the logged-in user
|
|
1547
1621
|
* @summary Get Order Groups
|
package/api/series-api.ts
CHANGED
|
@@ -23,7 +23,7 @@ import { URL, URLSearchParams } from 'url';
|
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError
|
|
26
|
+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
import type { ErrorResponse } from '../models';
|
|
29
29
|
// @ts-ignore
|
|
@@ -131,7 +131,7 @@ export const SeriesApiFp = function(configuration?: Configuration) {
|
|
|
131
131
|
async getSeries(status?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetSeriesResponse>> {
|
|
132
132
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getSeries(status, options);
|
|
133
133
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
134
|
-
const localVarOperationServerBasePath =
|
|
134
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
135
135
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
136
136
|
},
|
|
137
137
|
/**
|
|
@@ -144,7 +144,7 @@ export const SeriesApiFp = function(configuration?: Configuration) {
|
|
|
144
144
|
async getSeriesByTicker(ticker: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetSeriesByTickerResponse>> {
|
|
145
145
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getSeriesByTicker(ticker, options);
|
|
146
146
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
147
|
-
const localVarOperationServerBasePath =
|
|
147
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
148
148
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
149
149
|
},
|
|
150
150
|
}
|
|
@@ -23,7 +23,7 @@ import { URL, URLSearchParams } from 'url';
|
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError
|
|
26
|
+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
import type { ErrorResponse } from '../models';
|
|
29
29
|
// @ts-ignore
|
|
@@ -136,7 +136,7 @@ export const StructuredTargetsApiFp = function(configuration?: Configuration) {
|
|
|
136
136
|
async getStructuredTarget(structuredTargetId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetStructuredTargetResponse>> {
|
|
137
137
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getStructuredTarget(structuredTargetId, options);
|
|
138
138
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
139
|
-
const localVarOperationServerBasePath =
|
|
139
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
140
140
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
141
141
|
},
|
|
142
142
|
/**
|
|
@@ -150,7 +150,7 @@ export const StructuredTargetsApiFp = function(configuration?: Configuration) {
|
|
|
150
150
|
async getStructuredTargets(status?: string, pageSize?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetStructuredTargetsResponse>> {
|
|
151
151
|
const localVarAxiosArgs = await localVarAxiosParamCreator.getStructuredTargets(status, pageSize, options);
|
|
152
152
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
153
|
-
const localVarOperationServerBasePath =
|
|
153
|
+
const localVarOperationServerBasePath: string | undefined = undefined;
|
|
154
154
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
155
155
|
},
|
|
156
156
|
}
|
package/auth.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as crypto from 'crypto';
|
|
2
|
+
|
|
3
|
+
export class KalshiAuth {
|
|
4
|
+
private apiKey: string;
|
|
5
|
+
private privateKeyPem: string;
|
|
6
|
+
|
|
7
|
+
constructor(apiKey: string, privateKeyPem: string) {
|
|
8
|
+
this.apiKey = apiKey;
|
|
9
|
+
this.privateKeyPem = privateKeyPem;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
private signPssText(text: string): string {
|
|
13
|
+
const sign = crypto.createSign('RSA-SHA256');
|
|
14
|
+
sign.update(text);
|
|
15
|
+
sign.end();
|
|
16
|
+
|
|
17
|
+
const signature = sign.sign({
|
|
18
|
+
key: this.privateKeyPem,
|
|
19
|
+
padding: crypto.constants.RSA_PKCS1_PSS_PADDING,
|
|
20
|
+
saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return signature.toString('base64');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public generateAuthHeaders(method: string, path: string): Record<string, string> {
|
|
27
|
+
const currentTimeMilliseconds = Date.now();
|
|
28
|
+
const timestampStr = currentTimeMilliseconds.toString();
|
|
29
|
+
const msgString = timestampStr + method + path;
|
|
30
|
+
const sig = this.signPssText(msgString);
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
'KALSHI-ACCESS-KEY': this.apiKey,
|
|
34
|
+
'KALSHI-ACCESS-SIGNATURE': sig,
|
|
35
|
+
'KALSHI-ACCESS-TIMESTAMP': timestampStr
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|