crypticorn 2.17.0rc1__py3-none-any.whl → 2.17.0rc2__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.
- crypticorn/__init__.py +2 -2
- crypticorn/auth/client/api/admin_api.py +415 -13
- crypticorn/auth/client/api/auth_api.py +2622 -113
- crypticorn/auth/client/api/service_api.py +258 -7
- crypticorn/auth/client/api/user_api.py +2485 -270
- crypticorn/auth/client/api/wallet_api.py +1518 -77
- crypticorn/auth/client/models/create_api_key_request.py +2 -1
- crypticorn/auth/client/models/get_api_keys200_response_inner.py +2 -1
- crypticorn/auth/client/rest.py +23 -4
- crypticorn/auth/main.py +8 -5
- crypticorn/client.py +227 -59
- crypticorn/common/__init__.py +0 -1
- crypticorn/common/metrics.py +4 -6
- crypticorn/common/middleware.py +10 -5
- crypticorn/common/pagination.py +137 -18
- crypticorn/common/router/admin_router.py +1 -1
- crypticorn/common/utils.py +2 -1
- crypticorn/common/warnings.py +1 -0
- crypticorn/hive/client/api/admin_api.py +1234 -51
- crypticorn/hive/client/api/data_api.py +517 -13
- crypticorn/hive/client/api/models_api.py +1657 -83
- crypticorn/hive/client/api/status_api.py +415 -13
- crypticorn/hive/client/models/api_error_identifier.py +1 -1
- crypticorn/hive/client/rest.py +23 -4
- crypticorn/hive/main.py +99 -25
- crypticorn/klines/client/api/admin_api.py +1234 -51
- crypticorn/klines/client/api/change_in_timeframe_api.py +278 -7
- crypticorn/klines/client/api/funding_rates_api.py +324 -7
- crypticorn/klines/client/api/ohlcv_data_api.py +399 -7
- crypticorn/klines/client/api/status_api.py +415 -13
- crypticorn/klines/client/api/symbols_api.py +225 -7
- crypticorn/klines/client/api/udf_api.py +1393 -120
- crypticorn/klines/client/models/api_error_identifier.py +3 -1
- crypticorn/klines/client/rest.py +23 -4
- crypticorn/klines/main.py +89 -12
- crypticorn/metrics/client/api/admin_api.py +1234 -51
- crypticorn/metrics/client/api/exchanges_api.py +1405 -140
- crypticorn/metrics/client/api/indicators_api.py +640 -13
- crypticorn/metrics/client/api/logs_api.py +305 -7
- crypticorn/metrics/client/api/marketcap_api.py +1240 -60
- crypticorn/metrics/client/api/markets_api.py +352 -7
- crypticorn/metrics/client/api/quote_currencies_api.py +237 -7
- crypticorn/metrics/client/api/status_api.py +415 -13
- crypticorn/metrics/client/api/tokens_api.py +400 -13
- crypticorn/metrics/client/configuration.py +4 -2
- crypticorn/metrics/client/rest.py +23 -4
- crypticorn/metrics/main.py +113 -19
- crypticorn/pay/client/api/admin_api.py +1720 -126
- crypticorn/pay/client/api/now_payments_api.py +1013 -42
- crypticorn/pay/client/api/payments_api.py +580 -13
- crypticorn/pay/client/api/products_api.py +915 -25
- crypticorn/pay/client/api/status_api.py +415 -13
- crypticorn/pay/client/configuration.py +2 -2
- crypticorn/pay/client/models/api_error_identifier.py +7 -7
- crypticorn/pay/client/models/scope.py +1 -0
- crypticorn/pay/client/rest.py +23 -4
- crypticorn/pay/main.py +10 -6
- crypticorn/trade/client/__init__.py +2 -1
- crypticorn/trade/client/api/__init__.py +0 -1
- crypticorn/trade/client/api/admin_api.py +1718 -123
- crypticorn/trade/client/api/api_keys_api.py +1596 -103
- crypticorn/trade/client/api/bots_api.py +1106 -47
- crypticorn/trade/client/api/exchanges_api.py +592 -19
- crypticorn/trade/client/api/notifications_api.py +1340 -112
- crypticorn/trade/client/api/orders_api.py +240 -7
- crypticorn/trade/client/api/status_api.py +415 -13
- crypticorn/trade/client/api/strategies_api.py +1170 -69
- crypticorn/trade/client/api/trading_actions_api.py +650 -19
- crypticorn/trade/client/models/__init__.py +2 -0
- crypticorn/trade/client/models/exchange.py +6 -1
- crypticorn/trade/client/models/exchange_key_balance.py +111 -0
- crypticorn/trade/client/models/futures_balance.py +27 -25
- crypticorn/trade/client/models/spot_balance.py +110 -0
- crypticorn/trade/client/models/strategy.py +5 -3
- crypticorn/trade/client/models/strategy_create.py +6 -4
- crypticorn/trade/client/models/strategy_exchange_info.py +16 -4
- crypticorn/trade/client/models/strategy_update.py +2 -2
- crypticorn/trade/client/rest.py +23 -4
- crypticorn/trade/main.py +15 -12
- {crypticorn-2.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/METADATA +64 -20
- {crypticorn-2.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/RECORD +85 -84
- crypticorn/trade/client/api/futures_trading_panel_api.py +0 -1285
- {crypticorn-2.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/WHEEL +0 -0
- {crypticorn-2.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/licenses/LICENSE +0 -0
- {crypticorn-2.17.0rc1.dist-info → crypticorn-2.17.0rc2.dist-info}/top_level.txt +0 -0
@@ -30,6 +30,24 @@ from crypticorn.metrics.client.api_client import ApiClient, RequestSerialized
|
|
30
30
|
from crypticorn.metrics.client.api_response import ApiResponse
|
31
31
|
from crypticorn.metrics.client.rest import RESTResponseType
|
32
32
|
|
33
|
+
# Import async_to_sync for sync methods
|
34
|
+
try:
|
35
|
+
from asgiref.sync import async_to_sync
|
36
|
+
|
37
|
+
_HAS_ASGIREF = True
|
38
|
+
except ImportError:
|
39
|
+
_HAS_ASGIREF = False
|
40
|
+
|
41
|
+
def async_to_sync(async_func):
|
42
|
+
"""Fallback decorator that raises an error if asgiref is not available."""
|
43
|
+
|
44
|
+
def wrapper(*args, **kwargs):
|
45
|
+
raise ImportError(
|
46
|
+
"asgiref is required for sync methods. Install with: pip install asgiref"
|
47
|
+
)
|
48
|
+
|
49
|
+
return wrapper
|
50
|
+
|
33
51
|
|
34
52
|
class ExchangesApi:
|
35
53
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
@@ -38,13 +56,264 @@ class ExchangesApi:
|
|
38
56
|
Do not edit the class manually.
|
39
57
|
"""
|
40
58
|
|
41
|
-
def __init__(self, api_client=None) -> None:
|
59
|
+
def __init__(self, api_client=None, is_sync: bool = False) -> None:
|
42
60
|
if api_client is None:
|
43
61
|
api_client = ApiClient.get_default()
|
44
62
|
self.api_client = api_client
|
63
|
+
self.is_sync = is_sync
|
64
|
+
|
65
|
+
@validate_call
|
66
|
+
def get_available_exchanges(
|
67
|
+
self,
|
68
|
+
market: Annotated[
|
69
|
+
MarketType, Field(description="Market type (spot or futures)")
|
70
|
+
],
|
71
|
+
symbol: Annotated[
|
72
|
+
StrictStr, Field(description="Symbol to fetch available exchanges for")
|
73
|
+
],
|
74
|
+
interval: Annotated[
|
75
|
+
Optional[TimeInterval],
|
76
|
+
Field(description="Interval for which to fetch available exchanges"),
|
77
|
+
] = None,
|
78
|
+
start_timestamp: Annotated[
|
79
|
+
Optional[StrictInt],
|
80
|
+
Field(
|
81
|
+
description="Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)"
|
82
|
+
),
|
83
|
+
] = None,
|
84
|
+
end_timestamp: Annotated[
|
85
|
+
Optional[StrictInt],
|
86
|
+
Field(description="End timestamp for which to fetch available exchanges"),
|
87
|
+
] = None,
|
88
|
+
quote_currency: Annotated[
|
89
|
+
Optional[StrictStr],
|
90
|
+
Field(
|
91
|
+
description="Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)"
|
92
|
+
),
|
93
|
+
] = None,
|
94
|
+
status: Annotated[
|
95
|
+
Optional[TradingStatus],
|
96
|
+
Field(
|
97
|
+
description="Trading pair status for which to fetch available exchanges"
|
98
|
+
),
|
99
|
+
] = None,
|
100
|
+
_request_timeout: Union[
|
101
|
+
None,
|
102
|
+
Annotated[StrictFloat, Field(gt=0)],
|
103
|
+
Tuple[
|
104
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
105
|
+
],
|
106
|
+
] = None,
|
107
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
108
|
+
_content_type: Optional[StrictStr] = None,
|
109
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
110
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
111
|
+
) -> List[ExchangeAvailability]:
|
112
|
+
"""Get Available Exchanges
|
113
|
+
|
114
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
115
|
+
"""
|
116
|
+
if self.is_sync:
|
117
|
+
return self._get_available_exchanges_sync(
|
118
|
+
market=market,
|
119
|
+
symbol=symbol,
|
120
|
+
interval=interval,
|
121
|
+
start_timestamp=start_timestamp,
|
122
|
+
end_timestamp=end_timestamp,
|
123
|
+
quote_currency=quote_currency,
|
124
|
+
status=status,
|
125
|
+
_request_timeout=_request_timeout,
|
126
|
+
_request_auth=_request_auth,
|
127
|
+
_content_type=_content_type,
|
128
|
+
_headers=_headers,
|
129
|
+
_host_index=_host_index,
|
130
|
+
)
|
131
|
+
|
132
|
+
else:
|
133
|
+
return self._get_available_exchanges_async(
|
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_timeout=_request_timeout,
|
142
|
+
_request_auth=_request_auth,
|
143
|
+
_content_type=_content_type,
|
144
|
+
_headers=_headers,
|
145
|
+
_host_index=_host_index,
|
146
|
+
)
|
147
|
+
|
148
|
+
@validate_call
|
149
|
+
def get_available_exchanges_with_http_info(
|
150
|
+
self,
|
151
|
+
market: Annotated[
|
152
|
+
MarketType, Field(description="Market type (spot or futures)")
|
153
|
+
],
|
154
|
+
symbol: Annotated[
|
155
|
+
StrictStr, Field(description="Symbol to fetch available exchanges for")
|
156
|
+
],
|
157
|
+
interval: Annotated[
|
158
|
+
Optional[TimeInterval],
|
159
|
+
Field(description="Interval for which to fetch available exchanges"),
|
160
|
+
] = None,
|
161
|
+
start_timestamp: Annotated[
|
162
|
+
Optional[StrictInt],
|
163
|
+
Field(
|
164
|
+
description="Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)"
|
165
|
+
),
|
166
|
+
] = None,
|
167
|
+
end_timestamp: Annotated[
|
168
|
+
Optional[StrictInt],
|
169
|
+
Field(description="End timestamp for which to fetch available exchanges"),
|
170
|
+
] = None,
|
171
|
+
quote_currency: Annotated[
|
172
|
+
Optional[StrictStr],
|
173
|
+
Field(
|
174
|
+
description="Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)"
|
175
|
+
),
|
176
|
+
] = None,
|
177
|
+
status: Annotated[
|
178
|
+
Optional[TradingStatus],
|
179
|
+
Field(
|
180
|
+
description="Trading pair status for which to fetch available exchanges"
|
181
|
+
),
|
182
|
+
] = None,
|
183
|
+
_request_timeout: Union[
|
184
|
+
None,
|
185
|
+
Annotated[StrictFloat, Field(gt=0)],
|
186
|
+
Tuple[
|
187
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
188
|
+
],
|
189
|
+
] = None,
|
190
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
191
|
+
_content_type: Optional[StrictStr] = None,
|
192
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
193
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
194
|
+
) -> ApiResponse[List[ExchangeAvailability]]:
|
195
|
+
"""Get Available Exchanges with HTTP info
|
196
|
+
|
197
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
198
|
+
"""
|
199
|
+
if self.is_sync:
|
200
|
+
return self._get_available_exchanges_sync_with_http_info(
|
201
|
+
market=market,
|
202
|
+
symbol=symbol,
|
203
|
+
interval=interval,
|
204
|
+
start_timestamp=start_timestamp,
|
205
|
+
end_timestamp=end_timestamp,
|
206
|
+
quote_currency=quote_currency,
|
207
|
+
status=status,
|
208
|
+
_request_timeout=_request_timeout,
|
209
|
+
_request_auth=_request_auth,
|
210
|
+
_content_type=_content_type,
|
211
|
+
_headers=_headers,
|
212
|
+
_host_index=_host_index,
|
213
|
+
)
|
214
|
+
|
215
|
+
else:
|
216
|
+
return self._get_available_exchanges_async_with_http_info(
|
217
|
+
market=market,
|
218
|
+
symbol=symbol,
|
219
|
+
interval=interval,
|
220
|
+
start_timestamp=start_timestamp,
|
221
|
+
end_timestamp=end_timestamp,
|
222
|
+
quote_currency=quote_currency,
|
223
|
+
status=status,
|
224
|
+
_request_timeout=_request_timeout,
|
225
|
+
_request_auth=_request_auth,
|
226
|
+
_content_type=_content_type,
|
227
|
+
_headers=_headers,
|
228
|
+
_host_index=_host_index,
|
229
|
+
)
|
230
|
+
|
231
|
+
@validate_call
|
232
|
+
def get_available_exchanges_without_preload_content(
|
233
|
+
self,
|
234
|
+
market: Annotated[
|
235
|
+
MarketType, Field(description="Market type (spot or futures)")
|
236
|
+
],
|
237
|
+
symbol: Annotated[
|
238
|
+
StrictStr, Field(description="Symbol to fetch available exchanges for")
|
239
|
+
],
|
240
|
+
interval: Annotated[
|
241
|
+
Optional[TimeInterval],
|
242
|
+
Field(description="Interval for which to fetch available exchanges"),
|
243
|
+
] = None,
|
244
|
+
start_timestamp: Annotated[
|
245
|
+
Optional[StrictInt],
|
246
|
+
Field(
|
247
|
+
description="Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)"
|
248
|
+
),
|
249
|
+
] = None,
|
250
|
+
end_timestamp: Annotated[
|
251
|
+
Optional[StrictInt],
|
252
|
+
Field(description="End timestamp for which to fetch available exchanges"),
|
253
|
+
] = None,
|
254
|
+
quote_currency: Annotated[
|
255
|
+
Optional[StrictStr],
|
256
|
+
Field(
|
257
|
+
description="Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)"
|
258
|
+
),
|
259
|
+
] = None,
|
260
|
+
status: Annotated[
|
261
|
+
Optional[TradingStatus],
|
262
|
+
Field(
|
263
|
+
description="Trading pair status for which to fetch available exchanges"
|
264
|
+
),
|
265
|
+
] = None,
|
266
|
+
_request_timeout: Union[
|
267
|
+
None,
|
268
|
+
Annotated[StrictFloat, Field(gt=0)],
|
269
|
+
Tuple[
|
270
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
271
|
+
],
|
272
|
+
] = None,
|
273
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
274
|
+
_content_type: Optional[StrictStr] = None,
|
275
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
276
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
277
|
+
) -> RESTResponseType:
|
278
|
+
"""Get Available Exchanges without preloading content
|
279
|
+
|
280
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
281
|
+
"""
|
282
|
+
if self.is_sync:
|
283
|
+
return self._get_available_exchanges_sync_without_preload_content(
|
284
|
+
market=market,
|
285
|
+
symbol=symbol,
|
286
|
+
interval=interval,
|
287
|
+
start_timestamp=start_timestamp,
|
288
|
+
end_timestamp=end_timestamp,
|
289
|
+
quote_currency=quote_currency,
|
290
|
+
status=status,
|
291
|
+
_request_timeout=_request_timeout,
|
292
|
+
_request_auth=_request_auth,
|
293
|
+
_content_type=_content_type,
|
294
|
+
_headers=_headers,
|
295
|
+
_host_index=_host_index,
|
296
|
+
)
|
45
297
|
|
298
|
+
else:
|
299
|
+
return self._get_available_exchanges_async_without_preload_content(
|
300
|
+
market=market,
|
301
|
+
symbol=symbol,
|
302
|
+
interval=interval,
|
303
|
+
start_timestamp=start_timestamp,
|
304
|
+
end_timestamp=end_timestamp,
|
305
|
+
quote_currency=quote_currency,
|
306
|
+
status=status,
|
307
|
+
_request_timeout=_request_timeout,
|
308
|
+
_request_auth=_request_auth,
|
309
|
+
_content_type=_content_type,
|
310
|
+
_headers=_headers,
|
311
|
+
_host_index=_host_index,
|
312
|
+
)
|
313
|
+
|
314
|
+
# Private async implementation methods
|
46
315
|
@validate_call
|
47
|
-
async def
|
316
|
+
async def _get_available_exchanges_async(
|
48
317
|
self,
|
49
318
|
market: Annotated[
|
50
319
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -157,7 +426,7 @@ class ExchangesApi:
|
|
157
426
|
).data
|
158
427
|
|
159
428
|
@validate_call
|
160
|
-
async def
|
429
|
+
async def _get_available_exchanges_async_with_http_info(
|
161
430
|
self,
|
162
431
|
market: Annotated[
|
163
432
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -265,12 +534,11 @@ class ExchangesApi:
|
|
265
534
|
)
|
266
535
|
await response_data.read()
|
267
536
|
return self.api_client.response_deserialize(
|
268
|
-
response_data=response_data,
|
269
|
-
response_types_map=_response_types_map,
|
537
|
+
response_data=response_data, response_types_map=_response_types_map
|
270
538
|
)
|
271
539
|
|
272
540
|
@validate_call
|
273
|
-
async def
|
541
|
+
async def _get_available_exchanges_async_without_preload_content(
|
274
542
|
self,
|
275
543
|
market: Annotated[
|
276
544
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -376,110 +644,433 @@ class ExchangesApi:
|
|
376
644
|
response_data = await self.api_client.call_api(
|
377
645
|
*_param, _request_timeout=_request_timeout
|
378
646
|
)
|
379
|
-
return response_data
|
380
|
-
|
381
|
-
def _get_available_exchanges_serialize(
|
382
|
-
self,
|
383
|
-
market,
|
384
|
-
symbol,
|
385
|
-
interval,
|
386
|
-
start_timestamp,
|
387
|
-
end_timestamp,
|
388
|
-
quote_currency,
|
389
|
-
status,
|
390
|
-
_request_auth,
|
391
|
-
_content_type,
|
392
|
-
_headers,
|
393
|
-
_host_index,
|
394
|
-
) -> RequestSerialized:
|
395
|
-
|
396
|
-
_host = None
|
397
|
-
|
398
|
-
_collection_formats: Dict[str, str] = {}
|
399
|
-
|
400
|
-
_path_params: Dict[str, str] = {}
|
401
|
-
_query_params: List[Tuple[str, str]] = []
|
402
|
-
_header_params: Dict[str, Optional[str]] = _headers or {}
|
403
|
-
_form_params: List[Tuple[str, str]] = []
|
404
|
-
_files: Dict[
|
405
|
-
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
406
|
-
] = {}
|
407
|
-
_body_params: Optional[bytes] = None
|
408
|
-
|
409
|
-
# process the path parameters
|
410
|
-
# process the query parameters
|
411
|
-
if market is not None:
|
412
|
-
|
413
|
-
_query_params.append(("market", market.value))
|
414
|
-
|
415
|
-
if symbol is not None:
|
416
|
-
|
417
|
-
_query_params.append(("symbol", symbol))
|
418
|
-
|
419
|
-
if interval is not None:
|
420
|
-
|
421
|
-
_query_params.append(("interval", interval.value))
|
422
|
-
|
423
|
-
if start_timestamp is not None:
|
424
|
-
|
425
|
-
_query_params.append(("start_timestamp", start_timestamp))
|
426
|
-
|
427
|
-
if end_timestamp is not None:
|
428
|
-
|
429
|
-
_query_params.append(("end_timestamp", end_timestamp))
|
430
|
-
|
431
|
-
if quote_currency is not None:
|
432
|
-
|
433
|
-
_query_params.append(("quote_currency", quote_currency))
|
434
|
-
|
435
|
-
if status is not None:
|
436
|
-
|
437
|
-
_query_params.append(("status", status.value))
|
438
|
-
|
439
|
-
# process the header parameters
|
440
|
-
# process the form parameters
|
441
|
-
# process the body parameter
|
442
|
-
|
443
|
-
# set the HTTP header `Accept`
|
444
|
-
if "Accept" not in _header_params:
|
445
|
-
_header_params["Accept"] = self.api_client.select_header_accept(
|
446
|
-
["application/json"]
|
447
|
-
)
|
448
|
-
|
449
|
-
# authentication setting
|
450
|
-
_auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
|
451
|
-
|
452
|
-
return self.api_client.param_serialize(
|
453
|
-
method="GET",
|
454
|
-
resource_path="/exchanges/available",
|
455
|
-
path_params=_path_params,
|
456
|
-
query_params=_query_params,
|
457
|
-
header_params=_header_params,
|
458
|
-
body=_body_params,
|
459
|
-
post_params=_form_params,
|
460
|
-
files=_files,
|
461
|
-
auth_settings=_auth_settings,
|
462
|
-
collection_formats=_collection_formats,
|
463
|
-
_host=_host,
|
464
|
-
_request_auth=_request_auth,
|
465
|
-
)
|
647
|
+
return response_data
|
466
648
|
|
649
|
+
# Private sync implementation methods
|
467
650
|
@validate_call
|
468
|
-
|
651
|
+
def _get_available_exchanges_sync(
|
469
652
|
self,
|
470
653
|
market: Annotated[
|
471
654
|
MarketType, Field(description="Market type (spot or futures)")
|
472
655
|
],
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
] = None,
|
480
|
-
|
481
|
-
|
482
|
-
|
656
|
+
symbol: Annotated[
|
657
|
+
StrictStr, Field(description="Symbol to fetch available exchanges for")
|
658
|
+
],
|
659
|
+
interval: Annotated[
|
660
|
+
Optional[TimeInterval],
|
661
|
+
Field(description="Interval for which to fetch available exchanges"),
|
662
|
+
] = None,
|
663
|
+
start_timestamp: Annotated[
|
664
|
+
Optional[StrictInt],
|
665
|
+
Field(
|
666
|
+
description="Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)"
|
667
|
+
),
|
668
|
+
] = None,
|
669
|
+
end_timestamp: Annotated[
|
670
|
+
Optional[StrictInt],
|
671
|
+
Field(description="End timestamp for which to fetch available exchanges"),
|
672
|
+
] = None,
|
673
|
+
quote_currency: Annotated[
|
674
|
+
Optional[StrictStr],
|
675
|
+
Field(
|
676
|
+
description="Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)"
|
677
|
+
),
|
678
|
+
] = None,
|
679
|
+
status: Annotated[
|
680
|
+
Optional[TradingStatus],
|
681
|
+
Field(
|
682
|
+
description="Trading pair status for which to fetch available exchanges"
|
683
|
+
),
|
684
|
+
] = None,
|
685
|
+
_request_timeout: Union[
|
686
|
+
None,
|
687
|
+
Annotated[StrictFloat, Field(gt=0)],
|
688
|
+
Tuple[
|
689
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
690
|
+
],
|
691
|
+
] = None,
|
692
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
693
|
+
_content_type: Optional[StrictStr] = None,
|
694
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
695
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
696
|
+
) -> List[ExchangeAvailability]:
|
697
|
+
"""Synchronous version of get_available_exchanges"""
|
698
|
+
return async_to_sync(self._get_available_exchanges_async)(
|
699
|
+
market=market,
|
700
|
+
symbol=symbol,
|
701
|
+
interval=interval,
|
702
|
+
start_timestamp=start_timestamp,
|
703
|
+
end_timestamp=end_timestamp,
|
704
|
+
quote_currency=quote_currency,
|
705
|
+
status=status,
|
706
|
+
_request_timeout=_request_timeout,
|
707
|
+
_request_auth=_request_auth,
|
708
|
+
_content_type=_content_type,
|
709
|
+
_headers=_headers,
|
710
|
+
_host_index=_host_index,
|
711
|
+
)
|
712
|
+
|
713
|
+
@validate_call
|
714
|
+
def _get_available_exchanges_sync_with_http_info(
|
715
|
+
self,
|
716
|
+
market: Annotated[
|
717
|
+
MarketType, Field(description="Market type (spot or futures)")
|
718
|
+
],
|
719
|
+
symbol: Annotated[
|
720
|
+
StrictStr, Field(description="Symbol to fetch available exchanges for")
|
721
|
+
],
|
722
|
+
interval: Annotated[
|
723
|
+
Optional[TimeInterval],
|
724
|
+
Field(description="Interval for which to fetch available exchanges"),
|
725
|
+
] = None,
|
726
|
+
start_timestamp: Annotated[
|
727
|
+
Optional[StrictInt],
|
728
|
+
Field(
|
729
|
+
description="Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)"
|
730
|
+
),
|
731
|
+
] = None,
|
732
|
+
end_timestamp: Annotated[
|
733
|
+
Optional[StrictInt],
|
734
|
+
Field(description="End timestamp for which to fetch available exchanges"),
|
735
|
+
] = None,
|
736
|
+
quote_currency: Annotated[
|
737
|
+
Optional[StrictStr],
|
738
|
+
Field(
|
739
|
+
description="Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)"
|
740
|
+
),
|
741
|
+
] = None,
|
742
|
+
status: Annotated[
|
743
|
+
Optional[TradingStatus],
|
744
|
+
Field(
|
745
|
+
description="Trading pair status for which to fetch available exchanges"
|
746
|
+
),
|
747
|
+
] = None,
|
748
|
+
_request_timeout: Union[
|
749
|
+
None,
|
750
|
+
Annotated[StrictFloat, Field(gt=0)],
|
751
|
+
Tuple[
|
752
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
753
|
+
],
|
754
|
+
] = None,
|
755
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
756
|
+
_content_type: Optional[StrictStr] = None,
|
757
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
758
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
759
|
+
) -> ApiResponse[List[ExchangeAvailability]]:
|
760
|
+
"""Synchronous version of get_available_exchanges_with_http_info"""
|
761
|
+
return async_to_sync(self._get_available_exchanges_async_with_http_info)(
|
762
|
+
market=market,
|
763
|
+
symbol=symbol,
|
764
|
+
interval=interval,
|
765
|
+
start_timestamp=start_timestamp,
|
766
|
+
end_timestamp=end_timestamp,
|
767
|
+
quote_currency=quote_currency,
|
768
|
+
status=status,
|
769
|
+
_request_timeout=_request_timeout,
|
770
|
+
_request_auth=_request_auth,
|
771
|
+
_content_type=_content_type,
|
772
|
+
_headers=_headers,
|
773
|
+
_host_index=_host_index,
|
774
|
+
)
|
775
|
+
|
776
|
+
@validate_call
|
777
|
+
def _get_available_exchanges_sync_without_preload_content(
|
778
|
+
self,
|
779
|
+
market: Annotated[
|
780
|
+
MarketType, Field(description="Market type (spot or futures)")
|
781
|
+
],
|
782
|
+
symbol: Annotated[
|
783
|
+
StrictStr, Field(description="Symbol to fetch available exchanges for")
|
784
|
+
],
|
785
|
+
interval: Annotated[
|
786
|
+
Optional[TimeInterval],
|
787
|
+
Field(description="Interval for which to fetch available exchanges"),
|
788
|
+
] = None,
|
789
|
+
start_timestamp: Annotated[
|
790
|
+
Optional[StrictInt],
|
791
|
+
Field(
|
792
|
+
description="Start timestamp for which to fetch available exchanges (defaults to previous 7 day's closing)"
|
793
|
+
),
|
794
|
+
] = None,
|
795
|
+
end_timestamp: Annotated[
|
796
|
+
Optional[StrictInt],
|
797
|
+
Field(description="End timestamp for which to fetch available exchanges"),
|
798
|
+
] = None,
|
799
|
+
quote_currency: Annotated[
|
800
|
+
Optional[StrictStr],
|
801
|
+
Field(
|
802
|
+
description="Quote currency for which to fetch available exchanges (Use quote currencies endpoint to get available quote currencies)"
|
803
|
+
),
|
804
|
+
] = None,
|
805
|
+
status: Annotated[
|
806
|
+
Optional[TradingStatus],
|
807
|
+
Field(
|
808
|
+
description="Trading pair status for which to fetch available exchanges"
|
809
|
+
),
|
810
|
+
] = None,
|
811
|
+
_request_timeout: Union[
|
812
|
+
None,
|
813
|
+
Annotated[StrictFloat, Field(gt=0)],
|
814
|
+
Tuple[
|
815
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
816
|
+
],
|
817
|
+
] = None,
|
818
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
819
|
+
_content_type: Optional[StrictStr] = None,
|
820
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
821
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
822
|
+
) -> RESTResponseType:
|
823
|
+
"""Synchronous version of get_available_exchanges_without_preload_content"""
|
824
|
+
return async_to_sync(
|
825
|
+
self._get_available_exchanges_async_without_preload_content
|
826
|
+
)(
|
827
|
+
market=market,
|
828
|
+
symbol=symbol,
|
829
|
+
interval=interval,
|
830
|
+
start_timestamp=start_timestamp,
|
831
|
+
end_timestamp=end_timestamp,
|
832
|
+
quote_currency=quote_currency,
|
833
|
+
status=status,
|
834
|
+
_request_timeout=_request_timeout,
|
835
|
+
_request_auth=_request_auth,
|
836
|
+
_content_type=_content_type,
|
837
|
+
_headers=_headers,
|
838
|
+
_host_index=_host_index,
|
839
|
+
)
|
840
|
+
|
841
|
+
def _get_available_exchanges_serialize(
|
842
|
+
self,
|
843
|
+
market,
|
844
|
+
symbol,
|
845
|
+
interval,
|
846
|
+
start_timestamp,
|
847
|
+
end_timestamp,
|
848
|
+
quote_currency,
|
849
|
+
status,
|
850
|
+
_request_auth,
|
851
|
+
_content_type,
|
852
|
+
_headers,
|
853
|
+
_host_index,
|
854
|
+
) -> RequestSerialized:
|
855
|
+
|
856
|
+
_host = None
|
857
|
+
|
858
|
+
_collection_formats: Dict[str, str] = {}
|
859
|
+
|
860
|
+
_path_params: Dict[str, str] = {}
|
861
|
+
_query_params: List[Tuple[str, str]] = []
|
862
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
863
|
+
_form_params: List[Tuple[str, str]] = []
|
864
|
+
_files: Dict[
|
865
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
866
|
+
] = {}
|
867
|
+
_body_params: Optional[bytes] = None
|
868
|
+
|
869
|
+
# process the path parameters
|
870
|
+
# process the query parameters
|
871
|
+
if market is not None:
|
872
|
+
|
873
|
+
_query_params.append(("market", market.value))
|
874
|
+
|
875
|
+
if symbol is not None:
|
876
|
+
|
877
|
+
_query_params.append(("symbol", symbol))
|
878
|
+
|
879
|
+
if interval is not None:
|
880
|
+
|
881
|
+
_query_params.append(("interval", interval.value))
|
882
|
+
|
883
|
+
if start_timestamp is not None:
|
884
|
+
|
885
|
+
_query_params.append(("start_timestamp", start_timestamp))
|
886
|
+
|
887
|
+
if end_timestamp is not None:
|
888
|
+
|
889
|
+
_query_params.append(("end_timestamp", end_timestamp))
|
890
|
+
|
891
|
+
if quote_currency is not None:
|
892
|
+
|
893
|
+
_query_params.append(("quote_currency", quote_currency))
|
894
|
+
|
895
|
+
if status is not None:
|
896
|
+
|
897
|
+
_query_params.append(("status", status.value))
|
898
|
+
|
899
|
+
# process the header parameters
|
900
|
+
# process the form parameters
|
901
|
+
# process the body parameter
|
902
|
+
|
903
|
+
# set the HTTP header `Accept`
|
904
|
+
if "Accept" not in _header_params:
|
905
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
906
|
+
["application/json"]
|
907
|
+
)
|
908
|
+
|
909
|
+
# authentication setting
|
910
|
+
_auth_settings: List[str] = ["APIKeyHeader", "HTTPBearer"]
|
911
|
+
|
912
|
+
return self.api_client.param_serialize(
|
913
|
+
method="GET",
|
914
|
+
resource_path="/exchanges/available",
|
915
|
+
path_params=_path_params,
|
916
|
+
query_params=_query_params,
|
917
|
+
header_params=_header_params,
|
918
|
+
body=_body_params,
|
919
|
+
post_params=_form_params,
|
920
|
+
files=_files,
|
921
|
+
auth_settings=_auth_settings,
|
922
|
+
collection_formats=_collection_formats,
|
923
|
+
_host=_host,
|
924
|
+
_request_auth=_request_auth,
|
925
|
+
)
|
926
|
+
|
927
|
+
@validate_call
|
928
|
+
def get_available_exchanges_for_market(
|
929
|
+
self,
|
930
|
+
market: Annotated[
|
931
|
+
MarketType, Field(description="Market type (spot or futures)")
|
932
|
+
],
|
933
|
+
_request_timeout: Union[
|
934
|
+
None,
|
935
|
+
Annotated[StrictFloat, Field(gt=0)],
|
936
|
+
Tuple[
|
937
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
938
|
+
],
|
939
|
+
] = None,
|
940
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
941
|
+
_content_type: Optional[StrictStr] = None,
|
942
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
943
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
944
|
+
) -> List[str]:
|
945
|
+
"""Get Exchange List
|
946
|
+
|
947
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
948
|
+
"""
|
949
|
+
if self.is_sync:
|
950
|
+
return self._get_available_exchanges_for_market_sync(
|
951
|
+
market=market,
|
952
|
+
_request_timeout=_request_timeout,
|
953
|
+
_request_auth=_request_auth,
|
954
|
+
_content_type=_content_type,
|
955
|
+
_headers=_headers,
|
956
|
+
_host_index=_host_index,
|
957
|
+
)
|
958
|
+
|
959
|
+
else:
|
960
|
+
return self._get_available_exchanges_for_market_async(
|
961
|
+
market=market,
|
962
|
+
_request_timeout=_request_timeout,
|
963
|
+
_request_auth=_request_auth,
|
964
|
+
_content_type=_content_type,
|
965
|
+
_headers=_headers,
|
966
|
+
_host_index=_host_index,
|
967
|
+
)
|
968
|
+
|
969
|
+
@validate_call
|
970
|
+
def get_available_exchanges_for_market_with_http_info(
|
971
|
+
self,
|
972
|
+
market: Annotated[
|
973
|
+
MarketType, Field(description="Market type (spot or futures)")
|
974
|
+
],
|
975
|
+
_request_timeout: Union[
|
976
|
+
None,
|
977
|
+
Annotated[StrictFloat, Field(gt=0)],
|
978
|
+
Tuple[
|
979
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
980
|
+
],
|
981
|
+
] = None,
|
982
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
983
|
+
_content_type: Optional[StrictStr] = None,
|
984
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
985
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
986
|
+
) -> ApiResponse[List[str]]:
|
987
|
+
"""Get Exchange List with HTTP info
|
988
|
+
|
989
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
990
|
+
"""
|
991
|
+
if self.is_sync:
|
992
|
+
return self._get_available_exchanges_for_market_sync_with_http_info(
|
993
|
+
market=market,
|
994
|
+
_request_timeout=_request_timeout,
|
995
|
+
_request_auth=_request_auth,
|
996
|
+
_content_type=_content_type,
|
997
|
+
_headers=_headers,
|
998
|
+
_host_index=_host_index,
|
999
|
+
)
|
1000
|
+
|
1001
|
+
else:
|
1002
|
+
return self._get_available_exchanges_for_market_async_with_http_info(
|
1003
|
+
market=market,
|
1004
|
+
_request_timeout=_request_timeout,
|
1005
|
+
_request_auth=_request_auth,
|
1006
|
+
_content_type=_content_type,
|
1007
|
+
_headers=_headers,
|
1008
|
+
_host_index=_host_index,
|
1009
|
+
)
|
1010
|
+
|
1011
|
+
@validate_call
|
1012
|
+
def get_available_exchanges_for_market_without_preload_content(
|
1013
|
+
self,
|
1014
|
+
market: Annotated[
|
1015
|
+
MarketType, Field(description="Market type (spot or futures)")
|
1016
|
+
],
|
1017
|
+
_request_timeout: Union[
|
1018
|
+
None,
|
1019
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1020
|
+
Tuple[
|
1021
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1022
|
+
],
|
1023
|
+
] = None,
|
1024
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1025
|
+
_content_type: Optional[StrictStr] = None,
|
1026
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1027
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1028
|
+
) -> RESTResponseType:
|
1029
|
+
"""Get Exchange List without preloading content
|
1030
|
+
|
1031
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
1032
|
+
"""
|
1033
|
+
if self.is_sync:
|
1034
|
+
return (
|
1035
|
+
self._get_available_exchanges_for_market_sync_without_preload_content(
|
1036
|
+
market=market,
|
1037
|
+
_request_timeout=_request_timeout,
|
1038
|
+
_request_auth=_request_auth,
|
1039
|
+
_content_type=_content_type,
|
1040
|
+
_headers=_headers,
|
1041
|
+
_host_index=_host_index,
|
1042
|
+
)
|
1043
|
+
)
|
1044
|
+
|
1045
|
+
else:
|
1046
|
+
return (
|
1047
|
+
self._get_available_exchanges_for_market_async_without_preload_content(
|
1048
|
+
market=market,
|
1049
|
+
_request_timeout=_request_timeout,
|
1050
|
+
_request_auth=_request_auth,
|
1051
|
+
_content_type=_content_type,
|
1052
|
+
_headers=_headers,
|
1053
|
+
_host_index=_host_index,
|
1054
|
+
)
|
1055
|
+
)
|
1056
|
+
|
1057
|
+
# Private async implementation methods
|
1058
|
+
@validate_call
|
1059
|
+
async def _get_available_exchanges_for_market_async(
|
1060
|
+
self,
|
1061
|
+
market: Annotated[
|
1062
|
+
MarketType, Field(description="Market type (spot or futures)")
|
1063
|
+
],
|
1064
|
+
_request_timeout: Union[
|
1065
|
+
None,
|
1066
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1067
|
+
Tuple[
|
1068
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1069
|
+
],
|
1070
|
+
] = None,
|
1071
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1072
|
+
_content_type: Optional[StrictStr] = None,
|
1073
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
483
1074
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
484
1075
|
) -> List[str]:
|
485
1076
|
"""Get Exchange List
|
@@ -531,7 +1122,7 @@ class ExchangesApi:
|
|
531
1122
|
).data
|
532
1123
|
|
533
1124
|
@validate_call
|
534
|
-
async def
|
1125
|
+
async def _get_available_exchanges_for_market_async_with_http_info(
|
535
1126
|
self,
|
536
1127
|
market: Annotated[
|
537
1128
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -592,12 +1183,11 @@ class ExchangesApi:
|
|
592
1183
|
)
|
593
1184
|
await response_data.read()
|
594
1185
|
return self.api_client.response_deserialize(
|
595
|
-
response_data=response_data,
|
596
|
-
response_types_map=_response_types_map,
|
1186
|
+
response_data=response_data, response_types_map=_response_types_map
|
597
1187
|
)
|
598
1188
|
|
599
1189
|
@validate_call
|
600
|
-
async def
|
1190
|
+
async def _get_available_exchanges_for_market_async_without_preload_content(
|
601
1191
|
self,
|
602
1192
|
market: Annotated[
|
603
1193
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -656,7 +1246,96 @@ class ExchangesApi:
|
|
656
1246
|
response_data = await self.api_client.call_api(
|
657
1247
|
*_param, _request_timeout=_request_timeout
|
658
1248
|
)
|
659
|
-
return response_data
|
1249
|
+
return response_data
|
1250
|
+
|
1251
|
+
# Private sync implementation methods
|
1252
|
+
@validate_call
|
1253
|
+
def _get_available_exchanges_for_market_sync(
|
1254
|
+
self,
|
1255
|
+
market: Annotated[
|
1256
|
+
MarketType, Field(description="Market type (spot or futures)")
|
1257
|
+
],
|
1258
|
+
_request_timeout: Union[
|
1259
|
+
None,
|
1260
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1261
|
+
Tuple[
|
1262
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1263
|
+
],
|
1264
|
+
] = None,
|
1265
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1266
|
+
_content_type: Optional[StrictStr] = None,
|
1267
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1268
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1269
|
+
) -> List[str]:
|
1270
|
+
"""Synchronous version of get_available_exchanges_for_market"""
|
1271
|
+
return async_to_sync(self._get_available_exchanges_for_market_async)(
|
1272
|
+
market=market,
|
1273
|
+
_request_timeout=_request_timeout,
|
1274
|
+
_request_auth=_request_auth,
|
1275
|
+
_content_type=_content_type,
|
1276
|
+
_headers=_headers,
|
1277
|
+
_host_index=_host_index,
|
1278
|
+
)
|
1279
|
+
|
1280
|
+
@validate_call
|
1281
|
+
def _get_available_exchanges_for_market_sync_with_http_info(
|
1282
|
+
self,
|
1283
|
+
market: Annotated[
|
1284
|
+
MarketType, Field(description="Market type (spot or futures)")
|
1285
|
+
],
|
1286
|
+
_request_timeout: Union[
|
1287
|
+
None,
|
1288
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1289
|
+
Tuple[
|
1290
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1291
|
+
],
|
1292
|
+
] = None,
|
1293
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1294
|
+
_content_type: Optional[StrictStr] = None,
|
1295
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1296
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1297
|
+
) -> ApiResponse[List[str]]:
|
1298
|
+
"""Synchronous version of get_available_exchanges_for_market_with_http_info"""
|
1299
|
+
return async_to_sync(
|
1300
|
+
self._get_available_exchanges_for_market_async_with_http_info
|
1301
|
+
)(
|
1302
|
+
market=market,
|
1303
|
+
_request_timeout=_request_timeout,
|
1304
|
+
_request_auth=_request_auth,
|
1305
|
+
_content_type=_content_type,
|
1306
|
+
_headers=_headers,
|
1307
|
+
_host_index=_host_index,
|
1308
|
+
)
|
1309
|
+
|
1310
|
+
@validate_call
|
1311
|
+
def _get_available_exchanges_for_market_sync_without_preload_content(
|
1312
|
+
self,
|
1313
|
+
market: Annotated[
|
1314
|
+
MarketType, Field(description="Market type (spot or futures)")
|
1315
|
+
],
|
1316
|
+
_request_timeout: Union[
|
1317
|
+
None,
|
1318
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1319
|
+
Tuple[
|
1320
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1321
|
+
],
|
1322
|
+
] = None,
|
1323
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1324
|
+
_content_type: Optional[StrictStr] = None,
|
1325
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1326
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1327
|
+
) -> RESTResponseType:
|
1328
|
+
"""Synchronous version of get_available_exchanges_for_market_without_preload_content"""
|
1329
|
+
return async_to_sync(
|
1330
|
+
self._get_available_exchanges_for_market_async_without_preload_content
|
1331
|
+
)(
|
1332
|
+
market=market,
|
1333
|
+
_request_timeout=_request_timeout,
|
1334
|
+
_request_auth=_request_auth,
|
1335
|
+
_content_type=_content_type,
|
1336
|
+
_headers=_headers,
|
1337
|
+
_host_index=_host_index,
|
1338
|
+
)
|
660
1339
|
|
661
1340
|
def _get_available_exchanges_for_market_serialize(
|
662
1341
|
self,
|
@@ -715,7 +1394,152 @@ class ExchangesApi:
|
|
715
1394
|
)
|
716
1395
|
|
717
1396
|
@validate_call
|
718
|
-
|
1397
|
+
def get_exchange_mappings(
|
1398
|
+
self,
|
1399
|
+
market: Annotated[
|
1400
|
+
MarketType, Field(description="Market type (spot or futures)")
|
1401
|
+
],
|
1402
|
+
exchange: Annotated[
|
1403
|
+
Optional[InternalExchange],
|
1404
|
+
Field(description="Exchange name for which to fetch exchange mappings"),
|
1405
|
+
] = None,
|
1406
|
+
_request_timeout: Union[
|
1407
|
+
None,
|
1408
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1409
|
+
Tuple[
|
1410
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1411
|
+
],
|
1412
|
+
] = None,
|
1413
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1414
|
+
_content_type: Optional[StrictStr] = None,
|
1415
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1416
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1417
|
+
) -> List[ExchangeMapping]:
|
1418
|
+
"""Get Exchange Mappings
|
1419
|
+
|
1420
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
1421
|
+
"""
|
1422
|
+
if self.is_sync:
|
1423
|
+
return self._get_exchange_mappings_sync(
|
1424
|
+
market=market,
|
1425
|
+
exchange=exchange,
|
1426
|
+
_request_timeout=_request_timeout,
|
1427
|
+
_request_auth=_request_auth,
|
1428
|
+
_content_type=_content_type,
|
1429
|
+
_headers=_headers,
|
1430
|
+
_host_index=_host_index,
|
1431
|
+
)
|
1432
|
+
|
1433
|
+
else:
|
1434
|
+
return self._get_exchange_mappings_async(
|
1435
|
+
market=market,
|
1436
|
+
exchange=exchange,
|
1437
|
+
_request_timeout=_request_timeout,
|
1438
|
+
_request_auth=_request_auth,
|
1439
|
+
_content_type=_content_type,
|
1440
|
+
_headers=_headers,
|
1441
|
+
_host_index=_host_index,
|
1442
|
+
)
|
1443
|
+
|
1444
|
+
@validate_call
|
1445
|
+
def get_exchange_mappings_with_http_info(
|
1446
|
+
self,
|
1447
|
+
market: Annotated[
|
1448
|
+
MarketType, Field(description="Market type (spot or futures)")
|
1449
|
+
],
|
1450
|
+
exchange: Annotated[
|
1451
|
+
Optional[InternalExchange],
|
1452
|
+
Field(description="Exchange name for which to fetch exchange mappings"),
|
1453
|
+
] = None,
|
1454
|
+
_request_timeout: Union[
|
1455
|
+
None,
|
1456
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1457
|
+
Tuple[
|
1458
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1459
|
+
],
|
1460
|
+
] = None,
|
1461
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1462
|
+
_content_type: Optional[StrictStr] = None,
|
1463
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1464
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1465
|
+
) -> ApiResponse[List[ExchangeMapping]]:
|
1466
|
+
"""Get Exchange Mappings with HTTP info
|
1467
|
+
|
1468
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
1469
|
+
"""
|
1470
|
+
if self.is_sync:
|
1471
|
+
return self._get_exchange_mappings_sync_with_http_info(
|
1472
|
+
market=market,
|
1473
|
+
exchange=exchange,
|
1474
|
+
_request_timeout=_request_timeout,
|
1475
|
+
_request_auth=_request_auth,
|
1476
|
+
_content_type=_content_type,
|
1477
|
+
_headers=_headers,
|
1478
|
+
_host_index=_host_index,
|
1479
|
+
)
|
1480
|
+
|
1481
|
+
else:
|
1482
|
+
return self._get_exchange_mappings_async_with_http_info(
|
1483
|
+
market=market,
|
1484
|
+
exchange=exchange,
|
1485
|
+
_request_timeout=_request_timeout,
|
1486
|
+
_request_auth=_request_auth,
|
1487
|
+
_content_type=_content_type,
|
1488
|
+
_headers=_headers,
|
1489
|
+
_host_index=_host_index,
|
1490
|
+
)
|
1491
|
+
|
1492
|
+
@validate_call
|
1493
|
+
def get_exchange_mappings_without_preload_content(
|
1494
|
+
self,
|
1495
|
+
market: Annotated[
|
1496
|
+
MarketType, Field(description="Market type (spot or futures)")
|
1497
|
+
],
|
1498
|
+
exchange: Annotated[
|
1499
|
+
Optional[InternalExchange],
|
1500
|
+
Field(description="Exchange name for which to fetch exchange mappings"),
|
1501
|
+
] = None,
|
1502
|
+
_request_timeout: Union[
|
1503
|
+
None,
|
1504
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1505
|
+
Tuple[
|
1506
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1507
|
+
],
|
1508
|
+
] = None,
|
1509
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1510
|
+
_content_type: Optional[StrictStr] = None,
|
1511
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1512
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1513
|
+
) -> RESTResponseType:
|
1514
|
+
"""Get Exchange Mappings without preloading content
|
1515
|
+
|
1516
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
1517
|
+
"""
|
1518
|
+
if self.is_sync:
|
1519
|
+
return self._get_exchange_mappings_sync_without_preload_content(
|
1520
|
+
market=market,
|
1521
|
+
exchange=exchange,
|
1522
|
+
_request_timeout=_request_timeout,
|
1523
|
+
_request_auth=_request_auth,
|
1524
|
+
_content_type=_content_type,
|
1525
|
+
_headers=_headers,
|
1526
|
+
_host_index=_host_index,
|
1527
|
+
)
|
1528
|
+
|
1529
|
+
else:
|
1530
|
+
return self._get_exchange_mappings_async_without_preload_content(
|
1531
|
+
market=market,
|
1532
|
+
exchange=exchange,
|
1533
|
+
_request_timeout=_request_timeout,
|
1534
|
+
_request_auth=_request_auth,
|
1535
|
+
_content_type=_content_type,
|
1536
|
+
_headers=_headers,
|
1537
|
+
_host_index=_host_index,
|
1538
|
+
)
|
1539
|
+
|
1540
|
+
# Private async implementation methods
|
1541
|
+
@validate_call
|
1542
|
+
async def _get_exchange_mappings_async(
|
719
1543
|
self,
|
720
1544
|
market: Annotated[
|
721
1545
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -788,7 +1612,7 @@ class ExchangesApi:
|
|
788
1612
|
).data
|
789
1613
|
|
790
1614
|
@validate_call
|
791
|
-
async def
|
1615
|
+
async def _get_exchange_mappings_async_with_http_info(
|
792
1616
|
self,
|
793
1617
|
market: Annotated[
|
794
1618
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -856,12 +1680,11 @@ class ExchangesApi:
|
|
856
1680
|
)
|
857
1681
|
await response_data.read()
|
858
1682
|
return self.api_client.response_deserialize(
|
859
|
-
response_data=response_data,
|
860
|
-
response_types_map=_response_types_map,
|
1683
|
+
response_data=response_data, response_types_map=_response_types_map
|
861
1684
|
)
|
862
1685
|
|
863
1686
|
@validate_call
|
864
|
-
async def
|
1687
|
+
async def _get_exchange_mappings_async_without_preload_content(
|
865
1688
|
self,
|
866
1689
|
market: Annotated[
|
867
1690
|
MarketType, Field(description="Market type (spot or futures)")
|
@@ -921,14 +1744,114 @@ class ExchangesApi:
|
|
921
1744
|
_host_index=_host_index,
|
922
1745
|
)
|
923
1746
|
|
924
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
925
|
-
"200": "List[ExchangeMapping]",
|
926
|
-
}
|
927
|
-
response_data = await self.api_client.call_api(
|
928
|
-
*_param, _request_timeout=_request_timeout
|
929
|
-
)
|
930
|
-
return response_data
|
931
|
-
|
1747
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1748
|
+
"200": "List[ExchangeMapping]",
|
1749
|
+
}
|
1750
|
+
response_data = await self.api_client.call_api(
|
1751
|
+
*_param, _request_timeout=_request_timeout
|
1752
|
+
)
|
1753
|
+
return response_data
|
1754
|
+
|
1755
|
+
# Private sync implementation methods
|
1756
|
+
@validate_call
|
1757
|
+
def _get_exchange_mappings_sync(
|
1758
|
+
self,
|
1759
|
+
market: Annotated[
|
1760
|
+
MarketType, Field(description="Market type (spot or futures)")
|
1761
|
+
],
|
1762
|
+
exchange: Annotated[
|
1763
|
+
Optional[InternalExchange],
|
1764
|
+
Field(description="Exchange name for which to fetch exchange mappings"),
|
1765
|
+
] = None,
|
1766
|
+
_request_timeout: Union[
|
1767
|
+
None,
|
1768
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1769
|
+
Tuple[
|
1770
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1771
|
+
],
|
1772
|
+
] = None,
|
1773
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1774
|
+
_content_type: Optional[StrictStr] = None,
|
1775
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1776
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1777
|
+
) -> List[ExchangeMapping]:
|
1778
|
+
"""Synchronous version of get_exchange_mappings"""
|
1779
|
+
return async_to_sync(self._get_exchange_mappings_async)(
|
1780
|
+
market=market,
|
1781
|
+
exchange=exchange,
|
1782
|
+
_request_timeout=_request_timeout,
|
1783
|
+
_request_auth=_request_auth,
|
1784
|
+
_content_type=_content_type,
|
1785
|
+
_headers=_headers,
|
1786
|
+
_host_index=_host_index,
|
1787
|
+
)
|
1788
|
+
|
1789
|
+
@validate_call
|
1790
|
+
def _get_exchange_mappings_sync_with_http_info(
|
1791
|
+
self,
|
1792
|
+
market: Annotated[
|
1793
|
+
MarketType, Field(description="Market type (spot or futures)")
|
1794
|
+
],
|
1795
|
+
exchange: Annotated[
|
1796
|
+
Optional[InternalExchange],
|
1797
|
+
Field(description="Exchange name for which to fetch exchange mappings"),
|
1798
|
+
] = None,
|
1799
|
+
_request_timeout: Union[
|
1800
|
+
None,
|
1801
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1802
|
+
Tuple[
|
1803
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1804
|
+
],
|
1805
|
+
] = None,
|
1806
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1807
|
+
_content_type: Optional[StrictStr] = None,
|
1808
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1809
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1810
|
+
) -> ApiResponse[List[ExchangeMapping]]:
|
1811
|
+
"""Synchronous version of get_exchange_mappings_with_http_info"""
|
1812
|
+
return async_to_sync(self._get_exchange_mappings_async_with_http_info)(
|
1813
|
+
market=market,
|
1814
|
+
exchange=exchange,
|
1815
|
+
_request_timeout=_request_timeout,
|
1816
|
+
_request_auth=_request_auth,
|
1817
|
+
_content_type=_content_type,
|
1818
|
+
_headers=_headers,
|
1819
|
+
_host_index=_host_index,
|
1820
|
+
)
|
1821
|
+
|
1822
|
+
@validate_call
|
1823
|
+
def _get_exchange_mappings_sync_without_preload_content(
|
1824
|
+
self,
|
1825
|
+
market: Annotated[
|
1826
|
+
MarketType, Field(description="Market type (spot or futures)")
|
1827
|
+
],
|
1828
|
+
exchange: Annotated[
|
1829
|
+
Optional[InternalExchange],
|
1830
|
+
Field(description="Exchange name for which to fetch exchange mappings"),
|
1831
|
+
] = None,
|
1832
|
+
_request_timeout: Union[
|
1833
|
+
None,
|
1834
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1835
|
+
Tuple[
|
1836
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1837
|
+
],
|
1838
|
+
] = None,
|
1839
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1840
|
+
_content_type: Optional[StrictStr] = None,
|
1841
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1842
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1843
|
+
) -> RESTResponseType:
|
1844
|
+
"""Synchronous version of get_exchange_mappings_without_preload_content"""
|
1845
|
+
return async_to_sync(self._get_exchange_mappings_async_without_preload_content)(
|
1846
|
+
market=market,
|
1847
|
+
exchange=exchange,
|
1848
|
+
_request_timeout=_request_timeout,
|
1849
|
+
_request_auth=_request_auth,
|
1850
|
+
_content_type=_content_type,
|
1851
|
+
_headers=_headers,
|
1852
|
+
_host_index=_host_index,
|
1853
|
+
)
|
1854
|
+
|
932
1855
|
def _get_exchange_mappings_serialize(
|
933
1856
|
self,
|
934
1857
|
market,
|
@@ -991,12 +1914,208 @@ class ExchangesApi:
|
|
991
1914
|
)
|
992
1915
|
|
993
1916
|
@validate_call
|
994
|
-
|
1917
|
+
def get_exchange_mappings_for_pair(
|
1918
|
+
self,
|
1919
|
+
pair: Annotated[
|
1920
|
+
StrictStr,
|
1921
|
+
Field(
|
1922
|
+
description="Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT')"
|
1923
|
+
),
|
1924
|
+
],
|
1925
|
+
market: Annotated[
|
1926
|
+
Optional[MarketType],
|
1927
|
+
Field(description="Market type (spot or futures). Defaults to futures."),
|
1928
|
+
] = None,
|
1929
|
+
exchange: Annotated[
|
1930
|
+
Optional[InternalExchange],
|
1931
|
+
Field(
|
1932
|
+
description="Optional exchange name to filter by. If not provided, returns all exchanges a match was found for."
|
1933
|
+
),
|
1934
|
+
] = None,
|
1935
|
+
quote_currency: Annotated[
|
1936
|
+
Optional[StrictStr],
|
1937
|
+
Field(description="Quote currency to filter by. Defaults to USDT."),
|
1938
|
+
] = None,
|
1939
|
+
_request_timeout: Union[
|
1940
|
+
None,
|
1941
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1942
|
+
Tuple[
|
1943
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
1944
|
+
],
|
1945
|
+
] = None,
|
1946
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1947
|
+
_content_type: Optional[StrictStr] = None,
|
1948
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1949
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1950
|
+
) -> List[ExchangeMapping]:
|
1951
|
+
"""Get Exchange Mappings For Pair
|
1952
|
+
|
1953
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
1954
|
+
"""
|
1955
|
+
if self.is_sync:
|
1956
|
+
return self._get_exchange_mappings_for_pair_sync(
|
1957
|
+
pair=pair,
|
1958
|
+
market=market,
|
1959
|
+
exchange=exchange,
|
1960
|
+
quote_currency=quote_currency,
|
1961
|
+
_request_timeout=_request_timeout,
|
1962
|
+
_request_auth=_request_auth,
|
1963
|
+
_content_type=_content_type,
|
1964
|
+
_headers=_headers,
|
1965
|
+
_host_index=_host_index,
|
1966
|
+
)
|
1967
|
+
|
1968
|
+
else:
|
1969
|
+
return self._get_exchange_mappings_for_pair_async(
|
1970
|
+
pair=pair,
|
1971
|
+
market=market,
|
1972
|
+
exchange=exchange,
|
1973
|
+
quote_currency=quote_currency,
|
1974
|
+
_request_timeout=_request_timeout,
|
1975
|
+
_request_auth=_request_auth,
|
1976
|
+
_content_type=_content_type,
|
1977
|
+
_headers=_headers,
|
1978
|
+
_host_index=_host_index,
|
1979
|
+
)
|
1980
|
+
|
1981
|
+
@validate_call
|
1982
|
+
def get_exchange_mappings_for_pair_with_http_info(
|
1983
|
+
self,
|
1984
|
+
pair: Annotated[
|
1985
|
+
StrictStr,
|
1986
|
+
Field(
|
1987
|
+
description="Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT')"
|
1988
|
+
),
|
1989
|
+
],
|
1990
|
+
market: Annotated[
|
1991
|
+
Optional[MarketType],
|
1992
|
+
Field(description="Market type (spot or futures). Defaults to futures."),
|
1993
|
+
] = None,
|
1994
|
+
exchange: Annotated[
|
1995
|
+
Optional[InternalExchange],
|
1996
|
+
Field(
|
1997
|
+
description="Optional exchange name to filter by. If not provided, returns all exchanges a match was found for."
|
1998
|
+
),
|
1999
|
+
] = None,
|
2000
|
+
quote_currency: Annotated[
|
2001
|
+
Optional[StrictStr],
|
2002
|
+
Field(description="Quote currency to filter by. Defaults to USDT."),
|
2003
|
+
] = None,
|
2004
|
+
_request_timeout: Union[
|
2005
|
+
None,
|
2006
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2007
|
+
Tuple[
|
2008
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
2009
|
+
],
|
2010
|
+
] = None,
|
2011
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2012
|
+
_content_type: Optional[StrictStr] = None,
|
2013
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2014
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2015
|
+
) -> ApiResponse[List[ExchangeMapping]]:
|
2016
|
+
"""Get Exchange Mappings For Pair with HTTP info
|
2017
|
+
|
2018
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
2019
|
+
"""
|
2020
|
+
if self.is_sync:
|
2021
|
+
return self._get_exchange_mappings_for_pair_sync_with_http_info(
|
2022
|
+
pair=pair,
|
2023
|
+
market=market,
|
2024
|
+
exchange=exchange,
|
2025
|
+
quote_currency=quote_currency,
|
2026
|
+
_request_timeout=_request_timeout,
|
2027
|
+
_request_auth=_request_auth,
|
2028
|
+
_content_type=_content_type,
|
2029
|
+
_headers=_headers,
|
2030
|
+
_host_index=_host_index,
|
2031
|
+
)
|
2032
|
+
|
2033
|
+
else:
|
2034
|
+
return self._get_exchange_mappings_for_pair_async_with_http_info(
|
2035
|
+
pair=pair,
|
2036
|
+
market=market,
|
2037
|
+
exchange=exchange,
|
2038
|
+
quote_currency=quote_currency,
|
2039
|
+
_request_timeout=_request_timeout,
|
2040
|
+
_request_auth=_request_auth,
|
2041
|
+
_content_type=_content_type,
|
2042
|
+
_headers=_headers,
|
2043
|
+
_host_index=_host_index,
|
2044
|
+
)
|
2045
|
+
|
2046
|
+
@validate_call
|
2047
|
+
def get_exchange_mappings_for_pair_without_preload_content(
|
2048
|
+
self,
|
2049
|
+
pair: Annotated[
|
2050
|
+
StrictStr,
|
2051
|
+
Field(
|
2052
|
+
description="Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT')"
|
2053
|
+
),
|
2054
|
+
],
|
2055
|
+
market: Annotated[
|
2056
|
+
Optional[MarketType],
|
2057
|
+
Field(description="Market type (spot or futures). Defaults to futures."),
|
2058
|
+
] = None,
|
2059
|
+
exchange: Annotated[
|
2060
|
+
Optional[InternalExchange],
|
2061
|
+
Field(
|
2062
|
+
description="Optional exchange name to filter by. If not provided, returns all exchanges a match was found for."
|
2063
|
+
),
|
2064
|
+
] = None,
|
2065
|
+
quote_currency: Annotated[
|
2066
|
+
Optional[StrictStr],
|
2067
|
+
Field(description="Quote currency to filter by. Defaults to USDT."),
|
2068
|
+
] = None,
|
2069
|
+
_request_timeout: Union[
|
2070
|
+
None,
|
2071
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2072
|
+
Tuple[
|
2073
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
2074
|
+
],
|
2075
|
+
] = None,
|
2076
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2077
|
+
_content_type: Optional[StrictStr] = None,
|
2078
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2079
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2080
|
+
) -> RESTResponseType:
|
2081
|
+
"""Get Exchange Mappings For Pair without preloading content
|
2082
|
+
|
2083
|
+
This method can work in both sync and async modes based on the is_sync flag.
|
2084
|
+
"""
|
2085
|
+
if self.is_sync:
|
2086
|
+
return self._get_exchange_mappings_for_pair_sync_without_preload_content(
|
2087
|
+
pair=pair,
|
2088
|
+
market=market,
|
2089
|
+
exchange=exchange,
|
2090
|
+
quote_currency=quote_currency,
|
2091
|
+
_request_timeout=_request_timeout,
|
2092
|
+
_request_auth=_request_auth,
|
2093
|
+
_content_type=_content_type,
|
2094
|
+
_headers=_headers,
|
2095
|
+
_host_index=_host_index,
|
2096
|
+
)
|
2097
|
+
|
2098
|
+
else:
|
2099
|
+
return self._get_exchange_mappings_for_pair_async_without_preload_content(
|
2100
|
+
pair=pair,
|
2101
|
+
market=market,
|
2102
|
+
exchange=exchange,
|
2103
|
+
quote_currency=quote_currency,
|
2104
|
+
_request_timeout=_request_timeout,
|
2105
|
+
_request_auth=_request_auth,
|
2106
|
+
_content_type=_content_type,
|
2107
|
+
_headers=_headers,
|
2108
|
+
_host_index=_host_index,
|
2109
|
+
)
|
2110
|
+
|
2111
|
+
# Private async implementation methods
|
2112
|
+
@validate_call
|
2113
|
+
async def _get_exchange_mappings_for_pair_async(
|
995
2114
|
self,
|
996
2115
|
pair: Annotated[
|
997
2116
|
StrictStr,
|
998
2117
|
Field(
|
999
|
-
description="Trading pair to find mappings for (e.g., 'BTCUSDT', '1000SHIBUSDT')"
|
2118
|
+
description="Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT')"
|
1000
2119
|
),
|
1001
2120
|
],
|
1002
2121
|
market: Annotated[
|
@@ -1006,7 +2125,7 @@ class ExchangesApi:
|
|
1006
2125
|
exchange: Annotated[
|
1007
2126
|
Optional[InternalExchange],
|
1008
2127
|
Field(
|
1009
|
-
description="Optional exchange name to filter by. If not provided, returns all exchanges."
|
2128
|
+
description="Optional exchange name to filter by. If not provided, returns all exchanges a match was found for."
|
1010
2129
|
),
|
1011
2130
|
] = None,
|
1012
2131
|
quote_currency: Annotated[
|
@@ -1029,11 +2148,11 @@ class ExchangesApi:
|
|
1029
2148
|
|
1030
2149
|
Get exchange mappings for a specific trading pair across all exchanges or a specific exchange. This endpoint finds the underlying symbol for a given pair and returns all perpetual contracts (excluding quarterly/dated contracts) with the specified quote currency.
|
1031
2150
|
|
1032
|
-
:param pair: Trading pair to find mappings for (e.g., 'BTCUSDT', '1000SHIBUSDT') (required)
|
2151
|
+
:param pair: Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT') (required)
|
1033
2152
|
:type pair: str
|
1034
2153
|
:param market: Market type (spot or futures). Defaults to futures.
|
1035
2154
|
:type market: MarketType
|
1036
|
-
:param exchange: Optional exchange name to filter by. If not provided, returns all exchanges.
|
2155
|
+
:param exchange: Optional exchange name to filter by. If not provided, returns all exchanges a match was found for.
|
1037
2156
|
:type exchange: InternalExchange
|
1038
2157
|
:param quote_currency: Quote currency to filter by. Defaults to USDT.
|
1039
2158
|
:type quote_currency: str
|
@@ -1083,12 +2202,12 @@ class ExchangesApi:
|
|
1083
2202
|
).data
|
1084
2203
|
|
1085
2204
|
@validate_call
|
1086
|
-
async def
|
2205
|
+
async def _get_exchange_mappings_for_pair_async_with_http_info(
|
1087
2206
|
self,
|
1088
2207
|
pair: Annotated[
|
1089
2208
|
StrictStr,
|
1090
2209
|
Field(
|
1091
|
-
description="Trading pair to find mappings for (e.g., 'BTCUSDT', '1000SHIBUSDT')"
|
2210
|
+
description="Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT')"
|
1092
2211
|
),
|
1093
2212
|
],
|
1094
2213
|
market: Annotated[
|
@@ -1098,7 +2217,7 @@ class ExchangesApi:
|
|
1098
2217
|
exchange: Annotated[
|
1099
2218
|
Optional[InternalExchange],
|
1100
2219
|
Field(
|
1101
|
-
description="Optional exchange name to filter by. If not provided, returns all exchanges."
|
2220
|
+
description="Optional exchange name to filter by. If not provided, returns all exchanges a match was found for."
|
1102
2221
|
),
|
1103
2222
|
] = None,
|
1104
2223
|
quote_currency: Annotated[
|
@@ -1121,11 +2240,11 @@ class ExchangesApi:
|
|
1121
2240
|
|
1122
2241
|
Get exchange mappings for a specific trading pair across all exchanges or a specific exchange. This endpoint finds the underlying symbol for a given pair and returns all perpetual contracts (excluding quarterly/dated contracts) with the specified quote currency.
|
1123
2242
|
|
1124
|
-
:param pair: Trading pair to find mappings for (e.g., 'BTCUSDT', '1000SHIBUSDT') (required)
|
2243
|
+
:param pair: Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT') (required)
|
1125
2244
|
:type pair: str
|
1126
2245
|
:param market: Market type (spot or futures). Defaults to futures.
|
1127
2246
|
:type market: MarketType
|
1128
|
-
:param exchange: Optional exchange name to filter by. If not provided, returns all exchanges.
|
2247
|
+
:param exchange: Optional exchange name to filter by. If not provided, returns all exchanges a match was found for.
|
1129
2248
|
:type exchange: InternalExchange
|
1130
2249
|
:param quote_currency: Quote currency to filter by. Defaults to USDT.
|
1131
2250
|
:type quote_currency: str
|
@@ -1170,17 +2289,16 @@ class ExchangesApi:
|
|
1170
2289
|
)
|
1171
2290
|
await response_data.read()
|
1172
2291
|
return self.api_client.response_deserialize(
|
1173
|
-
response_data=response_data,
|
1174
|
-
response_types_map=_response_types_map,
|
2292
|
+
response_data=response_data, response_types_map=_response_types_map
|
1175
2293
|
)
|
1176
2294
|
|
1177
2295
|
@validate_call
|
1178
|
-
async def
|
2296
|
+
async def _get_exchange_mappings_for_pair_async_without_preload_content(
|
1179
2297
|
self,
|
1180
2298
|
pair: Annotated[
|
1181
2299
|
StrictStr,
|
1182
2300
|
Field(
|
1183
|
-
description="Trading pair to find mappings for (e.g., 'BTCUSDT', '1000SHIBUSDT')"
|
2301
|
+
description="Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT')"
|
1184
2302
|
),
|
1185
2303
|
],
|
1186
2304
|
market: Annotated[
|
@@ -1190,7 +2308,7 @@ class ExchangesApi:
|
|
1190
2308
|
exchange: Annotated[
|
1191
2309
|
Optional[InternalExchange],
|
1192
2310
|
Field(
|
1193
|
-
description="Optional exchange name to filter by. If not provided, returns all exchanges."
|
2311
|
+
description="Optional exchange name to filter by. If not provided, returns all exchanges a match was found for."
|
1194
2312
|
),
|
1195
2313
|
] = None,
|
1196
2314
|
quote_currency: Annotated[
|
@@ -1213,11 +2331,11 @@ class ExchangesApi:
|
|
1213
2331
|
|
1214
2332
|
Get exchange mappings for a specific trading pair across all exchanges or a specific exchange. This endpoint finds the underlying symbol for a given pair and returns all perpetual contracts (excluding quarterly/dated contracts) with the specified quote currency.
|
1215
2333
|
|
1216
|
-
:param pair: Trading pair to find mappings for (e.g., 'BTCUSDT', '1000SHIBUSDT') (required)
|
2334
|
+
:param pair: Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT') (required)
|
1217
2335
|
:type pair: str
|
1218
2336
|
:param market: Market type (spot or futures). Defaults to futures.
|
1219
2337
|
:type market: MarketType
|
1220
|
-
:param exchange: Optional exchange name to filter by. If not provided, returns all exchanges.
|
2338
|
+
:param exchange: Optional exchange name to filter by. If not provided, returns all exchanges a match was found for.
|
1221
2339
|
:type exchange: InternalExchange
|
1222
2340
|
:param quote_currency: Quote currency to filter by. Defaults to USDT.
|
1223
2341
|
:type quote_currency: str
|
@@ -1260,7 +2378,154 @@ class ExchangesApi:
|
|
1260
2378
|
response_data = await self.api_client.call_api(
|
1261
2379
|
*_param, _request_timeout=_request_timeout
|
1262
2380
|
)
|
1263
|
-
return response_data
|
2381
|
+
return response_data
|
2382
|
+
|
2383
|
+
# Private sync implementation methods
|
2384
|
+
@validate_call
|
2385
|
+
def _get_exchange_mappings_for_pair_sync(
|
2386
|
+
self,
|
2387
|
+
pair: Annotated[
|
2388
|
+
StrictStr,
|
2389
|
+
Field(
|
2390
|
+
description="Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT')"
|
2391
|
+
),
|
2392
|
+
],
|
2393
|
+
market: Annotated[
|
2394
|
+
Optional[MarketType],
|
2395
|
+
Field(description="Market type (spot or futures). Defaults to futures."),
|
2396
|
+
] = None,
|
2397
|
+
exchange: Annotated[
|
2398
|
+
Optional[InternalExchange],
|
2399
|
+
Field(
|
2400
|
+
description="Optional exchange name to filter by. If not provided, returns all exchanges a match was found for."
|
2401
|
+
),
|
2402
|
+
] = None,
|
2403
|
+
quote_currency: Annotated[
|
2404
|
+
Optional[StrictStr],
|
2405
|
+
Field(description="Quote currency to filter by. Defaults to USDT."),
|
2406
|
+
] = None,
|
2407
|
+
_request_timeout: Union[
|
2408
|
+
None,
|
2409
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2410
|
+
Tuple[
|
2411
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
2412
|
+
],
|
2413
|
+
] = None,
|
2414
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2415
|
+
_content_type: Optional[StrictStr] = None,
|
2416
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2417
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2418
|
+
) -> List[ExchangeMapping]:
|
2419
|
+
"""Synchronous version of get_exchange_mappings_for_pair"""
|
2420
|
+
return async_to_sync(self._get_exchange_mappings_for_pair_async)(
|
2421
|
+
pair=pair,
|
2422
|
+
market=market,
|
2423
|
+
exchange=exchange,
|
2424
|
+
quote_currency=quote_currency,
|
2425
|
+
_request_timeout=_request_timeout,
|
2426
|
+
_request_auth=_request_auth,
|
2427
|
+
_content_type=_content_type,
|
2428
|
+
_headers=_headers,
|
2429
|
+
_host_index=_host_index,
|
2430
|
+
)
|
2431
|
+
|
2432
|
+
@validate_call
|
2433
|
+
def _get_exchange_mappings_for_pair_sync_with_http_info(
|
2434
|
+
self,
|
2435
|
+
pair: Annotated[
|
2436
|
+
StrictStr,
|
2437
|
+
Field(
|
2438
|
+
description="Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT')"
|
2439
|
+
),
|
2440
|
+
],
|
2441
|
+
market: Annotated[
|
2442
|
+
Optional[MarketType],
|
2443
|
+
Field(description="Market type (spot or futures). Defaults to futures."),
|
2444
|
+
] = None,
|
2445
|
+
exchange: Annotated[
|
2446
|
+
Optional[InternalExchange],
|
2447
|
+
Field(
|
2448
|
+
description="Optional exchange name to filter by. If not provided, returns all exchanges a match was found for."
|
2449
|
+
),
|
2450
|
+
] = None,
|
2451
|
+
quote_currency: Annotated[
|
2452
|
+
Optional[StrictStr],
|
2453
|
+
Field(description="Quote currency to filter by. Defaults to USDT."),
|
2454
|
+
] = None,
|
2455
|
+
_request_timeout: Union[
|
2456
|
+
None,
|
2457
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2458
|
+
Tuple[
|
2459
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
2460
|
+
],
|
2461
|
+
] = None,
|
2462
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2463
|
+
_content_type: Optional[StrictStr] = None,
|
2464
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2465
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2466
|
+
) -> ApiResponse[List[ExchangeMapping]]:
|
2467
|
+
"""Synchronous version of get_exchange_mappings_for_pair_with_http_info"""
|
2468
|
+
return async_to_sync(self._get_exchange_mappings_for_pair_async_with_http_info)(
|
2469
|
+
pair=pair,
|
2470
|
+
market=market,
|
2471
|
+
exchange=exchange,
|
2472
|
+
quote_currency=quote_currency,
|
2473
|
+
_request_timeout=_request_timeout,
|
2474
|
+
_request_auth=_request_auth,
|
2475
|
+
_content_type=_content_type,
|
2476
|
+
_headers=_headers,
|
2477
|
+
_host_index=_host_index,
|
2478
|
+
)
|
2479
|
+
|
2480
|
+
@validate_call
|
2481
|
+
def _get_exchange_mappings_for_pair_sync_without_preload_content(
|
2482
|
+
self,
|
2483
|
+
pair: Annotated[
|
2484
|
+
StrictStr,
|
2485
|
+
Field(
|
2486
|
+
description="Trading pair to find mappings for. Can be exchange specific (e.g., 'BTCUSDT', '1000SHIBUSDT') or a common format Symbol/QuoteCurrency (e.g., 'BTC/USDT')"
|
2487
|
+
),
|
2488
|
+
],
|
2489
|
+
market: Annotated[
|
2490
|
+
Optional[MarketType],
|
2491
|
+
Field(description="Market type (spot or futures). Defaults to futures."),
|
2492
|
+
] = None,
|
2493
|
+
exchange: Annotated[
|
2494
|
+
Optional[InternalExchange],
|
2495
|
+
Field(
|
2496
|
+
description="Optional exchange name to filter by. If not provided, returns all exchanges a match was found for."
|
2497
|
+
),
|
2498
|
+
] = None,
|
2499
|
+
quote_currency: Annotated[
|
2500
|
+
Optional[StrictStr],
|
2501
|
+
Field(description="Quote currency to filter by. Defaults to USDT."),
|
2502
|
+
] = None,
|
2503
|
+
_request_timeout: Union[
|
2504
|
+
None,
|
2505
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2506
|
+
Tuple[
|
2507
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
2508
|
+
],
|
2509
|
+
] = None,
|
2510
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2511
|
+
_content_type: Optional[StrictStr] = None,
|
2512
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2513
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2514
|
+
) -> RESTResponseType:
|
2515
|
+
"""Synchronous version of get_exchange_mappings_for_pair_without_preload_content"""
|
2516
|
+
return async_to_sync(
|
2517
|
+
self._get_exchange_mappings_for_pair_async_without_preload_content
|
2518
|
+
)(
|
2519
|
+
pair=pair,
|
2520
|
+
market=market,
|
2521
|
+
exchange=exchange,
|
2522
|
+
quote_currency=quote_currency,
|
2523
|
+
_request_timeout=_request_timeout,
|
2524
|
+
_request_auth=_request_auth,
|
2525
|
+
_content_type=_content_type,
|
2526
|
+
_headers=_headers,
|
2527
|
+
_host_index=_host_index,
|
2528
|
+
)
|
1264
2529
|
|
1265
2530
|
def _get_exchange_mappings_for_pair_serialize(
|
1266
2531
|
self,
|