crypticorn 2.1.5__py3-none-any.whl → 2.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. crypticorn/auth/main.py +2 -19
  2. crypticorn/client.py +75 -22
  3. crypticorn/common/__init__.py +1 -2
  4. crypticorn/common/auth.py +205 -1
  5. crypticorn/common/scopes.py +2 -2
  6. crypticorn/common/urls.py +21 -9
  7. crypticorn/hive/main.py +4 -12
  8. crypticorn/klines/client/configuration.py +2 -2
  9. crypticorn/klines/main.py +2 -12
  10. crypticorn/metrics/__init__.py +4 -0
  11. crypticorn/metrics/client/__init__.py +60 -0
  12. crypticorn/metrics/client/api/__init__.py +10 -0
  13. crypticorn/metrics/client/api/exchanges_api.py +1003 -0
  14. crypticorn/metrics/client/api/health_check_api.py +265 -0
  15. crypticorn/metrics/client/api/indicators_api.py +680 -0
  16. crypticorn/metrics/client/api/logs_api.py +356 -0
  17. crypticorn/metrics/client/api/marketcap_api.py +1315 -0
  18. crypticorn/metrics/client/api/markets_api.py +618 -0
  19. crypticorn/metrics/client/api/tokens_api.py +300 -0
  20. crypticorn/metrics/client/api_client.py +758 -0
  21. crypticorn/metrics/client/api_response.py +20 -0
  22. crypticorn/metrics/client/configuration.py +575 -0
  23. crypticorn/metrics/client/exceptions.py +220 -0
  24. crypticorn/metrics/client/models/__init__.py +37 -0
  25. crypticorn/metrics/client/models/base_response_dict.py +106 -0
  26. crypticorn/metrics/client/models/base_response_health_check_response.py +114 -0
  27. crypticorn/metrics/client/models/base_response_list_dict.py +106 -0
  28. crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +118 -0
  29. crypticorn/metrics/client/models/base_response_list_str.py +106 -0
  30. crypticorn/metrics/client/models/error_response.py +109 -0
  31. crypticorn/metrics/client/models/exchange_mapping.py +132 -0
  32. crypticorn/metrics/client/models/health_check_response.py +91 -0
  33. crypticorn/metrics/client/models/http_validation_error.py +99 -0
  34. crypticorn/metrics/client/models/market.py +35 -0
  35. crypticorn/metrics/client/models/severity.py +36 -0
  36. crypticorn/metrics/client/models/validation_error.py +105 -0
  37. crypticorn/metrics/client/models/validation_error_loc_inner.py +159 -0
  38. crypticorn/metrics/client/py.typed +0 -0
  39. crypticorn/metrics/client/rest.py +195 -0
  40. crypticorn/metrics/main.py +102 -0
  41. crypticorn/pay/main.py +2 -12
  42. crypticorn/trade/main.py +2 -12
  43. crypticorn-2.2.0.dist-info/METADATA +146 -0
  44. {crypticorn-2.1.5.dist-info → crypticorn-2.2.0.dist-info}/RECORD +46 -16
  45. crypticorn/common/auth_client.py +0 -213
  46. crypticorn-2.1.5.dist-info/METADATA +0 -92
  47. {crypticorn-2.1.5.dist-info → crypticorn-2.2.0.dist-info}/WHEEL +0 -0
  48. {crypticorn-2.1.5.dist-info → crypticorn-2.2.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1003 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Marketcap Service API
5
+
6
+ API for retrieving historical marketcap data, available exchanges, and indicators. ## Features - Historical marketcap data - OHLCV data with marketcap - Technical indicators (KER, SMA) - Exchange and symbol mappings - Error logs
7
+
8
+ The version of the OpenAPI document: 1.0.0
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 crypticorn.metrics.client.models.base_response_list_dict import (
23
+ BaseResponseListDict,
24
+ )
25
+ from crypticorn.metrics.client.models.base_response_list_exchange_mapping import (
26
+ BaseResponseListExchangeMapping,
27
+ )
28
+ from crypticorn.metrics.client.models.base_response_list_str import BaseResponseListStr
29
+ from crypticorn.metrics.client.models.market import Market
30
+
31
+ from crypticorn.metrics.client.api_client import ApiClient, RequestSerialized
32
+ from crypticorn.metrics.client.api_response import ApiResponse
33
+ from crypticorn.metrics.client.rest import RESTResponseType
34
+
35
+
36
+ class ExchangesApi:
37
+ """NOTE: This class is auto generated by OpenAPI Generator
38
+ Ref: https://openapi-generator.tech
39
+
40
+ Do not edit the class manually.
41
+ """
42
+
43
+ def __init__(self, api_client=None) -> None:
44
+ if api_client is None:
45
+ api_client = ApiClient.get_default()
46
+ self.api_client = api_client
47
+
48
+ @validate_call
49
+ async def get_available_exchanges(
50
+ self,
51
+ market: Annotated[Market, Field(description="Market type (spot or futures)")],
52
+ symbol: Annotated[
53
+ StrictStr, Field(description="Symbol to fetch available exchanges for")
54
+ ],
55
+ interval: Annotated[
56
+ Optional[StrictStr],
57
+ Field(description="Interval for which to fetch available exchanges"),
58
+ ] = None,
59
+ start_timestamp: Annotated[
60
+ Optional[StrictInt],
61
+ Field(
62
+ description="Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)"
63
+ ),
64
+ ] = None,
65
+ end_timestamp: Annotated[
66
+ Optional[StrictInt],
67
+ Field(description="End timestamp for which to fetch available exchanges"),
68
+ ] = None,
69
+ quote_currency: Annotated[
70
+ Optional[StrictStr],
71
+ Field(
72
+ description="Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)"
73
+ ),
74
+ ] = None,
75
+ status: Annotated[
76
+ Optional[StrictStr],
77
+ Field(
78
+ description="Trading pair status for which to fetch available exchanges"
79
+ ),
80
+ ] = None,
81
+ _request_timeout: Union[
82
+ None,
83
+ Annotated[StrictFloat, Field(gt=0)],
84
+ Tuple[
85
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
86
+ ],
87
+ ] = None,
88
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
89
+ _content_type: Optional[StrictStr] = None,
90
+ _headers: Optional[Dict[StrictStr, Any]] = None,
91
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
92
+ ) -> BaseResponseListDict:
93
+ """Get Available Exchanges
94
+
95
+ Get available exchanges for a symbol with various filtering options.
96
+
97
+ :param market: Market type (spot or futures) (required)
98
+ :type market: Market
99
+ :param symbol: Symbol to fetch available exchanges for (required)
100
+ :type symbol: str
101
+ :param interval: Interval for which to fetch available exchanges
102
+ :type interval: str
103
+ :param start_timestamp: Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)
104
+ :type start_timestamp: int
105
+ :param end_timestamp: End timestamp for which to fetch available exchanges
106
+ :type end_timestamp: int
107
+ :param quote_currency: Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)
108
+ :type quote_currency: str
109
+ :param status: Trading pair status for which to fetch available exchanges
110
+ :type status: str
111
+ :param _request_timeout: timeout setting for this request. If one
112
+ number provided, it will be total request
113
+ timeout. It can also be a pair (tuple) of
114
+ (connection, read) timeouts.
115
+ :type _request_timeout: int, tuple(int, int), optional
116
+ :param _request_auth: set to override the auth_settings for an a single
117
+ request; this effectively ignores the
118
+ authentication in the spec for a single request.
119
+ :type _request_auth: dict, optional
120
+ :param _content_type: force content-type for the request.
121
+ :type _content_type: str, Optional
122
+ :param _headers: set to override the headers for a single
123
+ request; this effectively ignores the headers
124
+ in the spec for a single request.
125
+ :type _headers: dict, optional
126
+ :param _host_index: set to override the host_index for a single
127
+ request; this effectively ignores the host_index
128
+ in the spec for a single request.
129
+ :type _host_index: int, optional
130
+ :return: Returns the result object.
131
+ """ # noqa: E501
132
+
133
+ _param = self._get_available_exchanges_serialize(
134
+ market=market,
135
+ symbol=symbol,
136
+ interval=interval,
137
+ start_timestamp=start_timestamp,
138
+ end_timestamp=end_timestamp,
139
+ quote_currency=quote_currency,
140
+ status=status,
141
+ _request_auth=_request_auth,
142
+ _content_type=_content_type,
143
+ _headers=_headers,
144
+ _host_index=_host_index,
145
+ )
146
+
147
+ _response_types_map: Dict[str, Optional[str]] = {
148
+ "200": "BaseResponseListDict",
149
+ "400": "ErrorResponse",
150
+ "404": "ErrorResponse",
151
+ "500": "ErrorResponse",
152
+ "422": "HTTPValidationError",
153
+ }
154
+ response_data = await self.api_client.call_api(
155
+ *_param, _request_timeout=_request_timeout
156
+ )
157
+ await response_data.read()
158
+ return self.api_client.response_deserialize(
159
+ response_data=response_data,
160
+ response_types_map=_response_types_map,
161
+ ).data
162
+
163
+ @validate_call
164
+ async def get_available_exchanges_with_http_info(
165
+ self,
166
+ market: Annotated[Market, Field(description="Market type (spot or futures)")],
167
+ symbol: Annotated[
168
+ StrictStr, Field(description="Symbol to fetch available exchanges for")
169
+ ],
170
+ interval: Annotated[
171
+ Optional[StrictStr],
172
+ Field(description="Interval for which to fetch available exchanges"),
173
+ ] = None,
174
+ start_timestamp: Annotated[
175
+ Optional[StrictInt],
176
+ Field(
177
+ description="Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)"
178
+ ),
179
+ ] = None,
180
+ end_timestamp: Annotated[
181
+ Optional[StrictInt],
182
+ Field(description="End timestamp for which to fetch available exchanges"),
183
+ ] = None,
184
+ quote_currency: Annotated[
185
+ Optional[StrictStr],
186
+ Field(
187
+ description="Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)"
188
+ ),
189
+ ] = None,
190
+ status: Annotated[
191
+ Optional[StrictStr],
192
+ Field(
193
+ description="Trading pair status for which to fetch available exchanges"
194
+ ),
195
+ ] = None,
196
+ _request_timeout: Union[
197
+ None,
198
+ Annotated[StrictFloat, Field(gt=0)],
199
+ Tuple[
200
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
201
+ ],
202
+ ] = None,
203
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
204
+ _content_type: Optional[StrictStr] = None,
205
+ _headers: Optional[Dict[StrictStr, Any]] = None,
206
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
207
+ ) -> ApiResponse[BaseResponseListDict]:
208
+ """Get Available Exchanges
209
+
210
+ Get available exchanges for a symbol with various filtering options.
211
+
212
+ :param market: Market type (spot or futures) (required)
213
+ :type market: Market
214
+ :param symbol: Symbol to fetch available exchanges for (required)
215
+ :type symbol: str
216
+ :param interval: Interval for which to fetch available exchanges
217
+ :type interval: str
218
+ :param start_timestamp: Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)
219
+ :type start_timestamp: int
220
+ :param end_timestamp: End timestamp for which to fetch available exchanges
221
+ :type end_timestamp: int
222
+ :param quote_currency: Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)
223
+ :type quote_currency: str
224
+ :param status: Trading pair status for which to fetch available exchanges
225
+ :type status: str
226
+ :param _request_timeout: timeout setting for this request. If one
227
+ number provided, it will be total request
228
+ timeout. It can also be a pair (tuple) of
229
+ (connection, read) timeouts.
230
+ :type _request_timeout: int, tuple(int, int), optional
231
+ :param _request_auth: set to override the auth_settings for an a single
232
+ request; this effectively ignores the
233
+ authentication in the spec for a single request.
234
+ :type _request_auth: dict, optional
235
+ :param _content_type: force content-type for the request.
236
+ :type _content_type: str, Optional
237
+ :param _headers: set to override the headers for a single
238
+ request; this effectively ignores the headers
239
+ in the spec for a single request.
240
+ :type _headers: dict, optional
241
+ :param _host_index: set to override the host_index for a single
242
+ request; this effectively ignores the host_index
243
+ in the spec for a single request.
244
+ :type _host_index: int, optional
245
+ :return: Returns the result object.
246
+ """ # noqa: E501
247
+
248
+ _param = self._get_available_exchanges_serialize(
249
+ market=market,
250
+ symbol=symbol,
251
+ interval=interval,
252
+ start_timestamp=start_timestamp,
253
+ end_timestamp=end_timestamp,
254
+ quote_currency=quote_currency,
255
+ status=status,
256
+ _request_auth=_request_auth,
257
+ _content_type=_content_type,
258
+ _headers=_headers,
259
+ _host_index=_host_index,
260
+ )
261
+
262
+ _response_types_map: Dict[str, Optional[str]] = {
263
+ "200": "BaseResponseListDict",
264
+ "400": "ErrorResponse",
265
+ "404": "ErrorResponse",
266
+ "500": "ErrorResponse",
267
+ "422": "HTTPValidationError",
268
+ }
269
+ response_data = await self.api_client.call_api(
270
+ *_param, _request_timeout=_request_timeout
271
+ )
272
+ await response_data.read()
273
+ return self.api_client.response_deserialize(
274
+ response_data=response_data,
275
+ response_types_map=_response_types_map,
276
+ )
277
+
278
+ @validate_call
279
+ async def get_available_exchanges_without_preload_content(
280
+ self,
281
+ market: Annotated[Market, Field(description="Market type (spot or futures)")],
282
+ symbol: Annotated[
283
+ StrictStr, Field(description="Symbol to fetch available exchanges for")
284
+ ],
285
+ interval: Annotated[
286
+ Optional[StrictStr],
287
+ Field(description="Interval for which to fetch available exchanges"),
288
+ ] = None,
289
+ start_timestamp: Annotated[
290
+ Optional[StrictInt],
291
+ Field(
292
+ description="Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)"
293
+ ),
294
+ ] = None,
295
+ end_timestamp: Annotated[
296
+ Optional[StrictInt],
297
+ Field(description="End timestamp for which to fetch available exchanges"),
298
+ ] = None,
299
+ quote_currency: Annotated[
300
+ Optional[StrictStr],
301
+ Field(
302
+ description="Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)"
303
+ ),
304
+ ] = None,
305
+ status: Annotated[
306
+ Optional[StrictStr],
307
+ Field(
308
+ description="Trading pair status for which to fetch available exchanges"
309
+ ),
310
+ ] = None,
311
+ _request_timeout: Union[
312
+ None,
313
+ Annotated[StrictFloat, Field(gt=0)],
314
+ Tuple[
315
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
316
+ ],
317
+ ] = None,
318
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
319
+ _content_type: Optional[StrictStr] = None,
320
+ _headers: Optional[Dict[StrictStr, Any]] = None,
321
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
322
+ ) -> RESTResponseType:
323
+ """Get Available Exchanges
324
+
325
+ Get available exchanges for a symbol with various filtering options.
326
+
327
+ :param market: Market type (spot or futures) (required)
328
+ :type market: Market
329
+ :param symbol: Symbol to fetch available exchanges for (required)
330
+ :type symbol: str
331
+ :param interval: Interval for which to fetch available exchanges
332
+ :type interval: str
333
+ :param start_timestamp: Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)
334
+ :type start_timestamp: int
335
+ :param end_timestamp: End timestamp for which to fetch available exchanges
336
+ :type end_timestamp: int
337
+ :param quote_currency: Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)
338
+ :type quote_currency: str
339
+ :param status: Trading pair status for which to fetch available exchanges
340
+ :type status: str
341
+ :param _request_timeout: timeout setting for this request. If one
342
+ number provided, it will be total request
343
+ timeout. It can also be a pair (tuple) of
344
+ (connection, read) timeouts.
345
+ :type _request_timeout: int, tuple(int, int), optional
346
+ :param _request_auth: set to override the auth_settings for an a single
347
+ request; this effectively ignores the
348
+ authentication in the spec for a single request.
349
+ :type _request_auth: dict, optional
350
+ :param _content_type: force content-type for the request.
351
+ :type _content_type: str, Optional
352
+ :param _headers: set to override the headers for a single
353
+ request; this effectively ignores the headers
354
+ in the spec for a single request.
355
+ :type _headers: dict, optional
356
+ :param _host_index: set to override the host_index for a single
357
+ request; this effectively ignores the host_index
358
+ in the spec for a single request.
359
+ :type _host_index: int, optional
360
+ :return: Returns the result object.
361
+ """ # noqa: E501
362
+
363
+ _param = self._get_available_exchanges_serialize(
364
+ market=market,
365
+ symbol=symbol,
366
+ interval=interval,
367
+ start_timestamp=start_timestamp,
368
+ end_timestamp=end_timestamp,
369
+ quote_currency=quote_currency,
370
+ status=status,
371
+ _request_auth=_request_auth,
372
+ _content_type=_content_type,
373
+ _headers=_headers,
374
+ _host_index=_host_index,
375
+ )
376
+
377
+ _response_types_map: Dict[str, Optional[str]] = {
378
+ "200": "BaseResponseListDict",
379
+ "400": "ErrorResponse",
380
+ "404": "ErrorResponse",
381
+ "500": "ErrorResponse",
382
+ "422": "HTTPValidationError",
383
+ }
384
+ response_data = await self.api_client.call_api(
385
+ *_param, _request_timeout=_request_timeout
386
+ )
387
+ return response_data.response
388
+
389
+ def _get_available_exchanges_serialize(
390
+ self,
391
+ market,
392
+ symbol,
393
+ interval,
394
+ start_timestamp,
395
+ end_timestamp,
396
+ quote_currency,
397
+ status,
398
+ _request_auth,
399
+ _content_type,
400
+ _headers,
401
+ _host_index,
402
+ ) -> RequestSerialized:
403
+
404
+ _host = None
405
+
406
+ _collection_formats: Dict[str, str] = {}
407
+
408
+ _path_params: Dict[str, str] = {}
409
+ _query_params: List[Tuple[str, str]] = []
410
+ _header_params: Dict[str, Optional[str]] = _headers or {}
411
+ _form_params: List[Tuple[str, str]] = []
412
+ _files: Dict[
413
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
414
+ ] = {}
415
+ _body_params: Optional[bytes] = None
416
+
417
+ # process the path parameters
418
+ if market is not None:
419
+ _path_params["market"] = market.value
420
+ if symbol is not None:
421
+ _path_params["symbol"] = symbol
422
+ # process the query parameters
423
+ if interval is not None:
424
+
425
+ _query_params.append(("interval", interval))
426
+
427
+ if start_timestamp is not None:
428
+
429
+ _query_params.append(("start_timestamp", start_timestamp))
430
+
431
+ if end_timestamp is not None:
432
+
433
+ _query_params.append(("end_timestamp", end_timestamp))
434
+
435
+ if quote_currency is not None:
436
+
437
+ _query_params.append(("quote_currency", quote_currency))
438
+
439
+ if status is not None:
440
+
441
+ _query_params.append(("status", status))
442
+
443
+ # process the header parameters
444
+ # process the form parameters
445
+ # process the body parameter
446
+
447
+ # set the HTTP header `Accept`
448
+ if "Accept" not in _header_params:
449
+ _header_params["Accept"] = self.api_client.select_header_accept(
450
+ ["application/json"]
451
+ )
452
+
453
+ # authentication setting
454
+ _auth_settings: List[str] = []
455
+
456
+ return self.api_client.param_serialize(
457
+ method="GET",
458
+ resource_path="/available_exchanges/{market}/{symbol}",
459
+ path_params=_path_params,
460
+ query_params=_query_params,
461
+ header_params=_header_params,
462
+ body=_body_params,
463
+ post_params=_form_params,
464
+ files=_files,
465
+ auth_settings=_auth_settings,
466
+ collection_formats=_collection_formats,
467
+ _host=_host,
468
+ _request_auth=_request_auth,
469
+ )
470
+
471
+ @validate_call
472
+ async def get_available_exchanges_for_market(
473
+ self,
474
+ market: Annotated[Market, Field(description="Market type (spot or futures)")],
475
+ _request_timeout: Union[
476
+ None,
477
+ Annotated[StrictFloat, Field(gt=0)],
478
+ Tuple[
479
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
480
+ ],
481
+ ] = None,
482
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
483
+ _content_type: Optional[StrictStr] = None,
484
+ _headers: Optional[Dict[StrictStr, Any]] = None,
485
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
486
+ ) -> BaseResponseListStr:
487
+ """Get Exchange List
488
+
489
+ Get list of exchanges for a market.
490
+
491
+ :param market: Market type (spot or futures) (required)
492
+ :type market: Market
493
+ :param _request_timeout: timeout setting for this request. If one
494
+ number provided, it will be total request
495
+ timeout. It can also be a pair (tuple) of
496
+ (connection, read) timeouts.
497
+ :type _request_timeout: int, tuple(int, int), optional
498
+ :param _request_auth: set to override the auth_settings for an a single
499
+ request; this effectively ignores the
500
+ authentication in the spec for a single request.
501
+ :type _request_auth: dict, optional
502
+ :param _content_type: force content-type for the request.
503
+ :type _content_type: str, Optional
504
+ :param _headers: set to override the headers for a single
505
+ request; this effectively ignores the headers
506
+ in the spec for a single request.
507
+ :type _headers: dict, optional
508
+ :param _host_index: set to override the host_index for a single
509
+ request; this effectively ignores the host_index
510
+ in the spec for a single request.
511
+ :type _host_index: int, optional
512
+ :return: Returns the result object.
513
+ """ # noqa: E501
514
+
515
+ _param = self._get_available_exchanges_for_market_serialize(
516
+ market=market,
517
+ _request_auth=_request_auth,
518
+ _content_type=_content_type,
519
+ _headers=_headers,
520
+ _host_index=_host_index,
521
+ )
522
+
523
+ _response_types_map: Dict[str, Optional[str]] = {
524
+ "200": "BaseResponseListStr",
525
+ "400": "ErrorResponse",
526
+ "404": "ErrorResponse",
527
+ "500": "ErrorResponse",
528
+ "422": "HTTPValidationError",
529
+ }
530
+ response_data = await self.api_client.call_api(
531
+ *_param, _request_timeout=_request_timeout
532
+ )
533
+ await response_data.read()
534
+ return self.api_client.response_deserialize(
535
+ response_data=response_data,
536
+ response_types_map=_response_types_map,
537
+ ).data
538
+
539
+ @validate_call
540
+ async def get_available_exchanges_for_market_with_http_info(
541
+ self,
542
+ market: Annotated[Market, Field(description="Market type (spot or futures)")],
543
+ _request_timeout: Union[
544
+ None,
545
+ Annotated[StrictFloat, Field(gt=0)],
546
+ Tuple[
547
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
548
+ ],
549
+ ] = None,
550
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
551
+ _content_type: Optional[StrictStr] = None,
552
+ _headers: Optional[Dict[StrictStr, Any]] = None,
553
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
554
+ ) -> ApiResponse[BaseResponseListStr]:
555
+ """Get Exchange List
556
+
557
+ Get list of exchanges for a market.
558
+
559
+ :param market: Market type (spot or futures) (required)
560
+ :type market: Market
561
+ :param _request_timeout: timeout setting for this request. If one
562
+ number provided, it will be total request
563
+ timeout. It can also be a pair (tuple) of
564
+ (connection, read) timeouts.
565
+ :type _request_timeout: int, tuple(int, int), optional
566
+ :param _request_auth: set to override the auth_settings for an a single
567
+ request; this effectively ignores the
568
+ authentication in the spec for a single request.
569
+ :type _request_auth: dict, optional
570
+ :param _content_type: force content-type for the request.
571
+ :type _content_type: str, Optional
572
+ :param _headers: set to override the headers for a single
573
+ request; this effectively ignores the headers
574
+ in the spec for a single request.
575
+ :type _headers: dict, optional
576
+ :param _host_index: set to override the host_index for a single
577
+ request; this effectively ignores the host_index
578
+ in the spec for a single request.
579
+ :type _host_index: int, optional
580
+ :return: Returns the result object.
581
+ """ # noqa: E501
582
+
583
+ _param = self._get_available_exchanges_for_market_serialize(
584
+ market=market,
585
+ _request_auth=_request_auth,
586
+ _content_type=_content_type,
587
+ _headers=_headers,
588
+ _host_index=_host_index,
589
+ )
590
+
591
+ _response_types_map: Dict[str, Optional[str]] = {
592
+ "200": "BaseResponseListStr",
593
+ "400": "ErrorResponse",
594
+ "404": "ErrorResponse",
595
+ "500": "ErrorResponse",
596
+ "422": "HTTPValidationError",
597
+ }
598
+ response_data = await self.api_client.call_api(
599
+ *_param, _request_timeout=_request_timeout
600
+ )
601
+ await response_data.read()
602
+ return self.api_client.response_deserialize(
603
+ response_data=response_data,
604
+ response_types_map=_response_types_map,
605
+ )
606
+
607
+ @validate_call
608
+ async def get_available_exchanges_for_market_without_preload_content(
609
+ self,
610
+ market: Annotated[Market, Field(description="Market type (spot or futures)")],
611
+ _request_timeout: Union[
612
+ None,
613
+ Annotated[StrictFloat, Field(gt=0)],
614
+ Tuple[
615
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
616
+ ],
617
+ ] = None,
618
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
619
+ _content_type: Optional[StrictStr] = None,
620
+ _headers: Optional[Dict[StrictStr, Any]] = None,
621
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
622
+ ) -> RESTResponseType:
623
+ """Get Exchange List
624
+
625
+ Get list of exchanges for a market.
626
+
627
+ :param market: Market type (spot or futures) (required)
628
+ :type market: Market
629
+ :param _request_timeout: timeout setting for this request. If one
630
+ number provided, it will be total request
631
+ timeout. It can also be a pair (tuple) of
632
+ (connection, read) timeouts.
633
+ :type _request_timeout: int, tuple(int, int), optional
634
+ :param _request_auth: set to override the auth_settings for an a single
635
+ request; this effectively ignores the
636
+ authentication in the spec for a single request.
637
+ :type _request_auth: dict, optional
638
+ :param _content_type: force content-type for the request.
639
+ :type _content_type: str, Optional
640
+ :param _headers: set to override the headers for a single
641
+ request; this effectively ignores the headers
642
+ in the spec for a single request.
643
+ :type _headers: dict, optional
644
+ :param _host_index: set to override the host_index for a single
645
+ request; this effectively ignores the host_index
646
+ in the spec for a single request.
647
+ :type _host_index: int, optional
648
+ :return: Returns the result object.
649
+ """ # noqa: E501
650
+
651
+ _param = self._get_available_exchanges_for_market_serialize(
652
+ market=market,
653
+ _request_auth=_request_auth,
654
+ _content_type=_content_type,
655
+ _headers=_headers,
656
+ _host_index=_host_index,
657
+ )
658
+
659
+ _response_types_map: Dict[str, Optional[str]] = {
660
+ "200": "BaseResponseListStr",
661
+ "400": "ErrorResponse",
662
+ "404": "ErrorResponse",
663
+ "500": "ErrorResponse",
664
+ "422": "HTTPValidationError",
665
+ }
666
+ response_data = await self.api_client.call_api(
667
+ *_param, _request_timeout=_request_timeout
668
+ )
669
+ return response_data.response
670
+
671
+ def _get_available_exchanges_for_market_serialize(
672
+ self,
673
+ market,
674
+ _request_auth,
675
+ _content_type,
676
+ _headers,
677
+ _host_index,
678
+ ) -> RequestSerialized:
679
+
680
+ _host = None
681
+
682
+ _collection_formats: Dict[str, str] = {}
683
+
684
+ _path_params: Dict[str, str] = {}
685
+ _query_params: List[Tuple[str, str]] = []
686
+ _header_params: Dict[str, Optional[str]] = _headers or {}
687
+ _form_params: List[Tuple[str, str]] = []
688
+ _files: Dict[
689
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
690
+ ] = {}
691
+ _body_params: Optional[bytes] = None
692
+
693
+ # process the path parameters
694
+ if market is not None:
695
+ _path_params["market"] = market.value
696
+ # process the query parameters
697
+ # process the header parameters
698
+ # process the form parameters
699
+ # process the body parameter
700
+
701
+ # set the HTTP header `Accept`
702
+ if "Accept" not in _header_params:
703
+ _header_params["Accept"] = self.api_client.select_header_accept(
704
+ ["application/json"]
705
+ )
706
+
707
+ # authentication setting
708
+ _auth_settings: List[str] = []
709
+
710
+ return self.api_client.param_serialize(
711
+ method="GET",
712
+ resource_path="/exchange_list/{market}",
713
+ path_params=_path_params,
714
+ query_params=_query_params,
715
+ header_params=_header_params,
716
+ body=_body_params,
717
+ post_params=_form_params,
718
+ files=_files,
719
+ auth_settings=_auth_settings,
720
+ collection_formats=_collection_formats,
721
+ _host=_host,
722
+ _request_auth=_request_auth,
723
+ )
724
+
725
+ @validate_call
726
+ async def get_exchange_mappings(
727
+ self,
728
+ market: Annotated[Market, Field(description="Market type (spot or futures)")],
729
+ exchange_name: Annotated[
730
+ Optional[StrictStr],
731
+ Field(description="Exchange name for which to fetch exchange mappings"),
732
+ ] = None,
733
+ _request_timeout: Union[
734
+ None,
735
+ Annotated[StrictFloat, Field(gt=0)],
736
+ Tuple[
737
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
738
+ ],
739
+ ] = None,
740
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
741
+ _content_type: Optional[StrictStr] = None,
742
+ _headers: Optional[Dict[StrictStr, Any]] = None,
743
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
744
+ ) -> BaseResponseListExchangeMapping:
745
+ """Get Exchange Mappings
746
+
747
+ Get exchange mappings for a market with optional exchange name filter.
748
+
749
+ :param market: Market type (spot or futures) (required)
750
+ :type market: Market
751
+ :param exchange_name: Exchange name for which to fetch exchange mappings
752
+ :type exchange_name: str
753
+ :param _request_timeout: timeout setting for this request. If one
754
+ number provided, it will be total request
755
+ timeout. It can also be a pair (tuple) of
756
+ (connection, read) timeouts.
757
+ :type _request_timeout: int, tuple(int, int), optional
758
+ :param _request_auth: set to override the auth_settings for an a single
759
+ request; this effectively ignores the
760
+ authentication in the spec for a single request.
761
+ :type _request_auth: dict, optional
762
+ :param _content_type: force content-type for the request.
763
+ :type _content_type: str, Optional
764
+ :param _headers: set to override the headers for a single
765
+ request; this effectively ignores the headers
766
+ in the spec for a single request.
767
+ :type _headers: dict, optional
768
+ :param _host_index: set to override the host_index for a single
769
+ request; this effectively ignores the host_index
770
+ in the spec for a single request.
771
+ :type _host_index: int, optional
772
+ :return: Returns the result object.
773
+ """ # noqa: E501
774
+
775
+ _param = self._get_exchange_mappings_serialize(
776
+ market=market,
777
+ exchange_name=exchange_name,
778
+ _request_auth=_request_auth,
779
+ _content_type=_content_type,
780
+ _headers=_headers,
781
+ _host_index=_host_index,
782
+ )
783
+
784
+ _response_types_map: Dict[str, Optional[str]] = {
785
+ "200": "BaseResponseListExchangeMapping",
786
+ "400": "ErrorResponse",
787
+ "404": "ErrorResponse",
788
+ "500": "ErrorResponse",
789
+ "422": "HTTPValidationError",
790
+ }
791
+ response_data = await self.api_client.call_api(
792
+ *_param, _request_timeout=_request_timeout
793
+ )
794
+ await response_data.read()
795
+ return self.api_client.response_deserialize(
796
+ response_data=response_data,
797
+ response_types_map=_response_types_map,
798
+ ).data
799
+
800
+ @validate_call
801
+ async def get_exchange_mappings_with_http_info(
802
+ self,
803
+ market: Annotated[Market, Field(description="Market type (spot or futures)")],
804
+ exchange_name: Annotated[
805
+ Optional[StrictStr],
806
+ Field(description="Exchange name for which to fetch exchange mappings"),
807
+ ] = None,
808
+ _request_timeout: Union[
809
+ None,
810
+ Annotated[StrictFloat, Field(gt=0)],
811
+ Tuple[
812
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
813
+ ],
814
+ ] = None,
815
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
816
+ _content_type: Optional[StrictStr] = None,
817
+ _headers: Optional[Dict[StrictStr, Any]] = None,
818
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
819
+ ) -> ApiResponse[BaseResponseListExchangeMapping]:
820
+ """Get Exchange Mappings
821
+
822
+ Get exchange mappings for a market with optional exchange name filter.
823
+
824
+ :param market: Market type (spot or futures) (required)
825
+ :type market: Market
826
+ :param exchange_name: Exchange name for which to fetch exchange mappings
827
+ :type exchange_name: str
828
+ :param _request_timeout: timeout setting for this request. If one
829
+ number provided, it will be total request
830
+ timeout. It can also be a pair (tuple) of
831
+ (connection, read) timeouts.
832
+ :type _request_timeout: int, tuple(int, int), optional
833
+ :param _request_auth: set to override the auth_settings for an a single
834
+ request; this effectively ignores the
835
+ authentication in the spec for a single request.
836
+ :type _request_auth: dict, optional
837
+ :param _content_type: force content-type for the request.
838
+ :type _content_type: str, Optional
839
+ :param _headers: set to override the headers for a single
840
+ request; this effectively ignores the headers
841
+ in the spec for a single request.
842
+ :type _headers: dict, optional
843
+ :param _host_index: set to override the host_index for a single
844
+ request; this effectively ignores the host_index
845
+ in the spec for a single request.
846
+ :type _host_index: int, optional
847
+ :return: Returns the result object.
848
+ """ # noqa: E501
849
+
850
+ _param = self._get_exchange_mappings_serialize(
851
+ market=market,
852
+ exchange_name=exchange_name,
853
+ _request_auth=_request_auth,
854
+ _content_type=_content_type,
855
+ _headers=_headers,
856
+ _host_index=_host_index,
857
+ )
858
+
859
+ _response_types_map: Dict[str, Optional[str]] = {
860
+ "200": "BaseResponseListExchangeMapping",
861
+ "400": "ErrorResponse",
862
+ "404": "ErrorResponse",
863
+ "500": "ErrorResponse",
864
+ "422": "HTTPValidationError",
865
+ }
866
+ response_data = await self.api_client.call_api(
867
+ *_param, _request_timeout=_request_timeout
868
+ )
869
+ await response_data.read()
870
+ return self.api_client.response_deserialize(
871
+ response_data=response_data,
872
+ response_types_map=_response_types_map,
873
+ )
874
+
875
+ @validate_call
876
+ async def get_exchange_mappings_without_preload_content(
877
+ self,
878
+ market: Annotated[Market, Field(description="Market type (spot or futures)")],
879
+ exchange_name: Annotated[
880
+ Optional[StrictStr],
881
+ Field(description="Exchange name for which to fetch exchange mappings"),
882
+ ] = None,
883
+ _request_timeout: Union[
884
+ None,
885
+ Annotated[StrictFloat, Field(gt=0)],
886
+ Tuple[
887
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
888
+ ],
889
+ ] = None,
890
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
891
+ _content_type: Optional[StrictStr] = None,
892
+ _headers: Optional[Dict[StrictStr, Any]] = None,
893
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
894
+ ) -> RESTResponseType:
895
+ """Get Exchange Mappings
896
+
897
+ Get exchange mappings for a market with optional exchange name filter.
898
+
899
+ :param market: Market type (spot or futures) (required)
900
+ :type market: Market
901
+ :param exchange_name: Exchange name for which to fetch exchange mappings
902
+ :type exchange_name: str
903
+ :param _request_timeout: timeout setting for this request. If one
904
+ number provided, it will be total request
905
+ timeout. It can also be a pair (tuple) of
906
+ (connection, read) timeouts.
907
+ :type _request_timeout: int, tuple(int, int), optional
908
+ :param _request_auth: set to override the auth_settings for an a single
909
+ request; this effectively ignores the
910
+ authentication in the spec for a single request.
911
+ :type _request_auth: dict, optional
912
+ :param _content_type: force content-type for the request.
913
+ :type _content_type: str, Optional
914
+ :param _headers: set to override the headers for a single
915
+ request; this effectively ignores the headers
916
+ in the spec for a single request.
917
+ :type _headers: dict, optional
918
+ :param _host_index: set to override the host_index for a single
919
+ request; this effectively ignores the host_index
920
+ in the spec for a single request.
921
+ :type _host_index: int, optional
922
+ :return: Returns the result object.
923
+ """ # noqa: E501
924
+
925
+ _param = self._get_exchange_mappings_serialize(
926
+ market=market,
927
+ exchange_name=exchange_name,
928
+ _request_auth=_request_auth,
929
+ _content_type=_content_type,
930
+ _headers=_headers,
931
+ _host_index=_host_index,
932
+ )
933
+
934
+ _response_types_map: Dict[str, Optional[str]] = {
935
+ "200": "BaseResponseListExchangeMapping",
936
+ "400": "ErrorResponse",
937
+ "404": "ErrorResponse",
938
+ "500": "ErrorResponse",
939
+ "422": "HTTPValidationError",
940
+ }
941
+ response_data = await self.api_client.call_api(
942
+ *_param, _request_timeout=_request_timeout
943
+ )
944
+ return response_data.response
945
+
946
+ def _get_exchange_mappings_serialize(
947
+ self,
948
+ market,
949
+ exchange_name,
950
+ _request_auth,
951
+ _content_type,
952
+ _headers,
953
+ _host_index,
954
+ ) -> RequestSerialized:
955
+
956
+ _host = None
957
+
958
+ _collection_formats: Dict[str, str] = {}
959
+
960
+ _path_params: Dict[str, str] = {}
961
+ _query_params: List[Tuple[str, str]] = []
962
+ _header_params: Dict[str, Optional[str]] = _headers or {}
963
+ _form_params: List[Tuple[str, str]] = []
964
+ _files: Dict[
965
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
966
+ ] = {}
967
+ _body_params: Optional[bytes] = None
968
+
969
+ # process the path parameters
970
+ if market is not None:
971
+ _path_params["market"] = market.value
972
+ # process the query parameters
973
+ if exchange_name is not None:
974
+
975
+ _query_params.append(("exchange_name", exchange_name))
976
+
977
+ # process the header parameters
978
+ # process the form parameters
979
+ # process the body parameter
980
+
981
+ # set the HTTP header `Accept`
982
+ if "Accept" not in _header_params:
983
+ _header_params["Accept"] = self.api_client.select_header_accept(
984
+ ["application/json"]
985
+ )
986
+
987
+ # authentication setting
988
+ _auth_settings: List[str] = []
989
+
990
+ return self.api_client.param_serialize(
991
+ method="GET",
992
+ resource_path="/exchange_mappings/{market}",
993
+ path_params=_path_params,
994
+ query_params=_query_params,
995
+ header_params=_header_params,
996
+ body=_body_params,
997
+ post_params=_form_params,
998
+ files=_files,
999
+ auth_settings=_auth_settings,
1000
+ collection_formats=_collection_formats,
1001
+ _host=_host,
1002
+ _request_auth=_request_auth,
1003
+ )