kalshi-typescript 2.1.1 → 2.1.2

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.
Files changed (189) hide show
  1. package/.openapi-generator/FILES +4 -1
  2. package/.openapi-generator-ignore +9 -2
  3. package/README.md +200 -29
  4. package/api/exchange-api.ts +4 -4
  5. package/api/markets-api.ts +4 -4
  6. package/api/portfolio-api.ts +75 -1
  7. package/auth.ts +38 -0
  8. package/base.ts +51 -17
  9. package/common.ts +1 -1
  10. package/configuration.ts +1 -1
  11. package/dist/api/api-keys-api.d.ts +4 -4
  12. package/dist/api/communications-api.d.ts +11 -11
  13. package/dist/api/events-api.d.ts +3 -3
  14. package/dist/api/exchange-api.d.ts +8 -8
  15. package/dist/api/exchange-api.js +4 -4
  16. package/dist/api/markets-api.d.ts +9 -9
  17. package/dist/api/markets-api.js +4 -4
  18. package/dist/api/milestones-api.d.ts +2 -2
  19. package/dist/api/multivariate-collections-api.d.ts +3 -3
  20. package/dist/api/portfolio-api.d.ts +52 -19
  21. package/dist/api/portfolio-api.js +69 -1
  22. package/dist/api/series-api.d.ts +2 -2
  23. package/dist/api/structured-targets-api.d.ts +2 -2
  24. package/dist/auth.d.ts +7 -0
  25. package/dist/auth.js +33 -0
  26. package/dist/base.d.ts +25 -10
  27. package/dist/base.js +37 -6
  28. package/dist/esm/api/api-keys-api.d.ts +4 -4
  29. package/dist/esm/api/communications-api.d.ts +11 -11
  30. package/dist/esm/api/events-api.d.ts +3 -3
  31. package/dist/esm/api/exchange-api.d.ts +8 -8
  32. package/dist/esm/api/exchange-api.js +4 -4
  33. package/dist/esm/api/markets-api.d.ts +9 -9
  34. package/dist/esm/api/markets-api.js +4 -4
  35. package/dist/esm/api/milestones-api.d.ts +2 -2
  36. package/dist/esm/api/multivariate-collections-api.d.ts +3 -3
  37. package/dist/esm/api/portfolio-api.d.ts +52 -19
  38. package/dist/esm/api/portfolio-api.js +69 -1
  39. package/dist/esm/api/series-api.d.ts +2 -2
  40. package/dist/esm/api/structured-targets-api.d.ts +2 -2
  41. package/dist/esm/auth.d.ts +7 -0
  42. package/dist/esm/auth.js +29 -0
  43. package/dist/esm/base.d.ts +25 -10
  44. package/dist/esm/base.js +36 -5
  45. package/dist/esm/models/amend-order-request.d.ts +30 -0
  46. package/dist/esm/models/amend-order-request.js +8 -1
  47. package/dist/esm/models/create-order-group-request.d.ts +4 -1
  48. package/dist/esm/models/create-order-group-response.d.ts +4 -2
  49. package/dist/esm/models/create-order-request.d.ts +8 -0
  50. package/dist/esm/models/error-response-error.d.ts +1 -1
  51. package/dist/esm/models/event-position.d.ts +53 -0
  52. package/dist/esm/models/event-position.js +14 -0
  53. package/dist/esm/models/get-order-group-response.d.ts +21 -0
  54. package/dist/esm/models/get-order-group-response.js +14 -0
  55. package/dist/esm/models/get-order-response.d.ts +1 -1
  56. package/dist/esm/models/get-positions-response.d.ts +3 -1
  57. package/dist/esm/models/index.d.ts +2 -0
  58. package/dist/esm/models/index.js +2 -0
  59. package/dist/esm/models/order-group.d.ts +8 -4
  60. package/dist/esm/models/order.d.ts +16 -0
  61. package/dist/models/amend-order-request.d.ts +30 -0
  62. package/dist/models/amend-order-request.js +9 -0
  63. package/dist/models/create-order-group-request.d.ts +4 -1
  64. package/dist/models/create-order-group-response.d.ts +4 -2
  65. package/dist/models/create-order-request.d.ts +8 -0
  66. package/dist/models/error-response-error.d.ts +1 -1
  67. package/dist/models/event-position.d.ts +53 -0
  68. package/dist/models/event-position.js +15 -0
  69. package/dist/models/get-order-group-response.d.ts +21 -0
  70. package/dist/models/get-order-group-response.js +15 -0
  71. package/dist/models/get-order-response.d.ts +1 -1
  72. package/dist/models/get-positions-response.d.ts +3 -1
  73. package/dist/models/index.d.ts +2 -0
  74. package/dist/models/index.js +2 -0
  75. package/dist/models/order-group.d.ts +8 -4
  76. package/dist/models/order.d.ts +16 -0
  77. package/docs/AcceptQuoteRequest.md +1 -1
  78. package/docs/AmendOrderRequest.md +11 -1
  79. package/docs/AmendOrderResponse.md +1 -1
  80. package/docs/Announcement.md +1 -1
  81. package/docs/ApiKey.md +1 -1
  82. package/docs/ApiKeysApi.md +20 -8
  83. package/docs/BatchCancelOrdersRequest.md +1 -1
  84. package/docs/BatchCancelOrdersResponse.md +1 -1
  85. package/docs/BatchCancelOrdersResponseResponsesInner.md +1 -1
  86. package/docs/BatchCreateOrdersRequest.md +1 -1
  87. package/docs/BatchCreateOrdersResponse.md +1 -1
  88. package/docs/BatchCreateOrdersResponseResponsesInner.md +1 -1
  89. package/docs/CancelOrderResponse.md +1 -1
  90. package/docs/Candlestick.md +1 -1
  91. package/docs/CommunicationsApi.md +55 -22
  92. package/docs/CreateApiKeyRequest.md +1 -1
  93. package/docs/CreateApiKeyResponse.md +1 -1
  94. package/docs/CreateOrderGroupRequest.md +3 -3
  95. package/docs/CreateOrderGroupResponse.md +3 -3
  96. package/docs/CreateOrderRequest.md +5 -1
  97. package/docs/CreateOrderResponse.md +1 -1
  98. package/docs/CreateQuoteRequest.md +1 -1
  99. package/docs/CreateQuoteResponse.md +1 -1
  100. package/docs/CreateRFQRequest.md +1 -1
  101. package/docs/CreateRFQResponse.md +1 -1
  102. package/docs/DailySchedule.md +1 -1
  103. package/docs/DecreaseOrderRequest.md +1 -1
  104. package/docs/DecreaseOrderResponse.md +1 -1
  105. package/docs/ErrorResponse.md +1 -1
  106. package/docs/ErrorResponseError.md +2 -2
  107. package/docs/Event.md +1 -1
  108. package/docs/EventPosition.md +38 -0
  109. package/docs/EventsApi.md +15 -6
  110. package/docs/ExchangeApi.md +21 -9
  111. package/docs/ExchangeStatus.md +1 -1
  112. package/docs/Fill.md +1 -1
  113. package/docs/GenerateApiKeyRequest.md +1 -1
  114. package/docs/GenerateApiKeyResponse.md +1 -1
  115. package/docs/GetApiKeysResponse.md +1 -1
  116. package/docs/GetBalanceResponse.md +1 -1
  117. package/docs/GetCommunicationsIDResponse.md +1 -1
  118. package/docs/GetEventMetadataResponse.md +1 -1
  119. package/docs/GetEventResponse.md +1 -1
  120. package/docs/GetEventsResponse.md +1 -1
  121. package/docs/GetExchangeAnnouncementsResponse.md +1 -1
  122. package/docs/GetExchangeScheduleResponse.md +1 -1
  123. package/docs/GetExchangeScheduleResponseSchedule.md +1 -1
  124. package/docs/GetFillsResponse.md +1 -1
  125. package/docs/GetMarketCandlesticksResponse.md +1 -1
  126. package/docs/GetMarketOrderbookResponse.md +1 -1
  127. package/docs/GetMarketOrderbookResponseOrderbook.md +1 -1
  128. package/docs/GetMarketResponse.md +1 -1
  129. package/docs/GetMarketsResponse.md +1 -1
  130. package/docs/GetMilestoneResponse.md +1 -1
  131. package/docs/GetMilestonesResponse.md +1 -1
  132. package/docs/GetMultivariateEventCollectionResponse.md +1 -1
  133. package/docs/GetMultivariateEventCollectionsResponse.md +1 -1
  134. package/docs/GetOrderGroupResponse.md +22 -0
  135. package/docs/GetOrderGroupsResponse.md +1 -1
  136. package/docs/GetOrderQueuePositionResponse.md +1 -1
  137. package/docs/GetOrderResponse.md +2 -2
  138. package/docs/GetOrdersResponse.md +1 -1
  139. package/docs/GetPositionsResponse.md +5 -3
  140. package/docs/GetQueuePositionsRequest.md +1 -1
  141. package/docs/GetQueuePositionsResponse.md +1 -1
  142. package/docs/GetQuoteResponse.md +1 -1
  143. package/docs/GetQuotesResponse.md +1 -1
  144. package/docs/GetRFQResponse.md +1 -1
  145. package/docs/GetRFQsResponse.md +1 -1
  146. package/docs/GetSeriesByTickerResponse.md +1 -1
  147. package/docs/GetSeriesResponse.md +1 -1
  148. package/docs/GetSettlementsResponse.md +1 -1
  149. package/docs/GetStructuredTargetResponse.md +1 -1
  150. package/docs/GetStructuredTargetsResponse.md +1 -1
  151. package/docs/GetTotalRestingOrderValueResponse.md +1 -1
  152. package/docs/GetTradesResponse.md +1 -1
  153. package/docs/GetUserDataTimestampResponse.md +1 -1
  154. package/docs/LookupBundleRequest.md +1 -1
  155. package/docs/LookupBundleRequestBundleInner.md +1 -1
  156. package/docs/LookupBundleResponse.md +1 -1
  157. package/docs/Market.md +1 -1
  158. package/docs/MarketsApi.md +26 -11
  159. package/docs/Milestone.md +1 -1
  160. package/docs/MilestonesApi.md +10 -4
  161. package/docs/MultivariateCollectionsApi.md +15 -6
  162. package/docs/MultivariateEventCollection.md +1 -1
  163. package/docs/MultivariateEventCollectionEventsInner.md +1 -1
  164. package/docs/Order.md +9 -1
  165. package/docs/OrderGroup.md +5 -9
  166. package/docs/OrderbookLevel.md +1 -1
  167. package/docs/PortfolioApi.md +154 -39
  168. package/docs/Position.md +1 -1
  169. package/docs/Quote.md +1 -1
  170. package/docs/RFQ.md +1 -1
  171. package/docs/Series.md +1 -1
  172. package/docs/SeriesApi.md +10 -4
  173. package/docs/Settlement.md +1 -1
  174. package/docs/StructuredTarget.md +1 -1
  175. package/docs/StructuredTargetsApi.md +10 -4
  176. package/docs/Trade.md +1 -1
  177. package/models/amend-order-request.ts +34 -0
  178. package/models/create-order-group-request.ts +4 -1
  179. package/models/create-order-group-response.ts +4 -4
  180. package/models/create-order-request.ts +8 -0
  181. package/models/error-response-error.ts +1 -1
  182. package/models/event-position.ts +59 -0
  183. package/models/get-order-group-response.ts +27 -0
  184. package/models/get-order-response.ts +1 -1
  185. package/models/get-positions-response.ts +5 -1
  186. package/models/index.ts +2 -0
  187. package/models/order-group.ts +8 -4
  188. package/models/order.ts +16 -0
  189. package/package.json +4 -4
@@ -15,6 +15,7 @@ All URIs are relative to *https://api.elections.kalshi.com/trade-api/v2*
15
15
  |[**getBalance**](#getbalance) | **GET** /portfolio/balance | Get Balance|
16
16
  |[**getFills**](#getfills) | **GET** /portfolio/fills | Get Fills|
17
17
  |[**getOrder**](#getorder) | **GET** /portfolio/orders/{order_id} | Get Order|
18
+ |[**getOrderGroup**](#getordergroup) | **GET** /portfolio/order_groups/{order_group_id} | Get Order Group|
18
19
  |[**getOrderGroups**](#getordergroups) | **GET** /portfolio/order_groups | Get Order Groups|
19
20
  |[**getOrderQueuePosition**](#getorderqueueposition) | **GET** /portfolio/orders/{order_id}/queue_position | Get Order Queue Position|
20
21
  |[**getOrders**](#getorders) | **GET** /portfolio/orders | Get Orders|
@@ -22,7 +23,7 @@ All URIs are relative to *https://api.elections.kalshi.com/trade-api/v2*
22
23
  |[**getQueuePositions**](#getqueuepositions) | **POST** /portfolio/orders/queue_positions | Get Queue Positions|
23
24
  |[**getSettlements**](#getsettlements) | **GET** /portfolio/settlements | Get Settlements|
24
25
  |[**getTotalRestingOrderValue**](#gettotalrestingordervalue) | **GET** /portfolio/summary/total_resting_order_value | Get Total Resting Order Value|
25
- |[**resetOrderGroup**](#resetordergroup) | **POST** /portfolio/order_groups/{order_group_id}/reset | Reset Order Group|
26
+ |[**resetOrderGroup**](#resetordergroup) | **PUT** /portfolio/order_groups/{order_group_id}/reset | Reset Order Group|
26
27
 
27
28
  # **amendOrder**
28
29
  > AmendOrderResponse amendOrder(amendOrderRequest)
@@ -36,9 +37,12 @@ import {
36
37
  PortfolioApi,
37
38
  Configuration,
38
39
  AmendOrderRequest
39
- } from '@kalshi/trading-api';
40
+ } from 'kalshi-typescript';
40
41
 
41
- const configuration = new Configuration();
42
+ const configuration = new Configuration({
43
+ apiKey: 'your-api-key-id',
44
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
45
+ });
42
46
  const apiInstance = new PortfolioApi(configuration);
43
47
 
44
48
  let orderId: string; //Order ID (default to undefined)
@@ -95,9 +99,12 @@ import {
95
99
  PortfolioApi,
96
100
  Configuration,
97
101
  BatchCancelOrdersRequest
98
- } from '@kalshi/trading-api';
102
+ } from 'kalshi-typescript';
99
103
 
100
- const configuration = new Configuration();
104
+ const configuration = new Configuration({
105
+ apiKey: 'your-api-key-id',
106
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
107
+ });
101
108
  const apiInstance = new PortfolioApi(configuration);
102
109
 
103
110
  let batchCancelOrdersRequest: BatchCancelOrdersRequest; //
@@ -150,9 +157,12 @@ import {
150
157
  PortfolioApi,
151
158
  Configuration,
152
159
  BatchCreateOrdersRequest
153
- } from '@kalshi/trading-api';
160
+ } from 'kalshi-typescript';
154
161
 
155
- const configuration = new Configuration();
162
+ const configuration = new Configuration({
163
+ apiKey: 'your-api-key-id',
164
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
165
+ });
156
166
  const apiInstance = new PortfolioApi(configuration);
157
167
 
158
168
  let batchCreateOrdersRequest: BatchCreateOrdersRequest; //
@@ -204,9 +214,12 @@ Cancel an order
204
214
  import {
205
215
  PortfolioApi,
206
216
  Configuration
207
- } from '@kalshi/trading-api';
217
+ } from 'kalshi-typescript';
208
218
 
209
- const configuration = new Configuration();
219
+ const configuration = new Configuration({
220
+ apiKey: 'your-api-key-id',
221
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
222
+ });
210
223
  const apiInstance = new PortfolioApi(configuration);
211
224
 
212
225
  let orderId: string; //Order ID (default to undefined)
@@ -259,9 +272,12 @@ import {
259
272
  PortfolioApi,
260
273
  Configuration,
261
274
  CreateOrderRequest
262
- } from '@kalshi/trading-api';
275
+ } from 'kalshi-typescript';
263
276
 
264
- const configuration = new Configuration();
277
+ const configuration = new Configuration({
278
+ apiKey: 'your-api-key-id',
279
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
280
+ });
265
281
  const apiInstance = new PortfolioApi(configuration);
266
282
 
267
283
  let createOrderRequest: CreateOrderRequest; //
@@ -315,9 +331,12 @@ import {
315
331
  PortfolioApi,
316
332
  Configuration,
317
333
  CreateOrderGroupRequest
318
- } from '@kalshi/trading-api';
334
+ } from 'kalshi-typescript';
319
335
 
320
- const configuration = new Configuration();
336
+ const configuration = new Configuration({
337
+ apiKey: 'your-api-key-id',
338
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
339
+ });
321
340
  const apiInstance = new PortfolioApi(configuration);
322
341
 
323
342
  let createOrderGroupRequest: CreateOrderGroupRequest; //
@@ -370,9 +389,12 @@ import {
370
389
  PortfolioApi,
371
390
  Configuration,
372
391
  DecreaseOrderRequest
373
- } from '@kalshi/trading-api';
392
+ } from 'kalshi-typescript';
374
393
 
375
- const configuration = new Configuration();
394
+ const configuration = new Configuration({
395
+ apiKey: 'your-api-key-id',
396
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
397
+ });
376
398
  const apiInstance = new PortfolioApi(configuration);
377
399
 
378
400
  let orderId: string; //Order ID (default to undefined)
@@ -428,9 +450,12 @@ Delete an order group
428
450
  import {
429
451
  PortfolioApi,
430
452
  Configuration
431
- } from '@kalshi/trading-api';
453
+ } from 'kalshi-typescript';
432
454
 
433
- const configuration = new Configuration();
455
+ const configuration = new Configuration({
456
+ apiKey: 'your-api-key-id',
457
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
458
+ });
434
459
  const apiInstance = new PortfolioApi(configuration);
435
460
 
436
461
  let orderGroupId: string; //Order group ID (default to undefined)
@@ -482,9 +507,12 @@ Get the user\'s current balance
482
507
  import {
483
508
  PortfolioApi,
484
509
  Configuration
485
- } from '@kalshi/trading-api';
510
+ } from 'kalshi-typescript';
486
511
 
487
- const configuration = new Configuration();
512
+ const configuration = new Configuration({
513
+ apiKey: 'your-api-key-id',
514
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
515
+ });
488
516
  const apiInstance = new PortfolioApi(configuration);
489
517
 
490
518
  const { status, data } = await apiInstance.getBalance();
@@ -528,9 +556,12 @@ Get fills for the logged-in user. A fill represents a partial or complete execu
528
556
  import {
529
557
  PortfolioApi,
530
558
  Configuration
531
- } from '@kalshi/trading-api';
559
+ } from 'kalshi-typescript';
532
560
 
533
- const configuration = new Configuration();
561
+ const configuration = new Configuration({
562
+ apiKey: 'your-api-key-id',
563
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
564
+ });
534
565
  const apiInstance = new PortfolioApi(configuration);
535
566
 
536
567
  let ticker: string; //Filter by market ticker (optional) (default to undefined)
@@ -597,9 +628,12 @@ Get a single order by ID
597
628
  import {
598
629
  PortfolioApi,
599
630
  Configuration
600
- } from '@kalshi/trading-api';
631
+ } from 'kalshi-typescript';
601
632
 
602
- const configuration = new Configuration();
633
+ const configuration = new Configuration({
634
+ apiKey: 'your-api-key-id',
635
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
636
+ });
603
637
  const apiInstance = new PortfolioApi(configuration);
604
638
 
605
639
  let orderId: string; //Order ID (default to undefined)
@@ -640,6 +674,63 @@ const { status, data } = await apiInstance.getOrder(
640
674
 
641
675
  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
642
676
 
677
+ # **getOrderGroup**
678
+ > GetOrderGroupResponse getOrderGroup()
679
+
680
+ Get details of a specific order group
681
+
682
+ ### Example
683
+
684
+ ```typescript
685
+ import {
686
+ PortfolioApi,
687
+ Configuration
688
+ } from 'kalshi-typescript';
689
+
690
+ const configuration = new Configuration({
691
+ apiKey: 'your-api-key-id',
692
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
693
+ });
694
+ const apiInstance = new PortfolioApi(configuration);
695
+
696
+ let orderGroupId: string; //Order group ID (default to undefined)
697
+
698
+ const { status, data } = await apiInstance.getOrderGroup(
699
+ orderGroupId
700
+ );
701
+ ```
702
+
703
+ ### Parameters
704
+
705
+ |Name | Type | Description | Notes|
706
+ |------------- | ------------- | ------------- | -------------|
707
+ | **orderGroupId** | [**string**] | Order group ID | defaults to undefined|
708
+
709
+
710
+ ### Return type
711
+
712
+ **GetOrderGroupResponse**
713
+
714
+ ### Authorization
715
+
716
+ [bearerAuth](../README.md#bearerAuth)
717
+
718
+ ### HTTP request headers
719
+
720
+ - **Content-Type**: Not defined
721
+ - **Accept**: application/json
722
+
723
+
724
+ ### HTTP response details
725
+ | Status code | Description | Response headers |
726
+ |-------------|-------------|------------------|
727
+ |**200** | Order group retrieved successfully | - |
728
+ |**401** | Unauthorized - authentication required | - |
729
+ |**404** | Resource not found | - |
730
+ |**500** | Internal server error | - |
731
+
732
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
733
+
643
734
  # **getOrderGroups**
644
735
  > GetOrderGroupsResponse getOrderGroups()
645
736
 
@@ -651,9 +742,12 @@ Get order groups for the logged-in user
651
742
  import {
652
743
  PortfolioApi,
653
744
  Configuration
654
- } from '@kalshi/trading-api';
745
+ } from 'kalshi-typescript';
655
746
 
656
- const configuration = new Configuration();
747
+ const configuration = new Configuration({
748
+ apiKey: 'your-api-key-id',
749
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
750
+ });
657
751
  const apiInstance = new PortfolioApi(configuration);
658
752
 
659
753
  let status: string; //Filter by status. Possible values depend on the endpoint. (optional) (default to undefined)
@@ -711,9 +805,12 @@ Get the queue position for an order
711
805
  import {
712
806
  PortfolioApi,
713
807
  Configuration
714
- } from '@kalshi/trading-api';
808
+ } from 'kalshi-typescript';
715
809
 
716
- const configuration = new Configuration();
810
+ const configuration = new Configuration({
811
+ apiKey: 'your-api-key-id',
812
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
813
+ });
717
814
  const apiInstance = new PortfolioApi(configuration);
718
815
 
719
816
  let orderId: string; //Order ID (default to undefined)
@@ -765,9 +862,12 @@ Get orders for the logged-in user
765
862
  import {
766
863
  PortfolioApi,
767
864
  Configuration
768
- } from '@kalshi/trading-api';
865
+ } from 'kalshi-typescript';
769
866
 
770
- const configuration = new Configuration();
867
+ const configuration = new Configuration({
868
+ apiKey: 'your-api-key-id',
869
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
870
+ });
771
871
  const apiInstance = new PortfolioApi(configuration);
772
872
 
773
873
  let ticker: string; //Filter by market ticker (optional) (default to undefined)
@@ -837,9 +937,12 @@ Get positions for the logged-in user
837
937
  import {
838
938
  PortfolioApi,
839
939
  Configuration
840
- } from '@kalshi/trading-api';
940
+ } from 'kalshi-typescript';
841
941
 
842
- const configuration = new Configuration();
942
+ const configuration = new Configuration({
943
+ apiKey: 'your-api-key-id',
944
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
945
+ });
843
946
  const apiInstance = new PortfolioApi(configuration);
844
947
 
845
948
  let ticker: string; //Filter by market ticker (optional) (default to undefined)
@@ -907,9 +1010,12 @@ import {
907
1010
  PortfolioApi,
908
1011
  Configuration,
909
1012
  GetQueuePositionsRequest
910
- } from '@kalshi/trading-api';
1013
+ } from 'kalshi-typescript';
911
1014
 
912
- const configuration = new Configuration();
1015
+ const configuration = new Configuration({
1016
+ apiKey: 'your-api-key-id',
1017
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
1018
+ });
913
1019
  const apiInstance = new PortfolioApi(configuration);
914
1020
 
915
1021
  let getQueuePositionsRequest: GetQueuePositionsRequest; //
@@ -961,9 +1067,12 @@ Get settlements for the logged-in user
961
1067
  import {
962
1068
  PortfolioApi,
963
1069
  Configuration
964
- } from '@kalshi/trading-api';
1070
+ } from 'kalshi-typescript';
965
1071
 
966
- const configuration = new Configuration();
1072
+ const configuration = new Configuration({
1073
+ apiKey: 'your-api-key-id',
1074
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
1075
+ });
967
1076
  const apiInstance = new PortfolioApi(configuration);
968
1077
 
969
1078
  let limit: number; //Number of results per page. Defaults to 100. Maximum value is 200. (optional) (default to 100)
@@ -1018,9 +1127,12 @@ Get the total value of all resting orders
1018
1127
  import {
1019
1128
  PortfolioApi,
1020
1129
  Configuration
1021
- } from '@kalshi/trading-api';
1130
+ } from 'kalshi-typescript';
1022
1131
 
1023
- const configuration = new Configuration();
1132
+ const configuration = new Configuration({
1133
+ apiKey: 'your-api-key-id',
1134
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
1135
+ });
1024
1136
  const apiInstance = new PortfolioApi(configuration);
1025
1137
 
1026
1138
  const { status, data } = await apiInstance.getTotalRestingOrderValue();
@@ -1064,9 +1176,12 @@ Reset an order group
1064
1176
  import {
1065
1177
  PortfolioApi,
1066
1178
  Configuration
1067
- } from '@kalshi/trading-api';
1179
+ } from 'kalshi-typescript';
1068
1180
 
1069
- const configuration = new Configuration();
1181
+ const configuration = new Configuration({
1182
+ apiKey: 'your-api-key-id',
1183
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
1184
+ });
1070
1185
  const apiInstance = new PortfolioApi(configuration);
1071
1186
 
1072
1187
  let orderGroupId: string; //Order group ID (default to undefined)
package/docs/Position.md CHANGED
@@ -17,7 +17,7 @@ Name | Type | Description | Notes
17
17
  ## Example
18
18
 
19
19
  ```typescript
20
- import { Position } from '@kalshi/trading-api';
20
+ import { Position } from 'kalshi-typescript';
21
21
 
22
22
  const instance: Position = {
23
23
  ticker,
package/docs/Quote.md CHANGED
@@ -18,7 +18,7 @@ Name | Type | Description | Notes
18
18
  ## Example
19
19
 
20
20
  ```typescript
21
- import { Quote } from '@kalshi/trading-api';
21
+ import { Quote } from 'kalshi-typescript';
22
22
 
23
23
  const instance: Quote = {
24
24
  quote_id,
package/docs/RFQ.md CHANGED
@@ -17,7 +17,7 @@ Name | Type | Description | Notes
17
17
  ## Example
18
18
 
19
19
  ```typescript
20
- import { RFQ } from '@kalshi/trading-api';
20
+ import { RFQ } from 'kalshi-typescript';
21
21
 
22
22
  const instance: RFQ = {
23
23
  rfq_id,
package/docs/Series.md CHANGED
@@ -13,7 +13,7 @@ Name | Type | Description | Notes
13
13
  ## Example
14
14
 
15
15
  ```typescript
16
- import { Series } from '@kalshi/trading-api';
16
+ import { Series } from 'kalshi-typescript';
17
17
 
18
18
  const instance: Series = {
19
19
  ticker,
package/docs/SeriesApi.md CHANGED
@@ -18,9 +18,12 @@ Get all market series
18
18
  import {
19
19
  SeriesApi,
20
20
  Configuration
21
- } from '@kalshi/trading-api';
21
+ } from 'kalshi-typescript';
22
22
 
23
- const configuration = new Configuration();
23
+ const configuration = new Configuration({
24
+ apiKey: 'your-api-key-id',
25
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
26
+ });
24
27
  const apiInstance = new SeriesApi(configuration);
25
28
 
26
29
  let status: string; //Filter by series status (optional) (default to undefined)
@@ -71,9 +74,12 @@ Get a single series by its ticker
71
74
  import {
72
75
  SeriesApi,
73
76
  Configuration
74
- } from '@kalshi/trading-api';
77
+ } from 'kalshi-typescript';
75
78
 
76
- const configuration = new Configuration();
79
+ const configuration = new Configuration({
80
+ apiKey: 'your-api-key-id',
81
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
82
+ });
77
83
  const apiInstance = new SeriesApi(configuration);
78
84
 
79
85
  let ticker: string; //The series ticker (default to undefined)
@@ -15,7 +15,7 @@ Name | Type | Description | Notes
15
15
  ## Example
16
16
 
17
17
  ```typescript
18
- import { Settlement } from '@kalshi/trading-api';
18
+ import { Settlement } from 'kalshi-typescript';
19
19
 
20
20
  const instance: Settlement = {
21
21
  ticker,
@@ -12,7 +12,7 @@ Name | Type | Description | Notes
12
12
  ## Example
13
13
 
14
14
  ```typescript
15
- import { StructuredTarget } from '@kalshi/trading-api';
15
+ import { StructuredTarget } from 'kalshi-typescript';
16
16
 
17
17
  const instance: StructuredTarget = {
18
18
  structured_target_id,
@@ -18,9 +18,12 @@ Get a single structured target by ID
18
18
  import {
19
19
  StructuredTargetsApi,
20
20
  Configuration
21
- } from '@kalshi/trading-api';
21
+ } from 'kalshi-typescript';
22
22
 
23
- const configuration = new Configuration();
23
+ const configuration = new Configuration({
24
+ apiKey: 'your-api-key-id',
25
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
26
+ });
24
27
  const apiInstance = new StructuredTargetsApi(configuration);
25
28
 
26
29
  let structuredTargetId: string; //Structured target ID (default to undefined)
@@ -72,9 +75,12 @@ Get all structured targets
72
75
  import {
73
76
  StructuredTargetsApi,
74
77
  Configuration
75
- } from '@kalshi/trading-api';
78
+ } from 'kalshi-typescript';
76
79
 
77
- const configuration = new Configuration();
80
+ const configuration = new Configuration({
81
+ apiKey: 'your-api-key-id',
82
+ privateKeyPath: '/path/to/private-key.pem' // or privateKeyPem: 'PEM string'
83
+ });
78
84
  const apiInstance = new StructuredTargetsApi(configuration);
79
85
 
80
86
  let status: string; //Filter by structured target status (optional) (default to undefined)
package/docs/Trade.md CHANGED
@@ -15,7 +15,7 @@ Name | Type | Description | Notes
15
15
  ## Example
16
16
 
17
17
  ```typescript
18
- import { Trade } from '@kalshi/trading-api';
18
+ import { Trade } from 'kalshi-typescript';
19
19
 
20
20
  const instance: Trade = {
21
21
  trade_id,
@@ -15,8 +15,42 @@
15
15
 
16
16
 
17
17
  export interface AmendOrderRequest {
18
+ /**
19
+ * Market ticker
20
+ */
21
+ 'ticker': string;
22
+ /**
23
+ * Side of the order
24
+ */
25
+ 'side': AmendOrderRequestSideEnum;
26
+ /**
27
+ * Buy or sell action
28
+ */
29
+ 'action': AmendOrderRequestActionEnum;
18
30
  'yes_price'?: number;
19
31
  'no_price'?: number;
20
32
  'count'?: number;
33
+ /**
34
+ * Current client order ID
35
+ */
36
+ 'client_order_id': string;
37
+ /**
38
+ * New client order ID after amendment
39
+ */
40
+ 'updated_client_order_id': string;
21
41
  }
22
42
 
43
+ export const AmendOrderRequestSideEnum = {
44
+ Yes: 'yes',
45
+ No: 'no'
46
+ } as const;
47
+
48
+ export type AmendOrderRequestSideEnum = typeof AmendOrderRequestSideEnum[keyof typeof AmendOrderRequestSideEnum];
49
+ export const AmendOrderRequestActionEnum = {
50
+ Buy: 'buy',
51
+ Sell: 'sell'
52
+ } as const;
53
+
54
+ export type AmendOrderRequestActionEnum = typeof AmendOrderRequestActionEnum[keyof typeof AmendOrderRequestActionEnum];
55
+
56
+
@@ -15,6 +15,9 @@
15
15
 
16
16
 
17
17
  export interface CreateOrderGroupRequest {
18
- 'name': string;
18
+ /**
19
+ * Specifies the maximum number of contracts that can be matched within this group.
20
+ */
21
+ 'contracts_limit'?: number;
19
22
  }
20
23
 
@@ -13,11 +13,11 @@
13
13
  */
14
14
 
15
15
 
16
- // May contain unused imports in some cases
17
- // @ts-ignore
18
- import type { OrderGroup } from './order-group';
19
16
 
20
17
  export interface CreateOrderGroupResponse {
21
- 'order_group'?: OrderGroup;
18
+ /**
19
+ * The unique identifier for the created order group
20
+ */
21
+ 'order_group_id'?: string;
22
22
  }
23
23
 
@@ -26,6 +26,14 @@ export interface CreateOrderRequest {
26
26
  'expiration_ts'?: number;
27
27
  'sell_position_floor'?: number;
28
28
  'buy_max_cost'?: number;
29
+ /**
30
+ * If set to true, the order will be rejected if it crosses the spread and executes immediately
31
+ */
32
+ 'post_only'?: boolean;
33
+ /**
34
+ * OrderGroupId specifies the order group this order is part of
35
+ */
36
+ 'order_group_id'?: string;
29
37
  }
30
38
 
31
39
  export const CreateOrderRequestSideEnum = {
@@ -26,6 +26,6 @@ export interface ErrorResponseError {
26
26
  /**
27
27
  * Additional error details
28
28
  */
29
- 'details'?: object;
29
+ 'details'?: string;
30
30
  }
31
31
 
@@ -0,0 +1,59 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Kalshi Trading API
5
+ * Complete API for the Kalshi trading platform including all handlers for SDK generation
6
+ *
7
+ * The version of the OpenAPI document: 2.0.0
8
+ * Contact: support@kalshi.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+
17
+ export interface EventPosition {
18
+ /**
19
+ * Unique identifier for events.
20
+ */
21
+ 'event_ticker'?: string;
22
+ /**
23
+ * Total spent on this event in cents.
24
+ */
25
+ 'total_cost'?: number;
26
+ /**
27
+ * Total spent on this event in dollars.
28
+ */
29
+ 'total_cost_dollars'?: string;
30
+ /**
31
+ * Cost of the aggregate event position in cents.
32
+ */
33
+ 'event_exposure'?: number;
34
+ /**
35
+ * Cost of the aggregate event position in dollars.
36
+ */
37
+ 'event_exposure_dollars'?: string;
38
+ /**
39
+ * Locked in profit and loss, in cents.
40
+ */
41
+ 'realized_pnl'?: number;
42
+ /**
43
+ * Locked in profit and loss, in dollars.
44
+ */
45
+ 'realized_pnl_dollars'?: string;
46
+ /**
47
+ * Aggregate size of resting orders in contract units.
48
+ */
49
+ 'resting_order_count'?: number;
50
+ /**
51
+ * Fees paid on fill orders, in cents.
52
+ */
53
+ 'fees_paid'?: number;
54
+ /**
55
+ * Fees paid on fill orders, in dollars.
56
+ */
57
+ 'fees_paid_dollars'?: string;
58
+ }
59
+
@@ -0,0 +1,27 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Kalshi Trading API
5
+ * Complete API for the Kalshi trading platform including all handlers for SDK generation
6
+ *
7
+ * The version of the OpenAPI document: 2.0.0
8
+ * Contact: support@kalshi.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+
17
+ export interface GetOrderGroupResponse {
18
+ /**
19
+ * Whether auto-cancel is enabled for this order group
20
+ */
21
+ 'is_auto_cancel_enabled'?: boolean;
22
+ /**
23
+ * List of order IDs that belong to this order group
24
+ */
25
+ 'orders'?: Array<string>;
26
+ }
27
+