kalshi-python-async 3.0.0__py3-none-any.whl

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 (151) hide show
  1. kalshi_python_async/__init__.py +272 -0
  2. kalshi_python_async/api/__init__.py +19 -0
  3. kalshi_python_async/api/api_keys_api.py +1098 -0
  4. kalshi_python_async/api/communications_api.py +3216 -0
  5. kalshi_python_async/api/events_api.py +1941 -0
  6. kalshi_python_async/api/exchange_api.py +1263 -0
  7. kalshi_python_async/api/fcm_api.py +792 -0
  8. kalshi_python_async/api/incentive_programs_api.py +346 -0
  9. kalshi_python_async/api/live_data_api.py +564 -0
  10. kalshi_python_async/api/market_api.py +2568 -0
  11. kalshi_python_async/api/milestone_api.py +689 -0
  12. kalshi_python_async/api/multivariate_api.py +1486 -0
  13. kalshi_python_async/api/order_groups_api.py +1375 -0
  14. kalshi_python_async/api/orders_api.py +2913 -0
  15. kalshi_python_async/api/portfolio_api.py +1572 -0
  16. kalshi_python_async/api/search_api.py +516 -0
  17. kalshi_python_async/api/structured_targets_api.py +605 -0
  18. kalshi_python_async/api_client.py +833 -0
  19. kalshi_python_async/api_response.py +21 -0
  20. kalshi_python_async/auth.py +89 -0
  21. kalshi_python_async/configuration.py +622 -0
  22. kalshi_python_async/exceptions.py +216 -0
  23. kalshi_python_async/models/__init__.py +136 -0
  24. kalshi_python_async/models/accept_quote_request.py +94 -0
  25. kalshi_python_async/models/amend_order_request.py +120 -0
  26. kalshi_python_async/models/amend_order_response.py +96 -0
  27. kalshi_python_async/models/announcement.py +108 -0
  28. kalshi_python_async/models/api_key.py +89 -0
  29. kalshi_python_async/models/associated_event.py +105 -0
  30. kalshi_python_async/models/batch_cancel_orders_individual_response.py +111 -0
  31. kalshi_python_async/models/batch_cancel_orders_request.py +87 -0
  32. kalshi_python_async/models/batch_cancel_orders_response.py +95 -0
  33. kalshi_python_async/models/batch_create_orders_individual_response.py +114 -0
  34. kalshi_python_async/models/batch_create_orders_request.py +95 -0
  35. kalshi_python_async/models/batch_create_orders_response.py +95 -0
  36. kalshi_python_async/models/batch_get_market_candlesticks_response.py +95 -0
  37. kalshi_python_async/models/bid_ask_distribution.py +101 -0
  38. kalshi_python_async/models/cancel_order_response.py +93 -0
  39. kalshi_python_async/models/create_api_key_request.py +89 -0
  40. kalshi_python_async/models/create_api_key_response.py +87 -0
  41. kalshi_python_async/models/create_market_in_multivariate_event_collection_request.py +95 -0
  42. kalshi_python_async/models/create_market_in_multivariate_event_collection_response.py +89 -0
  43. kalshi_python_async/models/create_order_group_request.py +88 -0
  44. kalshi_python_async/models/create_order_group_response.py +87 -0
  45. kalshi_python_async/models/create_order_request.py +159 -0
  46. kalshi_python_async/models/create_order_response.py +91 -0
  47. kalshi_python_async/models/create_quote_request.py +93 -0
  48. kalshi_python_async/models/create_quote_response.py +87 -0
  49. kalshi_python_async/models/create_rfq_request.py +97 -0
  50. kalshi_python_async/models/create_rfq_response.py +87 -0
  51. kalshi_python_async/models/daily_schedule.py +89 -0
  52. kalshi_python_async/models/decrease_order_request.py +90 -0
  53. kalshi_python_async/models/decrease_order_response.py +91 -0
  54. kalshi_python_async/models/error_response.py +93 -0
  55. kalshi_python_async/models/event_data.py +133 -0
  56. kalshi_python_async/models/event_position.py +105 -0
  57. kalshi_python_async/models/exchange_status.py +97 -0
  58. kalshi_python_async/models/fill.py +134 -0
  59. kalshi_python_async/models/forecast_percentiles_point.py +101 -0
  60. kalshi_python_async/models/generate_api_key_request.py +87 -0
  61. kalshi_python_async/models/generate_api_key_response.py +89 -0
  62. kalshi_python_async/models/get_api_keys_response.py +95 -0
  63. kalshi_python_async/models/get_balance_response.py +91 -0
  64. kalshi_python_async/models/get_communications_id_response.py +87 -0
  65. kalshi_python_async/models/get_event_candlesticks_response.py +104 -0
  66. kalshi_python_async/models/get_event_forecast_percentiles_history_response.py +95 -0
  67. kalshi_python_async/models/get_event_metadata_response.py +123 -0
  68. kalshi_python_async/models/get_event_response.py +101 -0
  69. kalshi_python_async/models/get_events_candlesticks_response.py +95 -0
  70. kalshi_python_async/models/get_events_candlesticks_response_events_inner.py +106 -0
  71. kalshi_python_async/models/get_events_response.py +107 -0
  72. kalshi_python_async/models/get_exchange_announcements_response.py +95 -0
  73. kalshi_python_async/models/get_exchange_schedule_response.py +91 -0
  74. kalshi_python_async/models/get_fills_response.py +97 -0
  75. kalshi_python_async/models/get_filters_by_sports_response.py +102 -0
  76. kalshi_python_async/models/get_incentive_programs_response.py +97 -0
  77. kalshi_python_async/models/get_live_data_response.py +91 -0
  78. kalshi_python_async/models/get_live_datas_response.py +95 -0
  79. kalshi_python_async/models/get_market_candlesticks_response.py +97 -0
  80. kalshi_python_async/models/get_market_orderbook_response.py +91 -0
  81. kalshi_python_async/models/get_market_response.py +91 -0
  82. kalshi_python_async/models/get_markets_response.py +97 -0
  83. kalshi_python_async/models/get_milestone_response.py +91 -0
  84. kalshi_python_async/models/get_milestones_response.py +97 -0
  85. kalshi_python_async/models/get_multivariate_event_collection_lookup_history_response.py +95 -0
  86. kalshi_python_async/models/get_multivariate_event_collection_response.py +91 -0
  87. kalshi_python_async/models/get_multivariate_event_collections_response.py +97 -0
  88. kalshi_python_async/models/get_multivariate_events_response.py +97 -0
  89. kalshi_python_async/models/get_order_group_response.py +89 -0
  90. kalshi_python_async/models/get_order_groups_response.py +95 -0
  91. kalshi_python_async/models/get_order_queue_position_response.py +87 -0
  92. kalshi_python_async/models/get_order_queue_positions_response.py +95 -0
  93. kalshi_python_async/models/get_order_response.py +91 -0
  94. kalshi_python_async/models/get_orders_response.py +97 -0
  95. kalshi_python_async/models/get_portfolio_resting_order_total_value_response.py +87 -0
  96. kalshi_python_async/models/get_positions_response.py +107 -0
  97. kalshi_python_async/models/get_quote_response.py +91 -0
  98. kalshi_python_async/models/get_quotes_response.py +97 -0
  99. kalshi_python_async/models/get_rfq_response.py +91 -0
  100. kalshi_python_async/models/get_rfqs_response.py +97 -0
  101. kalshi_python_async/models/get_series_fee_changes_response.py +95 -0
  102. kalshi_python_async/models/get_series_list_response.py +95 -0
  103. kalshi_python_async/models/get_series_response.py +91 -0
  104. kalshi_python_async/models/get_settlements_response.py +97 -0
  105. kalshi_python_async/models/get_structured_target_response.py +91 -0
  106. kalshi_python_async/models/get_structured_targets_response.py +97 -0
  107. kalshi_python_async/models/get_tags_for_series_categories_response.py +87 -0
  108. kalshi_python_async/models/get_trades_response.py +97 -0
  109. kalshi_python_async/models/get_user_data_timestamp_response.py +88 -0
  110. kalshi_python_async/models/incentive_program.py +121 -0
  111. kalshi_python_async/models/live_data.py +91 -0
  112. kalshi_python_async/models/lookup_point.py +102 -0
  113. kalshi_python_async/models/lookup_tickers_for_market_in_multivariate_event_collection_request.py +95 -0
  114. kalshi_python_async/models/lookup_tickers_for_market_in_multivariate_event_collection_response.py +89 -0
  115. kalshi_python_async/models/maintenance_window.py +90 -0
  116. kalshi_python_async/models/market.py +307 -0
  117. kalshi_python_async/models/market_candlestick.py +108 -0
  118. kalshi_python_async/models/market_candlesticks_response.py +97 -0
  119. kalshi_python_async/models/market_metadata.py +91 -0
  120. kalshi_python_async/models/market_position.py +110 -0
  121. kalshi_python_async/models/milestone.py +120 -0
  122. kalshi_python_async/models/multivariate_event_collection.py +122 -0
  123. kalshi_python_async/models/mve_selected_leg.py +91 -0
  124. kalshi_python_async/models/order.py +189 -0
  125. kalshi_python_async/models/order_group.py +89 -0
  126. kalshi_python_async/models/order_queue_position.py +91 -0
  127. kalshi_python_async/models/order_status.py +38 -0
  128. kalshi_python_async/models/orderbook.py +94 -0
  129. kalshi_python_async/models/percentile_point.py +93 -0
  130. kalshi_python_async/models/price_distribution.py +157 -0
  131. kalshi_python_async/models/price_range.py +91 -0
  132. kalshi_python_async/models/quote.py +153 -0
  133. kalshi_python_async/models/rfq.py +129 -0
  134. kalshi_python_async/models/schedule.py +105 -0
  135. kalshi_python_async/models/scope_list.py +87 -0
  136. kalshi_python_async/models/self_trade_prevention_type.py +37 -0
  137. kalshi_python_async/models/series.py +129 -0
  138. kalshi_python_async/models/series_fee_change.py +103 -0
  139. kalshi_python_async/models/settlement.py +118 -0
  140. kalshi_python_async/models/settlement_source.py +89 -0
  141. kalshi_python_async/models/sport_filter_details.py +102 -0
  142. kalshi_python_async/models/structured_target.py +98 -0
  143. kalshi_python_async/models/ticker_pair.py +98 -0
  144. kalshi_python_async/models/trade.py +113 -0
  145. kalshi_python_async/models/weekly_schedule.py +154 -0
  146. kalshi_python_async/py.typed +0 -0
  147. kalshi_python_async/rest.py +213 -0
  148. kalshi_python_async-3.0.0.dist-info/METADATA +78 -0
  149. kalshi_python_async-3.0.0.dist-info/RECORD +151 -0
  150. kalshi_python_async-3.0.0.dist-info/WHEEL +5 -0
  151. kalshi_python_async-3.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1572 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Kalshi Trade API Manual Endpoints
5
+
6
+ Manually defined OpenAPI spec for endpoints being migrated to spec-first approach
7
+
8
+ The version of the OpenAPI document: 3.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+ import warnings
14
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt, StrictBool
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+ from typing_extensions import Annotated
17
+
18
+ from pydantic import Field, StrictInt, StrictStr, field_validator
19
+ from typing import Optional
20
+ from typing_extensions import Annotated
21
+ from kalshi_python_async.models.get_balance_response import GetBalanceResponse
22
+ from kalshi_python_async.models.get_fills_response import GetFillsResponse
23
+ from kalshi_python_async.models.get_portfolio_resting_order_total_value_response import GetPortfolioRestingOrderTotalValueResponse
24
+ from kalshi_python_async.models.get_positions_response import GetPositionsResponse
25
+ from kalshi_python_async.models.get_settlements_response import GetSettlementsResponse
26
+
27
+ from kalshi_python_async.api_client import ApiClient, RequestSerialized
28
+ from kalshi_python_async.api_response import ApiResponse
29
+ from kalshi_python_async.rest import RESTResponseType
30
+
31
+
32
+ class PortfolioApi:
33
+ """NOTE: This class is auto generated by OpenAPI Generator
34
+ Ref: https://openapi-generator.tech
35
+
36
+ Do not edit the class manually.
37
+ """
38
+
39
+ def __init__(self, api_client=None) -> None:
40
+ if api_client is None:
41
+ api_client = ApiClient.get_default()
42
+ self.api_client = api_client
43
+
44
+
45
+ @validate_call
46
+ async def get_balance(
47
+ self,
48
+ ) -> GetBalanceResponse:
49
+ """Get Balance
50
+
51
+ Endpoint for getting the balance and portfolio value of a member. Both values are returned in cents.
52
+
53
+ :param _request_timeout: timeout setting for this request. If one
54
+ number provided, it will be total request
55
+ timeout. It can also be a pair (tuple) of
56
+ (connection, read) timeouts.
57
+ :type _request_timeout: int, tuple(int, int), optional
58
+ :param _request_auth: set to override the auth_settings for an a single
59
+ request; this effectively ignores the
60
+ authentication in the spec for a single request.
61
+ :type _request_auth: dict, optional
62
+ :param _content_type: force content-type for the request.
63
+ :type _content_type: str, Optional
64
+ :param _headers: set to override the headers for a single
65
+ request; this effectively ignores the headers
66
+ in the spec for a single request.
67
+ :type _headers: dict, optional
68
+ :param _host_index: set to override the host_index for a single
69
+ request; this effectively ignores the host_index
70
+ in the spec for a single request.
71
+ :type _host_index: int, optional
72
+ :return: Returns the result object.
73
+ """ # noqa: E501
74
+
75
+
76
+ _param = self._get_balance_serialize(
77
+ _request_auth=None,
78
+ _content_type=None,
79
+ _headers=None,
80
+ _host_index=0
81
+ )
82
+
83
+ _response_types_map: Dict[str, Optional[str]] = {
84
+ '200': "GetBalanceResponse",
85
+ '401': "ErrorResponse",
86
+ '500': "ErrorResponse",
87
+ }
88
+ response_data = await self.api_client.call_api(
89
+ *_param,
90
+ _request_timeout=None,
91
+ )
92
+ await response_data.read()
93
+ return self.api_client.response_deserialize(
94
+ response_data=response_data,
95
+ response_types_map=_response_types_map,
96
+ ).data
97
+
98
+
99
+ @validate_call
100
+ async def get_balance_with_http_info(
101
+ self,
102
+ _request_timeout: Union[
103
+ None,
104
+ Annotated[StrictFloat, Field(gt=0)],
105
+ Tuple[
106
+ Annotated[StrictFloat, Field(gt=0)],
107
+ Annotated[StrictFloat, Field(gt=0)]
108
+ ]
109
+ ] = None,
110
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
111
+ _content_type: Optional[StrictStr] = None,
112
+ _headers: Optional[Dict[StrictStr, Any]] = None,
113
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
114
+ ) -> ApiResponse[GetBalanceResponse]:
115
+ """Get Balance
116
+
117
+ Endpoint for getting the balance and portfolio value of a member. Both values are returned in cents.
118
+
119
+ :param _request_timeout: timeout setting for this request. If one
120
+ number provided, it will be total request
121
+ timeout. It can also be a pair (tuple) of
122
+ (connection, read) timeouts.
123
+ :type _request_timeout: int, tuple(int, int), optional
124
+ :param _request_auth: set to override the auth_settings for an a single
125
+ request; this effectively ignores the
126
+ authentication in the spec for a single request.
127
+ :type _request_auth: dict, optional
128
+ :param _content_type: force content-type for the request.
129
+ :type _content_type: str, Optional
130
+ :param _headers: set to override the headers for a single
131
+ request; this effectively ignores the headers
132
+ in the spec for a single request.
133
+ :type _headers: dict, optional
134
+ :param _host_index: set to override the host_index for a single
135
+ request; this effectively ignores the host_index
136
+ in the spec for a single request.
137
+ :type _host_index: int, optional
138
+ :return: Returns the result object.
139
+ """ # noqa: E501
140
+
141
+ _param = self._get_balance_serialize(
142
+ _request_auth=_request_auth,
143
+ _content_type=_content_type,
144
+ _headers=_headers,
145
+ _host_index=_host_index
146
+ )
147
+
148
+ _response_types_map: Dict[str, Optional[str]] = {
149
+ '200': "GetBalanceResponse",
150
+ '401': "ErrorResponse",
151
+ '500': "ErrorResponse",
152
+ }
153
+ response_data = await self.api_client.call_api(
154
+ *_param,
155
+ _request_timeout=_request_timeout
156
+ )
157
+ await response_data.read()
158
+ return self.api_client.response_deserialize(
159
+ response_data=response_data,
160
+ response_types_map=_response_types_map,
161
+ )
162
+
163
+
164
+ @validate_call
165
+ async def get_balance_without_preload_content(
166
+ self,
167
+ _request_timeout: Union[
168
+ None,
169
+ Annotated[StrictFloat, Field(gt=0)],
170
+ Tuple[
171
+ Annotated[StrictFloat, Field(gt=0)],
172
+ Annotated[StrictFloat, Field(gt=0)]
173
+ ]
174
+ ] = None,
175
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
176
+ _content_type: Optional[StrictStr] = None,
177
+ _headers: Optional[Dict[StrictStr, Any]] = None,
178
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
179
+ ) -> RESTResponseType:
180
+ """Get Balance
181
+
182
+ Endpoint for getting the balance and portfolio value of a member. Both values are returned in cents.
183
+
184
+ :param _request_timeout: timeout setting for this request. If one
185
+ number provided, it will be total request
186
+ timeout. It can also be a pair (tuple) of
187
+ (connection, read) timeouts.
188
+ :type _request_timeout: int, tuple(int, int), optional
189
+ :param _request_auth: set to override the auth_settings for an a single
190
+ request; this effectively ignores the
191
+ authentication in the spec for a single request.
192
+ :type _request_auth: dict, optional
193
+ :param _content_type: force content-type for the request.
194
+ :type _content_type: str, Optional
195
+ :param _headers: set to override the headers for a single
196
+ request; this effectively ignores the headers
197
+ in the spec for a single request.
198
+ :type _headers: dict, optional
199
+ :param _host_index: set to override the host_index for a single
200
+ request; this effectively ignores the host_index
201
+ in the spec for a single request.
202
+ :type _host_index: int, optional
203
+ :return: Returns the result object.
204
+ """ # noqa: E501
205
+
206
+ _param = self._get_balance_serialize(
207
+ _request_auth=_request_auth,
208
+ _content_type=_content_type,
209
+ _headers=_headers,
210
+ _host_index=_host_index
211
+ )
212
+
213
+ _response_types_map: Dict[str, Optional[str]] = {
214
+ '200': "GetBalanceResponse",
215
+ '401': "ErrorResponse",
216
+ '500': "ErrorResponse",
217
+ }
218
+ response_data = await self.api_client.call_api(
219
+ *_param,
220
+ _request_timeout=_request_timeout
221
+ )
222
+ return response_data.response
223
+
224
+
225
+ def _get_balance_serialize(
226
+ self,
227
+ _request_auth,
228
+ _content_type,
229
+ _headers,
230
+ _host_index,
231
+ ) -> RequestSerialized:
232
+
233
+ _host = None
234
+
235
+ _collection_formats: Dict[str, str] = {
236
+ }
237
+
238
+ _path_params: Dict[str, str] = {}
239
+ _query_params: List[Tuple[str, str]] = []
240
+ _header_params: Dict[str, Optional[str]] = _headers or {}
241
+ _form_params: List[Tuple[str, str]] = []
242
+ _files: Dict[
243
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
244
+ ] = {}
245
+ _body_params: Optional[bytes] = None
246
+
247
+ # process the path parameters
248
+ # process the query parameters
249
+ # process the header parameters
250
+ # process the form parameters
251
+ # process the body parameter
252
+
253
+
254
+ # set the HTTP header `Accept`
255
+ if 'Accept' not in _header_params:
256
+ _header_params['Accept'] = self.api_client.select_header_accept(
257
+ [
258
+ 'application/json'
259
+ ]
260
+ )
261
+
262
+
263
+ # authentication setting
264
+ _auth_settings: List[str] = [
265
+ 'kalshiAccessSignature',
266
+ 'kalshiAccessKey',
267
+ 'kalshiAccessTimestamp'
268
+ ]
269
+
270
+ return self.api_client.param_serialize(
271
+ method='GET',
272
+ resource_path='/portfolio/balance',
273
+ path_params=_path_params,
274
+ query_params=_query_params,
275
+ header_params=_header_params,
276
+ body=_body_params,
277
+ post_params=_form_params,
278
+ files=_files,
279
+ auth_settings=_auth_settings,
280
+ collection_formats=_collection_formats,
281
+ _host=_host,
282
+ _request_auth=_request_auth
283
+ )
284
+
285
+
286
+
287
+
288
+ @validate_call
289
+ async def get_fills(
290
+ self,
291
+ ticker: Any = None,
292
+ order_id: Any = None,
293
+ min_ts: Any = None,
294
+ max_ts: Any = None,
295
+ limit: Any = None,
296
+ cursor: Any = None,
297
+ ) -> GetFillsResponse:
298
+ """Get Fills
299
+
300
+ Endpoint for getting all fills for the member. A fill is when a trade you have is matched.
301
+
302
+ :param ticker: Filter by market ticker
303
+ :type ticker: str
304
+ :param order_id: Filter by order ID
305
+ :type order_id: str
306
+ :param min_ts: Filter items after this Unix timestamp
307
+ :type min_ts: int
308
+ :param max_ts: Filter items before this Unix timestamp
309
+ :type max_ts: int
310
+ :param limit: Number of results per page. Defaults to 100. Maximum value is 200.
311
+ :type limit: int
312
+ :param 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.
313
+ :type cursor: str
314
+ :param _request_timeout: timeout setting for this request. If one
315
+ number provided, it will be total request
316
+ timeout. It can also be a pair (tuple) of
317
+ (connection, read) timeouts.
318
+ :type _request_timeout: int, tuple(int, int), optional
319
+ :param _request_auth: set to override the auth_settings for an a single
320
+ request; this effectively ignores the
321
+ authentication in the spec for a single request.
322
+ :type _request_auth: dict, optional
323
+ :param _content_type: force content-type for the request.
324
+ :type _content_type: str, Optional
325
+ :param _headers: set to override the headers for a single
326
+ request; this effectively ignores the headers
327
+ in the spec for a single request.
328
+ :type _headers: dict, optional
329
+ :param _host_index: set to override the host_index for a single
330
+ request; this effectively ignores the host_index
331
+ in the spec for a single request.
332
+ :type _host_index: int, optional
333
+ :return: Returns the result object.
334
+ """ # noqa: E501
335
+
336
+
337
+ _param = self._get_fills_serialize(
338
+ ticker=ticker,
339
+ order_id=order_id,
340
+ min_ts=min_ts,
341
+ max_ts=max_ts,
342
+ limit=limit,
343
+ cursor=cursor,
344
+ _request_auth=None,
345
+ _content_type=None,
346
+ _headers=None,
347
+ _host_index=0
348
+ )
349
+
350
+ _response_types_map: Dict[str, Optional[str]] = {
351
+ '200': "GetFillsResponse",
352
+ '400': None,
353
+ '401': None,
354
+ '500': None,
355
+ }
356
+ response_data = await self.api_client.call_api(
357
+ *_param,
358
+ _request_timeout=None,
359
+ )
360
+ await response_data.read()
361
+ return self.api_client.response_deserialize(
362
+ response_data=response_data,
363
+ response_types_map=_response_types_map,
364
+ ).data
365
+
366
+
367
+ @validate_call
368
+ async def get_fills_with_http_info(
369
+ self,
370
+ ticker: Annotated[Optional[StrictStr], Field(description="Filter by market ticker")] = None,
371
+ order_id: Annotated[Optional[StrictStr], Field(description="Filter by order ID")] = None,
372
+ min_ts: Annotated[Optional[StrictInt], Field(description="Filter items after this Unix timestamp")] = None,
373
+ max_ts: Annotated[Optional[StrictInt], Field(description="Filter items before this Unix timestamp")] = None,
374
+ limit: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=1)]], Field(description="Number of results per page. Defaults to 100. Maximum value is 200.")] = None,
375
+ cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.")] = None,
376
+ _request_timeout: Union[
377
+ None,
378
+ Annotated[StrictFloat, Field(gt=0)],
379
+ Tuple[
380
+ Annotated[StrictFloat, Field(gt=0)],
381
+ Annotated[StrictFloat, Field(gt=0)]
382
+ ]
383
+ ] = None,
384
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
385
+ _content_type: Optional[StrictStr] = None,
386
+ _headers: Optional[Dict[StrictStr, Any]] = None,
387
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
388
+ ) -> ApiResponse[GetFillsResponse]:
389
+ """Get Fills
390
+
391
+ Endpoint for getting all fills for the member. A fill is when a trade you have is matched.
392
+
393
+ :param ticker: Filter by market ticker
394
+ :type ticker: str
395
+ :param order_id: Filter by order ID
396
+ :type order_id: str
397
+ :param min_ts: Filter items after this Unix timestamp
398
+ :type min_ts: int
399
+ :param max_ts: Filter items before this Unix timestamp
400
+ :type max_ts: int
401
+ :param limit: Number of results per page. Defaults to 100. Maximum value is 200.
402
+ :type limit: int
403
+ :param 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.
404
+ :type cursor: str
405
+ :param _request_timeout: timeout setting for this request. If one
406
+ number provided, it will be total request
407
+ timeout. It can also be a pair (tuple) of
408
+ (connection, read) timeouts.
409
+ :type _request_timeout: int, tuple(int, int), optional
410
+ :param _request_auth: set to override the auth_settings for an a single
411
+ request; this effectively ignores the
412
+ authentication in the spec for a single request.
413
+ :type _request_auth: dict, optional
414
+ :param _content_type: force content-type for the request.
415
+ :type _content_type: str, Optional
416
+ :param _headers: set to override the headers for a single
417
+ request; this effectively ignores the headers
418
+ in the spec for a single request.
419
+ :type _headers: dict, optional
420
+ :param _host_index: set to override the host_index for a single
421
+ request; this effectively ignores the host_index
422
+ in the spec for a single request.
423
+ :type _host_index: int, optional
424
+ :return: Returns the result object.
425
+ """ # noqa: E501
426
+
427
+ _param = self._get_fills_serialize(
428
+ ticker=ticker,
429
+ order_id=order_id,
430
+ min_ts=min_ts,
431
+ max_ts=max_ts,
432
+ limit=limit,
433
+ cursor=cursor,
434
+ _request_auth=_request_auth,
435
+ _content_type=_content_type,
436
+ _headers=_headers,
437
+ _host_index=_host_index
438
+ )
439
+
440
+ _response_types_map: Dict[str, Optional[str]] = {
441
+ '200': "GetFillsResponse",
442
+ '400': None,
443
+ '401': None,
444
+ '500': None,
445
+ }
446
+ response_data = await self.api_client.call_api(
447
+ *_param,
448
+ _request_timeout=_request_timeout
449
+ )
450
+ await response_data.read()
451
+ return self.api_client.response_deserialize(
452
+ response_data=response_data,
453
+ response_types_map=_response_types_map,
454
+ )
455
+
456
+
457
+ @validate_call
458
+ async def get_fills_without_preload_content(
459
+ self,
460
+ ticker: Annotated[Optional[StrictStr], Field(description="Filter by market ticker")] = None,
461
+ order_id: Annotated[Optional[StrictStr], Field(description="Filter by order ID")] = None,
462
+ min_ts: Annotated[Optional[StrictInt], Field(description="Filter items after this Unix timestamp")] = None,
463
+ max_ts: Annotated[Optional[StrictInt], Field(description="Filter items before this Unix timestamp")] = None,
464
+ limit: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=1)]], Field(description="Number of results per page. Defaults to 100. Maximum value is 200.")] = None,
465
+ cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.")] = None,
466
+ _request_timeout: Union[
467
+ None,
468
+ Annotated[StrictFloat, Field(gt=0)],
469
+ Tuple[
470
+ Annotated[StrictFloat, Field(gt=0)],
471
+ Annotated[StrictFloat, Field(gt=0)]
472
+ ]
473
+ ] = None,
474
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
475
+ _content_type: Optional[StrictStr] = None,
476
+ _headers: Optional[Dict[StrictStr, Any]] = None,
477
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
478
+ ) -> RESTResponseType:
479
+ """Get Fills
480
+
481
+ Endpoint for getting all fills for the member. A fill is when a trade you have is matched.
482
+
483
+ :param ticker: Filter by market ticker
484
+ :type ticker: str
485
+ :param order_id: Filter by order ID
486
+ :type order_id: str
487
+ :param min_ts: Filter items after this Unix timestamp
488
+ :type min_ts: int
489
+ :param max_ts: Filter items before this Unix timestamp
490
+ :type max_ts: int
491
+ :param limit: Number of results per page. Defaults to 100. Maximum value is 200.
492
+ :type limit: int
493
+ :param 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.
494
+ :type cursor: str
495
+ :param _request_timeout: timeout setting for this request. If one
496
+ number provided, it will be total request
497
+ timeout. It can also be a pair (tuple) of
498
+ (connection, read) timeouts.
499
+ :type _request_timeout: int, tuple(int, int), optional
500
+ :param _request_auth: set to override the auth_settings for an a single
501
+ request; this effectively ignores the
502
+ authentication in the spec for a single request.
503
+ :type _request_auth: dict, optional
504
+ :param _content_type: force content-type for the request.
505
+ :type _content_type: str, Optional
506
+ :param _headers: set to override the headers for a single
507
+ request; this effectively ignores the headers
508
+ in the spec for a single request.
509
+ :type _headers: dict, optional
510
+ :param _host_index: set to override the host_index for a single
511
+ request; this effectively ignores the host_index
512
+ in the spec for a single request.
513
+ :type _host_index: int, optional
514
+ :return: Returns the result object.
515
+ """ # noqa: E501
516
+
517
+ _param = self._get_fills_serialize(
518
+ ticker=ticker,
519
+ order_id=order_id,
520
+ min_ts=min_ts,
521
+ max_ts=max_ts,
522
+ limit=limit,
523
+ cursor=cursor,
524
+ _request_auth=_request_auth,
525
+ _content_type=_content_type,
526
+ _headers=_headers,
527
+ _host_index=_host_index
528
+ )
529
+
530
+ _response_types_map: Dict[str, Optional[str]] = {
531
+ '200': "GetFillsResponse",
532
+ '400': None,
533
+ '401': None,
534
+ '500': None,
535
+ }
536
+ response_data = await self.api_client.call_api(
537
+ *_param,
538
+ _request_timeout=_request_timeout
539
+ )
540
+ return response_data.response
541
+
542
+
543
+ def _get_fills_serialize(
544
+ self,
545
+ ticker,
546
+ order_id,
547
+ min_ts,
548
+ max_ts,
549
+ limit,
550
+ cursor,
551
+ _request_auth,
552
+ _content_type,
553
+ _headers,
554
+ _host_index,
555
+ ) -> RequestSerialized:
556
+
557
+ _host = None
558
+
559
+ _collection_formats: Dict[str, str] = {
560
+ }
561
+
562
+ _path_params: Dict[str, str] = {}
563
+ _query_params: List[Tuple[str, str]] = []
564
+ _header_params: Dict[str, Optional[str]] = _headers or {}
565
+ _form_params: List[Tuple[str, str]] = []
566
+ _files: Dict[
567
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
568
+ ] = {}
569
+ _body_params: Optional[bytes] = None
570
+
571
+ # process the path parameters
572
+ # process the query parameters
573
+ if ticker is not None:
574
+
575
+ _query_params.append(('ticker', ticker))
576
+
577
+ if order_id is not None:
578
+
579
+ _query_params.append(('order_id', order_id))
580
+
581
+ if min_ts is not None:
582
+
583
+ _query_params.append(('min_ts', min_ts))
584
+
585
+ if max_ts is not None:
586
+
587
+ _query_params.append(('max_ts', max_ts))
588
+
589
+ if limit is not None:
590
+
591
+ _query_params.append(('limit', limit))
592
+
593
+ if cursor is not None:
594
+
595
+ _query_params.append(('cursor', cursor))
596
+
597
+ # process the header parameters
598
+ # process the form parameters
599
+ # process the body parameter
600
+
601
+
602
+ # set the HTTP header `Accept`
603
+ if 'Accept' not in _header_params:
604
+ _header_params['Accept'] = self.api_client.select_header_accept(
605
+ [
606
+ 'application/json'
607
+ ]
608
+ )
609
+
610
+
611
+ # authentication setting
612
+ _auth_settings: List[str] = [
613
+ 'kalshiAccessSignature',
614
+ 'kalshiAccessKey',
615
+ 'kalshiAccessTimestamp'
616
+ ]
617
+
618
+ return self.api_client.param_serialize(
619
+ method='GET',
620
+ resource_path='/portfolio/fills',
621
+ path_params=_path_params,
622
+ query_params=_query_params,
623
+ header_params=_header_params,
624
+ body=_body_params,
625
+ post_params=_form_params,
626
+ files=_files,
627
+ auth_settings=_auth_settings,
628
+ collection_formats=_collection_formats,
629
+ _host=_host,
630
+ _request_auth=_request_auth
631
+ )
632
+
633
+
634
+
635
+
636
+ @validate_call
637
+ async def get_portfolio_resting_order_total_value(
638
+ self,
639
+ ) -> GetPortfolioRestingOrderTotalValueResponse:
640
+ """Get Total Resting Order Value
641
+
642
+ Endpoint for getting the total value, in cents, of resting orders. This endpoint is only intended for use by FCM members (rare). Note: If you're uncertain about this endpoint, it likely does not apply to you.
643
+
644
+ :param _request_timeout: timeout setting for this request. If one
645
+ number provided, it will be total request
646
+ timeout. It can also be a pair (tuple) of
647
+ (connection, read) timeouts.
648
+ :type _request_timeout: int, tuple(int, int), optional
649
+ :param _request_auth: set to override the auth_settings for an a single
650
+ request; this effectively ignores the
651
+ authentication in the spec for a single request.
652
+ :type _request_auth: dict, optional
653
+ :param _content_type: force content-type for the request.
654
+ :type _content_type: str, Optional
655
+ :param _headers: set to override the headers for a single
656
+ request; this effectively ignores the headers
657
+ in the spec for a single request.
658
+ :type _headers: dict, optional
659
+ :param _host_index: set to override the host_index for a single
660
+ request; this effectively ignores the host_index
661
+ in the spec for a single request.
662
+ :type _host_index: int, optional
663
+ :return: Returns the result object.
664
+ """ # noqa: E501
665
+
666
+
667
+ _param = self._get_portfolio_resting_order_total_value_serialize(
668
+ _request_auth=None,
669
+ _content_type=None,
670
+ _headers=None,
671
+ _host_index=0
672
+ )
673
+
674
+ _response_types_map: Dict[str, Optional[str]] = {
675
+ '200': "GetPortfolioRestingOrderTotalValueResponse",
676
+ '401': "ErrorResponse",
677
+ '500': "ErrorResponse",
678
+ }
679
+ response_data = await self.api_client.call_api(
680
+ *_param,
681
+ _request_timeout=None,
682
+ )
683
+ await response_data.read()
684
+ return self.api_client.response_deserialize(
685
+ response_data=response_data,
686
+ response_types_map=_response_types_map,
687
+ ).data
688
+
689
+
690
+ @validate_call
691
+ async def get_portfolio_resting_order_total_value_with_http_info(
692
+ self,
693
+ _request_timeout: Union[
694
+ None,
695
+ Annotated[StrictFloat, Field(gt=0)],
696
+ Tuple[
697
+ Annotated[StrictFloat, Field(gt=0)],
698
+ Annotated[StrictFloat, Field(gt=0)]
699
+ ]
700
+ ] = None,
701
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
702
+ _content_type: Optional[StrictStr] = None,
703
+ _headers: Optional[Dict[StrictStr, Any]] = None,
704
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
705
+ ) -> ApiResponse[GetPortfolioRestingOrderTotalValueResponse]:
706
+ """Get Total Resting Order Value
707
+
708
+ Endpoint for getting the total value, in cents, of resting orders. This endpoint is only intended for use by FCM members (rare). Note: If you're uncertain about this endpoint, it likely does not apply to you.
709
+
710
+ :param _request_timeout: timeout setting for this request. If one
711
+ number provided, it will be total request
712
+ timeout. It can also be a pair (tuple) of
713
+ (connection, read) timeouts.
714
+ :type _request_timeout: int, tuple(int, int), optional
715
+ :param _request_auth: set to override the auth_settings for an a single
716
+ request; this effectively ignores the
717
+ authentication in the spec for a single request.
718
+ :type _request_auth: dict, optional
719
+ :param _content_type: force content-type for the request.
720
+ :type _content_type: str, Optional
721
+ :param _headers: set to override the headers for a single
722
+ request; this effectively ignores the headers
723
+ in the spec for a single request.
724
+ :type _headers: dict, optional
725
+ :param _host_index: set to override the host_index for a single
726
+ request; this effectively ignores the host_index
727
+ in the spec for a single request.
728
+ :type _host_index: int, optional
729
+ :return: Returns the result object.
730
+ """ # noqa: E501
731
+
732
+ _param = self._get_portfolio_resting_order_total_value_serialize(
733
+ _request_auth=_request_auth,
734
+ _content_type=_content_type,
735
+ _headers=_headers,
736
+ _host_index=_host_index
737
+ )
738
+
739
+ _response_types_map: Dict[str, Optional[str]] = {
740
+ '200': "GetPortfolioRestingOrderTotalValueResponse",
741
+ '401': "ErrorResponse",
742
+ '500': "ErrorResponse",
743
+ }
744
+ response_data = await self.api_client.call_api(
745
+ *_param,
746
+ _request_timeout=_request_timeout
747
+ )
748
+ await response_data.read()
749
+ return self.api_client.response_deserialize(
750
+ response_data=response_data,
751
+ response_types_map=_response_types_map,
752
+ )
753
+
754
+
755
+ @validate_call
756
+ async def get_portfolio_resting_order_total_value_without_preload_content(
757
+ self,
758
+ _request_timeout: Union[
759
+ None,
760
+ Annotated[StrictFloat, Field(gt=0)],
761
+ Tuple[
762
+ Annotated[StrictFloat, Field(gt=0)],
763
+ Annotated[StrictFloat, Field(gt=0)]
764
+ ]
765
+ ] = None,
766
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
767
+ _content_type: Optional[StrictStr] = None,
768
+ _headers: Optional[Dict[StrictStr, Any]] = None,
769
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
770
+ ) -> RESTResponseType:
771
+ """Get Total Resting Order Value
772
+
773
+ Endpoint for getting the total value, in cents, of resting orders. This endpoint is only intended for use by FCM members (rare). Note: If you're uncertain about this endpoint, it likely does not apply to you.
774
+
775
+ :param _request_timeout: timeout setting for this request. If one
776
+ number provided, it will be total request
777
+ timeout. It can also be a pair (tuple) of
778
+ (connection, read) timeouts.
779
+ :type _request_timeout: int, tuple(int, int), optional
780
+ :param _request_auth: set to override the auth_settings for an a single
781
+ request; this effectively ignores the
782
+ authentication in the spec for a single request.
783
+ :type _request_auth: dict, optional
784
+ :param _content_type: force content-type for the request.
785
+ :type _content_type: str, Optional
786
+ :param _headers: set to override the headers for a single
787
+ request; this effectively ignores the headers
788
+ in the spec for a single request.
789
+ :type _headers: dict, optional
790
+ :param _host_index: set to override the host_index for a single
791
+ request; this effectively ignores the host_index
792
+ in the spec for a single request.
793
+ :type _host_index: int, optional
794
+ :return: Returns the result object.
795
+ """ # noqa: E501
796
+
797
+ _param = self._get_portfolio_resting_order_total_value_serialize(
798
+ _request_auth=_request_auth,
799
+ _content_type=_content_type,
800
+ _headers=_headers,
801
+ _host_index=_host_index
802
+ )
803
+
804
+ _response_types_map: Dict[str, Optional[str]] = {
805
+ '200': "GetPortfolioRestingOrderTotalValueResponse",
806
+ '401': "ErrorResponse",
807
+ '500': "ErrorResponse",
808
+ }
809
+ response_data = await self.api_client.call_api(
810
+ *_param,
811
+ _request_timeout=_request_timeout
812
+ )
813
+ return response_data.response
814
+
815
+
816
+ def _get_portfolio_resting_order_total_value_serialize(
817
+ self,
818
+ _request_auth,
819
+ _content_type,
820
+ _headers,
821
+ _host_index,
822
+ ) -> RequestSerialized:
823
+
824
+ _host = None
825
+
826
+ _collection_formats: Dict[str, str] = {
827
+ }
828
+
829
+ _path_params: Dict[str, str] = {}
830
+ _query_params: List[Tuple[str, str]] = []
831
+ _header_params: Dict[str, Optional[str]] = _headers or {}
832
+ _form_params: List[Tuple[str, str]] = []
833
+ _files: Dict[
834
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
835
+ ] = {}
836
+ _body_params: Optional[bytes] = None
837
+
838
+ # process the path parameters
839
+ # process the query parameters
840
+ # process the header parameters
841
+ # process the form parameters
842
+ # process the body parameter
843
+
844
+
845
+ # set the HTTP header `Accept`
846
+ if 'Accept' not in _header_params:
847
+ _header_params['Accept'] = self.api_client.select_header_accept(
848
+ [
849
+ 'application/json'
850
+ ]
851
+ )
852
+
853
+
854
+ # authentication setting
855
+ _auth_settings: List[str] = [
856
+ 'kalshiAccessSignature',
857
+ 'kalshiAccessKey',
858
+ 'kalshiAccessTimestamp'
859
+ ]
860
+
861
+ return self.api_client.param_serialize(
862
+ method='GET',
863
+ resource_path='/portfolio/summary/total_resting_order_value',
864
+ path_params=_path_params,
865
+ query_params=_query_params,
866
+ header_params=_header_params,
867
+ body=_body_params,
868
+ post_params=_form_params,
869
+ files=_files,
870
+ auth_settings=_auth_settings,
871
+ collection_formats=_collection_formats,
872
+ _host=_host,
873
+ _request_auth=_request_auth
874
+ )
875
+
876
+
877
+
878
+
879
+ @validate_call
880
+ async def get_positions(
881
+ self,
882
+ cursor: Any = None,
883
+ limit: Any = None,
884
+ count_filter: Any = None,
885
+ settlement_status: Any = None,
886
+ ticker: Any = None,
887
+ event_ticker: Any = None,
888
+ ) -> GetPositionsResponse:
889
+ """Get Positions
890
+
891
+ Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted: position, total_traded
892
+
893
+ :param cursor: The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page.
894
+ :type cursor: str
895
+ :param limit: Parameter to specify the number of results per page. Defaults to 100.
896
+ :type limit: int
897
+ :param count_filter: Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted - position, total_traded
898
+ :type count_filter: str
899
+ :param settlement_status: Settlement status of the markets to return. Defaults to unsettled.
900
+ :type settlement_status: str
901
+ :param ticker: Filter by market ticker
902
+ :type ticker: str
903
+ :param event_ticker: Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).
904
+ :type event_ticker: str
905
+ :param _request_timeout: timeout setting for this request. If one
906
+ number provided, it will be total request
907
+ timeout. It can also be a pair (tuple) of
908
+ (connection, read) timeouts.
909
+ :type _request_timeout: int, tuple(int, int), optional
910
+ :param _request_auth: set to override the auth_settings for an a single
911
+ request; this effectively ignores the
912
+ authentication in the spec for a single request.
913
+ :type _request_auth: dict, optional
914
+ :param _content_type: force content-type for the request.
915
+ :type _content_type: str, Optional
916
+ :param _headers: set to override the headers for a single
917
+ request; this effectively ignores the headers
918
+ in the spec for a single request.
919
+ :type _headers: dict, optional
920
+ :param _host_index: set to override the host_index for a single
921
+ request; this effectively ignores the host_index
922
+ in the spec for a single request.
923
+ :type _host_index: int, optional
924
+ :return: Returns the result object.
925
+ """ # noqa: E501
926
+
927
+
928
+ _param = self._get_positions_serialize(
929
+ cursor=cursor,
930
+ limit=limit,
931
+ count_filter=count_filter,
932
+ settlement_status=settlement_status,
933
+ ticker=ticker,
934
+ event_ticker=event_ticker,
935
+ _request_auth=None,
936
+ _content_type=None,
937
+ _headers=None,
938
+ _host_index=0
939
+ )
940
+
941
+ _response_types_map: Dict[str, Optional[str]] = {
942
+ '200': "GetPositionsResponse",
943
+ '400': "ErrorResponse",
944
+ '401': "ErrorResponse",
945
+ '500': "ErrorResponse",
946
+ }
947
+ response_data = await self.api_client.call_api(
948
+ *_param,
949
+ _request_timeout=None,
950
+ )
951
+ await response_data.read()
952
+ return self.api_client.response_deserialize(
953
+ response_data=response_data,
954
+ response_types_map=_response_types_map,
955
+ ).data
956
+
957
+
958
+ @validate_call
959
+ async def get_positions_with_http_info(
960
+ self,
961
+ cursor: Annotated[Optional[StrictStr], Field(description="The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page.")] = None,
962
+ limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Parameter to specify the number of results per page. Defaults to 100.")] = None,
963
+ count_filter: Annotated[Optional[StrictStr], Field(description="Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted - position, total_traded")] = None,
964
+ settlement_status: Annotated[Optional[StrictStr], Field(description="Settlement status of the markets to return. Defaults to unsettled.")] = None,
965
+ ticker: Annotated[Optional[StrictStr], Field(description="Filter by market ticker")] = None,
966
+ event_ticker: Annotated[Optional[StrictStr], Field(description="Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).")] = None,
967
+ _request_timeout: Union[
968
+ None,
969
+ Annotated[StrictFloat, Field(gt=0)],
970
+ Tuple[
971
+ Annotated[StrictFloat, Field(gt=0)],
972
+ Annotated[StrictFloat, Field(gt=0)]
973
+ ]
974
+ ] = None,
975
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
976
+ _content_type: Optional[StrictStr] = None,
977
+ _headers: Optional[Dict[StrictStr, Any]] = None,
978
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
979
+ ) -> ApiResponse[GetPositionsResponse]:
980
+ """Get Positions
981
+
982
+ Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted: position, total_traded
983
+
984
+ :param cursor: The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page.
985
+ :type cursor: str
986
+ :param limit: Parameter to specify the number of results per page. Defaults to 100.
987
+ :type limit: int
988
+ :param count_filter: Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted - position, total_traded
989
+ :type count_filter: str
990
+ :param settlement_status: Settlement status of the markets to return. Defaults to unsettled.
991
+ :type settlement_status: str
992
+ :param ticker: Filter by market ticker
993
+ :type ticker: str
994
+ :param event_ticker: Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).
995
+ :type event_ticker: str
996
+ :param _request_timeout: timeout setting for this request. If one
997
+ number provided, it will be total request
998
+ timeout. It can also be a pair (tuple) of
999
+ (connection, read) timeouts.
1000
+ :type _request_timeout: int, tuple(int, int), optional
1001
+ :param _request_auth: set to override the auth_settings for an a single
1002
+ request; this effectively ignores the
1003
+ authentication in the spec for a single request.
1004
+ :type _request_auth: dict, optional
1005
+ :param _content_type: force content-type for the request.
1006
+ :type _content_type: str, Optional
1007
+ :param _headers: set to override the headers for a single
1008
+ request; this effectively ignores the headers
1009
+ in the spec for a single request.
1010
+ :type _headers: dict, optional
1011
+ :param _host_index: set to override the host_index for a single
1012
+ request; this effectively ignores the host_index
1013
+ in the spec for a single request.
1014
+ :type _host_index: int, optional
1015
+ :return: Returns the result object.
1016
+ """ # noqa: E501
1017
+
1018
+ _param = self._get_positions_serialize(
1019
+ cursor=cursor,
1020
+ limit=limit,
1021
+ count_filter=count_filter,
1022
+ settlement_status=settlement_status,
1023
+ ticker=ticker,
1024
+ event_ticker=event_ticker,
1025
+ _request_auth=_request_auth,
1026
+ _content_type=_content_type,
1027
+ _headers=_headers,
1028
+ _host_index=_host_index
1029
+ )
1030
+
1031
+ _response_types_map: Dict[str, Optional[str]] = {
1032
+ '200': "GetPositionsResponse",
1033
+ '400': "ErrorResponse",
1034
+ '401': "ErrorResponse",
1035
+ '500': "ErrorResponse",
1036
+ }
1037
+ response_data = await self.api_client.call_api(
1038
+ *_param,
1039
+ _request_timeout=_request_timeout
1040
+ )
1041
+ await response_data.read()
1042
+ return self.api_client.response_deserialize(
1043
+ response_data=response_data,
1044
+ response_types_map=_response_types_map,
1045
+ )
1046
+
1047
+
1048
+ @validate_call
1049
+ async def get_positions_without_preload_content(
1050
+ self,
1051
+ cursor: Annotated[Optional[StrictStr], Field(description="The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page.")] = None,
1052
+ limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Parameter to specify the number of results per page. Defaults to 100.")] = None,
1053
+ count_filter: Annotated[Optional[StrictStr], Field(description="Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted - position, total_traded")] = None,
1054
+ settlement_status: Annotated[Optional[StrictStr], Field(description="Settlement status of the markets to return. Defaults to unsettled.")] = None,
1055
+ ticker: Annotated[Optional[StrictStr], Field(description="Filter by market ticker")] = None,
1056
+ event_ticker: Annotated[Optional[StrictStr], Field(description="Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).")] = None,
1057
+ _request_timeout: Union[
1058
+ None,
1059
+ Annotated[StrictFloat, Field(gt=0)],
1060
+ Tuple[
1061
+ Annotated[StrictFloat, Field(gt=0)],
1062
+ Annotated[StrictFloat, Field(gt=0)]
1063
+ ]
1064
+ ] = None,
1065
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1066
+ _content_type: Optional[StrictStr] = None,
1067
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1068
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1069
+ ) -> RESTResponseType:
1070
+ """Get Positions
1071
+
1072
+ Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted: position, total_traded
1073
+
1074
+ :param cursor: The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page.
1075
+ :type cursor: str
1076
+ :param limit: Parameter to specify the number of results per page. Defaults to 100.
1077
+ :type limit: int
1078
+ :param count_filter: Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted - position, total_traded
1079
+ :type count_filter: str
1080
+ :param settlement_status: Settlement status of the markets to return. Defaults to unsettled.
1081
+ :type settlement_status: str
1082
+ :param ticker: Filter by market ticker
1083
+ :type ticker: str
1084
+ :param event_ticker: Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).
1085
+ :type event_ticker: str
1086
+ :param _request_timeout: timeout setting for this request. If one
1087
+ number provided, it will be total request
1088
+ timeout. It can also be a pair (tuple) of
1089
+ (connection, read) timeouts.
1090
+ :type _request_timeout: int, tuple(int, int), optional
1091
+ :param _request_auth: set to override the auth_settings for an a single
1092
+ request; this effectively ignores the
1093
+ authentication in the spec for a single request.
1094
+ :type _request_auth: dict, optional
1095
+ :param _content_type: force content-type for the request.
1096
+ :type _content_type: str, Optional
1097
+ :param _headers: set to override the headers for a single
1098
+ request; this effectively ignores the headers
1099
+ in the spec for a single request.
1100
+ :type _headers: dict, optional
1101
+ :param _host_index: set to override the host_index for a single
1102
+ request; this effectively ignores the host_index
1103
+ in the spec for a single request.
1104
+ :type _host_index: int, optional
1105
+ :return: Returns the result object.
1106
+ """ # noqa: E501
1107
+
1108
+ _param = self._get_positions_serialize(
1109
+ cursor=cursor,
1110
+ limit=limit,
1111
+ count_filter=count_filter,
1112
+ settlement_status=settlement_status,
1113
+ ticker=ticker,
1114
+ event_ticker=event_ticker,
1115
+ _request_auth=_request_auth,
1116
+ _content_type=_content_type,
1117
+ _headers=_headers,
1118
+ _host_index=_host_index
1119
+ )
1120
+
1121
+ _response_types_map: Dict[str, Optional[str]] = {
1122
+ '200': "GetPositionsResponse",
1123
+ '400': "ErrorResponse",
1124
+ '401': "ErrorResponse",
1125
+ '500': "ErrorResponse",
1126
+ }
1127
+ response_data = await self.api_client.call_api(
1128
+ *_param,
1129
+ _request_timeout=_request_timeout
1130
+ )
1131
+ return response_data.response
1132
+
1133
+
1134
+ def _get_positions_serialize(
1135
+ self,
1136
+ cursor,
1137
+ limit,
1138
+ count_filter,
1139
+ settlement_status,
1140
+ ticker,
1141
+ event_ticker,
1142
+ _request_auth,
1143
+ _content_type,
1144
+ _headers,
1145
+ _host_index,
1146
+ ) -> RequestSerialized:
1147
+
1148
+ _host = None
1149
+
1150
+ _collection_formats: Dict[str, str] = {
1151
+ }
1152
+
1153
+ _path_params: Dict[str, str] = {}
1154
+ _query_params: List[Tuple[str, str]] = []
1155
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1156
+ _form_params: List[Tuple[str, str]] = []
1157
+ _files: Dict[
1158
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1159
+ ] = {}
1160
+ _body_params: Optional[bytes] = None
1161
+
1162
+ # process the path parameters
1163
+ # process the query parameters
1164
+ if cursor is not None:
1165
+
1166
+ _query_params.append(('cursor', cursor))
1167
+
1168
+ if limit is not None:
1169
+
1170
+ _query_params.append(('limit', limit))
1171
+
1172
+ if count_filter is not None:
1173
+
1174
+ _query_params.append(('count_filter', count_filter))
1175
+
1176
+ if settlement_status is not None:
1177
+
1178
+ _query_params.append(('settlement_status', settlement_status))
1179
+
1180
+ if ticker is not None:
1181
+
1182
+ _query_params.append(('ticker', ticker))
1183
+
1184
+ if event_ticker is not None:
1185
+
1186
+ _query_params.append(('event_ticker', event_ticker))
1187
+
1188
+ # process the header parameters
1189
+ # process the form parameters
1190
+ # process the body parameter
1191
+
1192
+
1193
+ # set the HTTP header `Accept`
1194
+ if 'Accept' not in _header_params:
1195
+ _header_params['Accept'] = self.api_client.select_header_accept(
1196
+ [
1197
+ 'application/json'
1198
+ ]
1199
+ )
1200
+
1201
+
1202
+ # authentication setting
1203
+ _auth_settings: List[str] = [
1204
+ 'kalshiAccessSignature',
1205
+ 'kalshiAccessKey',
1206
+ 'kalshiAccessTimestamp'
1207
+ ]
1208
+
1209
+ return self.api_client.param_serialize(
1210
+ method='GET',
1211
+ resource_path='/portfolio/positions',
1212
+ path_params=_path_params,
1213
+ query_params=_query_params,
1214
+ header_params=_header_params,
1215
+ body=_body_params,
1216
+ post_params=_form_params,
1217
+ files=_files,
1218
+ auth_settings=_auth_settings,
1219
+ collection_formats=_collection_formats,
1220
+ _host=_host,
1221
+ _request_auth=_request_auth
1222
+ )
1223
+
1224
+
1225
+
1226
+
1227
+ @validate_call
1228
+ async def get_settlements(
1229
+ self,
1230
+ limit: Any = None,
1231
+ cursor: Any = None,
1232
+ ticker: Any = None,
1233
+ event_ticker: Any = None,
1234
+ min_ts: Any = None,
1235
+ max_ts: Any = None,
1236
+ ) -> GetSettlementsResponse:
1237
+ """Get Settlements
1238
+
1239
+ Endpoint for getting the member's settlements historical track.
1240
+
1241
+ :param limit: Number of results per page. Defaults to 100. Maximum value is 200.
1242
+ :type limit: int
1243
+ :param 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.
1244
+ :type cursor: str
1245
+ :param ticker: Filter by market ticker
1246
+ :type ticker: str
1247
+ :param event_ticker: Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).
1248
+ :type event_ticker: str
1249
+ :param min_ts: Filter items after this Unix timestamp
1250
+ :type min_ts: int
1251
+ :param max_ts: Filter items before this Unix timestamp
1252
+ :type max_ts: int
1253
+ :param _request_timeout: timeout setting for this request. If one
1254
+ number provided, it will be total request
1255
+ timeout. It can also be a pair (tuple) of
1256
+ (connection, read) timeouts.
1257
+ :type _request_timeout: int, tuple(int, int), optional
1258
+ :param _request_auth: set to override the auth_settings for an a single
1259
+ request; this effectively ignores the
1260
+ authentication in the spec for a single request.
1261
+ :type _request_auth: dict, optional
1262
+ :param _content_type: force content-type for the request.
1263
+ :type _content_type: str, Optional
1264
+ :param _headers: set to override the headers for a single
1265
+ request; this effectively ignores the headers
1266
+ in the spec for a single request.
1267
+ :type _headers: dict, optional
1268
+ :param _host_index: set to override the host_index for a single
1269
+ request; this effectively ignores the host_index
1270
+ in the spec for a single request.
1271
+ :type _host_index: int, optional
1272
+ :return: Returns the result object.
1273
+ """ # noqa: E501
1274
+
1275
+
1276
+ _param = self._get_settlements_serialize(
1277
+ limit=limit,
1278
+ cursor=cursor,
1279
+ ticker=ticker,
1280
+ event_ticker=event_ticker,
1281
+ min_ts=min_ts,
1282
+ max_ts=max_ts,
1283
+ _request_auth=None,
1284
+ _content_type=None,
1285
+ _headers=None,
1286
+ _host_index=0
1287
+ )
1288
+
1289
+ _response_types_map: Dict[str, Optional[str]] = {
1290
+ '200': "GetSettlementsResponse",
1291
+ '400': "ErrorResponse",
1292
+ '401': "ErrorResponse",
1293
+ '500': "ErrorResponse",
1294
+ }
1295
+ response_data = await self.api_client.call_api(
1296
+ *_param,
1297
+ _request_timeout=None,
1298
+ )
1299
+ await response_data.read()
1300
+ return self.api_client.response_deserialize(
1301
+ response_data=response_data,
1302
+ response_types_map=_response_types_map,
1303
+ ).data
1304
+
1305
+
1306
+ @validate_call
1307
+ async def get_settlements_with_http_info(
1308
+ self,
1309
+ limit: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=1)]], Field(description="Number of results per page. Defaults to 100. Maximum value is 200.")] = None,
1310
+ cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.")] = None,
1311
+ ticker: Annotated[Optional[StrictStr], Field(description="Filter by market ticker")] = None,
1312
+ event_ticker: Annotated[Optional[StrictStr], Field(description="Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).")] = None,
1313
+ min_ts: Annotated[Optional[StrictInt], Field(description="Filter items after this Unix timestamp")] = None,
1314
+ max_ts: Annotated[Optional[StrictInt], Field(description="Filter items before this Unix timestamp")] = None,
1315
+ _request_timeout: Union[
1316
+ None,
1317
+ Annotated[StrictFloat, Field(gt=0)],
1318
+ Tuple[
1319
+ Annotated[StrictFloat, Field(gt=0)],
1320
+ Annotated[StrictFloat, Field(gt=0)]
1321
+ ]
1322
+ ] = None,
1323
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1324
+ _content_type: Optional[StrictStr] = None,
1325
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1326
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1327
+ ) -> ApiResponse[GetSettlementsResponse]:
1328
+ """Get Settlements
1329
+
1330
+ Endpoint for getting the member's settlements historical track.
1331
+
1332
+ :param limit: Number of results per page. Defaults to 100. Maximum value is 200.
1333
+ :type limit: int
1334
+ :param 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.
1335
+ :type cursor: str
1336
+ :param ticker: Filter by market ticker
1337
+ :type ticker: str
1338
+ :param event_ticker: Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).
1339
+ :type event_ticker: str
1340
+ :param min_ts: Filter items after this Unix timestamp
1341
+ :type min_ts: int
1342
+ :param max_ts: Filter items before this Unix timestamp
1343
+ :type max_ts: int
1344
+ :param _request_timeout: timeout setting for this request. If one
1345
+ number provided, it will be total request
1346
+ timeout. It can also be a pair (tuple) of
1347
+ (connection, read) timeouts.
1348
+ :type _request_timeout: int, tuple(int, int), optional
1349
+ :param _request_auth: set to override the auth_settings for an a single
1350
+ request; this effectively ignores the
1351
+ authentication in the spec for a single request.
1352
+ :type _request_auth: dict, optional
1353
+ :param _content_type: force content-type for the request.
1354
+ :type _content_type: str, Optional
1355
+ :param _headers: set to override the headers for a single
1356
+ request; this effectively ignores the headers
1357
+ in the spec for a single request.
1358
+ :type _headers: dict, optional
1359
+ :param _host_index: set to override the host_index for a single
1360
+ request; this effectively ignores the host_index
1361
+ in the spec for a single request.
1362
+ :type _host_index: int, optional
1363
+ :return: Returns the result object.
1364
+ """ # noqa: E501
1365
+
1366
+ _param = self._get_settlements_serialize(
1367
+ limit=limit,
1368
+ cursor=cursor,
1369
+ ticker=ticker,
1370
+ event_ticker=event_ticker,
1371
+ min_ts=min_ts,
1372
+ max_ts=max_ts,
1373
+ _request_auth=_request_auth,
1374
+ _content_type=_content_type,
1375
+ _headers=_headers,
1376
+ _host_index=_host_index
1377
+ )
1378
+
1379
+ _response_types_map: Dict[str, Optional[str]] = {
1380
+ '200': "GetSettlementsResponse",
1381
+ '400': "ErrorResponse",
1382
+ '401': "ErrorResponse",
1383
+ '500': "ErrorResponse",
1384
+ }
1385
+ response_data = await self.api_client.call_api(
1386
+ *_param,
1387
+ _request_timeout=_request_timeout
1388
+ )
1389
+ await response_data.read()
1390
+ return self.api_client.response_deserialize(
1391
+ response_data=response_data,
1392
+ response_types_map=_response_types_map,
1393
+ )
1394
+
1395
+
1396
+ @validate_call
1397
+ async def get_settlements_without_preload_content(
1398
+ self,
1399
+ limit: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=1)]], Field(description="Number of results per page. Defaults to 100. Maximum value is 200.")] = None,
1400
+ cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.")] = None,
1401
+ ticker: Annotated[Optional[StrictStr], Field(description="Filter by market ticker")] = None,
1402
+ event_ticker: Annotated[Optional[StrictStr], Field(description="Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).")] = None,
1403
+ min_ts: Annotated[Optional[StrictInt], Field(description="Filter items after this Unix timestamp")] = None,
1404
+ max_ts: Annotated[Optional[StrictInt], Field(description="Filter items before this Unix timestamp")] = None,
1405
+ _request_timeout: Union[
1406
+ None,
1407
+ Annotated[StrictFloat, Field(gt=0)],
1408
+ Tuple[
1409
+ Annotated[StrictFloat, Field(gt=0)],
1410
+ Annotated[StrictFloat, Field(gt=0)]
1411
+ ]
1412
+ ] = None,
1413
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1414
+ _content_type: Optional[StrictStr] = None,
1415
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1416
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1417
+ ) -> RESTResponseType:
1418
+ """Get Settlements
1419
+
1420
+ Endpoint for getting the member's settlements historical track.
1421
+
1422
+ :param limit: Number of results per page. Defaults to 100. Maximum value is 200.
1423
+ :type limit: int
1424
+ :param 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.
1425
+ :type cursor: str
1426
+ :param ticker: Filter by market ticker
1427
+ :type ticker: str
1428
+ :param event_ticker: Event ticker of desired positions. Multiple event tickers can be provided as a comma-separated list (maximum 10).
1429
+ :type event_ticker: str
1430
+ :param min_ts: Filter items after this Unix timestamp
1431
+ :type min_ts: int
1432
+ :param max_ts: Filter items before this Unix timestamp
1433
+ :type max_ts: int
1434
+ :param _request_timeout: timeout setting for this request. If one
1435
+ number provided, it will be total request
1436
+ timeout. It can also be a pair (tuple) of
1437
+ (connection, read) timeouts.
1438
+ :type _request_timeout: int, tuple(int, int), optional
1439
+ :param _request_auth: set to override the auth_settings for an a single
1440
+ request; this effectively ignores the
1441
+ authentication in the spec for a single request.
1442
+ :type _request_auth: dict, optional
1443
+ :param _content_type: force content-type for the request.
1444
+ :type _content_type: str, Optional
1445
+ :param _headers: set to override the headers for a single
1446
+ request; this effectively ignores the headers
1447
+ in the spec for a single request.
1448
+ :type _headers: dict, optional
1449
+ :param _host_index: set to override the host_index for a single
1450
+ request; this effectively ignores the host_index
1451
+ in the spec for a single request.
1452
+ :type _host_index: int, optional
1453
+ :return: Returns the result object.
1454
+ """ # noqa: E501
1455
+
1456
+ _param = self._get_settlements_serialize(
1457
+ limit=limit,
1458
+ cursor=cursor,
1459
+ ticker=ticker,
1460
+ event_ticker=event_ticker,
1461
+ min_ts=min_ts,
1462
+ max_ts=max_ts,
1463
+ _request_auth=_request_auth,
1464
+ _content_type=_content_type,
1465
+ _headers=_headers,
1466
+ _host_index=_host_index
1467
+ )
1468
+
1469
+ _response_types_map: Dict[str, Optional[str]] = {
1470
+ '200': "GetSettlementsResponse",
1471
+ '400': "ErrorResponse",
1472
+ '401': "ErrorResponse",
1473
+ '500': "ErrorResponse",
1474
+ }
1475
+ response_data = await self.api_client.call_api(
1476
+ *_param,
1477
+ _request_timeout=_request_timeout
1478
+ )
1479
+ return response_data.response
1480
+
1481
+
1482
+ def _get_settlements_serialize(
1483
+ self,
1484
+ limit,
1485
+ cursor,
1486
+ ticker,
1487
+ event_ticker,
1488
+ min_ts,
1489
+ max_ts,
1490
+ _request_auth,
1491
+ _content_type,
1492
+ _headers,
1493
+ _host_index,
1494
+ ) -> RequestSerialized:
1495
+
1496
+ _host = None
1497
+
1498
+ _collection_formats: Dict[str, str] = {
1499
+ }
1500
+
1501
+ _path_params: Dict[str, str] = {}
1502
+ _query_params: List[Tuple[str, str]] = []
1503
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1504
+ _form_params: List[Tuple[str, str]] = []
1505
+ _files: Dict[
1506
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1507
+ ] = {}
1508
+ _body_params: Optional[bytes] = None
1509
+
1510
+ # process the path parameters
1511
+ # process the query parameters
1512
+ if limit is not None:
1513
+
1514
+ _query_params.append(('limit', limit))
1515
+
1516
+ if cursor is not None:
1517
+
1518
+ _query_params.append(('cursor', cursor))
1519
+
1520
+ if ticker is not None:
1521
+
1522
+ _query_params.append(('ticker', ticker))
1523
+
1524
+ if event_ticker is not None:
1525
+
1526
+ _query_params.append(('event_ticker', event_ticker))
1527
+
1528
+ if min_ts is not None:
1529
+
1530
+ _query_params.append(('min_ts', min_ts))
1531
+
1532
+ if max_ts is not None:
1533
+
1534
+ _query_params.append(('max_ts', max_ts))
1535
+
1536
+ # process the header parameters
1537
+ # process the form parameters
1538
+ # process the body parameter
1539
+
1540
+
1541
+ # set the HTTP header `Accept`
1542
+ if 'Accept' not in _header_params:
1543
+ _header_params['Accept'] = self.api_client.select_header_accept(
1544
+ [
1545
+ 'application/json'
1546
+ ]
1547
+ )
1548
+
1549
+
1550
+ # authentication setting
1551
+ _auth_settings: List[str] = [
1552
+ 'kalshiAccessSignature',
1553
+ 'kalshiAccessKey',
1554
+ 'kalshiAccessTimestamp'
1555
+ ]
1556
+
1557
+ return self.api_client.param_serialize(
1558
+ method='GET',
1559
+ resource_path='/portfolio/settlements',
1560
+ path_params=_path_params,
1561
+ query_params=_query_params,
1562
+ header_params=_header_params,
1563
+ body=_body_params,
1564
+ post_params=_form_params,
1565
+ files=_files,
1566
+ auth_settings=_auth_settings,
1567
+ collection_formats=_collection_formats,
1568
+ _host=_host,
1569
+ _request_auth=_request_auth
1570
+ )
1571
+
1572
+