lighter-sdk 0.1.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. lighter/__init__.py +140 -0
  2. lighter/api/__init__.py +11 -0
  3. lighter/api/account_api.py +2371 -0
  4. lighter/api/block_api.py +863 -0
  5. lighter/api/candlestick_api.py +718 -0
  6. lighter/api/info_api.py +282 -0
  7. lighter/api/order_api.py +2734 -0
  8. lighter/api/root_api.py +529 -0
  9. lighter/api/transaction_api.py +3525 -0
  10. lighter/api_client.py +784 -0
  11. lighter/api_response.py +21 -0
  12. lighter/configuration.py +475 -0
  13. lighter/exceptions.py +199 -0
  14. lighter/models/__init__.py +112 -0
  15. lighter/models/account.py +110 -0
  16. lighter/models/account_api_keys.py +104 -0
  17. lighter/models/account_market_stats.py +98 -0
  18. lighter/models/account_metadata.py +94 -0
  19. lighter/models/account_pn_l.py +106 -0
  20. lighter/models/account_position.py +112 -0
  21. lighter/models/account_stats.py +102 -0
  22. lighter/models/accounts.py +106 -0
  23. lighter/models/api_key.py +98 -0
  24. lighter/models/block.py +124 -0
  25. lighter/models/blocks.py +106 -0
  26. lighter/models/bridge_supported_network.py +96 -0
  27. lighter/models/candlestick.py +106 -0
  28. lighter/models/candlesticks.py +106 -0
  29. lighter/models/contract_address.py +94 -0
  30. lighter/models/current_height.py +96 -0
  31. lighter/models/cursor.py +92 -0
  32. lighter/models/deposit_history.py +106 -0
  33. lighter/models/deposit_history_item.py +105 -0
  34. lighter/models/detailed_account.py +152 -0
  35. lighter/models/detailed_accounts.py +106 -0
  36. lighter/models/detailed_candlestick.py +108 -0
  37. lighter/models/enriched_tx.py +129 -0
  38. lighter/models/exchange_stats.py +110 -0
  39. lighter/models/fee_bucket.py +96 -0
  40. lighter/models/funding.py +98 -0
  41. lighter/models/fundings.py +106 -0
  42. lighter/models/is_whitelisted.py +98 -0
  43. lighter/models/l1_provider_info.py +98 -0
  44. lighter/models/layer2_basic_info.py +100 -0
  45. lighter/models/liquidation.py +100 -0
  46. lighter/models/market_info.py +116 -0
  47. lighter/models/next_nonce.py +96 -0
  48. lighter/models/order.py +159 -0
  49. lighter/models/order_book.py +119 -0
  50. lighter/models/order_book_depth.py +115 -0
  51. lighter/models/order_book_detail.py +151 -0
  52. lighter/models/order_book_details.py +104 -0
  53. lighter/models/order_book_orders.py +117 -0
  54. lighter/models/order_book_stats.py +102 -0
  55. lighter/models/order_books.py +104 -0
  56. lighter/models/orders.py +106 -0
  57. lighter/models/pn_l_entry.py +94 -0
  58. lighter/models/position_funding.py +111 -0
  59. lighter/models/price_level.py +94 -0
  60. lighter/models/public_pool.py +128 -0
  61. lighter/models/public_pool_info.py +100 -0
  62. lighter/models/public_pool_share.py +96 -0
  63. lighter/models/public_pools.py +106 -0
  64. lighter/models/req_get_account.py +101 -0
  65. lighter/models/req_get_account_active_orders.py +96 -0
  66. lighter/models/req_get_account_api_keys.py +94 -0
  67. lighter/models/req_get_account_by_l1_address.py +92 -0
  68. lighter/models/req_get_account_inactive_orders.py +103 -0
  69. lighter/models/req_get_account_orders.py +99 -0
  70. lighter/models/req_get_account_pending_txs.py +106 -0
  71. lighter/models/req_get_account_pn_l.py +118 -0
  72. lighter/models/req_get_account_txs.py +111 -0
  73. lighter/models/req_get_block.py +101 -0
  74. lighter/models/req_get_block_txs.py +101 -0
  75. lighter/models/req_get_by_account.py +101 -0
  76. lighter/models/req_get_candlesticks.py +109 -0
  77. lighter/models/req_get_deposit_history.py +106 -0
  78. lighter/models/req_get_fee_bucket.py +92 -0
  79. lighter/models/req_get_fundings.py +107 -0
  80. lighter/models/req_get_l1_tx.py +92 -0
  81. lighter/models/req_get_latest_deposit.py +92 -0
  82. lighter/models/req_get_next_nonce.py +94 -0
  83. lighter/models/req_get_order_book_details.py +92 -0
  84. lighter/models/req_get_order_book_orders.py +95 -0
  85. lighter/models/req_get_order_books.py +92 -0
  86. lighter/models/req_get_public_pools.py +109 -0
  87. lighter/models/req_get_range_with_cursor.py +95 -0
  88. lighter/models/req_get_range_with_index.py +95 -0
  89. lighter/models/req_get_range_with_index_sortable.py +107 -0
  90. lighter/models/req_get_recent_trades.py +95 -0
  91. lighter/models/req_get_trades.py +126 -0
  92. lighter/models/req_get_tx.py +101 -0
  93. lighter/models/req_get_withdraw_history.py +106 -0
  94. lighter/models/req_is_whitelisted.py +92 -0
  95. lighter/models/result_code.py +94 -0
  96. lighter/models/simple_order.py +102 -0
  97. lighter/models/status.py +94 -0
  98. lighter/models/sub_accounts.py +106 -0
  99. lighter/models/ticker.py +103 -0
  100. lighter/models/trade.py +125 -0
  101. lighter/models/trades.py +106 -0
  102. lighter/models/tx.py +121 -0
  103. lighter/models/tx_hash.py +96 -0
  104. lighter/models/tx_hashes.py +96 -0
  105. lighter/models/txs.py +104 -0
  106. lighter/models/validator_info.py +94 -0
  107. lighter/models/withdraw_history.py +110 -0
  108. lighter/models/withdraw_history_cursor.py +94 -0
  109. lighter/models/withdraw_history_item.py +114 -0
  110. lighter/models/zk_lighter_info.py +92 -0
  111. lighter/py.typed +0 -0
  112. lighter/rest.py +215 -0
  113. lighter/signer_client.py +440 -0
  114. lighter/signers/signer-amd64.so +0 -0
  115. lighter/signers/signer-arm64.dylib +0 -0
  116. lighter/transactions/__init__.py +3 -0
  117. lighter/transactions/cancel_order.py +27 -0
  118. lighter/transactions/create_order.py +33 -0
  119. lighter/transactions/withdraw.py +25 -0
  120. lighter/ws_client.py +160 -0
  121. lighter_sdk-0.1.0.dist-info/LICENSE +201 -0
  122. lighter_sdk-0.1.0.dist-info/METADATA +26 -0
  123. lighter_sdk-0.1.0.dist-info/RECORD +125 -0
  124. lighter_sdk-0.1.0.dist-info/WHEEL +5 -0
  125. lighter_sdk-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2734 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document:
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictInt, StrictStr, field_validator
20
+ from typing import Optional
21
+ from typing_extensions import Annotated
22
+ from lighter.models.exchange_stats import ExchangeStats
23
+ from lighter.models.order_book_details import OrderBookDetails
24
+ from lighter.models.order_book_orders import OrderBookOrders
25
+ from lighter.models.order_books import OrderBooks
26
+ from lighter.models.orders import Orders
27
+ from lighter.models.trades import Trades
28
+
29
+ from lighter.api_client import ApiClient, RequestSerialized
30
+ from lighter.api_response import ApiResponse
31
+ from lighter.rest import RESTResponseType
32
+
33
+
34
+ class OrderApi:
35
+ """NOTE: This class is auto generated by OpenAPI Generator
36
+ Ref: https://openapi-generator.tech
37
+
38
+ Do not edit the class manually.
39
+ """
40
+
41
+ def __init__(self, api_client=None) -> None:
42
+ if api_client is None:
43
+ api_client = ApiClient.get_default()
44
+ self.api_client = api_client
45
+
46
+
47
+ @validate_call
48
+ async def account_active_orders(
49
+ self,
50
+ account_index: StrictInt,
51
+ market_id: StrictInt,
52
+ auth: StrictStr,
53
+ _request_timeout: Union[
54
+ None,
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Tuple[
57
+ Annotated[StrictFloat, Field(gt=0)],
58
+ Annotated[StrictFloat, Field(gt=0)]
59
+ ]
60
+ ] = None,
61
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
62
+ _content_type: Optional[StrictStr] = None,
63
+ _headers: Optional[Dict[StrictStr, Any]] = None,
64
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
65
+ ) -> Orders:
66
+ """accountActiveOrders
67
+
68
+ Get account active orders
69
+
70
+ :param account_index: (required)
71
+ :type account_index: int
72
+ :param market_id: (required)
73
+ :type market_id: int
74
+ :param auth: (required)
75
+ :type auth: str
76
+ :param _request_timeout: timeout setting for this request. If one
77
+ number provided, it will be total request
78
+ timeout. It can also be a pair (tuple) of
79
+ (connection, read) timeouts.
80
+ :type _request_timeout: int, tuple(int, int), optional
81
+ :param _request_auth: set to override the auth_settings for an a single
82
+ request; this effectively ignores the
83
+ authentication in the spec for a single request.
84
+ :type _request_auth: dict, optional
85
+ :param _content_type: force content-type for the request.
86
+ :type _content_type: str, Optional
87
+ :param _headers: set to override the headers for a single
88
+ request; this effectively ignores the headers
89
+ in the spec for a single request.
90
+ :type _headers: dict, optional
91
+ :param _host_index: set to override the host_index for a single
92
+ request; this effectively ignores the host_index
93
+ in the spec for a single request.
94
+ :type _host_index: int, optional
95
+ :return: Returns the result object.
96
+ """ # noqa: E501
97
+
98
+ _param = self._account_active_orders_serialize(
99
+ account_index=account_index,
100
+ market_id=market_id,
101
+ auth=auth,
102
+ _request_auth=_request_auth,
103
+ _content_type=_content_type,
104
+ _headers=_headers,
105
+ _host_index=_host_index
106
+ )
107
+
108
+ _response_types_map: Dict[str, Optional[str]] = {
109
+ '200': "Orders",
110
+ '400': "ResultCode",
111
+ }
112
+ response_data = await self.api_client.call_api(
113
+ *_param,
114
+ _request_timeout=_request_timeout
115
+ )
116
+ await response_data.read()
117
+ return self.api_client.response_deserialize(
118
+ response_data=response_data,
119
+ response_types_map=_response_types_map,
120
+ ).data
121
+
122
+
123
+ @validate_call
124
+ async def account_active_orders_with_http_info(
125
+ self,
126
+ account_index: StrictInt,
127
+ market_id: StrictInt,
128
+ auth: StrictStr,
129
+ _request_timeout: Union[
130
+ None,
131
+ Annotated[StrictFloat, Field(gt=0)],
132
+ Tuple[
133
+ Annotated[StrictFloat, Field(gt=0)],
134
+ Annotated[StrictFloat, Field(gt=0)]
135
+ ]
136
+ ] = None,
137
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
138
+ _content_type: Optional[StrictStr] = None,
139
+ _headers: Optional[Dict[StrictStr, Any]] = None,
140
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
141
+ ) -> ApiResponse[Orders]:
142
+ """accountActiveOrders
143
+
144
+ Get account active orders
145
+
146
+ :param account_index: (required)
147
+ :type account_index: int
148
+ :param market_id: (required)
149
+ :type market_id: int
150
+ :param auth: (required)
151
+ :type auth: str
152
+ :param _request_timeout: timeout setting for this request. If one
153
+ number provided, it will be total request
154
+ timeout. It can also be a pair (tuple) of
155
+ (connection, read) timeouts.
156
+ :type _request_timeout: int, tuple(int, int), optional
157
+ :param _request_auth: set to override the auth_settings for an a single
158
+ request; this effectively ignores the
159
+ authentication in the spec for a single request.
160
+ :type _request_auth: dict, optional
161
+ :param _content_type: force content-type for the request.
162
+ :type _content_type: str, Optional
163
+ :param _headers: set to override the headers for a single
164
+ request; this effectively ignores the headers
165
+ in the spec for a single request.
166
+ :type _headers: dict, optional
167
+ :param _host_index: set to override the host_index for a single
168
+ request; this effectively ignores the host_index
169
+ in the spec for a single request.
170
+ :type _host_index: int, optional
171
+ :return: Returns the result object.
172
+ """ # noqa: E501
173
+
174
+ _param = self._account_active_orders_serialize(
175
+ account_index=account_index,
176
+ market_id=market_id,
177
+ auth=auth,
178
+ _request_auth=_request_auth,
179
+ _content_type=_content_type,
180
+ _headers=_headers,
181
+ _host_index=_host_index
182
+ )
183
+
184
+ _response_types_map: Dict[str, Optional[str]] = {
185
+ '200': "Orders",
186
+ '400': "ResultCode",
187
+ }
188
+ response_data = await self.api_client.call_api(
189
+ *_param,
190
+ _request_timeout=_request_timeout
191
+ )
192
+ await response_data.read()
193
+ return self.api_client.response_deserialize(
194
+ response_data=response_data,
195
+ response_types_map=_response_types_map,
196
+ )
197
+
198
+
199
+ @validate_call
200
+ async def account_active_orders_without_preload_content(
201
+ self,
202
+ account_index: StrictInt,
203
+ market_id: StrictInt,
204
+ auth: StrictStr,
205
+ _request_timeout: Union[
206
+ None,
207
+ Annotated[StrictFloat, Field(gt=0)],
208
+ Tuple[
209
+ Annotated[StrictFloat, Field(gt=0)],
210
+ Annotated[StrictFloat, Field(gt=0)]
211
+ ]
212
+ ] = None,
213
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
214
+ _content_type: Optional[StrictStr] = None,
215
+ _headers: Optional[Dict[StrictStr, Any]] = None,
216
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
217
+ ) -> RESTResponseType:
218
+ """accountActiveOrders
219
+
220
+ Get account active orders
221
+
222
+ :param account_index: (required)
223
+ :type account_index: int
224
+ :param market_id: (required)
225
+ :type market_id: int
226
+ :param auth: (required)
227
+ :type auth: str
228
+ :param _request_timeout: timeout setting for this request. If one
229
+ number provided, it will be total request
230
+ timeout. It can also be a pair (tuple) of
231
+ (connection, read) timeouts.
232
+ :type _request_timeout: int, tuple(int, int), optional
233
+ :param _request_auth: set to override the auth_settings for an a single
234
+ request; this effectively ignores the
235
+ authentication in the spec for a single request.
236
+ :type _request_auth: dict, optional
237
+ :param _content_type: force content-type for the request.
238
+ :type _content_type: str, Optional
239
+ :param _headers: set to override the headers for a single
240
+ request; this effectively ignores the headers
241
+ in the spec for a single request.
242
+ :type _headers: dict, optional
243
+ :param _host_index: set to override the host_index for a single
244
+ request; this effectively ignores the host_index
245
+ in the spec for a single request.
246
+ :type _host_index: int, optional
247
+ :return: Returns the result object.
248
+ """ # noqa: E501
249
+
250
+ _param = self._account_active_orders_serialize(
251
+ account_index=account_index,
252
+ market_id=market_id,
253
+ auth=auth,
254
+ _request_auth=_request_auth,
255
+ _content_type=_content_type,
256
+ _headers=_headers,
257
+ _host_index=_host_index
258
+ )
259
+
260
+ _response_types_map: Dict[str, Optional[str]] = {
261
+ '200': "Orders",
262
+ '400': "ResultCode",
263
+ }
264
+ response_data = await self.api_client.call_api(
265
+ *_param,
266
+ _request_timeout=_request_timeout
267
+ )
268
+ return response_data.response
269
+
270
+
271
+ def _account_active_orders_serialize(
272
+ self,
273
+ account_index,
274
+ market_id,
275
+ auth,
276
+ _request_auth,
277
+ _content_type,
278
+ _headers,
279
+ _host_index,
280
+ ) -> RequestSerialized:
281
+
282
+ _host = None
283
+
284
+ _collection_formats: Dict[str, str] = {
285
+ }
286
+
287
+ _path_params: Dict[str, str] = {}
288
+ _query_params: List[Tuple[str, str]] = []
289
+ _header_params: Dict[str, Optional[str]] = _headers or {}
290
+ _form_params: List[Tuple[str, str]] = []
291
+ _files: Dict[str, Union[str, bytes]] = {}
292
+ _body_params: Optional[bytes] = None
293
+
294
+ # process the path parameters
295
+ # process the query parameters
296
+ if account_index is not None:
297
+
298
+ _query_params.append(('account_index', account_index))
299
+
300
+ if market_id is not None:
301
+
302
+ _query_params.append(('market_id', market_id))
303
+
304
+ if auth is not None:
305
+
306
+ _query_params.append(('auth', auth))
307
+
308
+ # process the header parameters
309
+ # process the form parameters
310
+ # process the body parameter
311
+
312
+
313
+ # set the HTTP header `Accept`
314
+ if 'Accept' not in _header_params:
315
+ _header_params['Accept'] = self.api_client.select_header_accept(
316
+ [
317
+ 'application/json'
318
+ ]
319
+ )
320
+
321
+
322
+ # authentication setting
323
+ _auth_settings: List[str] = [
324
+ ]
325
+
326
+ return self.api_client.param_serialize(
327
+ method='GET',
328
+ resource_path='/api/v1/accountActiveOrders',
329
+ path_params=_path_params,
330
+ query_params=_query_params,
331
+ header_params=_header_params,
332
+ body=_body_params,
333
+ post_params=_form_params,
334
+ files=_files,
335
+ auth_settings=_auth_settings,
336
+ collection_formats=_collection_formats,
337
+ _host=_host,
338
+ _request_auth=_request_auth
339
+ )
340
+
341
+
342
+
343
+
344
+ @validate_call
345
+ async def account_inactive_orders(
346
+ self,
347
+ account_index: StrictInt,
348
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
349
+ market_id: Optional[StrictInt] = None,
350
+ ask_filter: Optional[StrictInt] = None,
351
+ between_timestamps: Optional[StrictStr] = None,
352
+ cursor: Optional[StrictStr] = None,
353
+ _request_timeout: Union[
354
+ None,
355
+ Annotated[StrictFloat, Field(gt=0)],
356
+ Tuple[
357
+ Annotated[StrictFloat, Field(gt=0)],
358
+ Annotated[StrictFloat, Field(gt=0)]
359
+ ]
360
+ ] = None,
361
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
362
+ _content_type: Optional[StrictStr] = None,
363
+ _headers: Optional[Dict[StrictStr, Any]] = None,
364
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
365
+ ) -> Orders:
366
+ """accountInactiveOrders
367
+
368
+ Get account active orders
369
+
370
+ :param account_index: (required)
371
+ :type account_index: int
372
+ :param limit: (required)
373
+ :type limit: int
374
+ :param market_id:
375
+ :type market_id: int
376
+ :param ask_filter:
377
+ :type ask_filter: int
378
+ :param between_timestamps:
379
+ :type between_timestamps: str
380
+ :param cursor:
381
+ :type cursor: str
382
+ :param _request_timeout: timeout setting for this request. If one
383
+ number provided, it will be total request
384
+ timeout. It can also be a pair (tuple) of
385
+ (connection, read) timeouts.
386
+ :type _request_timeout: int, tuple(int, int), optional
387
+ :param _request_auth: set to override the auth_settings for an a single
388
+ request; this effectively ignores the
389
+ authentication in the spec for a single request.
390
+ :type _request_auth: dict, optional
391
+ :param _content_type: force content-type for the request.
392
+ :type _content_type: str, Optional
393
+ :param _headers: set to override the headers for a single
394
+ request; this effectively ignores the headers
395
+ in the spec for a single request.
396
+ :type _headers: dict, optional
397
+ :param _host_index: set to override the host_index for a single
398
+ request; this effectively ignores the host_index
399
+ in the spec for a single request.
400
+ :type _host_index: int, optional
401
+ :return: Returns the result object.
402
+ """ # noqa: E501
403
+
404
+ _param = self._account_inactive_orders_serialize(
405
+ account_index=account_index,
406
+ limit=limit,
407
+ market_id=market_id,
408
+ ask_filter=ask_filter,
409
+ between_timestamps=between_timestamps,
410
+ cursor=cursor,
411
+ _request_auth=_request_auth,
412
+ _content_type=_content_type,
413
+ _headers=_headers,
414
+ _host_index=_host_index
415
+ )
416
+
417
+ _response_types_map: Dict[str, Optional[str]] = {
418
+ '200': "Orders",
419
+ '400': "ResultCode",
420
+ }
421
+ response_data = await self.api_client.call_api(
422
+ *_param,
423
+ _request_timeout=_request_timeout
424
+ )
425
+ await response_data.read()
426
+ return self.api_client.response_deserialize(
427
+ response_data=response_data,
428
+ response_types_map=_response_types_map,
429
+ ).data
430
+
431
+
432
+ @validate_call
433
+ async def account_inactive_orders_with_http_info(
434
+ self,
435
+ account_index: StrictInt,
436
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
437
+ market_id: Optional[StrictInt] = None,
438
+ ask_filter: Optional[StrictInt] = None,
439
+ between_timestamps: Optional[StrictStr] = None,
440
+ cursor: Optional[StrictStr] = None,
441
+ _request_timeout: Union[
442
+ None,
443
+ Annotated[StrictFloat, Field(gt=0)],
444
+ Tuple[
445
+ Annotated[StrictFloat, Field(gt=0)],
446
+ Annotated[StrictFloat, Field(gt=0)]
447
+ ]
448
+ ] = None,
449
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
450
+ _content_type: Optional[StrictStr] = None,
451
+ _headers: Optional[Dict[StrictStr, Any]] = None,
452
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
453
+ ) -> ApiResponse[Orders]:
454
+ """accountInactiveOrders
455
+
456
+ Get account active orders
457
+
458
+ :param account_index: (required)
459
+ :type account_index: int
460
+ :param limit: (required)
461
+ :type limit: int
462
+ :param market_id:
463
+ :type market_id: int
464
+ :param ask_filter:
465
+ :type ask_filter: int
466
+ :param between_timestamps:
467
+ :type between_timestamps: str
468
+ :param cursor:
469
+ :type cursor: str
470
+ :param _request_timeout: timeout setting for this request. If one
471
+ number provided, it will be total request
472
+ timeout. It can also be a pair (tuple) of
473
+ (connection, read) timeouts.
474
+ :type _request_timeout: int, tuple(int, int), optional
475
+ :param _request_auth: set to override the auth_settings for an a single
476
+ request; this effectively ignores the
477
+ authentication in the spec for a single request.
478
+ :type _request_auth: dict, optional
479
+ :param _content_type: force content-type for the request.
480
+ :type _content_type: str, Optional
481
+ :param _headers: set to override the headers for a single
482
+ request; this effectively ignores the headers
483
+ in the spec for a single request.
484
+ :type _headers: dict, optional
485
+ :param _host_index: set to override the host_index for a single
486
+ request; this effectively ignores the host_index
487
+ in the spec for a single request.
488
+ :type _host_index: int, optional
489
+ :return: Returns the result object.
490
+ """ # noqa: E501
491
+
492
+ _param = self._account_inactive_orders_serialize(
493
+ account_index=account_index,
494
+ limit=limit,
495
+ market_id=market_id,
496
+ ask_filter=ask_filter,
497
+ between_timestamps=between_timestamps,
498
+ cursor=cursor,
499
+ _request_auth=_request_auth,
500
+ _content_type=_content_type,
501
+ _headers=_headers,
502
+ _host_index=_host_index
503
+ )
504
+
505
+ _response_types_map: Dict[str, Optional[str]] = {
506
+ '200': "Orders",
507
+ '400': "ResultCode",
508
+ }
509
+ response_data = await self.api_client.call_api(
510
+ *_param,
511
+ _request_timeout=_request_timeout
512
+ )
513
+ await response_data.read()
514
+ return self.api_client.response_deserialize(
515
+ response_data=response_data,
516
+ response_types_map=_response_types_map,
517
+ )
518
+
519
+
520
+ @validate_call
521
+ async def account_inactive_orders_without_preload_content(
522
+ self,
523
+ account_index: StrictInt,
524
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
525
+ market_id: Optional[StrictInt] = None,
526
+ ask_filter: Optional[StrictInt] = None,
527
+ between_timestamps: Optional[StrictStr] = None,
528
+ cursor: Optional[StrictStr] = None,
529
+ _request_timeout: Union[
530
+ None,
531
+ Annotated[StrictFloat, Field(gt=0)],
532
+ Tuple[
533
+ Annotated[StrictFloat, Field(gt=0)],
534
+ Annotated[StrictFloat, Field(gt=0)]
535
+ ]
536
+ ] = None,
537
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
538
+ _content_type: Optional[StrictStr] = None,
539
+ _headers: Optional[Dict[StrictStr, Any]] = None,
540
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
541
+ ) -> RESTResponseType:
542
+ """accountInactiveOrders
543
+
544
+ Get account active orders
545
+
546
+ :param account_index: (required)
547
+ :type account_index: int
548
+ :param limit: (required)
549
+ :type limit: int
550
+ :param market_id:
551
+ :type market_id: int
552
+ :param ask_filter:
553
+ :type ask_filter: int
554
+ :param between_timestamps:
555
+ :type between_timestamps: str
556
+ :param cursor:
557
+ :type cursor: str
558
+ :param _request_timeout: timeout setting for this request. If one
559
+ number provided, it will be total request
560
+ timeout. It can also be a pair (tuple) of
561
+ (connection, read) timeouts.
562
+ :type _request_timeout: int, tuple(int, int), optional
563
+ :param _request_auth: set to override the auth_settings for an a single
564
+ request; this effectively ignores the
565
+ authentication in the spec for a single request.
566
+ :type _request_auth: dict, optional
567
+ :param _content_type: force content-type for the request.
568
+ :type _content_type: str, Optional
569
+ :param _headers: set to override the headers for a single
570
+ request; this effectively ignores the headers
571
+ in the spec for a single request.
572
+ :type _headers: dict, optional
573
+ :param _host_index: set to override the host_index for a single
574
+ request; this effectively ignores the host_index
575
+ in the spec for a single request.
576
+ :type _host_index: int, optional
577
+ :return: Returns the result object.
578
+ """ # noqa: E501
579
+
580
+ _param = self._account_inactive_orders_serialize(
581
+ account_index=account_index,
582
+ limit=limit,
583
+ market_id=market_id,
584
+ ask_filter=ask_filter,
585
+ between_timestamps=between_timestamps,
586
+ cursor=cursor,
587
+ _request_auth=_request_auth,
588
+ _content_type=_content_type,
589
+ _headers=_headers,
590
+ _host_index=_host_index
591
+ )
592
+
593
+ _response_types_map: Dict[str, Optional[str]] = {
594
+ '200': "Orders",
595
+ '400': "ResultCode",
596
+ }
597
+ response_data = await self.api_client.call_api(
598
+ *_param,
599
+ _request_timeout=_request_timeout
600
+ )
601
+ return response_data.response
602
+
603
+
604
+ def _account_inactive_orders_serialize(
605
+ self,
606
+ account_index,
607
+ limit,
608
+ market_id,
609
+ ask_filter,
610
+ between_timestamps,
611
+ cursor,
612
+ _request_auth,
613
+ _content_type,
614
+ _headers,
615
+ _host_index,
616
+ ) -> RequestSerialized:
617
+
618
+ _host = None
619
+
620
+ _collection_formats: Dict[str, str] = {
621
+ }
622
+
623
+ _path_params: Dict[str, str] = {}
624
+ _query_params: List[Tuple[str, str]] = []
625
+ _header_params: Dict[str, Optional[str]] = _headers or {}
626
+ _form_params: List[Tuple[str, str]] = []
627
+ _files: Dict[str, Union[str, bytes]] = {}
628
+ _body_params: Optional[bytes] = None
629
+
630
+ # process the path parameters
631
+ # process the query parameters
632
+ if account_index is not None:
633
+
634
+ _query_params.append(('account_index', account_index))
635
+
636
+ if market_id is not None:
637
+
638
+ _query_params.append(('market_id', market_id))
639
+
640
+ if ask_filter is not None:
641
+
642
+ _query_params.append(('ask_filter', ask_filter))
643
+
644
+ if between_timestamps is not None:
645
+
646
+ _query_params.append(('between_timestamps', between_timestamps))
647
+
648
+ if cursor is not None:
649
+
650
+ _query_params.append(('cursor', cursor))
651
+
652
+ if limit is not None:
653
+
654
+ _query_params.append(('limit', limit))
655
+
656
+ # process the header parameters
657
+ # process the form parameters
658
+ # process the body parameter
659
+
660
+
661
+ # set the HTTP header `Accept`
662
+ if 'Accept' not in _header_params:
663
+ _header_params['Accept'] = self.api_client.select_header_accept(
664
+ [
665
+ 'application/json'
666
+ ]
667
+ )
668
+
669
+
670
+ # authentication setting
671
+ _auth_settings: List[str] = [
672
+ ]
673
+
674
+ return self.api_client.param_serialize(
675
+ method='GET',
676
+ resource_path='/api/v1/accountInactiveOrders',
677
+ path_params=_path_params,
678
+ query_params=_query_params,
679
+ header_params=_header_params,
680
+ body=_body_params,
681
+ post_params=_form_params,
682
+ files=_files,
683
+ auth_settings=_auth_settings,
684
+ collection_formats=_collection_formats,
685
+ _host=_host,
686
+ _request_auth=_request_auth
687
+ )
688
+
689
+
690
+
691
+
692
+ @validate_call
693
+ async def account_orders(
694
+ self,
695
+ account_index: StrictInt,
696
+ market_id: StrictInt,
697
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
698
+ cursor: Optional[StrictStr] = None,
699
+ _request_timeout: Union[
700
+ None,
701
+ Annotated[StrictFloat, Field(gt=0)],
702
+ Tuple[
703
+ Annotated[StrictFloat, Field(gt=0)],
704
+ Annotated[StrictFloat, Field(gt=0)]
705
+ ]
706
+ ] = None,
707
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
708
+ _content_type: Optional[StrictStr] = None,
709
+ _headers: Optional[Dict[StrictStr, Any]] = None,
710
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
711
+ ) -> Orders:
712
+ """accountOrders
713
+
714
+ Get account orders
715
+
716
+ :param account_index: (required)
717
+ :type account_index: int
718
+ :param market_id: (required)
719
+ :type market_id: int
720
+ :param limit: (required)
721
+ :type limit: int
722
+ :param cursor:
723
+ :type cursor: str
724
+ :param _request_timeout: timeout setting for this request. If one
725
+ number provided, it will be total request
726
+ timeout. It can also be a pair (tuple) of
727
+ (connection, read) timeouts.
728
+ :type _request_timeout: int, tuple(int, int), optional
729
+ :param _request_auth: set to override the auth_settings for an a single
730
+ request; this effectively ignores the
731
+ authentication in the spec for a single request.
732
+ :type _request_auth: dict, optional
733
+ :param _content_type: force content-type for the request.
734
+ :type _content_type: str, Optional
735
+ :param _headers: set to override the headers for a single
736
+ request; this effectively ignores the headers
737
+ in the spec for a single request.
738
+ :type _headers: dict, optional
739
+ :param _host_index: set to override the host_index for a single
740
+ request; this effectively ignores the host_index
741
+ in the spec for a single request.
742
+ :type _host_index: int, optional
743
+ :return: Returns the result object.
744
+ """ # noqa: E501
745
+
746
+ _param = self._account_orders_serialize(
747
+ account_index=account_index,
748
+ market_id=market_id,
749
+ limit=limit,
750
+ cursor=cursor,
751
+ _request_auth=_request_auth,
752
+ _content_type=_content_type,
753
+ _headers=_headers,
754
+ _host_index=_host_index
755
+ )
756
+
757
+ _response_types_map: Dict[str, Optional[str]] = {
758
+ '200': "Orders",
759
+ '400': "ResultCode",
760
+ }
761
+ response_data = await self.api_client.call_api(
762
+ *_param,
763
+ _request_timeout=_request_timeout
764
+ )
765
+ await response_data.read()
766
+ return self.api_client.response_deserialize(
767
+ response_data=response_data,
768
+ response_types_map=_response_types_map,
769
+ ).data
770
+
771
+
772
+ @validate_call
773
+ async def account_orders_with_http_info(
774
+ self,
775
+ account_index: StrictInt,
776
+ market_id: StrictInt,
777
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
778
+ cursor: Optional[StrictStr] = None,
779
+ _request_timeout: Union[
780
+ None,
781
+ Annotated[StrictFloat, Field(gt=0)],
782
+ Tuple[
783
+ Annotated[StrictFloat, Field(gt=0)],
784
+ Annotated[StrictFloat, Field(gt=0)]
785
+ ]
786
+ ] = None,
787
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
788
+ _content_type: Optional[StrictStr] = None,
789
+ _headers: Optional[Dict[StrictStr, Any]] = None,
790
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
791
+ ) -> ApiResponse[Orders]:
792
+ """accountOrders
793
+
794
+ Get account orders
795
+
796
+ :param account_index: (required)
797
+ :type account_index: int
798
+ :param market_id: (required)
799
+ :type market_id: int
800
+ :param limit: (required)
801
+ :type limit: int
802
+ :param cursor:
803
+ :type cursor: str
804
+ :param _request_timeout: timeout setting for this request. If one
805
+ number provided, it will be total request
806
+ timeout. It can also be a pair (tuple) of
807
+ (connection, read) timeouts.
808
+ :type _request_timeout: int, tuple(int, int), optional
809
+ :param _request_auth: set to override the auth_settings for an a single
810
+ request; this effectively ignores the
811
+ authentication in the spec for a single request.
812
+ :type _request_auth: dict, optional
813
+ :param _content_type: force content-type for the request.
814
+ :type _content_type: str, Optional
815
+ :param _headers: set to override the headers for a single
816
+ request; this effectively ignores the headers
817
+ in the spec for a single request.
818
+ :type _headers: dict, optional
819
+ :param _host_index: set to override the host_index for a single
820
+ request; this effectively ignores the host_index
821
+ in the spec for a single request.
822
+ :type _host_index: int, optional
823
+ :return: Returns the result object.
824
+ """ # noqa: E501
825
+
826
+ _param = self._account_orders_serialize(
827
+ account_index=account_index,
828
+ market_id=market_id,
829
+ limit=limit,
830
+ cursor=cursor,
831
+ _request_auth=_request_auth,
832
+ _content_type=_content_type,
833
+ _headers=_headers,
834
+ _host_index=_host_index
835
+ )
836
+
837
+ _response_types_map: Dict[str, Optional[str]] = {
838
+ '200': "Orders",
839
+ '400': "ResultCode",
840
+ }
841
+ response_data = await self.api_client.call_api(
842
+ *_param,
843
+ _request_timeout=_request_timeout
844
+ )
845
+ await response_data.read()
846
+ return self.api_client.response_deserialize(
847
+ response_data=response_data,
848
+ response_types_map=_response_types_map,
849
+ )
850
+
851
+
852
+ @validate_call
853
+ async def account_orders_without_preload_content(
854
+ self,
855
+ account_index: StrictInt,
856
+ market_id: StrictInt,
857
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
858
+ cursor: Optional[StrictStr] = None,
859
+ _request_timeout: Union[
860
+ None,
861
+ Annotated[StrictFloat, Field(gt=0)],
862
+ Tuple[
863
+ Annotated[StrictFloat, Field(gt=0)],
864
+ Annotated[StrictFloat, Field(gt=0)]
865
+ ]
866
+ ] = None,
867
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
868
+ _content_type: Optional[StrictStr] = None,
869
+ _headers: Optional[Dict[StrictStr, Any]] = None,
870
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
871
+ ) -> RESTResponseType:
872
+ """accountOrders
873
+
874
+ Get account orders
875
+
876
+ :param account_index: (required)
877
+ :type account_index: int
878
+ :param market_id: (required)
879
+ :type market_id: int
880
+ :param limit: (required)
881
+ :type limit: int
882
+ :param cursor:
883
+ :type cursor: str
884
+ :param _request_timeout: timeout setting for this request. If one
885
+ number provided, it will be total request
886
+ timeout. It can also be a pair (tuple) of
887
+ (connection, read) timeouts.
888
+ :type _request_timeout: int, tuple(int, int), optional
889
+ :param _request_auth: set to override the auth_settings for an a single
890
+ request; this effectively ignores the
891
+ authentication in the spec for a single request.
892
+ :type _request_auth: dict, optional
893
+ :param _content_type: force content-type for the request.
894
+ :type _content_type: str, Optional
895
+ :param _headers: set to override the headers for a single
896
+ request; this effectively ignores the headers
897
+ in the spec for a single request.
898
+ :type _headers: dict, optional
899
+ :param _host_index: set to override the host_index for a single
900
+ request; this effectively ignores the host_index
901
+ in the spec for a single request.
902
+ :type _host_index: int, optional
903
+ :return: Returns the result object.
904
+ """ # noqa: E501
905
+
906
+ _param = self._account_orders_serialize(
907
+ account_index=account_index,
908
+ market_id=market_id,
909
+ limit=limit,
910
+ cursor=cursor,
911
+ _request_auth=_request_auth,
912
+ _content_type=_content_type,
913
+ _headers=_headers,
914
+ _host_index=_host_index
915
+ )
916
+
917
+ _response_types_map: Dict[str, Optional[str]] = {
918
+ '200': "Orders",
919
+ '400': "ResultCode",
920
+ }
921
+ response_data = await self.api_client.call_api(
922
+ *_param,
923
+ _request_timeout=_request_timeout
924
+ )
925
+ return response_data.response
926
+
927
+
928
+ def _account_orders_serialize(
929
+ self,
930
+ account_index,
931
+ market_id,
932
+ limit,
933
+ cursor,
934
+ _request_auth,
935
+ _content_type,
936
+ _headers,
937
+ _host_index,
938
+ ) -> RequestSerialized:
939
+
940
+ _host = None
941
+
942
+ _collection_formats: Dict[str, str] = {
943
+ }
944
+
945
+ _path_params: Dict[str, str] = {}
946
+ _query_params: List[Tuple[str, str]] = []
947
+ _header_params: Dict[str, Optional[str]] = _headers or {}
948
+ _form_params: List[Tuple[str, str]] = []
949
+ _files: Dict[str, Union[str, bytes]] = {}
950
+ _body_params: Optional[bytes] = None
951
+
952
+ # process the path parameters
953
+ # process the query parameters
954
+ if account_index is not None:
955
+
956
+ _query_params.append(('account_index', account_index))
957
+
958
+ if market_id is not None:
959
+
960
+ _query_params.append(('market_id', market_id))
961
+
962
+ if cursor is not None:
963
+
964
+ _query_params.append(('cursor', cursor))
965
+
966
+ if limit is not None:
967
+
968
+ _query_params.append(('limit', limit))
969
+
970
+ # process the header parameters
971
+ # process the form parameters
972
+ # process the body parameter
973
+
974
+
975
+ # set the HTTP header `Accept`
976
+ if 'Accept' not in _header_params:
977
+ _header_params['Accept'] = self.api_client.select_header_accept(
978
+ [
979
+ 'application/json'
980
+ ]
981
+ )
982
+
983
+
984
+ # authentication setting
985
+ _auth_settings: List[str] = [
986
+ ]
987
+
988
+ return self.api_client.param_serialize(
989
+ method='GET',
990
+ resource_path='/api/v1/accountOrders',
991
+ path_params=_path_params,
992
+ query_params=_query_params,
993
+ header_params=_header_params,
994
+ body=_body_params,
995
+ post_params=_form_params,
996
+ files=_files,
997
+ auth_settings=_auth_settings,
998
+ collection_formats=_collection_formats,
999
+ _host=_host,
1000
+ _request_auth=_request_auth
1001
+ )
1002
+
1003
+
1004
+
1005
+
1006
+ @validate_call
1007
+ async def exchange_stats(
1008
+ self,
1009
+ _request_timeout: Union[
1010
+ None,
1011
+ Annotated[StrictFloat, Field(gt=0)],
1012
+ Tuple[
1013
+ Annotated[StrictFloat, Field(gt=0)],
1014
+ Annotated[StrictFloat, Field(gt=0)]
1015
+ ]
1016
+ ] = None,
1017
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1018
+ _content_type: Optional[StrictStr] = None,
1019
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1020
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1021
+ ) -> ExchangeStats:
1022
+ """exchangeStats
1023
+
1024
+ Get exchange stats
1025
+
1026
+ :param _request_timeout: timeout setting for this request. If one
1027
+ number provided, it will be total request
1028
+ timeout. It can also be a pair (tuple) of
1029
+ (connection, read) timeouts.
1030
+ :type _request_timeout: int, tuple(int, int), optional
1031
+ :param _request_auth: set to override the auth_settings for an a single
1032
+ request; this effectively ignores the
1033
+ authentication in the spec for a single request.
1034
+ :type _request_auth: dict, optional
1035
+ :param _content_type: force content-type for the request.
1036
+ :type _content_type: str, Optional
1037
+ :param _headers: set to override the headers for a single
1038
+ request; this effectively ignores the headers
1039
+ in the spec for a single request.
1040
+ :type _headers: dict, optional
1041
+ :param _host_index: set to override the host_index for a single
1042
+ request; this effectively ignores the host_index
1043
+ in the spec for a single request.
1044
+ :type _host_index: int, optional
1045
+ :return: Returns the result object.
1046
+ """ # noqa: E501
1047
+
1048
+ _param = self._exchange_stats_serialize(
1049
+ _request_auth=_request_auth,
1050
+ _content_type=_content_type,
1051
+ _headers=_headers,
1052
+ _host_index=_host_index
1053
+ )
1054
+
1055
+ _response_types_map: Dict[str, Optional[str]] = {
1056
+ '200': "ExchangeStats",
1057
+ '400': "ResultCode",
1058
+ }
1059
+ response_data = await self.api_client.call_api(
1060
+ *_param,
1061
+ _request_timeout=_request_timeout
1062
+ )
1063
+ await response_data.read()
1064
+ return self.api_client.response_deserialize(
1065
+ response_data=response_data,
1066
+ response_types_map=_response_types_map,
1067
+ ).data
1068
+
1069
+
1070
+ @validate_call
1071
+ async def exchange_stats_with_http_info(
1072
+ self,
1073
+ _request_timeout: Union[
1074
+ None,
1075
+ Annotated[StrictFloat, Field(gt=0)],
1076
+ Tuple[
1077
+ Annotated[StrictFloat, Field(gt=0)],
1078
+ Annotated[StrictFloat, Field(gt=0)]
1079
+ ]
1080
+ ] = None,
1081
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1082
+ _content_type: Optional[StrictStr] = None,
1083
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1084
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1085
+ ) -> ApiResponse[ExchangeStats]:
1086
+ """exchangeStats
1087
+
1088
+ Get exchange stats
1089
+
1090
+ :param _request_timeout: timeout setting for this request. If one
1091
+ number provided, it will be total request
1092
+ timeout. It can also be a pair (tuple) of
1093
+ (connection, read) timeouts.
1094
+ :type _request_timeout: int, tuple(int, int), optional
1095
+ :param _request_auth: set to override the auth_settings for an a single
1096
+ request; this effectively ignores the
1097
+ authentication in the spec for a single request.
1098
+ :type _request_auth: dict, optional
1099
+ :param _content_type: force content-type for the request.
1100
+ :type _content_type: str, Optional
1101
+ :param _headers: set to override the headers for a single
1102
+ request; this effectively ignores the headers
1103
+ in the spec for a single request.
1104
+ :type _headers: dict, optional
1105
+ :param _host_index: set to override the host_index for a single
1106
+ request; this effectively ignores the host_index
1107
+ in the spec for a single request.
1108
+ :type _host_index: int, optional
1109
+ :return: Returns the result object.
1110
+ """ # noqa: E501
1111
+
1112
+ _param = self._exchange_stats_serialize(
1113
+ _request_auth=_request_auth,
1114
+ _content_type=_content_type,
1115
+ _headers=_headers,
1116
+ _host_index=_host_index
1117
+ )
1118
+
1119
+ _response_types_map: Dict[str, Optional[str]] = {
1120
+ '200': "ExchangeStats",
1121
+ '400': "ResultCode",
1122
+ }
1123
+ response_data = await self.api_client.call_api(
1124
+ *_param,
1125
+ _request_timeout=_request_timeout
1126
+ )
1127
+ await response_data.read()
1128
+ return self.api_client.response_deserialize(
1129
+ response_data=response_data,
1130
+ response_types_map=_response_types_map,
1131
+ )
1132
+
1133
+
1134
+ @validate_call
1135
+ async def exchange_stats_without_preload_content(
1136
+ self,
1137
+ _request_timeout: Union[
1138
+ None,
1139
+ Annotated[StrictFloat, Field(gt=0)],
1140
+ Tuple[
1141
+ Annotated[StrictFloat, Field(gt=0)],
1142
+ Annotated[StrictFloat, Field(gt=0)]
1143
+ ]
1144
+ ] = None,
1145
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1146
+ _content_type: Optional[StrictStr] = None,
1147
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1148
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1149
+ ) -> RESTResponseType:
1150
+ """exchangeStats
1151
+
1152
+ Get exchange stats
1153
+
1154
+ :param _request_timeout: timeout setting for this request. If one
1155
+ number provided, it will be total request
1156
+ timeout. It can also be a pair (tuple) of
1157
+ (connection, read) timeouts.
1158
+ :type _request_timeout: int, tuple(int, int), optional
1159
+ :param _request_auth: set to override the auth_settings for an a single
1160
+ request; this effectively ignores the
1161
+ authentication in the spec for a single request.
1162
+ :type _request_auth: dict, optional
1163
+ :param _content_type: force content-type for the request.
1164
+ :type _content_type: str, Optional
1165
+ :param _headers: set to override the headers for a single
1166
+ request; this effectively ignores the headers
1167
+ in the spec for a single request.
1168
+ :type _headers: dict, optional
1169
+ :param _host_index: set to override the host_index for a single
1170
+ request; this effectively ignores the host_index
1171
+ in the spec for a single request.
1172
+ :type _host_index: int, optional
1173
+ :return: Returns the result object.
1174
+ """ # noqa: E501
1175
+
1176
+ _param = self._exchange_stats_serialize(
1177
+ _request_auth=_request_auth,
1178
+ _content_type=_content_type,
1179
+ _headers=_headers,
1180
+ _host_index=_host_index
1181
+ )
1182
+
1183
+ _response_types_map: Dict[str, Optional[str]] = {
1184
+ '200': "ExchangeStats",
1185
+ '400': "ResultCode",
1186
+ }
1187
+ response_data = await self.api_client.call_api(
1188
+ *_param,
1189
+ _request_timeout=_request_timeout
1190
+ )
1191
+ return response_data.response
1192
+
1193
+
1194
+ def _exchange_stats_serialize(
1195
+ self,
1196
+ _request_auth,
1197
+ _content_type,
1198
+ _headers,
1199
+ _host_index,
1200
+ ) -> RequestSerialized:
1201
+
1202
+ _host = None
1203
+
1204
+ _collection_formats: Dict[str, str] = {
1205
+ }
1206
+
1207
+ _path_params: Dict[str, str] = {}
1208
+ _query_params: List[Tuple[str, str]] = []
1209
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1210
+ _form_params: List[Tuple[str, str]] = []
1211
+ _files: Dict[str, Union[str, bytes]] = {}
1212
+ _body_params: Optional[bytes] = None
1213
+
1214
+ # process the path parameters
1215
+ # process the query parameters
1216
+ # process the header parameters
1217
+ # process the form parameters
1218
+ # process the body parameter
1219
+
1220
+
1221
+ # set the HTTP header `Accept`
1222
+ if 'Accept' not in _header_params:
1223
+ _header_params['Accept'] = self.api_client.select_header_accept(
1224
+ [
1225
+ 'application/json'
1226
+ ]
1227
+ )
1228
+
1229
+
1230
+ # authentication setting
1231
+ _auth_settings: List[str] = [
1232
+ ]
1233
+
1234
+ return self.api_client.param_serialize(
1235
+ method='GET',
1236
+ resource_path='/api/v1/exchangeStats',
1237
+ path_params=_path_params,
1238
+ query_params=_query_params,
1239
+ header_params=_header_params,
1240
+ body=_body_params,
1241
+ post_params=_form_params,
1242
+ files=_files,
1243
+ auth_settings=_auth_settings,
1244
+ collection_formats=_collection_formats,
1245
+ _host=_host,
1246
+ _request_auth=_request_auth
1247
+ )
1248
+
1249
+
1250
+
1251
+
1252
+ @validate_call
1253
+ async def order_book_details(
1254
+ self,
1255
+ market_id: Optional[StrictInt] = None,
1256
+ _request_timeout: Union[
1257
+ None,
1258
+ Annotated[StrictFloat, Field(gt=0)],
1259
+ Tuple[
1260
+ Annotated[StrictFloat, Field(gt=0)],
1261
+ Annotated[StrictFloat, Field(gt=0)]
1262
+ ]
1263
+ ] = None,
1264
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1265
+ _content_type: Optional[StrictStr] = None,
1266
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1267
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1268
+ ) -> OrderBookDetails:
1269
+ """orderBookDetails
1270
+
1271
+ Get order books metadata
1272
+
1273
+ :param market_id:
1274
+ :type market_id: int
1275
+ :param _request_timeout: timeout setting for this request. If one
1276
+ number provided, it will be total request
1277
+ timeout. It can also be a pair (tuple) of
1278
+ (connection, read) timeouts.
1279
+ :type _request_timeout: int, tuple(int, int), optional
1280
+ :param _request_auth: set to override the auth_settings for an a single
1281
+ request; this effectively ignores the
1282
+ authentication in the spec for a single request.
1283
+ :type _request_auth: dict, optional
1284
+ :param _content_type: force content-type for the request.
1285
+ :type _content_type: str, Optional
1286
+ :param _headers: set to override the headers for a single
1287
+ request; this effectively ignores the headers
1288
+ in the spec for a single request.
1289
+ :type _headers: dict, optional
1290
+ :param _host_index: set to override the host_index for a single
1291
+ request; this effectively ignores the host_index
1292
+ in the spec for a single request.
1293
+ :type _host_index: int, optional
1294
+ :return: Returns the result object.
1295
+ """ # noqa: E501
1296
+
1297
+ _param = self._order_book_details_serialize(
1298
+ market_id=market_id,
1299
+ _request_auth=_request_auth,
1300
+ _content_type=_content_type,
1301
+ _headers=_headers,
1302
+ _host_index=_host_index
1303
+ )
1304
+
1305
+ _response_types_map: Dict[str, Optional[str]] = {
1306
+ '200': "OrderBookDetails",
1307
+ '400': "ResultCode",
1308
+ }
1309
+ response_data = await self.api_client.call_api(
1310
+ *_param,
1311
+ _request_timeout=_request_timeout
1312
+ )
1313
+ await response_data.read()
1314
+ return self.api_client.response_deserialize(
1315
+ response_data=response_data,
1316
+ response_types_map=_response_types_map,
1317
+ ).data
1318
+
1319
+
1320
+ @validate_call
1321
+ async def order_book_details_with_http_info(
1322
+ self,
1323
+ market_id: Optional[StrictInt] = None,
1324
+ _request_timeout: Union[
1325
+ None,
1326
+ Annotated[StrictFloat, Field(gt=0)],
1327
+ Tuple[
1328
+ Annotated[StrictFloat, Field(gt=0)],
1329
+ Annotated[StrictFloat, Field(gt=0)]
1330
+ ]
1331
+ ] = None,
1332
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1333
+ _content_type: Optional[StrictStr] = None,
1334
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1335
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1336
+ ) -> ApiResponse[OrderBookDetails]:
1337
+ """orderBookDetails
1338
+
1339
+ Get order books metadata
1340
+
1341
+ :param market_id:
1342
+ :type market_id: int
1343
+ :param _request_timeout: timeout setting for this request. If one
1344
+ number provided, it will be total request
1345
+ timeout. It can also be a pair (tuple) of
1346
+ (connection, read) timeouts.
1347
+ :type _request_timeout: int, tuple(int, int), optional
1348
+ :param _request_auth: set to override the auth_settings for an a single
1349
+ request; this effectively ignores the
1350
+ authentication in the spec for a single request.
1351
+ :type _request_auth: dict, optional
1352
+ :param _content_type: force content-type for the request.
1353
+ :type _content_type: str, Optional
1354
+ :param _headers: set to override the headers for a single
1355
+ request; this effectively ignores the headers
1356
+ in the spec for a single request.
1357
+ :type _headers: dict, optional
1358
+ :param _host_index: set to override the host_index for a single
1359
+ request; this effectively ignores the host_index
1360
+ in the spec for a single request.
1361
+ :type _host_index: int, optional
1362
+ :return: Returns the result object.
1363
+ """ # noqa: E501
1364
+
1365
+ _param = self._order_book_details_serialize(
1366
+ market_id=market_id,
1367
+ _request_auth=_request_auth,
1368
+ _content_type=_content_type,
1369
+ _headers=_headers,
1370
+ _host_index=_host_index
1371
+ )
1372
+
1373
+ _response_types_map: Dict[str, Optional[str]] = {
1374
+ '200': "OrderBookDetails",
1375
+ '400': "ResultCode",
1376
+ }
1377
+ response_data = await self.api_client.call_api(
1378
+ *_param,
1379
+ _request_timeout=_request_timeout
1380
+ )
1381
+ await response_data.read()
1382
+ return self.api_client.response_deserialize(
1383
+ response_data=response_data,
1384
+ response_types_map=_response_types_map,
1385
+ )
1386
+
1387
+
1388
+ @validate_call
1389
+ async def order_book_details_without_preload_content(
1390
+ self,
1391
+ market_id: Optional[StrictInt] = None,
1392
+ _request_timeout: Union[
1393
+ None,
1394
+ Annotated[StrictFloat, Field(gt=0)],
1395
+ Tuple[
1396
+ Annotated[StrictFloat, Field(gt=0)],
1397
+ Annotated[StrictFloat, Field(gt=0)]
1398
+ ]
1399
+ ] = None,
1400
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1401
+ _content_type: Optional[StrictStr] = None,
1402
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1403
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1404
+ ) -> RESTResponseType:
1405
+ """orderBookDetails
1406
+
1407
+ Get order books metadata
1408
+
1409
+ :param market_id:
1410
+ :type market_id: int
1411
+ :param _request_timeout: timeout setting for this request. If one
1412
+ number provided, it will be total request
1413
+ timeout. It can also be a pair (tuple) of
1414
+ (connection, read) timeouts.
1415
+ :type _request_timeout: int, tuple(int, int), optional
1416
+ :param _request_auth: set to override the auth_settings for an a single
1417
+ request; this effectively ignores the
1418
+ authentication in the spec for a single request.
1419
+ :type _request_auth: dict, optional
1420
+ :param _content_type: force content-type for the request.
1421
+ :type _content_type: str, Optional
1422
+ :param _headers: set to override the headers for a single
1423
+ request; this effectively ignores the headers
1424
+ in the spec for a single request.
1425
+ :type _headers: dict, optional
1426
+ :param _host_index: set to override the host_index for a single
1427
+ request; this effectively ignores the host_index
1428
+ in the spec for a single request.
1429
+ :type _host_index: int, optional
1430
+ :return: Returns the result object.
1431
+ """ # noqa: E501
1432
+
1433
+ _param = self._order_book_details_serialize(
1434
+ market_id=market_id,
1435
+ _request_auth=_request_auth,
1436
+ _content_type=_content_type,
1437
+ _headers=_headers,
1438
+ _host_index=_host_index
1439
+ )
1440
+
1441
+ _response_types_map: Dict[str, Optional[str]] = {
1442
+ '200': "OrderBookDetails",
1443
+ '400': "ResultCode",
1444
+ }
1445
+ response_data = await self.api_client.call_api(
1446
+ *_param,
1447
+ _request_timeout=_request_timeout
1448
+ )
1449
+ return response_data.response
1450
+
1451
+
1452
+ def _order_book_details_serialize(
1453
+ self,
1454
+ market_id,
1455
+ _request_auth,
1456
+ _content_type,
1457
+ _headers,
1458
+ _host_index,
1459
+ ) -> RequestSerialized:
1460
+
1461
+ _host = None
1462
+
1463
+ _collection_formats: Dict[str, str] = {
1464
+ }
1465
+
1466
+ _path_params: Dict[str, str] = {}
1467
+ _query_params: List[Tuple[str, str]] = []
1468
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1469
+ _form_params: List[Tuple[str, str]] = []
1470
+ _files: Dict[str, Union[str, bytes]] = {}
1471
+ _body_params: Optional[bytes] = None
1472
+
1473
+ # process the path parameters
1474
+ # process the query parameters
1475
+ if market_id is not None:
1476
+
1477
+ _query_params.append(('market_id', market_id))
1478
+
1479
+ # process the header parameters
1480
+ # process the form parameters
1481
+ # process the body parameter
1482
+
1483
+
1484
+ # set the HTTP header `Accept`
1485
+ if 'Accept' not in _header_params:
1486
+ _header_params['Accept'] = self.api_client.select_header_accept(
1487
+ [
1488
+ 'application/json'
1489
+ ]
1490
+ )
1491
+
1492
+
1493
+ # authentication setting
1494
+ _auth_settings: List[str] = [
1495
+ ]
1496
+
1497
+ return self.api_client.param_serialize(
1498
+ method='GET',
1499
+ resource_path='/api/v1/orderBookDetails',
1500
+ path_params=_path_params,
1501
+ query_params=_query_params,
1502
+ header_params=_header_params,
1503
+ body=_body_params,
1504
+ post_params=_form_params,
1505
+ files=_files,
1506
+ auth_settings=_auth_settings,
1507
+ collection_formats=_collection_formats,
1508
+ _host=_host,
1509
+ _request_auth=_request_auth
1510
+ )
1511
+
1512
+
1513
+
1514
+
1515
+ @validate_call
1516
+ async def order_book_orders(
1517
+ self,
1518
+ market_id: StrictInt,
1519
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
1520
+ _request_timeout: Union[
1521
+ None,
1522
+ Annotated[StrictFloat, Field(gt=0)],
1523
+ Tuple[
1524
+ Annotated[StrictFloat, Field(gt=0)],
1525
+ Annotated[StrictFloat, Field(gt=0)]
1526
+ ]
1527
+ ] = None,
1528
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1529
+ _content_type: Optional[StrictStr] = None,
1530
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1531
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1532
+ ) -> OrderBookOrders:
1533
+ """orderBookOrders
1534
+
1535
+ Get order book orders
1536
+
1537
+ :param market_id: (required)
1538
+ :type market_id: int
1539
+ :param limit: (required)
1540
+ :type limit: int
1541
+ :param _request_timeout: timeout setting for this request. If one
1542
+ number provided, it will be total request
1543
+ timeout. It can also be a pair (tuple) of
1544
+ (connection, read) timeouts.
1545
+ :type _request_timeout: int, tuple(int, int), optional
1546
+ :param _request_auth: set to override the auth_settings for an a single
1547
+ request; this effectively ignores the
1548
+ authentication in the spec for a single request.
1549
+ :type _request_auth: dict, optional
1550
+ :param _content_type: force content-type for the request.
1551
+ :type _content_type: str, Optional
1552
+ :param _headers: set to override the headers for a single
1553
+ request; this effectively ignores the headers
1554
+ in the spec for a single request.
1555
+ :type _headers: dict, optional
1556
+ :param _host_index: set to override the host_index for a single
1557
+ request; this effectively ignores the host_index
1558
+ in the spec for a single request.
1559
+ :type _host_index: int, optional
1560
+ :return: Returns the result object.
1561
+ """ # noqa: E501
1562
+
1563
+ _param = self._order_book_orders_serialize(
1564
+ market_id=market_id,
1565
+ limit=limit,
1566
+ _request_auth=_request_auth,
1567
+ _content_type=_content_type,
1568
+ _headers=_headers,
1569
+ _host_index=_host_index
1570
+ )
1571
+
1572
+ _response_types_map: Dict[str, Optional[str]] = {
1573
+ '200': "OrderBookOrders",
1574
+ '400': "ResultCode",
1575
+ }
1576
+ response_data = await self.api_client.call_api(
1577
+ *_param,
1578
+ _request_timeout=_request_timeout
1579
+ )
1580
+ await response_data.read()
1581
+ return self.api_client.response_deserialize(
1582
+ response_data=response_data,
1583
+ response_types_map=_response_types_map,
1584
+ ).data
1585
+
1586
+
1587
+ @validate_call
1588
+ async def order_book_orders_with_http_info(
1589
+ self,
1590
+ market_id: StrictInt,
1591
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
1592
+ _request_timeout: Union[
1593
+ None,
1594
+ Annotated[StrictFloat, Field(gt=0)],
1595
+ Tuple[
1596
+ Annotated[StrictFloat, Field(gt=0)],
1597
+ Annotated[StrictFloat, Field(gt=0)]
1598
+ ]
1599
+ ] = None,
1600
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1601
+ _content_type: Optional[StrictStr] = None,
1602
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1603
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1604
+ ) -> ApiResponse[OrderBookOrders]:
1605
+ """orderBookOrders
1606
+
1607
+ Get order book orders
1608
+
1609
+ :param market_id: (required)
1610
+ :type market_id: int
1611
+ :param limit: (required)
1612
+ :type limit: int
1613
+ :param _request_timeout: timeout setting for this request. If one
1614
+ number provided, it will be total request
1615
+ timeout. It can also be a pair (tuple) of
1616
+ (connection, read) timeouts.
1617
+ :type _request_timeout: int, tuple(int, int), optional
1618
+ :param _request_auth: set to override the auth_settings for an a single
1619
+ request; this effectively ignores the
1620
+ authentication in the spec for a single request.
1621
+ :type _request_auth: dict, optional
1622
+ :param _content_type: force content-type for the request.
1623
+ :type _content_type: str, Optional
1624
+ :param _headers: set to override the headers for a single
1625
+ request; this effectively ignores the headers
1626
+ in the spec for a single request.
1627
+ :type _headers: dict, optional
1628
+ :param _host_index: set to override the host_index for a single
1629
+ request; this effectively ignores the host_index
1630
+ in the spec for a single request.
1631
+ :type _host_index: int, optional
1632
+ :return: Returns the result object.
1633
+ """ # noqa: E501
1634
+
1635
+ _param = self._order_book_orders_serialize(
1636
+ market_id=market_id,
1637
+ limit=limit,
1638
+ _request_auth=_request_auth,
1639
+ _content_type=_content_type,
1640
+ _headers=_headers,
1641
+ _host_index=_host_index
1642
+ )
1643
+
1644
+ _response_types_map: Dict[str, Optional[str]] = {
1645
+ '200': "OrderBookOrders",
1646
+ '400': "ResultCode",
1647
+ }
1648
+ response_data = await self.api_client.call_api(
1649
+ *_param,
1650
+ _request_timeout=_request_timeout
1651
+ )
1652
+ await response_data.read()
1653
+ return self.api_client.response_deserialize(
1654
+ response_data=response_data,
1655
+ response_types_map=_response_types_map,
1656
+ )
1657
+
1658
+
1659
+ @validate_call
1660
+ async def order_book_orders_without_preload_content(
1661
+ self,
1662
+ market_id: StrictInt,
1663
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
1664
+ _request_timeout: Union[
1665
+ None,
1666
+ Annotated[StrictFloat, Field(gt=0)],
1667
+ Tuple[
1668
+ Annotated[StrictFloat, Field(gt=0)],
1669
+ Annotated[StrictFloat, Field(gt=0)]
1670
+ ]
1671
+ ] = None,
1672
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1673
+ _content_type: Optional[StrictStr] = None,
1674
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1675
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1676
+ ) -> RESTResponseType:
1677
+ """orderBookOrders
1678
+
1679
+ Get order book orders
1680
+
1681
+ :param market_id: (required)
1682
+ :type market_id: int
1683
+ :param limit: (required)
1684
+ :type limit: int
1685
+ :param _request_timeout: timeout setting for this request. If one
1686
+ number provided, it will be total request
1687
+ timeout. It can also be a pair (tuple) of
1688
+ (connection, read) timeouts.
1689
+ :type _request_timeout: int, tuple(int, int), optional
1690
+ :param _request_auth: set to override the auth_settings for an a single
1691
+ request; this effectively ignores the
1692
+ authentication in the spec for a single request.
1693
+ :type _request_auth: dict, optional
1694
+ :param _content_type: force content-type for the request.
1695
+ :type _content_type: str, Optional
1696
+ :param _headers: set to override the headers for a single
1697
+ request; this effectively ignores the headers
1698
+ in the spec for a single request.
1699
+ :type _headers: dict, optional
1700
+ :param _host_index: set to override the host_index for a single
1701
+ request; this effectively ignores the host_index
1702
+ in the spec for a single request.
1703
+ :type _host_index: int, optional
1704
+ :return: Returns the result object.
1705
+ """ # noqa: E501
1706
+
1707
+ _param = self._order_book_orders_serialize(
1708
+ market_id=market_id,
1709
+ limit=limit,
1710
+ _request_auth=_request_auth,
1711
+ _content_type=_content_type,
1712
+ _headers=_headers,
1713
+ _host_index=_host_index
1714
+ )
1715
+
1716
+ _response_types_map: Dict[str, Optional[str]] = {
1717
+ '200': "OrderBookOrders",
1718
+ '400': "ResultCode",
1719
+ }
1720
+ response_data = await self.api_client.call_api(
1721
+ *_param,
1722
+ _request_timeout=_request_timeout
1723
+ )
1724
+ return response_data.response
1725
+
1726
+
1727
+ def _order_book_orders_serialize(
1728
+ self,
1729
+ market_id,
1730
+ limit,
1731
+ _request_auth,
1732
+ _content_type,
1733
+ _headers,
1734
+ _host_index,
1735
+ ) -> RequestSerialized:
1736
+
1737
+ _host = None
1738
+
1739
+ _collection_formats: Dict[str, str] = {
1740
+ }
1741
+
1742
+ _path_params: Dict[str, str] = {}
1743
+ _query_params: List[Tuple[str, str]] = []
1744
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1745
+ _form_params: List[Tuple[str, str]] = []
1746
+ _files: Dict[str, Union[str, bytes]] = {}
1747
+ _body_params: Optional[bytes] = None
1748
+
1749
+ # process the path parameters
1750
+ # process the query parameters
1751
+ if market_id is not None:
1752
+
1753
+ _query_params.append(('market_id', market_id))
1754
+
1755
+ if limit is not None:
1756
+
1757
+ _query_params.append(('limit', limit))
1758
+
1759
+ # process the header parameters
1760
+ # process the form parameters
1761
+ # process the body parameter
1762
+
1763
+
1764
+ # set the HTTP header `Accept`
1765
+ if 'Accept' not in _header_params:
1766
+ _header_params['Accept'] = self.api_client.select_header_accept(
1767
+ [
1768
+ 'application/json'
1769
+ ]
1770
+ )
1771
+
1772
+
1773
+ # authentication setting
1774
+ _auth_settings: List[str] = [
1775
+ ]
1776
+
1777
+ return self.api_client.param_serialize(
1778
+ method='GET',
1779
+ resource_path='/api/v1/orderBookOrders',
1780
+ path_params=_path_params,
1781
+ query_params=_query_params,
1782
+ header_params=_header_params,
1783
+ body=_body_params,
1784
+ post_params=_form_params,
1785
+ files=_files,
1786
+ auth_settings=_auth_settings,
1787
+ collection_formats=_collection_formats,
1788
+ _host=_host,
1789
+ _request_auth=_request_auth
1790
+ )
1791
+
1792
+
1793
+
1794
+
1795
+ @validate_call
1796
+ async def order_books(
1797
+ self,
1798
+ market_id: Optional[StrictInt] = None,
1799
+ _request_timeout: Union[
1800
+ None,
1801
+ Annotated[StrictFloat, Field(gt=0)],
1802
+ Tuple[
1803
+ Annotated[StrictFloat, Field(gt=0)],
1804
+ Annotated[StrictFloat, Field(gt=0)]
1805
+ ]
1806
+ ] = None,
1807
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1808
+ _content_type: Optional[StrictStr] = None,
1809
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1810
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1811
+ ) -> OrderBooks:
1812
+ """orderBooks
1813
+
1814
+ Get order books metadata.<hr>**Response Description:**<br><br>1) **Taker and maker fees** are in percentage.<br>2) **Min base amount:** The amount of base token that can be traded in a single order.<br>3) **Min quote amount:** The amount of quote token that can be traded in a single order.<br>4) **Supported size decimals:** The number of decimal places that can be used for the size of the order.<br>5) **Supported price decimals:** The number of decimal places that can be used for the price of the order.<br>6) **Supported quote decimals:** Size Decimals + Quote Decimals.
1815
+
1816
+ :param market_id:
1817
+ :type market_id: int
1818
+ :param _request_timeout: timeout setting for this request. If one
1819
+ number provided, it will be total request
1820
+ timeout. It can also be a pair (tuple) of
1821
+ (connection, read) timeouts.
1822
+ :type _request_timeout: int, tuple(int, int), optional
1823
+ :param _request_auth: set to override the auth_settings for an a single
1824
+ request; this effectively ignores the
1825
+ authentication in the spec for a single request.
1826
+ :type _request_auth: dict, optional
1827
+ :param _content_type: force content-type for the request.
1828
+ :type _content_type: str, Optional
1829
+ :param _headers: set to override the headers for a single
1830
+ request; this effectively ignores the headers
1831
+ in the spec for a single request.
1832
+ :type _headers: dict, optional
1833
+ :param _host_index: set to override the host_index for a single
1834
+ request; this effectively ignores the host_index
1835
+ in the spec for a single request.
1836
+ :type _host_index: int, optional
1837
+ :return: Returns the result object.
1838
+ """ # noqa: E501
1839
+
1840
+ _param = self._order_books_serialize(
1841
+ market_id=market_id,
1842
+ _request_auth=_request_auth,
1843
+ _content_type=_content_type,
1844
+ _headers=_headers,
1845
+ _host_index=_host_index
1846
+ )
1847
+
1848
+ _response_types_map: Dict[str, Optional[str]] = {
1849
+ '200': "OrderBooks",
1850
+ '400': "ResultCode",
1851
+ }
1852
+ response_data = await self.api_client.call_api(
1853
+ *_param,
1854
+ _request_timeout=_request_timeout
1855
+ )
1856
+ await response_data.read()
1857
+ return self.api_client.response_deserialize(
1858
+ response_data=response_data,
1859
+ response_types_map=_response_types_map,
1860
+ ).data
1861
+
1862
+
1863
+ @validate_call
1864
+ async def order_books_with_http_info(
1865
+ self,
1866
+ market_id: Optional[StrictInt] = None,
1867
+ _request_timeout: Union[
1868
+ None,
1869
+ Annotated[StrictFloat, Field(gt=0)],
1870
+ Tuple[
1871
+ Annotated[StrictFloat, Field(gt=0)],
1872
+ Annotated[StrictFloat, Field(gt=0)]
1873
+ ]
1874
+ ] = None,
1875
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1876
+ _content_type: Optional[StrictStr] = None,
1877
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1878
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1879
+ ) -> ApiResponse[OrderBooks]:
1880
+ """orderBooks
1881
+
1882
+ Get order books metadata.<hr>**Response Description:**<br><br>1) **Taker and maker fees** are in percentage.<br>2) **Min base amount:** The amount of base token that can be traded in a single order.<br>3) **Min quote amount:** The amount of quote token that can be traded in a single order.<br>4) **Supported size decimals:** The number of decimal places that can be used for the size of the order.<br>5) **Supported price decimals:** The number of decimal places that can be used for the price of the order.<br>6) **Supported quote decimals:** Size Decimals + Quote Decimals.
1883
+
1884
+ :param market_id:
1885
+ :type market_id: int
1886
+ :param _request_timeout: timeout setting for this request. If one
1887
+ number provided, it will be total request
1888
+ timeout. It can also be a pair (tuple) of
1889
+ (connection, read) timeouts.
1890
+ :type _request_timeout: int, tuple(int, int), optional
1891
+ :param _request_auth: set to override the auth_settings for an a single
1892
+ request; this effectively ignores the
1893
+ authentication in the spec for a single request.
1894
+ :type _request_auth: dict, optional
1895
+ :param _content_type: force content-type for the request.
1896
+ :type _content_type: str, Optional
1897
+ :param _headers: set to override the headers for a single
1898
+ request; this effectively ignores the headers
1899
+ in the spec for a single request.
1900
+ :type _headers: dict, optional
1901
+ :param _host_index: set to override the host_index for a single
1902
+ request; this effectively ignores the host_index
1903
+ in the spec for a single request.
1904
+ :type _host_index: int, optional
1905
+ :return: Returns the result object.
1906
+ """ # noqa: E501
1907
+
1908
+ _param = self._order_books_serialize(
1909
+ market_id=market_id,
1910
+ _request_auth=_request_auth,
1911
+ _content_type=_content_type,
1912
+ _headers=_headers,
1913
+ _host_index=_host_index
1914
+ )
1915
+
1916
+ _response_types_map: Dict[str, Optional[str]] = {
1917
+ '200': "OrderBooks",
1918
+ '400': "ResultCode",
1919
+ }
1920
+ response_data = await self.api_client.call_api(
1921
+ *_param,
1922
+ _request_timeout=_request_timeout
1923
+ )
1924
+ await response_data.read()
1925
+ return self.api_client.response_deserialize(
1926
+ response_data=response_data,
1927
+ response_types_map=_response_types_map,
1928
+ )
1929
+
1930
+
1931
+ @validate_call
1932
+ async def order_books_without_preload_content(
1933
+ self,
1934
+ market_id: Optional[StrictInt] = None,
1935
+ _request_timeout: Union[
1936
+ None,
1937
+ Annotated[StrictFloat, Field(gt=0)],
1938
+ Tuple[
1939
+ Annotated[StrictFloat, Field(gt=0)],
1940
+ Annotated[StrictFloat, Field(gt=0)]
1941
+ ]
1942
+ ] = None,
1943
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1944
+ _content_type: Optional[StrictStr] = None,
1945
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1946
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1947
+ ) -> RESTResponseType:
1948
+ """orderBooks
1949
+
1950
+ Get order books metadata.<hr>**Response Description:**<br><br>1) **Taker and maker fees** are in percentage.<br>2) **Min base amount:** The amount of base token that can be traded in a single order.<br>3) **Min quote amount:** The amount of quote token that can be traded in a single order.<br>4) **Supported size decimals:** The number of decimal places that can be used for the size of the order.<br>5) **Supported price decimals:** The number of decimal places that can be used for the price of the order.<br>6) **Supported quote decimals:** Size Decimals + Quote Decimals.
1951
+
1952
+ :param market_id:
1953
+ :type market_id: int
1954
+ :param _request_timeout: timeout setting for this request. If one
1955
+ number provided, it will be total request
1956
+ timeout. It can also be a pair (tuple) of
1957
+ (connection, read) timeouts.
1958
+ :type _request_timeout: int, tuple(int, int), optional
1959
+ :param _request_auth: set to override the auth_settings for an a single
1960
+ request; this effectively ignores the
1961
+ authentication in the spec for a single request.
1962
+ :type _request_auth: dict, optional
1963
+ :param _content_type: force content-type for the request.
1964
+ :type _content_type: str, Optional
1965
+ :param _headers: set to override the headers for a single
1966
+ request; this effectively ignores the headers
1967
+ in the spec for a single request.
1968
+ :type _headers: dict, optional
1969
+ :param _host_index: set to override the host_index for a single
1970
+ request; this effectively ignores the host_index
1971
+ in the spec for a single request.
1972
+ :type _host_index: int, optional
1973
+ :return: Returns the result object.
1974
+ """ # noqa: E501
1975
+
1976
+ _param = self._order_books_serialize(
1977
+ market_id=market_id,
1978
+ _request_auth=_request_auth,
1979
+ _content_type=_content_type,
1980
+ _headers=_headers,
1981
+ _host_index=_host_index
1982
+ )
1983
+
1984
+ _response_types_map: Dict[str, Optional[str]] = {
1985
+ '200': "OrderBooks",
1986
+ '400': "ResultCode",
1987
+ }
1988
+ response_data = await self.api_client.call_api(
1989
+ *_param,
1990
+ _request_timeout=_request_timeout
1991
+ )
1992
+ return response_data.response
1993
+
1994
+
1995
+ def _order_books_serialize(
1996
+ self,
1997
+ market_id,
1998
+ _request_auth,
1999
+ _content_type,
2000
+ _headers,
2001
+ _host_index,
2002
+ ) -> RequestSerialized:
2003
+
2004
+ _host = None
2005
+
2006
+ _collection_formats: Dict[str, str] = {
2007
+ }
2008
+
2009
+ _path_params: Dict[str, str] = {}
2010
+ _query_params: List[Tuple[str, str]] = []
2011
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2012
+ _form_params: List[Tuple[str, str]] = []
2013
+ _files: Dict[str, Union[str, bytes]] = {}
2014
+ _body_params: Optional[bytes] = None
2015
+
2016
+ # process the path parameters
2017
+ # process the query parameters
2018
+ if market_id is not None:
2019
+
2020
+ _query_params.append(('market_id', market_id))
2021
+
2022
+ # process the header parameters
2023
+ # process the form parameters
2024
+ # process the body parameter
2025
+
2026
+
2027
+ # set the HTTP header `Accept`
2028
+ if 'Accept' not in _header_params:
2029
+ _header_params['Accept'] = self.api_client.select_header_accept(
2030
+ [
2031
+ 'application/json'
2032
+ ]
2033
+ )
2034
+
2035
+
2036
+ # authentication setting
2037
+ _auth_settings: List[str] = [
2038
+ ]
2039
+
2040
+ return self.api_client.param_serialize(
2041
+ method='GET',
2042
+ resource_path='/api/v1/orderBooks',
2043
+ path_params=_path_params,
2044
+ query_params=_query_params,
2045
+ header_params=_header_params,
2046
+ body=_body_params,
2047
+ post_params=_form_params,
2048
+ files=_files,
2049
+ auth_settings=_auth_settings,
2050
+ collection_formats=_collection_formats,
2051
+ _host=_host,
2052
+ _request_auth=_request_auth
2053
+ )
2054
+
2055
+
2056
+
2057
+
2058
+ @validate_call
2059
+ async def recent_trades(
2060
+ self,
2061
+ market_id: StrictInt,
2062
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
2063
+ _request_timeout: Union[
2064
+ None,
2065
+ Annotated[StrictFloat, Field(gt=0)],
2066
+ Tuple[
2067
+ Annotated[StrictFloat, Field(gt=0)],
2068
+ Annotated[StrictFloat, Field(gt=0)]
2069
+ ]
2070
+ ] = None,
2071
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2072
+ _content_type: Optional[StrictStr] = None,
2073
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2074
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2075
+ ) -> Trades:
2076
+ """recentTrades
2077
+
2078
+ Get recent trades
2079
+
2080
+ :param market_id: (required)
2081
+ :type market_id: int
2082
+ :param limit: (required)
2083
+ :type limit: int
2084
+ :param _request_timeout: timeout setting for this request. If one
2085
+ number provided, it will be total request
2086
+ timeout. It can also be a pair (tuple) of
2087
+ (connection, read) timeouts.
2088
+ :type _request_timeout: int, tuple(int, int), optional
2089
+ :param _request_auth: set to override the auth_settings for an a single
2090
+ request; this effectively ignores the
2091
+ authentication in the spec for a single request.
2092
+ :type _request_auth: dict, optional
2093
+ :param _content_type: force content-type for the request.
2094
+ :type _content_type: str, Optional
2095
+ :param _headers: set to override the headers for a single
2096
+ request; this effectively ignores the headers
2097
+ in the spec for a single request.
2098
+ :type _headers: dict, optional
2099
+ :param _host_index: set to override the host_index for a single
2100
+ request; this effectively ignores the host_index
2101
+ in the spec for a single request.
2102
+ :type _host_index: int, optional
2103
+ :return: Returns the result object.
2104
+ """ # noqa: E501
2105
+
2106
+ _param = self._recent_trades_serialize(
2107
+ market_id=market_id,
2108
+ limit=limit,
2109
+ _request_auth=_request_auth,
2110
+ _content_type=_content_type,
2111
+ _headers=_headers,
2112
+ _host_index=_host_index
2113
+ )
2114
+
2115
+ _response_types_map: Dict[str, Optional[str]] = {
2116
+ '200': "Trades",
2117
+ '400': "ResultCode",
2118
+ }
2119
+ response_data = await self.api_client.call_api(
2120
+ *_param,
2121
+ _request_timeout=_request_timeout
2122
+ )
2123
+ await response_data.read()
2124
+ return self.api_client.response_deserialize(
2125
+ response_data=response_data,
2126
+ response_types_map=_response_types_map,
2127
+ ).data
2128
+
2129
+
2130
+ @validate_call
2131
+ async def recent_trades_with_http_info(
2132
+ self,
2133
+ market_id: StrictInt,
2134
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
2135
+ _request_timeout: Union[
2136
+ None,
2137
+ Annotated[StrictFloat, Field(gt=0)],
2138
+ Tuple[
2139
+ Annotated[StrictFloat, Field(gt=0)],
2140
+ Annotated[StrictFloat, Field(gt=0)]
2141
+ ]
2142
+ ] = None,
2143
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2144
+ _content_type: Optional[StrictStr] = None,
2145
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2146
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2147
+ ) -> ApiResponse[Trades]:
2148
+ """recentTrades
2149
+
2150
+ Get recent trades
2151
+
2152
+ :param market_id: (required)
2153
+ :type market_id: int
2154
+ :param limit: (required)
2155
+ :type limit: int
2156
+ :param _request_timeout: timeout setting for this request. If one
2157
+ number provided, it will be total request
2158
+ timeout. It can also be a pair (tuple) of
2159
+ (connection, read) timeouts.
2160
+ :type _request_timeout: int, tuple(int, int), optional
2161
+ :param _request_auth: set to override the auth_settings for an a single
2162
+ request; this effectively ignores the
2163
+ authentication in the spec for a single request.
2164
+ :type _request_auth: dict, optional
2165
+ :param _content_type: force content-type for the request.
2166
+ :type _content_type: str, Optional
2167
+ :param _headers: set to override the headers for a single
2168
+ request; this effectively ignores the headers
2169
+ in the spec for a single request.
2170
+ :type _headers: dict, optional
2171
+ :param _host_index: set to override the host_index for a single
2172
+ request; this effectively ignores the host_index
2173
+ in the spec for a single request.
2174
+ :type _host_index: int, optional
2175
+ :return: Returns the result object.
2176
+ """ # noqa: E501
2177
+
2178
+ _param = self._recent_trades_serialize(
2179
+ market_id=market_id,
2180
+ limit=limit,
2181
+ _request_auth=_request_auth,
2182
+ _content_type=_content_type,
2183
+ _headers=_headers,
2184
+ _host_index=_host_index
2185
+ )
2186
+
2187
+ _response_types_map: Dict[str, Optional[str]] = {
2188
+ '200': "Trades",
2189
+ '400': "ResultCode",
2190
+ }
2191
+ response_data = await self.api_client.call_api(
2192
+ *_param,
2193
+ _request_timeout=_request_timeout
2194
+ )
2195
+ await response_data.read()
2196
+ return self.api_client.response_deserialize(
2197
+ response_data=response_data,
2198
+ response_types_map=_response_types_map,
2199
+ )
2200
+
2201
+
2202
+ @validate_call
2203
+ async def recent_trades_without_preload_content(
2204
+ self,
2205
+ market_id: StrictInt,
2206
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
2207
+ _request_timeout: Union[
2208
+ None,
2209
+ Annotated[StrictFloat, Field(gt=0)],
2210
+ Tuple[
2211
+ Annotated[StrictFloat, Field(gt=0)],
2212
+ Annotated[StrictFloat, Field(gt=0)]
2213
+ ]
2214
+ ] = None,
2215
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2216
+ _content_type: Optional[StrictStr] = None,
2217
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2218
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2219
+ ) -> RESTResponseType:
2220
+ """recentTrades
2221
+
2222
+ Get recent trades
2223
+
2224
+ :param market_id: (required)
2225
+ :type market_id: int
2226
+ :param limit: (required)
2227
+ :type limit: int
2228
+ :param _request_timeout: timeout setting for this request. If one
2229
+ number provided, it will be total request
2230
+ timeout. It can also be a pair (tuple) of
2231
+ (connection, read) timeouts.
2232
+ :type _request_timeout: int, tuple(int, int), optional
2233
+ :param _request_auth: set to override the auth_settings for an a single
2234
+ request; this effectively ignores the
2235
+ authentication in the spec for a single request.
2236
+ :type _request_auth: dict, optional
2237
+ :param _content_type: force content-type for the request.
2238
+ :type _content_type: str, Optional
2239
+ :param _headers: set to override the headers for a single
2240
+ request; this effectively ignores the headers
2241
+ in the spec for a single request.
2242
+ :type _headers: dict, optional
2243
+ :param _host_index: set to override the host_index for a single
2244
+ request; this effectively ignores the host_index
2245
+ in the spec for a single request.
2246
+ :type _host_index: int, optional
2247
+ :return: Returns the result object.
2248
+ """ # noqa: E501
2249
+
2250
+ _param = self._recent_trades_serialize(
2251
+ market_id=market_id,
2252
+ limit=limit,
2253
+ _request_auth=_request_auth,
2254
+ _content_type=_content_type,
2255
+ _headers=_headers,
2256
+ _host_index=_host_index
2257
+ )
2258
+
2259
+ _response_types_map: Dict[str, Optional[str]] = {
2260
+ '200': "Trades",
2261
+ '400': "ResultCode",
2262
+ }
2263
+ response_data = await self.api_client.call_api(
2264
+ *_param,
2265
+ _request_timeout=_request_timeout
2266
+ )
2267
+ return response_data.response
2268
+
2269
+
2270
+ def _recent_trades_serialize(
2271
+ self,
2272
+ market_id,
2273
+ limit,
2274
+ _request_auth,
2275
+ _content_type,
2276
+ _headers,
2277
+ _host_index,
2278
+ ) -> RequestSerialized:
2279
+
2280
+ _host = None
2281
+
2282
+ _collection_formats: Dict[str, str] = {
2283
+ }
2284
+
2285
+ _path_params: Dict[str, str] = {}
2286
+ _query_params: List[Tuple[str, str]] = []
2287
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2288
+ _form_params: List[Tuple[str, str]] = []
2289
+ _files: Dict[str, Union[str, bytes]] = {}
2290
+ _body_params: Optional[bytes] = None
2291
+
2292
+ # process the path parameters
2293
+ # process the query parameters
2294
+ if market_id is not None:
2295
+
2296
+ _query_params.append(('market_id', market_id))
2297
+
2298
+ if limit is not None:
2299
+
2300
+ _query_params.append(('limit', limit))
2301
+
2302
+ # process the header parameters
2303
+ # process the form parameters
2304
+ # process the body parameter
2305
+
2306
+
2307
+ # set the HTTP header `Accept`
2308
+ if 'Accept' not in _header_params:
2309
+ _header_params['Accept'] = self.api_client.select_header_accept(
2310
+ [
2311
+ 'application/json'
2312
+ ]
2313
+ )
2314
+
2315
+
2316
+ # authentication setting
2317
+ _auth_settings: List[str] = [
2318
+ ]
2319
+
2320
+ return self.api_client.param_serialize(
2321
+ method='GET',
2322
+ resource_path='/api/v1/recentTrades',
2323
+ path_params=_path_params,
2324
+ query_params=_query_params,
2325
+ header_params=_header_params,
2326
+ body=_body_params,
2327
+ post_params=_form_params,
2328
+ files=_files,
2329
+ auth_settings=_auth_settings,
2330
+ collection_formats=_collection_formats,
2331
+ _host=_host,
2332
+ _request_auth=_request_auth
2333
+ )
2334
+
2335
+
2336
+
2337
+
2338
+ @validate_call
2339
+ async def trades(
2340
+ self,
2341
+ sort_by: StrictStr,
2342
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
2343
+ market_id: Optional[StrictInt] = None,
2344
+ account_index: Optional[StrictInt] = None,
2345
+ order_index: Optional[StrictInt] = None,
2346
+ sort_dir: Optional[StrictStr] = None,
2347
+ cursor: Optional[StrictStr] = None,
2348
+ var_from: Optional[StrictInt] = None,
2349
+ ask_filter: Optional[StrictInt] = None,
2350
+ _request_timeout: Union[
2351
+ None,
2352
+ Annotated[StrictFloat, Field(gt=0)],
2353
+ Tuple[
2354
+ Annotated[StrictFloat, Field(gt=0)],
2355
+ Annotated[StrictFloat, Field(gt=0)]
2356
+ ]
2357
+ ] = None,
2358
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2359
+ _content_type: Optional[StrictStr] = None,
2360
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2361
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2362
+ ) -> Trades:
2363
+ """trades
2364
+
2365
+ Get trades
2366
+
2367
+ :param sort_by: (required)
2368
+ :type sort_by: str
2369
+ :param limit: (required)
2370
+ :type limit: int
2371
+ :param market_id:
2372
+ :type market_id: int
2373
+ :param account_index:
2374
+ :type account_index: int
2375
+ :param order_index:
2376
+ :type order_index: int
2377
+ :param sort_dir:
2378
+ :type sort_dir: str
2379
+ :param cursor:
2380
+ :type cursor: str
2381
+ :param var_from:
2382
+ :type var_from: int
2383
+ :param ask_filter:
2384
+ :type ask_filter: int
2385
+ :param _request_timeout: timeout setting for this request. If one
2386
+ number provided, it will be total request
2387
+ timeout. It can also be a pair (tuple) of
2388
+ (connection, read) timeouts.
2389
+ :type _request_timeout: int, tuple(int, int), optional
2390
+ :param _request_auth: set to override the auth_settings for an a single
2391
+ request; this effectively ignores the
2392
+ authentication in the spec for a single request.
2393
+ :type _request_auth: dict, optional
2394
+ :param _content_type: force content-type for the request.
2395
+ :type _content_type: str, Optional
2396
+ :param _headers: set to override the headers for a single
2397
+ request; this effectively ignores the headers
2398
+ in the spec for a single request.
2399
+ :type _headers: dict, optional
2400
+ :param _host_index: set to override the host_index for a single
2401
+ request; this effectively ignores the host_index
2402
+ in the spec for a single request.
2403
+ :type _host_index: int, optional
2404
+ :return: Returns the result object.
2405
+ """ # noqa: E501
2406
+
2407
+ _param = self._trades_serialize(
2408
+ sort_by=sort_by,
2409
+ limit=limit,
2410
+ market_id=market_id,
2411
+ account_index=account_index,
2412
+ order_index=order_index,
2413
+ sort_dir=sort_dir,
2414
+ cursor=cursor,
2415
+ var_from=var_from,
2416
+ ask_filter=ask_filter,
2417
+ _request_auth=_request_auth,
2418
+ _content_type=_content_type,
2419
+ _headers=_headers,
2420
+ _host_index=_host_index
2421
+ )
2422
+
2423
+ _response_types_map: Dict[str, Optional[str]] = {
2424
+ '200': "Trades",
2425
+ '400': "ResultCode",
2426
+ }
2427
+ response_data = await self.api_client.call_api(
2428
+ *_param,
2429
+ _request_timeout=_request_timeout
2430
+ )
2431
+ await response_data.read()
2432
+ return self.api_client.response_deserialize(
2433
+ response_data=response_data,
2434
+ response_types_map=_response_types_map,
2435
+ ).data
2436
+
2437
+
2438
+ @validate_call
2439
+ async def trades_with_http_info(
2440
+ self,
2441
+ sort_by: StrictStr,
2442
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
2443
+ market_id: Optional[StrictInt] = None,
2444
+ account_index: Optional[StrictInt] = None,
2445
+ order_index: Optional[StrictInt] = None,
2446
+ sort_dir: Optional[StrictStr] = None,
2447
+ cursor: Optional[StrictStr] = None,
2448
+ var_from: Optional[StrictInt] = None,
2449
+ ask_filter: Optional[StrictInt] = None,
2450
+ _request_timeout: Union[
2451
+ None,
2452
+ Annotated[StrictFloat, Field(gt=0)],
2453
+ Tuple[
2454
+ Annotated[StrictFloat, Field(gt=0)],
2455
+ Annotated[StrictFloat, Field(gt=0)]
2456
+ ]
2457
+ ] = None,
2458
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2459
+ _content_type: Optional[StrictStr] = None,
2460
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2461
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2462
+ ) -> ApiResponse[Trades]:
2463
+ """trades
2464
+
2465
+ Get trades
2466
+
2467
+ :param sort_by: (required)
2468
+ :type sort_by: str
2469
+ :param limit: (required)
2470
+ :type limit: int
2471
+ :param market_id:
2472
+ :type market_id: int
2473
+ :param account_index:
2474
+ :type account_index: int
2475
+ :param order_index:
2476
+ :type order_index: int
2477
+ :param sort_dir:
2478
+ :type sort_dir: str
2479
+ :param cursor:
2480
+ :type cursor: str
2481
+ :param var_from:
2482
+ :type var_from: int
2483
+ :param ask_filter:
2484
+ :type ask_filter: int
2485
+ :param _request_timeout: timeout setting for this request. If one
2486
+ number provided, it will be total request
2487
+ timeout. It can also be a pair (tuple) of
2488
+ (connection, read) timeouts.
2489
+ :type _request_timeout: int, tuple(int, int), optional
2490
+ :param _request_auth: set to override the auth_settings for an a single
2491
+ request; this effectively ignores the
2492
+ authentication in the spec for a single request.
2493
+ :type _request_auth: dict, optional
2494
+ :param _content_type: force content-type for the request.
2495
+ :type _content_type: str, Optional
2496
+ :param _headers: set to override the headers for a single
2497
+ request; this effectively ignores the headers
2498
+ in the spec for a single request.
2499
+ :type _headers: dict, optional
2500
+ :param _host_index: set to override the host_index for a single
2501
+ request; this effectively ignores the host_index
2502
+ in the spec for a single request.
2503
+ :type _host_index: int, optional
2504
+ :return: Returns the result object.
2505
+ """ # noqa: E501
2506
+
2507
+ _param = self._trades_serialize(
2508
+ sort_by=sort_by,
2509
+ limit=limit,
2510
+ market_id=market_id,
2511
+ account_index=account_index,
2512
+ order_index=order_index,
2513
+ sort_dir=sort_dir,
2514
+ cursor=cursor,
2515
+ var_from=var_from,
2516
+ ask_filter=ask_filter,
2517
+ _request_auth=_request_auth,
2518
+ _content_type=_content_type,
2519
+ _headers=_headers,
2520
+ _host_index=_host_index
2521
+ )
2522
+
2523
+ _response_types_map: Dict[str, Optional[str]] = {
2524
+ '200': "Trades",
2525
+ '400': "ResultCode",
2526
+ }
2527
+ response_data = await self.api_client.call_api(
2528
+ *_param,
2529
+ _request_timeout=_request_timeout
2530
+ )
2531
+ await response_data.read()
2532
+ return self.api_client.response_deserialize(
2533
+ response_data=response_data,
2534
+ response_types_map=_response_types_map,
2535
+ )
2536
+
2537
+
2538
+ @validate_call
2539
+ async def trades_without_preload_content(
2540
+ self,
2541
+ sort_by: StrictStr,
2542
+ limit: Annotated[int, Field(le=100, strict=True, ge=1)],
2543
+ market_id: Optional[StrictInt] = None,
2544
+ account_index: Optional[StrictInt] = None,
2545
+ order_index: Optional[StrictInt] = None,
2546
+ sort_dir: Optional[StrictStr] = None,
2547
+ cursor: Optional[StrictStr] = None,
2548
+ var_from: Optional[StrictInt] = None,
2549
+ ask_filter: Optional[StrictInt] = None,
2550
+ _request_timeout: Union[
2551
+ None,
2552
+ Annotated[StrictFloat, Field(gt=0)],
2553
+ Tuple[
2554
+ Annotated[StrictFloat, Field(gt=0)],
2555
+ Annotated[StrictFloat, Field(gt=0)]
2556
+ ]
2557
+ ] = None,
2558
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2559
+ _content_type: Optional[StrictStr] = None,
2560
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2561
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2562
+ ) -> RESTResponseType:
2563
+ """trades
2564
+
2565
+ Get trades
2566
+
2567
+ :param sort_by: (required)
2568
+ :type sort_by: str
2569
+ :param limit: (required)
2570
+ :type limit: int
2571
+ :param market_id:
2572
+ :type market_id: int
2573
+ :param account_index:
2574
+ :type account_index: int
2575
+ :param order_index:
2576
+ :type order_index: int
2577
+ :param sort_dir:
2578
+ :type sort_dir: str
2579
+ :param cursor:
2580
+ :type cursor: str
2581
+ :param var_from:
2582
+ :type var_from: int
2583
+ :param ask_filter:
2584
+ :type ask_filter: int
2585
+ :param _request_timeout: timeout setting for this request. If one
2586
+ number provided, it will be total request
2587
+ timeout. It can also be a pair (tuple) of
2588
+ (connection, read) timeouts.
2589
+ :type _request_timeout: int, tuple(int, int), optional
2590
+ :param _request_auth: set to override the auth_settings for an a single
2591
+ request; this effectively ignores the
2592
+ authentication in the spec for a single request.
2593
+ :type _request_auth: dict, optional
2594
+ :param _content_type: force content-type for the request.
2595
+ :type _content_type: str, Optional
2596
+ :param _headers: set to override the headers for a single
2597
+ request; this effectively ignores the headers
2598
+ in the spec for a single request.
2599
+ :type _headers: dict, optional
2600
+ :param _host_index: set to override the host_index for a single
2601
+ request; this effectively ignores the host_index
2602
+ in the spec for a single request.
2603
+ :type _host_index: int, optional
2604
+ :return: Returns the result object.
2605
+ """ # noqa: E501
2606
+
2607
+ _param = self._trades_serialize(
2608
+ sort_by=sort_by,
2609
+ limit=limit,
2610
+ market_id=market_id,
2611
+ account_index=account_index,
2612
+ order_index=order_index,
2613
+ sort_dir=sort_dir,
2614
+ cursor=cursor,
2615
+ var_from=var_from,
2616
+ ask_filter=ask_filter,
2617
+ _request_auth=_request_auth,
2618
+ _content_type=_content_type,
2619
+ _headers=_headers,
2620
+ _host_index=_host_index
2621
+ )
2622
+
2623
+ _response_types_map: Dict[str, Optional[str]] = {
2624
+ '200': "Trades",
2625
+ '400': "ResultCode",
2626
+ }
2627
+ response_data = await self.api_client.call_api(
2628
+ *_param,
2629
+ _request_timeout=_request_timeout
2630
+ )
2631
+ return response_data.response
2632
+
2633
+
2634
+ def _trades_serialize(
2635
+ self,
2636
+ sort_by,
2637
+ limit,
2638
+ market_id,
2639
+ account_index,
2640
+ order_index,
2641
+ sort_dir,
2642
+ cursor,
2643
+ var_from,
2644
+ ask_filter,
2645
+ _request_auth,
2646
+ _content_type,
2647
+ _headers,
2648
+ _host_index,
2649
+ ) -> RequestSerialized:
2650
+
2651
+ _host = None
2652
+
2653
+ _collection_formats: Dict[str, str] = {
2654
+ }
2655
+
2656
+ _path_params: Dict[str, str] = {}
2657
+ _query_params: List[Tuple[str, str]] = []
2658
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2659
+ _form_params: List[Tuple[str, str]] = []
2660
+ _files: Dict[str, Union[str, bytes]] = {}
2661
+ _body_params: Optional[bytes] = None
2662
+
2663
+ # process the path parameters
2664
+ # process the query parameters
2665
+ if market_id is not None:
2666
+
2667
+ _query_params.append(('market_id', market_id))
2668
+
2669
+ if account_index is not None:
2670
+
2671
+ _query_params.append(('account_index', account_index))
2672
+
2673
+ if order_index is not None:
2674
+
2675
+ _query_params.append(('order_index', order_index))
2676
+
2677
+ if sort_by is not None:
2678
+
2679
+ _query_params.append(('sort_by', sort_by))
2680
+
2681
+ if sort_dir is not None:
2682
+
2683
+ _query_params.append(('sort_dir', sort_dir))
2684
+
2685
+ if cursor is not None:
2686
+
2687
+ _query_params.append(('cursor', cursor))
2688
+
2689
+ if var_from is not None:
2690
+
2691
+ _query_params.append(('from', var_from))
2692
+
2693
+ if ask_filter is not None:
2694
+
2695
+ _query_params.append(('ask_filter', ask_filter))
2696
+
2697
+ if limit is not None:
2698
+
2699
+ _query_params.append(('limit', limit))
2700
+
2701
+ # process the header parameters
2702
+ # process the form parameters
2703
+ # process the body parameter
2704
+
2705
+
2706
+ # set the HTTP header `Accept`
2707
+ if 'Accept' not in _header_params:
2708
+ _header_params['Accept'] = self.api_client.select_header_accept(
2709
+ [
2710
+ 'application/json'
2711
+ ]
2712
+ )
2713
+
2714
+
2715
+ # authentication setting
2716
+ _auth_settings: List[str] = [
2717
+ ]
2718
+
2719
+ return self.api_client.param_serialize(
2720
+ method='GET',
2721
+ resource_path='/api/v1/trades',
2722
+ path_params=_path_params,
2723
+ query_params=_query_params,
2724
+ header_params=_header_params,
2725
+ body=_body_params,
2726
+ post_params=_form_params,
2727
+ files=_files,
2728
+ auth_settings=_auth_settings,
2729
+ collection_formats=_collection_formats,
2730
+ _host=_host,
2731
+ _request_auth=_request_auth
2732
+ )
2733
+
2734
+