snaptrade-python-sdk 11.0.117__py3-none-any.whl → 11.0.119__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.
- snaptrade_client/__init__.py +1 -1
- snaptrade_client/api_client.py +1 -1
- snaptrade_client/apis/path_to_api.py +9 -9
- snaptrade_client/apis/paths/accounts_account_id_trading_crypto.py +7 -0
- snaptrade_client/apis/paths/accounts_account_id_trading_crypto_preview.py +7 -0
- snaptrade_client/apis/paths/accounts_account_id_trading_replace.py +7 -0
- snaptrade_client/apis/tags/trading_api_generated.py +5 -5
- snaptrade_client/configuration.py +1 -1
- snaptrade_client/model/crypto_order_form.py +249 -0
- snaptrade_client/model/crypto_order_form.pyi +229 -0
- snaptrade_client/model/{simple_order_preview.pyi → crypto_order_preview.py} +8 -8
- snaptrade_client/model/{simple_order_preview.py → crypto_order_preview.pyi} +8 -8
- snaptrade_client/model/{simple_order_preview_estimated_fee.py → crypto_order_preview_estimated_fee.py} +2 -2
- snaptrade_client/model/{simple_order_preview_estimated_fee.pyi → crypto_order_preview_estimated_fee.pyi} +2 -2
- snaptrade_client/model/crypto_trading_instrument.py +113 -0
- snaptrade_client/model/crypto_trading_instrument.pyi +106 -0
- snaptrade_client/model/manual_trade_replace_form.py +15 -3
- snaptrade_client/model/manual_trade_replace_form.pyi +15 -3
- snaptrade_client/model/simple_order_form.py +14 -15
- snaptrade_client/model/simple_order_form.pyi +14 -15
- snaptrade_client/models/__init__.py +4 -2
- snaptrade_client/operation_parameter_map.py +43 -43
- snaptrade_client/paths/__init__.py +3 -3
- snaptrade_client/paths/accounts_account_id_orders_cancel/post.py +6 -2
- snaptrade_client/paths/accounts_account_id_orders_cancel/post.pyi +6 -2
- snaptrade_client/paths/accounts_account_id_trading_cancel/post.py +2 -2
- snaptrade_client/paths/accounts_account_id_trading_cancel/post.pyi +2 -2
- snaptrade_client/paths/{accounts_account_id_trading_simple → accounts_account_id_trading_crypto}/__init__.py +2 -2
- snaptrade_client/paths/{accounts_account_id_trading_simple → accounts_account_id_trading_crypto}/post.py +34 -34
- snaptrade_client/paths/{accounts_account_id_trading_simple → accounts_account_id_trading_crypto}/post.pyi +34 -34
- snaptrade_client/paths/{accounts_account_id_trading_simple_preview → accounts_account_id_trading_crypto_preview}/__init__.py +2 -2
- snaptrade_client/paths/{accounts_account_id_trading_simple_preview → accounts_account_id_trading_crypto_preview}/post.py +39 -39
- snaptrade_client/paths/{accounts_account_id_trading_simple_preview → accounts_account_id_trading_crypto_preview}/post.pyi +39 -39
- snaptrade_client/paths/{accounts_account_id_trading_simple_brokerage_order_id_replace → accounts_account_id_trading_replace}/__init__.py +2 -2
- snaptrade_client/paths/{accounts_account_id_trading_simple_brokerage_order_id_replace/patch.py → accounts_account_id_trading_replace/post.py} +18 -28
- snaptrade_client/paths/{accounts_account_id_trading_simple_brokerage_order_id_replace/patch.pyi → accounts_account_id_trading_replace/post.pyi} +18 -28
- snaptrade_client/paths/brokerages_brokerage_id_instruments/get.py +4 -4
- snaptrade_client/paths/brokerages_brokerage_id_instruments/get.pyi +4 -4
- snaptrade_client/type/crypto_order_form.py +50 -0
- snaptrade_client/type/{simple_order_preview.py → crypto_order_preview.py} +5 -5
- snaptrade_client/type/{simple_order_preview_estimated_fee.py → crypto_order_preview_estimated_fee.py} +3 -3
- snaptrade_client/type/crypto_trading_instrument.py +30 -0
- snaptrade_client/type/manual_trade_replace_form.py +3 -0
- {snaptrade_python_sdk-11.0.117.dist-info → snaptrade_python_sdk-11.0.119.dist-info}/METADATA +107 -105
- {snaptrade_python_sdk-11.0.117.dist-info → snaptrade_python_sdk-11.0.119.dist-info}/RECORD +47 -41
- snaptrade_client/apis/paths/accounts_account_id_trading_simple.py +0 -7
- snaptrade_client/apis/paths/accounts_account_id_trading_simple_brokerage_order_id_replace.py +0 -7
- snaptrade_client/apis/paths/accounts_account_id_trading_simple_preview.py +0 -7
- {snaptrade_python_sdk-11.0.117.dist-info → snaptrade_python_sdk-11.0.119.dist-info}/LICENSE +0 -0
- {snaptrade_python_sdk-11.0.117.dist-info → snaptrade_python_sdk-11.0.119.dist-info}/WHEEL +0 -0
|
@@ -32,16 +32,16 @@ import frozendict # noqa: F401
|
|
|
32
32
|
|
|
33
33
|
from snaptrade_client import schemas # noqa: F401
|
|
34
34
|
|
|
35
|
-
from snaptrade_client.model.trading_instrument import TradingInstrument as TradingInstrumentSchema
|
|
36
35
|
from snaptrade_client.model.model400_failed_request_response import Model400FailedRequestResponse as Model400FailedRequestResponseSchema
|
|
37
36
|
from snaptrade_client.model.action_strict import ActionStrict as ActionStrictSchema
|
|
38
|
-
from snaptrade_client.model.
|
|
37
|
+
from snaptrade_client.model.crypto_order_form import CryptoOrderForm as CryptoOrderFormSchema
|
|
38
|
+
from snaptrade_client.model.crypto_trading_instrument import CryptoTradingInstrument as CryptoTradingInstrumentSchema
|
|
39
39
|
from snaptrade_client.model.order_updated_response import OrderUpdatedResponse as OrderUpdatedResponseSchema
|
|
40
40
|
|
|
41
|
-
from snaptrade_client.type.
|
|
41
|
+
from snaptrade_client.type.crypto_order_form import CryptoOrderForm
|
|
42
42
|
from snaptrade_client.type.model400_failed_request_response import Model400FailedRequestResponse
|
|
43
|
+
from snaptrade_client.type.crypto_trading_instrument import CryptoTradingInstrument
|
|
43
44
|
from snaptrade_client.type.action_strict import ActionStrict
|
|
44
|
-
from snaptrade_client.type.simple_order_form import SimpleOrderForm
|
|
45
45
|
from snaptrade_client.type.order_updated_response import OrderUpdatedResponse
|
|
46
46
|
|
|
47
47
|
# Query params
|
|
@@ -107,10 +107,10 @@ request_path_account_id = api_client.PathParameter(
|
|
|
107
107
|
required=True,
|
|
108
108
|
)
|
|
109
109
|
# body param
|
|
110
|
-
SchemaForRequestBodyApplicationJson =
|
|
110
|
+
SchemaForRequestBodyApplicationJson = CryptoOrderFormSchema
|
|
111
111
|
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
request_body_crypto_order_form = api_client.RequestBody(
|
|
114
114
|
content={
|
|
115
115
|
'application/json': api_client.MediaType(
|
|
116
116
|
schema=SchemaForRequestBodyApplicationJson),
|
|
@@ -182,10 +182,10 @@ _all_accept_content_types = (
|
|
|
182
182
|
|
|
183
183
|
class BaseApi(api_client.Api):
|
|
184
184
|
|
|
185
|
-
def
|
|
185
|
+
def _place_crypto_order_mapped_args(
|
|
186
186
|
self,
|
|
187
|
-
body: typing.Optional[
|
|
188
|
-
instrument: typing.Optional[
|
|
187
|
+
body: typing.Optional[CryptoOrderForm] = None,
|
|
188
|
+
instrument: typing.Optional[CryptoTradingInstrument] = None,
|
|
189
189
|
side: typing.Optional[ActionStrict] = None,
|
|
190
190
|
type: typing.Optional[str] = None,
|
|
191
191
|
time_in_force: typing.Optional[str] = None,
|
|
@@ -233,7 +233,7 @@ class BaseApi(api_client.Api):
|
|
|
233
233
|
args.path = path_params if path_params else _path_params
|
|
234
234
|
return args
|
|
235
235
|
|
|
236
|
-
async def
|
|
236
|
+
async def _aplace_crypto_order_oapg(
|
|
237
237
|
self,
|
|
238
238
|
body: typing.Any = None,
|
|
239
239
|
query_params: typing.Optional[dict] = {},
|
|
@@ -303,12 +303,12 @@ class BaseApi(api_client.Api):
|
|
|
303
303
|
resource_path=used_path,
|
|
304
304
|
method=method,
|
|
305
305
|
configuration=self.api_client.configuration,
|
|
306
|
-
path_template='/accounts/{accountId}/trading/
|
|
306
|
+
path_template='/accounts/{accountId}/trading/crypto',
|
|
307
307
|
body=body,
|
|
308
308
|
auth_settings=_auth,
|
|
309
309
|
headers=_headers,
|
|
310
310
|
)
|
|
311
|
-
serialized_data =
|
|
311
|
+
serialized_data = request_body_crypto_order_form.serialize(body, content_type)
|
|
312
312
|
if 'fields' in serialized_data:
|
|
313
313
|
_fields = serialized_data['fields']
|
|
314
314
|
elif 'body' in serialized_data:
|
|
@@ -381,7 +381,7 @@ class BaseApi(api_client.Api):
|
|
|
381
381
|
return api_response
|
|
382
382
|
|
|
383
383
|
|
|
384
|
-
def
|
|
384
|
+
def _place_crypto_order_oapg(
|
|
385
385
|
self,
|
|
386
386
|
body: typing.Any = None,
|
|
387
387
|
query_params: typing.Optional[dict] = {},
|
|
@@ -449,12 +449,12 @@ class BaseApi(api_client.Api):
|
|
|
449
449
|
resource_path=used_path,
|
|
450
450
|
method=method,
|
|
451
451
|
configuration=self.api_client.configuration,
|
|
452
|
-
path_template='/accounts/{accountId}/trading/
|
|
452
|
+
path_template='/accounts/{accountId}/trading/crypto',
|
|
453
453
|
body=body,
|
|
454
454
|
auth_settings=_auth,
|
|
455
455
|
headers=_headers,
|
|
456
456
|
)
|
|
457
|
-
serialized_data =
|
|
457
|
+
serialized_data = request_body_crypto_order_form.serialize(body, content_type)
|
|
458
458
|
if 'fields' in serialized_data:
|
|
459
459
|
_fields = serialized_data['fields']
|
|
460
460
|
elif 'body' in serialized_data:
|
|
@@ -496,13 +496,13 @@ class BaseApi(api_client.Api):
|
|
|
496
496
|
return api_response
|
|
497
497
|
|
|
498
498
|
|
|
499
|
-
class
|
|
499
|
+
class PlaceCryptoOrder(BaseApi):
|
|
500
500
|
# this class is used by api classes that refer to endpoints with operationId fn names
|
|
501
501
|
|
|
502
|
-
async def
|
|
502
|
+
async def aplace_crypto_order(
|
|
503
503
|
self,
|
|
504
|
-
body: typing.Optional[
|
|
505
|
-
instrument: typing.Optional[
|
|
504
|
+
body: typing.Optional[CryptoOrderForm] = None,
|
|
505
|
+
instrument: typing.Optional[CryptoTradingInstrument] = None,
|
|
506
506
|
side: typing.Optional[ActionStrict] = None,
|
|
507
507
|
type: typing.Optional[str] = None,
|
|
508
508
|
time_in_force: typing.Optional[str] = None,
|
|
@@ -522,7 +522,7 @@ class PlaceSimpleOrder(BaseApi):
|
|
|
522
522
|
api_client.ApiResponseWithoutDeserializationAsync,
|
|
523
523
|
AsyncGeneratorResponse,
|
|
524
524
|
]:
|
|
525
|
-
args = self.
|
|
525
|
+
args = self._place_crypto_order_mapped_args(
|
|
526
526
|
body=body,
|
|
527
527
|
query_params=query_params,
|
|
528
528
|
path_params=path_params,
|
|
@@ -539,17 +539,17 @@ class PlaceSimpleOrder(BaseApi):
|
|
|
539
539
|
post_only=post_only,
|
|
540
540
|
expiration_date=expiration_date,
|
|
541
541
|
)
|
|
542
|
-
return await self.
|
|
542
|
+
return await self._aplace_crypto_order_oapg(
|
|
543
543
|
body=args.body,
|
|
544
544
|
query_params=args.query,
|
|
545
545
|
path_params=args.path,
|
|
546
546
|
**kwargs,
|
|
547
547
|
)
|
|
548
548
|
|
|
549
|
-
def
|
|
549
|
+
def place_crypto_order(
|
|
550
550
|
self,
|
|
551
|
-
body: typing.Optional[
|
|
552
|
-
instrument: typing.Optional[
|
|
551
|
+
body: typing.Optional[CryptoOrderForm] = None,
|
|
552
|
+
instrument: typing.Optional[CryptoTradingInstrument] = None,
|
|
553
553
|
side: typing.Optional[ActionStrict] = None,
|
|
554
554
|
type: typing.Optional[str] = None,
|
|
555
555
|
time_in_force: typing.Optional[str] = None,
|
|
@@ -568,7 +568,7 @@ class PlaceSimpleOrder(BaseApi):
|
|
|
568
568
|
api_client.ApiResponseWithoutDeserialization,
|
|
569
569
|
]:
|
|
570
570
|
""" Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order. """
|
|
571
|
-
args = self.
|
|
571
|
+
args = self._place_crypto_order_mapped_args(
|
|
572
572
|
body=body,
|
|
573
573
|
query_params=query_params,
|
|
574
574
|
path_params=path_params,
|
|
@@ -585,7 +585,7 @@ class PlaceSimpleOrder(BaseApi):
|
|
|
585
585
|
post_only=post_only,
|
|
586
586
|
expiration_date=expiration_date,
|
|
587
587
|
)
|
|
588
|
-
return self.
|
|
588
|
+
return self._place_crypto_order_oapg(
|
|
589
589
|
body=args.body,
|
|
590
590
|
query_params=args.query,
|
|
591
591
|
path_params=args.path,
|
|
@@ -596,8 +596,8 @@ class ApiForpost(BaseApi):
|
|
|
596
596
|
|
|
597
597
|
async def apost(
|
|
598
598
|
self,
|
|
599
|
-
body: typing.Optional[
|
|
600
|
-
instrument: typing.Optional[
|
|
599
|
+
body: typing.Optional[CryptoOrderForm] = None,
|
|
600
|
+
instrument: typing.Optional[CryptoTradingInstrument] = None,
|
|
601
601
|
side: typing.Optional[ActionStrict] = None,
|
|
602
602
|
type: typing.Optional[str] = None,
|
|
603
603
|
time_in_force: typing.Optional[str] = None,
|
|
@@ -617,7 +617,7 @@ class ApiForpost(BaseApi):
|
|
|
617
617
|
api_client.ApiResponseWithoutDeserializationAsync,
|
|
618
618
|
AsyncGeneratorResponse,
|
|
619
619
|
]:
|
|
620
|
-
args = self.
|
|
620
|
+
args = self._place_crypto_order_mapped_args(
|
|
621
621
|
body=body,
|
|
622
622
|
query_params=query_params,
|
|
623
623
|
path_params=path_params,
|
|
@@ -634,7 +634,7 @@ class ApiForpost(BaseApi):
|
|
|
634
634
|
post_only=post_only,
|
|
635
635
|
expiration_date=expiration_date,
|
|
636
636
|
)
|
|
637
|
-
return await self.
|
|
637
|
+
return await self._aplace_crypto_order_oapg(
|
|
638
638
|
body=args.body,
|
|
639
639
|
query_params=args.query,
|
|
640
640
|
path_params=args.path,
|
|
@@ -643,8 +643,8 @@ class ApiForpost(BaseApi):
|
|
|
643
643
|
|
|
644
644
|
def post(
|
|
645
645
|
self,
|
|
646
|
-
body: typing.Optional[
|
|
647
|
-
instrument: typing.Optional[
|
|
646
|
+
body: typing.Optional[CryptoOrderForm] = None,
|
|
647
|
+
instrument: typing.Optional[CryptoTradingInstrument] = None,
|
|
648
648
|
side: typing.Optional[ActionStrict] = None,
|
|
649
649
|
type: typing.Optional[str] = None,
|
|
650
650
|
time_in_force: typing.Optional[str] = None,
|
|
@@ -663,7 +663,7 @@ class ApiForpost(BaseApi):
|
|
|
663
663
|
api_client.ApiResponseWithoutDeserialization,
|
|
664
664
|
]:
|
|
665
665
|
""" Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order. """
|
|
666
|
-
args = self.
|
|
666
|
+
args = self._place_crypto_order_mapped_args(
|
|
667
667
|
body=body,
|
|
668
668
|
query_params=query_params,
|
|
669
669
|
path_params=path_params,
|
|
@@ -680,7 +680,7 @@ class ApiForpost(BaseApi):
|
|
|
680
680
|
post_only=post_only,
|
|
681
681
|
expiration_date=expiration_date,
|
|
682
682
|
)
|
|
683
|
-
return self.
|
|
683
|
+
return self._place_crypto_order_oapg(
|
|
684
684
|
body=args.body,
|
|
685
685
|
query_params=args.query,
|
|
686
686
|
path_params=args.path,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# do not import all endpoints into this module because that uses a lot of memory and stack frames
|
|
2
2
|
# if you need the ability to import all endpoints from this module, import them with
|
|
3
|
-
# from snaptrade_client.paths.
|
|
3
|
+
# from snaptrade_client.paths.accounts_account_id_trading_crypto_preview import Api
|
|
4
4
|
|
|
5
5
|
from snaptrade_client.paths import PathValues
|
|
6
6
|
|
|
7
|
-
path = PathValues.
|
|
7
|
+
path = PathValues.ACCOUNTS_ACCOUNT_ID_TRADING_CRYPTO_PREVIEW
|
|
@@ -32,17 +32,17 @@ import frozendict # noqa: F401
|
|
|
32
32
|
|
|
33
33
|
from snaptrade_client import schemas # noqa: F401
|
|
34
34
|
|
|
35
|
-
from snaptrade_client.model.trading_instrument import TradingInstrument as TradingInstrumentSchema
|
|
36
35
|
from snaptrade_client.model.model400_failed_request_response import Model400FailedRequestResponse as Model400FailedRequestResponseSchema
|
|
37
36
|
from snaptrade_client.model.action_strict import ActionStrict as ActionStrictSchema
|
|
38
|
-
from snaptrade_client.model.
|
|
39
|
-
from snaptrade_client.model.
|
|
37
|
+
from snaptrade_client.model.crypto_order_form import CryptoOrderForm as CryptoOrderFormSchema
|
|
38
|
+
from snaptrade_client.model.crypto_trading_instrument import CryptoTradingInstrument as CryptoTradingInstrumentSchema
|
|
39
|
+
from snaptrade_client.model.crypto_order_preview import CryptoOrderPreview as CryptoOrderPreviewSchema
|
|
40
40
|
|
|
41
|
-
from snaptrade_client.type.
|
|
42
|
-
from snaptrade_client.type.simple_order_preview import SimpleOrderPreview
|
|
41
|
+
from snaptrade_client.type.crypto_order_form import CryptoOrderForm
|
|
43
42
|
from snaptrade_client.type.model400_failed_request_response import Model400FailedRequestResponse
|
|
43
|
+
from snaptrade_client.type.crypto_trading_instrument import CryptoTradingInstrument
|
|
44
44
|
from snaptrade_client.type.action_strict import ActionStrict
|
|
45
|
-
from snaptrade_client.type.
|
|
45
|
+
from snaptrade_client.type.crypto_order_preview import CryptoOrderPreview
|
|
46
46
|
|
|
47
47
|
from . import path
|
|
48
48
|
|
|
@@ -109,10 +109,10 @@ request_path_account_id = api_client.PathParameter(
|
|
|
109
109
|
required=True,
|
|
110
110
|
)
|
|
111
111
|
# body param
|
|
112
|
-
SchemaForRequestBodyApplicationJson =
|
|
112
|
+
SchemaForRequestBodyApplicationJson = CryptoOrderFormSchema
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
request_body_crypto_order_form = api_client.RequestBody(
|
|
116
116
|
content={
|
|
117
117
|
'application/json': api_client.MediaType(
|
|
118
118
|
schema=SchemaForRequestBodyApplicationJson),
|
|
@@ -124,17 +124,17 @@ _auth = [
|
|
|
124
124
|
'PartnerSignature',
|
|
125
125
|
'PartnerTimestamp',
|
|
126
126
|
]
|
|
127
|
-
SchemaFor200ResponseBodyApplicationJson =
|
|
127
|
+
SchemaFor200ResponseBodyApplicationJson = CryptoOrderPreviewSchema
|
|
128
128
|
|
|
129
129
|
|
|
130
130
|
@dataclass
|
|
131
131
|
class ApiResponseFor200(api_client.ApiResponse):
|
|
132
|
-
body:
|
|
132
|
+
body: CryptoOrderPreview
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
@dataclass
|
|
136
136
|
class ApiResponseFor200Async(api_client.AsyncApiResponse):
|
|
137
|
-
body:
|
|
137
|
+
body: CryptoOrderPreview
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
_response_for_200 = api_client.OpenApiResponse(
|
|
@@ -194,10 +194,10 @@ _all_accept_content_types = (
|
|
|
194
194
|
|
|
195
195
|
class BaseApi(api_client.Api):
|
|
196
196
|
|
|
197
|
-
def
|
|
197
|
+
def _preview_crypto_order_mapped_args(
|
|
198
198
|
self,
|
|
199
|
-
body: typing.Optional[
|
|
200
|
-
instrument: typing.Optional[
|
|
199
|
+
body: typing.Optional[CryptoOrderForm] = None,
|
|
200
|
+
instrument: typing.Optional[CryptoTradingInstrument] = None,
|
|
201
201
|
side: typing.Optional[ActionStrict] = None,
|
|
202
202
|
type: typing.Optional[str] = None,
|
|
203
203
|
time_in_force: typing.Optional[str] = None,
|
|
@@ -245,7 +245,7 @@ class BaseApi(api_client.Api):
|
|
|
245
245
|
args.path = path_params if path_params else _path_params
|
|
246
246
|
return args
|
|
247
247
|
|
|
248
|
-
async def
|
|
248
|
+
async def _apreview_crypto_order_oapg(
|
|
249
249
|
self,
|
|
250
250
|
body: typing.Any = None,
|
|
251
251
|
query_params: typing.Optional[dict] = {},
|
|
@@ -315,12 +315,12 @@ class BaseApi(api_client.Api):
|
|
|
315
315
|
resource_path=used_path,
|
|
316
316
|
method=method,
|
|
317
317
|
configuration=self.api_client.configuration,
|
|
318
|
-
path_template='/accounts/{accountId}/trading/
|
|
318
|
+
path_template='/accounts/{accountId}/trading/crypto/preview',
|
|
319
319
|
body=body,
|
|
320
320
|
auth_settings=_auth,
|
|
321
321
|
headers=_headers,
|
|
322
322
|
)
|
|
323
|
-
serialized_data =
|
|
323
|
+
serialized_data = request_body_crypto_order_form.serialize(body, content_type)
|
|
324
324
|
if 'fields' in serialized_data:
|
|
325
325
|
_fields = serialized_data['fields']
|
|
326
326
|
elif 'body' in serialized_data:
|
|
@@ -393,7 +393,7 @@ class BaseApi(api_client.Api):
|
|
|
393
393
|
return api_response
|
|
394
394
|
|
|
395
395
|
|
|
396
|
-
def
|
|
396
|
+
def _preview_crypto_order_oapg(
|
|
397
397
|
self,
|
|
398
398
|
body: typing.Any = None,
|
|
399
399
|
query_params: typing.Optional[dict] = {},
|
|
@@ -461,12 +461,12 @@ class BaseApi(api_client.Api):
|
|
|
461
461
|
resource_path=used_path,
|
|
462
462
|
method=method,
|
|
463
463
|
configuration=self.api_client.configuration,
|
|
464
|
-
path_template='/accounts/{accountId}/trading/
|
|
464
|
+
path_template='/accounts/{accountId}/trading/crypto/preview',
|
|
465
465
|
body=body,
|
|
466
466
|
auth_settings=_auth,
|
|
467
467
|
headers=_headers,
|
|
468
468
|
)
|
|
469
|
-
serialized_data =
|
|
469
|
+
serialized_data = request_body_crypto_order_form.serialize(body, content_type)
|
|
470
470
|
if 'fields' in serialized_data:
|
|
471
471
|
_fields = serialized_data['fields']
|
|
472
472
|
elif 'body' in serialized_data:
|
|
@@ -508,13 +508,13 @@ class BaseApi(api_client.Api):
|
|
|
508
508
|
return api_response
|
|
509
509
|
|
|
510
510
|
|
|
511
|
-
class
|
|
511
|
+
class PreviewCryptoOrder(BaseApi):
|
|
512
512
|
# this class is used by api classes that refer to endpoints with operationId fn names
|
|
513
513
|
|
|
514
|
-
async def
|
|
514
|
+
async def apreview_crypto_order(
|
|
515
515
|
self,
|
|
516
|
-
body: typing.Optional[
|
|
517
|
-
instrument: typing.Optional[
|
|
516
|
+
body: typing.Optional[CryptoOrderForm] = None,
|
|
517
|
+
instrument: typing.Optional[CryptoTradingInstrument] = None,
|
|
518
518
|
side: typing.Optional[ActionStrict] = None,
|
|
519
519
|
type: typing.Optional[str] = None,
|
|
520
520
|
time_in_force: typing.Optional[str] = None,
|
|
@@ -534,7 +534,7 @@ class PreviewSimpleOrder(BaseApi):
|
|
|
534
534
|
api_client.ApiResponseWithoutDeserializationAsync,
|
|
535
535
|
AsyncGeneratorResponse,
|
|
536
536
|
]:
|
|
537
|
-
args = self.
|
|
537
|
+
args = self._preview_crypto_order_mapped_args(
|
|
538
538
|
body=body,
|
|
539
539
|
query_params=query_params,
|
|
540
540
|
path_params=path_params,
|
|
@@ -551,17 +551,17 @@ class PreviewSimpleOrder(BaseApi):
|
|
|
551
551
|
post_only=post_only,
|
|
552
552
|
expiration_date=expiration_date,
|
|
553
553
|
)
|
|
554
|
-
return await self.
|
|
554
|
+
return await self._apreview_crypto_order_oapg(
|
|
555
555
|
body=args.body,
|
|
556
556
|
query_params=args.query,
|
|
557
557
|
path_params=args.path,
|
|
558
558
|
**kwargs,
|
|
559
559
|
)
|
|
560
560
|
|
|
561
|
-
def
|
|
561
|
+
def preview_crypto_order(
|
|
562
562
|
self,
|
|
563
|
-
body: typing.Optional[
|
|
564
|
-
instrument: typing.Optional[
|
|
563
|
+
body: typing.Optional[CryptoOrderForm] = None,
|
|
564
|
+
instrument: typing.Optional[CryptoTradingInstrument] = None,
|
|
565
565
|
side: typing.Optional[ActionStrict] = None,
|
|
566
566
|
type: typing.Optional[str] = None,
|
|
567
567
|
time_in_force: typing.Optional[str] = None,
|
|
@@ -580,7 +580,7 @@ class PreviewSimpleOrder(BaseApi):
|
|
|
580
580
|
api_client.ApiResponseWithoutDeserialization,
|
|
581
581
|
]:
|
|
582
582
|
""" Previews an order using the specified account. """
|
|
583
|
-
args = self.
|
|
583
|
+
args = self._preview_crypto_order_mapped_args(
|
|
584
584
|
body=body,
|
|
585
585
|
query_params=query_params,
|
|
586
586
|
path_params=path_params,
|
|
@@ -597,7 +597,7 @@ class PreviewSimpleOrder(BaseApi):
|
|
|
597
597
|
post_only=post_only,
|
|
598
598
|
expiration_date=expiration_date,
|
|
599
599
|
)
|
|
600
|
-
return self.
|
|
600
|
+
return self._preview_crypto_order_oapg(
|
|
601
601
|
body=args.body,
|
|
602
602
|
query_params=args.query,
|
|
603
603
|
path_params=args.path,
|
|
@@ -608,8 +608,8 @@ class ApiForpost(BaseApi):
|
|
|
608
608
|
|
|
609
609
|
async def apost(
|
|
610
610
|
self,
|
|
611
|
-
body: typing.Optional[
|
|
612
|
-
instrument: typing.Optional[
|
|
611
|
+
body: typing.Optional[CryptoOrderForm] = None,
|
|
612
|
+
instrument: typing.Optional[CryptoTradingInstrument] = None,
|
|
613
613
|
side: typing.Optional[ActionStrict] = None,
|
|
614
614
|
type: typing.Optional[str] = None,
|
|
615
615
|
time_in_force: typing.Optional[str] = None,
|
|
@@ -629,7 +629,7 @@ class ApiForpost(BaseApi):
|
|
|
629
629
|
api_client.ApiResponseWithoutDeserializationAsync,
|
|
630
630
|
AsyncGeneratorResponse,
|
|
631
631
|
]:
|
|
632
|
-
args = self.
|
|
632
|
+
args = self._preview_crypto_order_mapped_args(
|
|
633
633
|
body=body,
|
|
634
634
|
query_params=query_params,
|
|
635
635
|
path_params=path_params,
|
|
@@ -646,7 +646,7 @@ class ApiForpost(BaseApi):
|
|
|
646
646
|
post_only=post_only,
|
|
647
647
|
expiration_date=expiration_date,
|
|
648
648
|
)
|
|
649
|
-
return await self.
|
|
649
|
+
return await self._apreview_crypto_order_oapg(
|
|
650
650
|
body=args.body,
|
|
651
651
|
query_params=args.query,
|
|
652
652
|
path_params=args.path,
|
|
@@ -655,8 +655,8 @@ class ApiForpost(BaseApi):
|
|
|
655
655
|
|
|
656
656
|
def post(
|
|
657
657
|
self,
|
|
658
|
-
body: typing.Optional[
|
|
659
|
-
instrument: typing.Optional[
|
|
658
|
+
body: typing.Optional[CryptoOrderForm] = None,
|
|
659
|
+
instrument: typing.Optional[CryptoTradingInstrument] = None,
|
|
660
660
|
side: typing.Optional[ActionStrict] = None,
|
|
661
661
|
type: typing.Optional[str] = None,
|
|
662
662
|
time_in_force: typing.Optional[str] = None,
|
|
@@ -675,7 +675,7 @@ class ApiForpost(BaseApi):
|
|
|
675
675
|
api_client.ApiResponseWithoutDeserialization,
|
|
676
676
|
]:
|
|
677
677
|
""" Previews an order using the specified account. """
|
|
678
|
-
args = self.
|
|
678
|
+
args = self._preview_crypto_order_mapped_args(
|
|
679
679
|
body=body,
|
|
680
680
|
query_params=query_params,
|
|
681
681
|
path_params=path_params,
|
|
@@ -692,7 +692,7 @@ class ApiForpost(BaseApi):
|
|
|
692
692
|
post_only=post_only,
|
|
693
693
|
expiration_date=expiration_date,
|
|
694
694
|
)
|
|
695
|
-
return self.
|
|
695
|
+
return self._preview_crypto_order_oapg(
|
|
696
696
|
body=args.body,
|
|
697
697
|
query_params=args.query,
|
|
698
698
|
path_params=args.path,
|