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
|
@@ -88,12 +88,10 @@ request_query_user_secret = api_client.QueryParameter(
|
|
|
88
88
|
)
|
|
89
89
|
# Path params
|
|
90
90
|
AccountIdSchema = schemas.UUIDSchema
|
|
91
|
-
BrokerageOrderIdSchema = schemas.StrSchema
|
|
92
91
|
RequestRequiredPathParams = typing_extensions.TypedDict(
|
|
93
92
|
'RequestRequiredPathParams',
|
|
94
93
|
{
|
|
95
94
|
'accountId': typing.Union[AccountIdSchema, str, uuid.UUID, ],
|
|
96
|
-
'brokerageOrderId': typing.Union[BrokerageOrderIdSchema, str, ],
|
|
97
95
|
}
|
|
98
96
|
)
|
|
99
97
|
RequestOptionalPathParams = typing_extensions.TypedDict(
|
|
@@ -114,12 +112,6 @@ request_path_account_id = api_client.PathParameter(
|
|
|
114
112
|
schema=AccountIdSchema,
|
|
115
113
|
required=True,
|
|
116
114
|
)
|
|
117
|
-
request_path_brokerage_order_id = api_client.PathParameter(
|
|
118
|
-
name="brokerageOrderId",
|
|
119
|
-
style=api_client.ParameterStyle.SIMPLE,
|
|
120
|
-
schema=BrokerageOrderIdSchema,
|
|
121
|
-
required=True,
|
|
122
|
-
)
|
|
123
115
|
# body param
|
|
124
116
|
SchemaForRequestBodyApplicationJson = ManualTradeReplaceFormSchema
|
|
125
117
|
|
|
@@ -220,11 +212,11 @@ class BaseApi(api_client.Api):
|
|
|
220
212
|
def _replace_order_mapped_args(
|
|
221
213
|
self,
|
|
222
214
|
body: typing.Optional[ManualTradeReplaceForm] = None,
|
|
215
|
+
brokerage_order_id: typing.Optional[str] = None,
|
|
223
216
|
action: typing.Optional[ActionStrict] = None,
|
|
224
217
|
order_type: typing.Optional[OrderTypeStrict] = None,
|
|
225
218
|
time_in_force: typing.Optional[TimeInForceStrict] = None,
|
|
226
219
|
account_id: typing.Optional[str] = None,
|
|
227
|
-
brokerage_order_id: typing.Optional[str] = None,
|
|
228
220
|
user_id: typing.Optional[str] = None,
|
|
229
221
|
user_secret: typing.Optional[str] = None,
|
|
230
222
|
price: typing.Optional[typing.Optional[typing.Union[int, float]]] = None,
|
|
@@ -238,6 +230,8 @@ class BaseApi(api_client.Api):
|
|
|
238
230
|
_query_params = {}
|
|
239
231
|
_path_params = {}
|
|
240
232
|
_body = {}
|
|
233
|
+
if brokerage_order_id is not None:
|
|
234
|
+
_body["brokerage_order_id"] = brokerage_order_id
|
|
241
235
|
if action is not None:
|
|
242
236
|
_body["action"] = action
|
|
243
237
|
if order_type is not None:
|
|
@@ -259,8 +253,6 @@ class BaseApi(api_client.Api):
|
|
|
259
253
|
_query_params["userSecret"] = user_secret
|
|
260
254
|
if account_id is not None:
|
|
261
255
|
_path_params["accountId"] = account_id
|
|
262
|
-
if brokerage_order_id is not None:
|
|
263
|
-
_path_params["brokerageOrderId"] = brokerage_order_id
|
|
264
256
|
args.query = query_params if query_params else _query_params
|
|
265
257
|
args.path = path_params if path_params else _path_params
|
|
266
258
|
return args
|
|
@@ -294,7 +286,6 @@ class BaseApi(api_client.Api):
|
|
|
294
286
|
_path_params = {}
|
|
295
287
|
for parameter in (
|
|
296
288
|
request_path_account_id,
|
|
297
|
-
request_path_brokerage_order_id,
|
|
298
289
|
):
|
|
299
290
|
parameter_data = path_params.get(parameter.name, schemas.unset)
|
|
300
291
|
if parameter_data is schemas.unset:
|
|
@@ -324,7 +315,7 @@ class BaseApi(api_client.Api):
|
|
|
324
315
|
if accept_content_types:
|
|
325
316
|
for accept_content_type in accept_content_types:
|
|
326
317
|
_headers.add('Accept', accept_content_type)
|
|
327
|
-
method = '
|
|
318
|
+
method = 'post'.upper()
|
|
328
319
|
_headers.add('Content-Type', content_type)
|
|
329
320
|
|
|
330
321
|
if body is schemas.unset:
|
|
@@ -336,7 +327,7 @@ class BaseApi(api_client.Api):
|
|
|
336
327
|
resource_path=used_path,
|
|
337
328
|
method=method,
|
|
338
329
|
configuration=self.api_client.configuration,
|
|
339
|
-
path_template='/accounts/{accountId}/trading/
|
|
330
|
+
path_template='/accounts/{accountId}/trading/replace',
|
|
340
331
|
body=body,
|
|
341
332
|
auth_settings=_auth,
|
|
342
333
|
headers=_headers,
|
|
@@ -441,7 +432,6 @@ class BaseApi(api_client.Api):
|
|
|
441
432
|
_path_params = {}
|
|
442
433
|
for parameter in (
|
|
443
434
|
request_path_account_id,
|
|
444
|
-
request_path_brokerage_order_id,
|
|
445
435
|
):
|
|
446
436
|
parameter_data = path_params.get(parameter.name, schemas.unset)
|
|
447
437
|
if parameter_data is schemas.unset:
|
|
@@ -471,7 +461,7 @@ class BaseApi(api_client.Api):
|
|
|
471
461
|
if accept_content_types:
|
|
472
462
|
for accept_content_type in accept_content_types:
|
|
473
463
|
_headers.add('Accept', accept_content_type)
|
|
474
|
-
method = '
|
|
464
|
+
method = 'post'.upper()
|
|
475
465
|
_headers.add('Content-Type', content_type)
|
|
476
466
|
|
|
477
467
|
if body is schemas.unset:
|
|
@@ -483,7 +473,7 @@ class BaseApi(api_client.Api):
|
|
|
483
473
|
resource_path=used_path,
|
|
484
474
|
method=method,
|
|
485
475
|
configuration=self.api_client.configuration,
|
|
486
|
-
path_template='/accounts/{accountId}/trading/
|
|
476
|
+
path_template='/accounts/{accountId}/trading/replace',
|
|
487
477
|
body=body,
|
|
488
478
|
auth_settings=_auth,
|
|
489
479
|
headers=_headers,
|
|
@@ -536,11 +526,11 @@ class ReplaceOrder(BaseApi):
|
|
|
536
526
|
async def areplace_order(
|
|
537
527
|
self,
|
|
538
528
|
body: typing.Optional[ManualTradeReplaceForm] = None,
|
|
529
|
+
brokerage_order_id: typing.Optional[str] = None,
|
|
539
530
|
action: typing.Optional[ActionStrict] = None,
|
|
540
531
|
order_type: typing.Optional[OrderTypeStrict] = None,
|
|
541
532
|
time_in_force: typing.Optional[TimeInForceStrict] = None,
|
|
542
533
|
account_id: typing.Optional[str] = None,
|
|
543
|
-
brokerage_order_id: typing.Optional[str] = None,
|
|
544
534
|
user_id: typing.Optional[str] = None,
|
|
545
535
|
user_secret: typing.Optional[str] = None,
|
|
546
536
|
price: typing.Optional[typing.Optional[typing.Union[int, float]]] = None,
|
|
@@ -559,11 +549,11 @@ class ReplaceOrder(BaseApi):
|
|
|
559
549
|
body=body,
|
|
560
550
|
query_params=query_params,
|
|
561
551
|
path_params=path_params,
|
|
552
|
+
brokerage_order_id=brokerage_order_id,
|
|
562
553
|
action=action,
|
|
563
554
|
order_type=order_type,
|
|
564
555
|
time_in_force=time_in_force,
|
|
565
556
|
account_id=account_id,
|
|
566
|
-
brokerage_order_id=brokerage_order_id,
|
|
567
557
|
user_id=user_id,
|
|
568
558
|
user_secret=user_secret,
|
|
569
559
|
price=price,
|
|
@@ -581,11 +571,11 @@ class ReplaceOrder(BaseApi):
|
|
|
581
571
|
def replace_order(
|
|
582
572
|
self,
|
|
583
573
|
body: typing.Optional[ManualTradeReplaceForm] = None,
|
|
574
|
+
brokerage_order_id: typing.Optional[str] = None,
|
|
584
575
|
action: typing.Optional[ActionStrict] = None,
|
|
585
576
|
order_type: typing.Optional[OrderTypeStrict] = None,
|
|
586
577
|
time_in_force: typing.Optional[TimeInForceStrict] = None,
|
|
587
578
|
account_id: typing.Optional[str] = None,
|
|
588
|
-
brokerage_order_id: typing.Optional[str] = None,
|
|
589
579
|
user_id: typing.Optional[str] = None,
|
|
590
580
|
user_secret: typing.Optional[str] = None,
|
|
591
581
|
price: typing.Optional[typing.Optional[typing.Union[int, float]]] = None,
|
|
@@ -603,11 +593,11 @@ class ReplaceOrder(BaseApi):
|
|
|
603
593
|
body=body,
|
|
604
594
|
query_params=query_params,
|
|
605
595
|
path_params=path_params,
|
|
596
|
+
brokerage_order_id=brokerage_order_id,
|
|
606
597
|
action=action,
|
|
607
598
|
order_type=order_type,
|
|
608
599
|
time_in_force=time_in_force,
|
|
609
600
|
account_id=account_id,
|
|
610
|
-
brokerage_order_id=brokerage_order_id,
|
|
611
601
|
user_id=user_id,
|
|
612
602
|
user_secret=user_secret,
|
|
613
603
|
price=price,
|
|
@@ -621,17 +611,17 @@ class ReplaceOrder(BaseApi):
|
|
|
621
611
|
path_params=args.path,
|
|
622
612
|
)
|
|
623
613
|
|
|
624
|
-
class
|
|
614
|
+
class ApiForpost(BaseApi):
|
|
625
615
|
# this class is used by api classes that refer to endpoints by path and http method names
|
|
626
616
|
|
|
627
|
-
async def
|
|
617
|
+
async def apost(
|
|
628
618
|
self,
|
|
629
619
|
body: typing.Optional[ManualTradeReplaceForm] = None,
|
|
620
|
+
brokerage_order_id: typing.Optional[str] = None,
|
|
630
621
|
action: typing.Optional[ActionStrict] = None,
|
|
631
622
|
order_type: typing.Optional[OrderTypeStrict] = None,
|
|
632
623
|
time_in_force: typing.Optional[TimeInForceStrict] = None,
|
|
633
624
|
account_id: typing.Optional[str] = None,
|
|
634
|
-
brokerage_order_id: typing.Optional[str] = None,
|
|
635
625
|
user_id: typing.Optional[str] = None,
|
|
636
626
|
user_secret: typing.Optional[str] = None,
|
|
637
627
|
price: typing.Optional[typing.Optional[typing.Union[int, float]]] = None,
|
|
@@ -650,11 +640,11 @@ class ApiForpatch(BaseApi):
|
|
|
650
640
|
body=body,
|
|
651
641
|
query_params=query_params,
|
|
652
642
|
path_params=path_params,
|
|
643
|
+
brokerage_order_id=brokerage_order_id,
|
|
653
644
|
action=action,
|
|
654
645
|
order_type=order_type,
|
|
655
646
|
time_in_force=time_in_force,
|
|
656
647
|
account_id=account_id,
|
|
657
|
-
brokerage_order_id=brokerage_order_id,
|
|
658
648
|
user_id=user_id,
|
|
659
649
|
user_secret=user_secret,
|
|
660
650
|
price=price,
|
|
@@ -669,14 +659,14 @@ class ApiForpatch(BaseApi):
|
|
|
669
659
|
**kwargs,
|
|
670
660
|
)
|
|
671
661
|
|
|
672
|
-
def
|
|
662
|
+
def post(
|
|
673
663
|
self,
|
|
674
664
|
body: typing.Optional[ManualTradeReplaceForm] = None,
|
|
665
|
+
brokerage_order_id: typing.Optional[str] = None,
|
|
675
666
|
action: typing.Optional[ActionStrict] = None,
|
|
676
667
|
order_type: typing.Optional[OrderTypeStrict] = None,
|
|
677
668
|
time_in_force: typing.Optional[TimeInForceStrict] = None,
|
|
678
669
|
account_id: typing.Optional[str] = None,
|
|
679
|
-
brokerage_order_id: typing.Optional[str] = None,
|
|
680
670
|
user_id: typing.Optional[str] = None,
|
|
681
671
|
user_secret: typing.Optional[str] = None,
|
|
682
672
|
price: typing.Optional[typing.Optional[typing.Union[int, float]]] = None,
|
|
@@ -694,11 +684,11 @@ class ApiForpatch(BaseApi):
|
|
|
694
684
|
body=body,
|
|
695
685
|
query_params=query_params,
|
|
696
686
|
path_params=path_params,
|
|
687
|
+
brokerage_order_id=brokerage_order_id,
|
|
697
688
|
action=action,
|
|
698
689
|
order_type=order_type,
|
|
699
690
|
time_in_force=time_in_force,
|
|
700
691
|
account_id=account_id,
|
|
701
|
-
brokerage_order_id=brokerage_order_id,
|
|
702
692
|
user_id=user_id,
|
|
703
693
|
user_secret=user_secret,
|
|
704
694
|
price=price,
|
|
@@ -143,7 +143,7 @@ class BaseApi(api_client.Api):
|
|
|
143
143
|
AsyncGeneratorResponse,
|
|
144
144
|
]:
|
|
145
145
|
"""
|
|
146
|
-
Get
|
|
146
|
+
Get brokerage instruments
|
|
147
147
|
:param skip_deserialization: If true then api_response.response will be set but
|
|
148
148
|
api_response.body and api_response.headers will not be deserialized into schema
|
|
149
149
|
class instances
|
|
@@ -260,7 +260,7 @@ class BaseApi(api_client.Api):
|
|
|
260
260
|
api_client.ApiResponseWithoutDeserialization,
|
|
261
261
|
]:
|
|
262
262
|
"""
|
|
263
|
-
Get
|
|
263
|
+
Get brokerage instruments
|
|
264
264
|
:param skip_deserialization: If true then api_response.response will be set but
|
|
265
265
|
api_response.body and api_response.headers will not be deserialized into schema
|
|
266
266
|
class instances
|
|
@@ -365,7 +365,7 @@ class ListAllBrokerageInstruments(BaseApi):
|
|
|
365
365
|
ApiResponseForDefault,
|
|
366
366
|
api_client.ApiResponseWithoutDeserialization,
|
|
367
367
|
]:
|
|
368
|
-
""" Returns a list of all brokerage instruments available for a given brokerage
|
|
368
|
+
""" Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don't will return an empty list. """
|
|
369
369
|
args = self._list_all_brokerage_instruments_mapped_args(
|
|
370
370
|
path_params=path_params,
|
|
371
371
|
brokerage_id=brokerage_id,
|
|
@@ -406,7 +406,7 @@ class ApiForget(BaseApi):
|
|
|
406
406
|
ApiResponseForDefault,
|
|
407
407
|
api_client.ApiResponseWithoutDeserialization,
|
|
408
408
|
]:
|
|
409
|
-
""" Returns a list of all brokerage instruments available for a given brokerage
|
|
409
|
+
""" Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don't will return an empty list. """
|
|
410
410
|
args = self._list_all_brokerage_instruments_mapped_args(
|
|
411
411
|
path_params=path_params,
|
|
412
412
|
brokerage_id=brokerage_id,
|
|
@@ -132,7 +132,7 @@ class BaseApi(api_client.Api):
|
|
|
132
132
|
AsyncGeneratorResponse,
|
|
133
133
|
]:
|
|
134
134
|
"""
|
|
135
|
-
Get
|
|
135
|
+
Get brokerage instruments
|
|
136
136
|
:param skip_deserialization: If true then api_response.response will be set but
|
|
137
137
|
api_response.body and api_response.headers will not be deserialized into schema
|
|
138
138
|
class instances
|
|
@@ -249,7 +249,7 @@ class BaseApi(api_client.Api):
|
|
|
249
249
|
api_client.ApiResponseWithoutDeserialization,
|
|
250
250
|
]:
|
|
251
251
|
"""
|
|
252
|
-
Get
|
|
252
|
+
Get brokerage instruments
|
|
253
253
|
:param skip_deserialization: If true then api_response.response will be set but
|
|
254
254
|
api_response.body and api_response.headers will not be deserialized into schema
|
|
255
255
|
class instances
|
|
@@ -354,7 +354,7 @@ class ListAllBrokerageInstruments(BaseApi):
|
|
|
354
354
|
ApiResponseForDefault,
|
|
355
355
|
api_client.ApiResponseWithoutDeserialization,
|
|
356
356
|
]:
|
|
357
|
-
""" Returns a list of all brokerage instruments available for a given brokerage
|
|
357
|
+
""" Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don't will return an empty list. """
|
|
358
358
|
args = self._list_all_brokerage_instruments_mapped_args(
|
|
359
359
|
path_params=path_params,
|
|
360
360
|
brokerage_id=brokerage_id,
|
|
@@ -395,7 +395,7 @@ class ApiForget(BaseApi):
|
|
|
395
395
|
ApiResponseForDefault,
|
|
396
396
|
api_client.ApiResponseWithoutDeserialization,
|
|
397
397
|
]:
|
|
398
|
-
""" Returns a list of all brokerage instruments available for a given brokerage
|
|
398
|
+
""" Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don't will return an empty list. """
|
|
399
399
|
args = self._list_all_brokerage_instruments_mapped_args(
|
|
400
400
|
path_params=path_params,
|
|
401
401
|
brokerage_id=brokerage_id,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
SnapTrade
|
|
5
|
+
|
|
6
|
+
Connect brokerage accounts to your app for live positions and trading
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: api@snaptrade.com
|
|
10
|
+
Created by: https://snaptrade.com/
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from datetime import datetime, date
|
|
14
|
+
import typing
|
|
15
|
+
from enum import Enum
|
|
16
|
+
from typing_extensions import TypedDict, Literal, TYPE_CHECKING
|
|
17
|
+
|
|
18
|
+
from snaptrade_client.type.action_strict import ActionStrict
|
|
19
|
+
from snaptrade_client.type.crypto_trading_instrument import CryptoTradingInstrument
|
|
20
|
+
|
|
21
|
+
class RequiredCryptoOrderForm(TypedDict):
|
|
22
|
+
instrument: CryptoTradingInstrument
|
|
23
|
+
|
|
24
|
+
side: ActionStrict
|
|
25
|
+
|
|
26
|
+
# The type of order to place.
|
|
27
|
+
type: str
|
|
28
|
+
|
|
29
|
+
# The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled. - `GTD` - Good Til Date. The order is valid until the specified date.
|
|
30
|
+
time_in_force: str
|
|
31
|
+
|
|
32
|
+
# The amount of the base currency to buy or sell.
|
|
33
|
+
amount: str
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class OptionalCryptoOrderForm(TypedDict, total=False):
|
|
37
|
+
# The limit price. Required if the order type is LIMIT, STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT.
|
|
38
|
+
limit_price: str
|
|
39
|
+
|
|
40
|
+
# The stop price. Required if the order type is STOP_LOSS_MARKET, STOP_LOSS_LIMIT, TAKE_PROFIT_MARKET or TAKE_PROFIT_LIMIT.
|
|
41
|
+
stop_price: str
|
|
42
|
+
|
|
43
|
+
# Valid and required only for order type LIMIT. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
44
|
+
post_only: bool
|
|
45
|
+
|
|
46
|
+
# The expiration date of the order. Required if the time_in_force is GTD.
|
|
47
|
+
expiration_date: datetime
|
|
48
|
+
|
|
49
|
+
class CryptoOrderForm(RequiredCryptoOrderForm, OptionalCryptoOrderForm):
|
|
50
|
+
pass
|
|
@@ -15,13 +15,13 @@ import typing
|
|
|
15
15
|
from enum import Enum
|
|
16
16
|
from typing_extensions import TypedDict, Literal, TYPE_CHECKING
|
|
17
17
|
|
|
18
|
-
from snaptrade_client.type.
|
|
18
|
+
from snaptrade_client.type.crypto_order_preview_estimated_fee import CryptoOrderPreviewEstimatedFee
|
|
19
19
|
|
|
20
|
-
class
|
|
20
|
+
class RequiredCryptoOrderPreview(TypedDict):
|
|
21
21
|
pass
|
|
22
22
|
|
|
23
|
-
class
|
|
24
|
-
estimated_fee:
|
|
23
|
+
class OptionalCryptoOrderPreview(TypedDict, total=False):
|
|
24
|
+
estimated_fee: CryptoOrderPreviewEstimatedFee
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class CryptoOrderPreview(RequiredCryptoOrderPreview, OptionalCryptoOrderPreview):
|
|
27
27
|
pass
|
|
@@ -16,14 +16,14 @@ from enum import Enum
|
|
|
16
16
|
from typing_extensions import TypedDict, Literal, TYPE_CHECKING
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
class
|
|
19
|
+
class RequiredCryptoOrderPreviewEstimatedFee(TypedDict):
|
|
20
20
|
# Symbol to identify a cryptocurrency or fiat currency on a crypto exchange. Fiat currencies symbols are ISO-4217 codes.
|
|
21
21
|
currency: str
|
|
22
22
|
|
|
23
23
|
amount: str
|
|
24
24
|
|
|
25
|
-
class
|
|
25
|
+
class OptionalCryptoOrderPreviewEstimatedFee(TypedDict, total=False):
|
|
26
26
|
pass
|
|
27
27
|
|
|
28
|
-
class
|
|
28
|
+
class CryptoOrderPreviewEstimatedFee(RequiredCryptoOrderPreviewEstimatedFee, OptionalCryptoOrderPreviewEstimatedFee):
|
|
29
29
|
pass
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
SnapTrade
|
|
5
|
+
|
|
6
|
+
Connect brokerage accounts to your app for live positions and trading
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Contact: api@snaptrade.com
|
|
10
|
+
Created by: https://snaptrade.com/
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from datetime import datetime, date
|
|
14
|
+
import typing
|
|
15
|
+
from enum import Enum
|
|
16
|
+
from typing_extensions import TypedDict, Literal, TYPE_CHECKING
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class RequiredCryptoTradingInstrument(TypedDict):
|
|
20
|
+
# The instrument's trading ticker symbol
|
|
21
|
+
symbol: str
|
|
22
|
+
|
|
23
|
+
# The instrument's type
|
|
24
|
+
type: str
|
|
25
|
+
|
|
26
|
+
class OptionalCryptoTradingInstrument(TypedDict, total=False):
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
class CryptoTradingInstrument(RequiredCryptoTradingInstrument, OptionalCryptoTradingInstrument):
|
|
30
|
+
pass
|
|
@@ -21,6 +21,9 @@ from snaptrade_client.type.time_in_force_strict import TimeInForceStrict
|
|
|
21
21
|
from snaptrade_client.type.units_nullable import UnitsNullable
|
|
22
22
|
|
|
23
23
|
class RequiredManualTradeReplaceForm(TypedDict):
|
|
24
|
+
# Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
|
25
|
+
brokerage_order_id: str
|
|
26
|
+
|
|
24
27
|
action: ActionStrict
|
|
25
28
|
|
|
26
29
|
order_type: OrderTypeStrict
|