crypticorn 2.16.0__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.
Files changed (86) hide show
  1. crypticorn/__init__.py +2 -2
  2. crypticorn/auth/client/api/admin_api.py +415 -13
  3. crypticorn/auth/client/api/auth_api.py +2622 -113
  4. crypticorn/auth/client/api/service_api.py +258 -7
  5. crypticorn/auth/client/api/user_api.py +2485 -270
  6. crypticorn/auth/client/api/wallet_api.py +1518 -77
  7. crypticorn/auth/client/models/create_api_key_request.py +2 -1
  8. crypticorn/auth/client/models/get_api_keys200_response_inner.py +2 -1
  9. crypticorn/auth/client/rest.py +23 -4
  10. crypticorn/auth/main.py +8 -5
  11. crypticorn/client.py +227 -59
  12. crypticorn/common/__init__.py +1 -0
  13. crypticorn/common/metrics.py +18 -0
  14. crypticorn/common/middleware.py +46 -0
  15. crypticorn/common/pagination.py +137 -18
  16. crypticorn/common/router/admin_router.py +12 -2
  17. crypticorn/common/utils.py +2 -1
  18. crypticorn/common/warnings.py +7 -0
  19. crypticorn/hive/client/api/admin_api.py +1234 -51
  20. crypticorn/hive/client/api/data_api.py +517 -13
  21. crypticorn/hive/client/api/models_api.py +1657 -83
  22. crypticorn/hive/client/api/status_api.py +415 -13
  23. crypticorn/hive/client/models/api_error_identifier.py +1 -1
  24. crypticorn/hive/client/rest.py +23 -4
  25. crypticorn/hive/main.py +99 -25
  26. crypticorn/klines/client/api/admin_api.py +1234 -51
  27. crypticorn/klines/client/api/change_in_timeframe_api.py +278 -7
  28. crypticorn/klines/client/api/funding_rates_api.py +324 -7
  29. crypticorn/klines/client/api/ohlcv_data_api.py +399 -7
  30. crypticorn/klines/client/api/status_api.py +415 -13
  31. crypticorn/klines/client/api/symbols_api.py +225 -7
  32. crypticorn/klines/client/api/udf_api.py +1393 -120
  33. crypticorn/klines/client/models/api_error_identifier.py +3 -1
  34. crypticorn/klines/client/rest.py +23 -4
  35. crypticorn/klines/main.py +89 -12
  36. crypticorn/metrics/client/api/admin_api.py +1234 -51
  37. crypticorn/metrics/client/api/exchanges_api.py +1405 -140
  38. crypticorn/metrics/client/api/indicators_api.py +640 -13
  39. crypticorn/metrics/client/api/logs_api.py +305 -7
  40. crypticorn/metrics/client/api/marketcap_api.py +1240 -60
  41. crypticorn/metrics/client/api/markets_api.py +352 -7
  42. crypticorn/metrics/client/api/quote_currencies_api.py +237 -7
  43. crypticorn/metrics/client/api/status_api.py +415 -13
  44. crypticorn/metrics/client/api/tokens_api.py +400 -13
  45. crypticorn/metrics/client/configuration.py +4 -2
  46. crypticorn/metrics/client/rest.py +23 -4
  47. crypticorn/metrics/main.py +113 -19
  48. crypticorn/pay/client/api/admin_api.py +1720 -126
  49. crypticorn/pay/client/api/now_payments_api.py +1013 -42
  50. crypticorn/pay/client/api/payments_api.py +580 -13
  51. crypticorn/pay/client/api/products_api.py +915 -25
  52. crypticorn/pay/client/api/status_api.py +415 -13
  53. crypticorn/pay/client/configuration.py +2 -2
  54. crypticorn/pay/client/models/api_error_identifier.py +7 -7
  55. crypticorn/pay/client/models/scope.py +1 -0
  56. crypticorn/pay/client/rest.py +23 -4
  57. crypticorn/pay/main.py +10 -6
  58. crypticorn/trade/client/__init__.py +2 -1
  59. crypticorn/trade/client/api/__init__.py +0 -1
  60. crypticorn/trade/client/api/admin_api.py +1718 -123
  61. crypticorn/trade/client/api/api_keys_api.py +1596 -103
  62. crypticorn/trade/client/api/bots_api.py +1106 -47
  63. crypticorn/trade/client/api/exchanges_api.py +592 -19
  64. crypticorn/trade/client/api/notifications_api.py +1340 -112
  65. crypticorn/trade/client/api/orders_api.py +240 -7
  66. crypticorn/trade/client/api/status_api.py +415 -13
  67. crypticorn/trade/client/api/strategies_api.py +1170 -69
  68. crypticorn/trade/client/api/trading_actions_api.py +650 -19
  69. crypticorn/trade/client/models/__init__.py +2 -0
  70. crypticorn/trade/client/models/exchange.py +6 -1
  71. crypticorn/trade/client/models/exchange_key_balance.py +111 -0
  72. crypticorn/trade/client/models/futures_balance.py +27 -25
  73. crypticorn/trade/client/models/spot_balance.py +110 -0
  74. crypticorn/trade/client/models/strategy.py +5 -3
  75. crypticorn/trade/client/models/strategy_create.py +6 -4
  76. crypticorn/trade/client/models/strategy_exchange_info.py +16 -4
  77. crypticorn/trade/client/models/strategy_update.py +2 -2
  78. crypticorn/trade/client/rest.py +23 -4
  79. crypticorn/trade/main.py +15 -12
  80. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/METADATA +65 -20
  81. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/RECORD +85 -83
  82. crypticorn/trade/client/api/futures_trading_panel_api.py +0 -1285
  83. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/WHEEL +0 -0
  84. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/entry_points.txt +0 -0
  85. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/licenses/LICENSE +0 -0
  86. {crypticorn-2.16.0.dist-info → crypticorn-2.17.0rc2.dist-info}/top_level.txt +0 -0
@@ -31,6 +31,24 @@ from crypticorn.trade.client.api_client import ApiClient, RequestSerialized
31
31
  from crypticorn.trade.client.api_response import ApiResponse
32
32
  from crypticorn.trade.client.rest import RESTResponseType
33
33
 
34
+ # Import async_to_sync for sync methods
35
+ try:
36
+ from asgiref.sync import async_to_sync
37
+
38
+ _HAS_ASGIREF = True
39
+ except ImportError:
40
+ _HAS_ASGIREF = False
41
+
42
+ def async_to_sync(async_func):
43
+ """Fallback decorator that raises an error if asgiref is not available."""
44
+
45
+ def wrapper(*args, **kwargs):
46
+ raise ImportError(
47
+ "asgiref is required for sync methods. Install with: pip install asgiref"
48
+ )
49
+
50
+ return wrapper
51
+
34
52
 
35
53
  class TradingActionsApi:
36
54
  """NOTE: This class is auto generated by OpenAPI Generator
@@ -39,13 +57,144 @@ class TradingActionsApi:
39
57
  Do not edit the class manually.
40
58
  """
41
59
 
42
- def __init__(self, api_client=None) -> None:
60
+ def __init__(self, api_client=None, is_sync: bool = False) -> None:
43
61
  if api_client is None:
44
62
  api_client = ApiClient.get_default()
45
63
  self.api_client = api_client
64
+ self.is_sync = is_sync
65
+
66
+ @validate_call
67
+ def get_actions(
68
+ self,
69
+ limit: Optional[StrictInt] = None,
70
+ offset: Optional[StrictInt] = None,
71
+ _request_timeout: Union[
72
+ None,
73
+ Annotated[StrictFloat, Field(gt=0)],
74
+ Tuple[
75
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
76
+ ],
77
+ ] = None,
78
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
79
+ _content_type: Optional[StrictStr] = None,
80
+ _headers: Optional[Dict[StrictStr, Any]] = None,
81
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
82
+ ) -> List[FuturesTradingAction]:
83
+ """Get Actions
84
+
85
+ This method can work in both sync and async modes based on the is_sync flag.
86
+ """
87
+ if self.is_sync:
88
+ return self._get_actions_sync(
89
+ limit=limit,
90
+ offset=offset,
91
+ _request_timeout=_request_timeout,
92
+ _request_auth=_request_auth,
93
+ _content_type=_content_type,
94
+ _headers=_headers,
95
+ _host_index=_host_index,
96
+ )
97
+
98
+ else:
99
+ return self._get_actions_async(
100
+ limit=limit,
101
+ offset=offset,
102
+ _request_timeout=_request_timeout,
103
+ _request_auth=_request_auth,
104
+ _content_type=_content_type,
105
+ _headers=_headers,
106
+ _host_index=_host_index,
107
+ )
108
+
109
+ @validate_call
110
+ def get_actions_with_http_info(
111
+ self,
112
+ limit: Optional[StrictInt] = None,
113
+ offset: Optional[StrictInt] = None,
114
+ _request_timeout: Union[
115
+ None,
116
+ Annotated[StrictFloat, Field(gt=0)],
117
+ Tuple[
118
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
119
+ ],
120
+ ] = None,
121
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
122
+ _content_type: Optional[StrictStr] = None,
123
+ _headers: Optional[Dict[StrictStr, Any]] = None,
124
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
125
+ ) -> ApiResponse[List[FuturesTradingAction]]:
126
+ """Get Actions with HTTP info
127
+
128
+ This method can work in both sync and async modes based on the is_sync flag.
129
+ """
130
+ if self.is_sync:
131
+ return self._get_actions_sync_with_http_info(
132
+ limit=limit,
133
+ offset=offset,
134
+ _request_timeout=_request_timeout,
135
+ _request_auth=_request_auth,
136
+ _content_type=_content_type,
137
+ _headers=_headers,
138
+ _host_index=_host_index,
139
+ )
140
+
141
+ else:
142
+ return self._get_actions_async_with_http_info(
143
+ limit=limit,
144
+ offset=offset,
145
+ _request_timeout=_request_timeout,
146
+ _request_auth=_request_auth,
147
+ _content_type=_content_type,
148
+ _headers=_headers,
149
+ _host_index=_host_index,
150
+ )
151
+
152
+ @validate_call
153
+ def get_actions_without_preload_content(
154
+ self,
155
+ limit: Optional[StrictInt] = None,
156
+ offset: Optional[StrictInt] = None,
157
+ _request_timeout: Union[
158
+ None,
159
+ Annotated[StrictFloat, Field(gt=0)],
160
+ Tuple[
161
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
162
+ ],
163
+ ] = None,
164
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
165
+ _content_type: Optional[StrictStr] = None,
166
+ _headers: Optional[Dict[StrictStr, Any]] = None,
167
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
168
+ ) -> RESTResponseType:
169
+ """Get Actions without preloading content
170
+
171
+ This method can work in both sync and async modes based on the is_sync flag.
172
+ """
173
+ if self.is_sync:
174
+ return self._get_actions_sync_without_preload_content(
175
+ limit=limit,
176
+ offset=offset,
177
+ _request_timeout=_request_timeout,
178
+ _request_auth=_request_auth,
179
+ _content_type=_content_type,
180
+ _headers=_headers,
181
+ _host_index=_host_index,
182
+ )
183
+
184
+ else:
185
+ return self._get_actions_async_without_preload_content(
186
+ limit=limit,
187
+ offset=offset,
188
+ _request_timeout=_request_timeout,
189
+ _request_auth=_request_auth,
190
+ _content_type=_content_type,
191
+ _headers=_headers,
192
+ _host_index=_host_index,
193
+ )
46
194
 
195
+ # Private async implementation methods
47
196
  @validate_call
48
- async def get_actions(
197
+ async def _get_actions_async(
49
198
  self,
50
199
  limit: Optional[StrictInt] = None,
51
200
  offset: Optional[StrictInt] = None,
@@ -112,7 +261,7 @@ class TradingActionsApi:
112
261
  ).data
113
262
 
114
263
  @validate_call
115
- async def get_actions_with_http_info(
264
+ async def _get_actions_async_with_http_info(
116
265
  self,
117
266
  limit: Optional[StrictInt] = None,
118
267
  offset: Optional[StrictInt] = None,
@@ -174,12 +323,11 @@ class TradingActionsApi:
174
323
  )
175
324
  await response_data.read()
176
325
  return self.api_client.response_deserialize(
177
- response_data=response_data,
178
- response_types_map=_response_types_map,
326
+ response_data=response_data, response_types_map=_response_types_map
179
327
  )
180
328
 
181
329
  @validate_call
182
- async def get_actions_without_preload_content(
330
+ async def _get_actions_async_without_preload_content(
183
331
  self,
184
332
  limit: Optional[StrictInt] = None,
185
333
  offset: Optional[StrictInt] = None,
@@ -239,7 +387,92 @@ class TradingActionsApi:
239
387
  response_data = await self.api_client.call_api(
240
388
  *_param, _request_timeout=_request_timeout
241
389
  )
242
- return response_data.response
390
+ return response_data
391
+
392
+ # Private sync implementation methods
393
+ @validate_call
394
+ def _get_actions_sync(
395
+ self,
396
+ limit: Optional[StrictInt] = None,
397
+ offset: Optional[StrictInt] = None,
398
+ _request_timeout: Union[
399
+ None,
400
+ Annotated[StrictFloat, Field(gt=0)],
401
+ Tuple[
402
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
403
+ ],
404
+ ] = None,
405
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
406
+ _content_type: Optional[StrictStr] = None,
407
+ _headers: Optional[Dict[StrictStr, Any]] = None,
408
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
409
+ ) -> List[FuturesTradingAction]:
410
+ """Synchronous version of get_actions"""
411
+ return async_to_sync(self._get_actions_async)(
412
+ limit=limit,
413
+ offset=offset,
414
+ _request_timeout=_request_timeout,
415
+ _request_auth=_request_auth,
416
+ _content_type=_content_type,
417
+ _headers=_headers,
418
+ _host_index=_host_index,
419
+ )
420
+
421
+ @validate_call
422
+ def _get_actions_sync_with_http_info(
423
+ self,
424
+ limit: Optional[StrictInt] = None,
425
+ offset: Optional[StrictInt] = None,
426
+ _request_timeout: Union[
427
+ None,
428
+ Annotated[StrictFloat, Field(gt=0)],
429
+ Tuple[
430
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
431
+ ],
432
+ ] = None,
433
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
434
+ _content_type: Optional[StrictStr] = None,
435
+ _headers: Optional[Dict[StrictStr, Any]] = None,
436
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
437
+ ) -> ApiResponse[List[FuturesTradingAction]]:
438
+ """Synchronous version of get_actions_with_http_info"""
439
+ return async_to_sync(self._get_actions_async_with_http_info)(
440
+ limit=limit,
441
+ offset=offset,
442
+ _request_timeout=_request_timeout,
443
+ _request_auth=_request_auth,
444
+ _content_type=_content_type,
445
+ _headers=_headers,
446
+ _host_index=_host_index,
447
+ )
448
+
449
+ @validate_call
450
+ def _get_actions_sync_without_preload_content(
451
+ self,
452
+ limit: Optional[StrictInt] = None,
453
+ offset: Optional[StrictInt] = None,
454
+ _request_timeout: Union[
455
+ None,
456
+ Annotated[StrictFloat, Field(gt=0)],
457
+ Tuple[
458
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
459
+ ],
460
+ ] = None,
461
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
462
+ _content_type: Optional[StrictStr] = None,
463
+ _headers: Optional[Dict[StrictStr, Any]] = None,
464
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
465
+ ) -> RESTResponseType:
466
+ """Synchronous version of get_actions_without_preload_content"""
467
+ return async_to_sync(self._get_actions_async_without_preload_content)(
468
+ limit=limit,
469
+ offset=offset,
470
+ _request_timeout=_request_timeout,
471
+ _request_auth=_request_auth,
472
+ _content_type=_content_type,
473
+ _headers=_headers,
474
+ _host_index=_host_index,
475
+ )
243
476
 
244
477
  def _get_actions_serialize(
245
478
  self,
@@ -303,7 +536,128 @@ class TradingActionsApi:
303
536
  )
304
537
 
305
538
  @validate_call
306
- async def post_futures_action(
539
+ def post_futures_action(
540
+ self,
541
+ futures_trading_action_create: FuturesTradingActionCreate,
542
+ _request_timeout: Union[
543
+ None,
544
+ Annotated[StrictFloat, Field(gt=0)],
545
+ Tuple[
546
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
547
+ ],
548
+ ] = None,
549
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
550
+ _content_type: Optional[StrictStr] = None,
551
+ _headers: Optional[Dict[StrictStr, Any]] = None,
552
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
553
+ ) -> PostFuturesAction:
554
+ """Post Futures Action
555
+
556
+ This method can work in both sync and async modes based on the is_sync flag.
557
+ """
558
+ if self.is_sync:
559
+ return self._post_futures_action_sync(
560
+ futures_trading_action_create=futures_trading_action_create,
561
+ _request_timeout=_request_timeout,
562
+ _request_auth=_request_auth,
563
+ _content_type=_content_type,
564
+ _headers=_headers,
565
+ _host_index=_host_index,
566
+ )
567
+
568
+ else:
569
+ return self._post_futures_action_async(
570
+ futures_trading_action_create=futures_trading_action_create,
571
+ _request_timeout=_request_timeout,
572
+ _request_auth=_request_auth,
573
+ _content_type=_content_type,
574
+ _headers=_headers,
575
+ _host_index=_host_index,
576
+ )
577
+
578
+ @validate_call
579
+ def post_futures_action_with_http_info(
580
+ self,
581
+ futures_trading_action_create: FuturesTradingActionCreate,
582
+ _request_timeout: Union[
583
+ None,
584
+ Annotated[StrictFloat, Field(gt=0)],
585
+ Tuple[
586
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
587
+ ],
588
+ ] = None,
589
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
590
+ _content_type: Optional[StrictStr] = None,
591
+ _headers: Optional[Dict[StrictStr, Any]] = None,
592
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
593
+ ) -> ApiResponse[PostFuturesAction]:
594
+ """Post Futures Action with HTTP info
595
+
596
+ This method can work in both sync and async modes based on the is_sync flag.
597
+ """
598
+ if self.is_sync:
599
+ return self._post_futures_action_sync_with_http_info(
600
+ futures_trading_action_create=futures_trading_action_create,
601
+ _request_timeout=_request_timeout,
602
+ _request_auth=_request_auth,
603
+ _content_type=_content_type,
604
+ _headers=_headers,
605
+ _host_index=_host_index,
606
+ )
607
+
608
+ else:
609
+ return self._post_futures_action_async_with_http_info(
610
+ futures_trading_action_create=futures_trading_action_create,
611
+ _request_timeout=_request_timeout,
612
+ _request_auth=_request_auth,
613
+ _content_type=_content_type,
614
+ _headers=_headers,
615
+ _host_index=_host_index,
616
+ )
617
+
618
+ @validate_call
619
+ def post_futures_action_without_preload_content(
620
+ self,
621
+ futures_trading_action_create: FuturesTradingActionCreate,
622
+ _request_timeout: Union[
623
+ None,
624
+ Annotated[StrictFloat, Field(gt=0)],
625
+ Tuple[
626
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
627
+ ],
628
+ ] = None,
629
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
630
+ _content_type: Optional[StrictStr] = None,
631
+ _headers: Optional[Dict[StrictStr, Any]] = None,
632
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
633
+ ) -> RESTResponseType:
634
+ """Post Futures Action without preloading content
635
+
636
+ This method can work in both sync and async modes based on the is_sync flag.
637
+ """
638
+ if self.is_sync:
639
+ return self._post_futures_action_sync_without_preload_content(
640
+ futures_trading_action_create=futures_trading_action_create,
641
+ _request_timeout=_request_timeout,
642
+ _request_auth=_request_auth,
643
+ _content_type=_content_type,
644
+ _headers=_headers,
645
+ _host_index=_host_index,
646
+ )
647
+
648
+ else:
649
+ return self._post_futures_action_async_without_preload_content(
650
+ futures_trading_action_create=futures_trading_action_create,
651
+ _request_timeout=_request_timeout,
652
+ _request_auth=_request_auth,
653
+ _content_type=_content_type,
654
+ _headers=_headers,
655
+ _host_index=_host_index,
656
+ )
657
+
658
+ # Private async implementation methods
659
+ @validate_call
660
+ async def _post_futures_action_async(
307
661
  self,
308
662
  futures_trading_action_create: FuturesTradingActionCreate,
309
663
  _request_timeout: Union[
@@ -367,7 +721,7 @@ class TradingActionsApi:
367
721
  ).data
368
722
 
369
723
  @validate_call
370
- async def post_futures_action_with_http_info(
724
+ async def _post_futures_action_async_with_http_info(
371
725
  self,
372
726
  futures_trading_action_create: FuturesTradingActionCreate,
373
727
  _request_timeout: Union[
@@ -426,12 +780,11 @@ class TradingActionsApi:
426
780
  )
427
781
  await response_data.read()
428
782
  return self.api_client.response_deserialize(
429
- response_data=response_data,
430
- response_types_map=_response_types_map,
783
+ response_data=response_data, response_types_map=_response_types_map
431
784
  )
432
785
 
433
786
  @validate_call
434
- async def post_futures_action_without_preload_content(
787
+ async def _post_futures_action_async_without_preload_content(
435
788
  self,
436
789
  futures_trading_action_create: FuturesTradingActionCreate,
437
790
  _request_timeout: Union[
@@ -488,7 +841,86 @@ class TradingActionsApi:
488
841
  response_data = await self.api_client.call_api(
489
842
  *_param, _request_timeout=_request_timeout
490
843
  )
491
- return response_data.response
844
+ return response_data
845
+
846
+ # Private sync implementation methods
847
+ @validate_call
848
+ def _post_futures_action_sync(
849
+ self,
850
+ futures_trading_action_create: FuturesTradingActionCreate,
851
+ _request_timeout: Union[
852
+ None,
853
+ Annotated[StrictFloat, Field(gt=0)],
854
+ Tuple[
855
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
856
+ ],
857
+ ] = None,
858
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
859
+ _content_type: Optional[StrictStr] = None,
860
+ _headers: Optional[Dict[StrictStr, Any]] = None,
861
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
862
+ ) -> PostFuturesAction:
863
+ """Synchronous version of post_futures_action"""
864
+ return async_to_sync(self._post_futures_action_async)(
865
+ futures_trading_action_create=futures_trading_action_create,
866
+ _request_timeout=_request_timeout,
867
+ _request_auth=_request_auth,
868
+ _content_type=_content_type,
869
+ _headers=_headers,
870
+ _host_index=_host_index,
871
+ )
872
+
873
+ @validate_call
874
+ def _post_futures_action_sync_with_http_info(
875
+ self,
876
+ futures_trading_action_create: FuturesTradingActionCreate,
877
+ _request_timeout: Union[
878
+ None,
879
+ Annotated[StrictFloat, Field(gt=0)],
880
+ Tuple[
881
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
882
+ ],
883
+ ] = None,
884
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
885
+ _content_type: Optional[StrictStr] = None,
886
+ _headers: Optional[Dict[StrictStr, Any]] = None,
887
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
888
+ ) -> ApiResponse[PostFuturesAction]:
889
+ """Synchronous version of post_futures_action_with_http_info"""
890
+ return async_to_sync(self._post_futures_action_async_with_http_info)(
891
+ futures_trading_action_create=futures_trading_action_create,
892
+ _request_timeout=_request_timeout,
893
+ _request_auth=_request_auth,
894
+ _content_type=_content_type,
895
+ _headers=_headers,
896
+ _host_index=_host_index,
897
+ )
898
+
899
+ @validate_call
900
+ def _post_futures_action_sync_without_preload_content(
901
+ self,
902
+ futures_trading_action_create: FuturesTradingActionCreate,
903
+ _request_timeout: Union[
904
+ None,
905
+ Annotated[StrictFloat, Field(gt=0)],
906
+ Tuple[
907
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
908
+ ],
909
+ ] = None,
910
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
911
+ _content_type: Optional[StrictStr] = None,
912
+ _headers: Optional[Dict[StrictStr, Any]] = None,
913
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
914
+ ) -> RESTResponseType:
915
+ """Synchronous version of post_futures_action_without_preload_content"""
916
+ return async_to_sync(self._post_futures_action_async_without_preload_content)(
917
+ futures_trading_action_create=futures_trading_action_create,
918
+ _request_timeout=_request_timeout,
919
+ _request_auth=_request_auth,
920
+ _content_type=_content_type,
921
+ _headers=_headers,
922
+ _host_index=_host_index,
923
+ )
492
924
 
493
925
  def _post_futures_action_serialize(
494
926
  self,
@@ -555,7 +987,128 @@ class TradingActionsApi:
555
987
  )
556
988
 
557
989
  @validate_call
558
- async def post_spot_action(
990
+ def post_spot_action(
991
+ self,
992
+ spot_trading_action_create: SpotTradingActionCreate,
993
+ _request_timeout: Union[
994
+ None,
995
+ Annotated[StrictFloat, Field(gt=0)],
996
+ Tuple[
997
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
998
+ ],
999
+ ] = None,
1000
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1001
+ _content_type: Optional[StrictStr] = None,
1002
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1003
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1004
+ ) -> object:
1005
+ """Post Spot Action
1006
+
1007
+ This method can work in both sync and async modes based on the is_sync flag.
1008
+ """
1009
+ if self.is_sync:
1010
+ return self._post_spot_action_sync(
1011
+ spot_trading_action_create=spot_trading_action_create,
1012
+ _request_timeout=_request_timeout,
1013
+ _request_auth=_request_auth,
1014
+ _content_type=_content_type,
1015
+ _headers=_headers,
1016
+ _host_index=_host_index,
1017
+ )
1018
+
1019
+ else:
1020
+ return self._post_spot_action_async(
1021
+ spot_trading_action_create=spot_trading_action_create,
1022
+ _request_timeout=_request_timeout,
1023
+ _request_auth=_request_auth,
1024
+ _content_type=_content_type,
1025
+ _headers=_headers,
1026
+ _host_index=_host_index,
1027
+ )
1028
+
1029
+ @validate_call
1030
+ def post_spot_action_with_http_info(
1031
+ self,
1032
+ spot_trading_action_create: SpotTradingActionCreate,
1033
+ _request_timeout: Union[
1034
+ None,
1035
+ Annotated[StrictFloat, Field(gt=0)],
1036
+ Tuple[
1037
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1038
+ ],
1039
+ ] = None,
1040
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1041
+ _content_type: Optional[StrictStr] = None,
1042
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1043
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1044
+ ) -> ApiResponse[object]:
1045
+ """Post Spot Action with HTTP info
1046
+
1047
+ This method can work in both sync and async modes based on the is_sync flag.
1048
+ """
1049
+ if self.is_sync:
1050
+ return self._post_spot_action_sync_with_http_info(
1051
+ spot_trading_action_create=spot_trading_action_create,
1052
+ _request_timeout=_request_timeout,
1053
+ _request_auth=_request_auth,
1054
+ _content_type=_content_type,
1055
+ _headers=_headers,
1056
+ _host_index=_host_index,
1057
+ )
1058
+
1059
+ else:
1060
+ return self._post_spot_action_async_with_http_info(
1061
+ spot_trading_action_create=spot_trading_action_create,
1062
+ _request_timeout=_request_timeout,
1063
+ _request_auth=_request_auth,
1064
+ _content_type=_content_type,
1065
+ _headers=_headers,
1066
+ _host_index=_host_index,
1067
+ )
1068
+
1069
+ @validate_call
1070
+ def post_spot_action_without_preload_content(
1071
+ self,
1072
+ spot_trading_action_create: SpotTradingActionCreate,
1073
+ _request_timeout: Union[
1074
+ None,
1075
+ Annotated[StrictFloat, Field(gt=0)],
1076
+ Tuple[
1077
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1078
+ ],
1079
+ ] = None,
1080
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1081
+ _content_type: Optional[StrictStr] = None,
1082
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1083
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1084
+ ) -> RESTResponseType:
1085
+ """Post Spot Action without preloading content
1086
+
1087
+ This method can work in both sync and async modes based on the is_sync flag.
1088
+ """
1089
+ if self.is_sync:
1090
+ return self._post_spot_action_sync_without_preload_content(
1091
+ spot_trading_action_create=spot_trading_action_create,
1092
+ _request_timeout=_request_timeout,
1093
+ _request_auth=_request_auth,
1094
+ _content_type=_content_type,
1095
+ _headers=_headers,
1096
+ _host_index=_host_index,
1097
+ )
1098
+
1099
+ else:
1100
+ return self._post_spot_action_async_without_preload_content(
1101
+ spot_trading_action_create=spot_trading_action_create,
1102
+ _request_timeout=_request_timeout,
1103
+ _request_auth=_request_auth,
1104
+ _content_type=_content_type,
1105
+ _headers=_headers,
1106
+ _host_index=_host_index,
1107
+ )
1108
+
1109
+ # Private async implementation methods
1110
+ @validate_call
1111
+ async def _post_spot_action_async(
559
1112
  self,
560
1113
  spot_trading_action_create: SpotTradingActionCreate,
561
1114
  _request_timeout: Union[
@@ -618,7 +1171,7 @@ class TradingActionsApi:
618
1171
  ).data
619
1172
 
620
1173
  @validate_call
621
- async def post_spot_action_with_http_info(
1174
+ async def _post_spot_action_async_with_http_info(
622
1175
  self,
623
1176
  spot_trading_action_create: SpotTradingActionCreate,
624
1177
  _request_timeout: Union[
@@ -676,12 +1229,11 @@ class TradingActionsApi:
676
1229
  )
677
1230
  await response_data.read()
678
1231
  return self.api_client.response_deserialize(
679
- response_data=response_data,
680
- response_types_map=_response_types_map,
1232
+ response_data=response_data, response_types_map=_response_types_map
681
1233
  )
682
1234
 
683
1235
  @validate_call
684
- async def post_spot_action_without_preload_content(
1236
+ async def _post_spot_action_async_without_preload_content(
685
1237
  self,
686
1238
  spot_trading_action_create: SpotTradingActionCreate,
687
1239
  _request_timeout: Union[
@@ -737,7 +1289,86 @@ class TradingActionsApi:
737
1289
  response_data = await self.api_client.call_api(
738
1290
  *_param, _request_timeout=_request_timeout
739
1291
  )
740
- return response_data.response
1292
+ return response_data
1293
+
1294
+ # Private sync implementation methods
1295
+ @validate_call
1296
+ def _post_spot_action_sync(
1297
+ self,
1298
+ spot_trading_action_create: SpotTradingActionCreate,
1299
+ _request_timeout: Union[
1300
+ None,
1301
+ Annotated[StrictFloat, Field(gt=0)],
1302
+ Tuple[
1303
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1304
+ ],
1305
+ ] = None,
1306
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1307
+ _content_type: Optional[StrictStr] = None,
1308
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1309
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1310
+ ) -> object:
1311
+ """Synchronous version of post_spot_action"""
1312
+ return async_to_sync(self._post_spot_action_async)(
1313
+ spot_trading_action_create=spot_trading_action_create,
1314
+ _request_timeout=_request_timeout,
1315
+ _request_auth=_request_auth,
1316
+ _content_type=_content_type,
1317
+ _headers=_headers,
1318
+ _host_index=_host_index,
1319
+ )
1320
+
1321
+ @validate_call
1322
+ def _post_spot_action_sync_with_http_info(
1323
+ self,
1324
+ spot_trading_action_create: SpotTradingActionCreate,
1325
+ _request_timeout: Union[
1326
+ None,
1327
+ Annotated[StrictFloat, Field(gt=0)],
1328
+ Tuple[
1329
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1330
+ ],
1331
+ ] = None,
1332
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1333
+ _content_type: Optional[StrictStr] = None,
1334
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1335
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1336
+ ) -> ApiResponse[object]:
1337
+ """Synchronous version of post_spot_action_with_http_info"""
1338
+ return async_to_sync(self._post_spot_action_async_with_http_info)(
1339
+ spot_trading_action_create=spot_trading_action_create,
1340
+ _request_timeout=_request_timeout,
1341
+ _request_auth=_request_auth,
1342
+ _content_type=_content_type,
1343
+ _headers=_headers,
1344
+ _host_index=_host_index,
1345
+ )
1346
+
1347
+ @validate_call
1348
+ def _post_spot_action_sync_without_preload_content(
1349
+ self,
1350
+ spot_trading_action_create: SpotTradingActionCreate,
1351
+ _request_timeout: Union[
1352
+ None,
1353
+ Annotated[StrictFloat, Field(gt=0)],
1354
+ Tuple[
1355
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
1356
+ ],
1357
+ ] = None,
1358
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1359
+ _content_type: Optional[StrictStr] = None,
1360
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1361
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1362
+ ) -> RESTResponseType:
1363
+ """Synchronous version of post_spot_action_without_preload_content"""
1364
+ return async_to_sync(self._post_spot_action_async_without_preload_content)(
1365
+ spot_trading_action_create=spot_trading_action_create,
1366
+ _request_timeout=_request_timeout,
1367
+ _request_auth=_request_auth,
1368
+ _content_type=_content_type,
1369
+ _headers=_headers,
1370
+ _host_index=_host_index,
1371
+ )
741
1372
 
742
1373
  def _post_spot_action_serialize(
743
1374
  self,