snaptrade-python-sdk 11.0.118__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/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.118.dist-info → snaptrade_python_sdk-11.0.119.dist-info}/METADATA +106 -104
- {snaptrade_python_sdk-11.0.118.dist-info → snaptrade_python_sdk-11.0.119.dist-info}/RECORD +45 -39
- 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.118.dist-info → snaptrade_python_sdk-11.0.119.dist-info}/LICENSE +0 -0
- {snaptrade_python_sdk-11.0.118.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,
|
|
@@ -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
|
{snaptrade_python_sdk-11.0.118.dist-info → snaptrade_python_sdk-11.0.119.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: snaptrade-python-sdk
|
|
3
|
-
Version: 11.0.
|
|
3
|
+
Version: 11.0.119
|
|
4
4
|
Summary: Client for SnapTrade
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: SnapTrade
|
|
@@ -30,7 +30,7 @@ Description-Content-Type: text/markdown
|
|
|
30
30
|
Connect brokerage accounts to your app for live positions and trading
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
[](https://pypi.org/project/snaptrade-python-sdk/11.0.119)
|
|
34
34
|
[](https://github.com/passiv/snaptrade-sdks/tree/master/sdks/python#readme)
|
|
35
35
|
[](https://snaptrade.com/)
|
|
36
36
|
|
|
@@ -92,11 +92,11 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
92
92
|
* [`snaptrade.trading.get_order_impact`](#snaptradetradingget_order_impact)
|
|
93
93
|
* [`snaptrade.trading.get_user_account_quotes`](#snaptradetradingget_user_account_quotes)
|
|
94
94
|
* [`snaptrade.trading.place_bracket_order`](#snaptradetradingplace_bracket_order)
|
|
95
|
+
* [`snaptrade.trading.place_crypto_order`](#snaptradetradingplace_crypto_order)
|
|
95
96
|
* [`snaptrade.trading.place_force_order`](#snaptradetradingplace_force_order)
|
|
96
97
|
* [`snaptrade.trading.place_mleg_order`](#snaptradetradingplace_mleg_order)
|
|
97
98
|
* [`snaptrade.trading.place_order`](#snaptradetradingplace_order)
|
|
98
|
-
* [`snaptrade.trading.
|
|
99
|
-
* [`snaptrade.trading.preview_simple_order`](#snaptradetradingpreview_simple_order)
|
|
99
|
+
* [`snaptrade.trading.preview_crypto_order`](#snaptradetradingpreview_crypto_order)
|
|
100
100
|
* [`snaptrade.trading.replace_order`](#snaptradetradingreplace_order)
|
|
101
101
|
* [`snaptrade.trading.search_cryptocurrency_pair_instruments`](#snaptradetradingsearch_cryptocurrency_pair_instruments)
|
|
102
102
|
* [`snaptrade.transactions_and_reporting.get_activities`](#snaptradetransactions_and_reportingget_activities)
|
|
@@ -111,7 +111,7 @@ Python >=3.8
|
|
|
111
111
|
## Installation<a id="installation"></a>
|
|
112
112
|
|
|
113
113
|
```sh
|
|
114
|
-
pip install snaptrade-python-sdk==11.0.
|
|
114
|
+
pip install snaptrade-python-sdk==11.0.119
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -1713,7 +1713,7 @@ The search query for symbols.
|
|
|
1713
1713
|
|
|
1714
1714
|
### `snaptrade.trading.cancel_order`<a id="snaptradetradingcancel_order"></a>
|
|
1715
1715
|
|
|
1716
|
-
Cancels an order in the specified account.
|
|
1716
|
+
Cancels an order in the specified account. Accepts order IDs for all asset types.
|
|
1717
1717
|
|
|
1718
1718
|
|
|
1719
1719
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
@@ -1755,7 +1755,9 @@ Order ID returned by brokerage. This is the unique identifier for the order in t
|
|
|
1755
1755
|
---
|
|
1756
1756
|
|
|
1757
1757
|
### `snaptrade.trading.cancel_user_account_order`<a id="snaptradetradingcancel_user_account_order"></a>
|
|
1758
|
+

|
|
1758
1759
|
|
|
1760
|
+
**This endpoint is deprecated. Please switch to [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) **
|
|
1759
1761
|
Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
|
|
1760
1762
|
|
|
1761
1763
|
|
|
@@ -2040,6 +2042,90 @@ Number of shares for the order. This can be a decimal for fractional orders. Mus
|
|
|
2040
2042
|
|
|
2041
2043
|
---
|
|
2042
2044
|
|
|
2045
|
+
### `snaptrade.trading.place_crypto_order`<a id="snaptradetradingplace_crypto_order"></a>
|
|
2046
|
+
|
|
2047
|
+
Places an order in the specified account.
|
|
2048
|
+
This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
2049
|
+
|
|
2050
|
+
|
|
2051
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2052
|
+
|
|
2053
|
+
```python
|
|
2054
|
+
place_crypto_order_response = snaptrade.trading.place_crypto_order(
|
|
2055
|
+
instrument={
|
|
2056
|
+
"symbol": "BTC",
|
|
2057
|
+
"type": "CRYPTOCURRENCY",
|
|
2058
|
+
},
|
|
2059
|
+
side="BUY",
|
|
2060
|
+
type="MARKET",
|
|
2061
|
+
time_in_force="GTC",
|
|
2062
|
+
amount="123.45",
|
|
2063
|
+
user_id="snaptrade-user-123",
|
|
2064
|
+
user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2065
|
+
account_id="917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2066
|
+
limit_price="123.45",
|
|
2067
|
+
stop_price="123.45",
|
|
2068
|
+
post_only=False,
|
|
2069
|
+
expiration_date="2024-01-01T00:00:00Z",
|
|
2070
|
+
)
|
|
2071
|
+
```
|
|
2072
|
+
|
|
2073
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2074
|
+
|
|
2075
|
+
##### instrument: [`CryptoTradingInstrument`](./snaptrade_client/type/crypto_trading_instrument.py)<a id="instrument-cryptotradinginstrumentsnaptrade_clienttypecrypto_trading_instrumentpy"></a>
|
|
2076
|
+
|
|
2077
|
+
|
|
2078
|
+
##### side: [`ActionStrict`](./snaptrade_client/type/action_strict.py)<a id="side-actionstrictsnaptrade_clienttypeaction_strictpy"></a>
|
|
2079
|
+
|
|
2080
|
+
##### type: `str`<a id="type-str"></a>
|
|
2081
|
+
|
|
2082
|
+
The type of order to place.
|
|
2083
|
+
|
|
2084
|
+
##### time_in_force: `str`<a id="time_in_force-str"></a>
|
|
2085
|
+
|
|
2086
|
+
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.
|
|
2087
|
+
|
|
2088
|
+
##### amount: `str`<a id="amount-str"></a>
|
|
2089
|
+
|
|
2090
|
+
The amount of the base currency to buy or sell.
|
|
2091
|
+
|
|
2092
|
+
##### user_id: `str`<a id="user_id-str"></a>
|
|
2093
|
+
|
|
2094
|
+
##### user_secret: `str`<a id="user_secret-str"></a>
|
|
2095
|
+
|
|
2096
|
+
##### account_id: `str`<a id="account_id-str"></a>
|
|
2097
|
+
|
|
2098
|
+
##### limit_price: `str`<a id="limit_price-str"></a>
|
|
2099
|
+
|
|
2100
|
+
The limit price. Required if the order type is LIMIT, STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT.
|
|
2101
|
+
|
|
2102
|
+
##### stop_price: `str`<a id="stop_price-str"></a>
|
|
2103
|
+
|
|
2104
|
+
The stop price. Required if the order type is STOP_LOSS_MARKET, STOP_LOSS_LIMIT, TAKE_PROFIT_MARKET or TAKE_PROFIT_LIMIT.
|
|
2105
|
+
|
|
2106
|
+
##### post_only: `bool`<a id="post_only-bool"></a>
|
|
2107
|
+
|
|
2108
|
+
Valid and required only for order type LIMIT. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
2109
|
+
|
|
2110
|
+
##### expiration_date: `datetime`<a id="expiration_date-datetime"></a>
|
|
2111
|
+
|
|
2112
|
+
The expiration date of the order. Required if the time_in_force is GTD.
|
|
2113
|
+
|
|
2114
|
+
#### ⚙️ Request Body<a id="⚙️-request-body"></a>
|
|
2115
|
+
|
|
2116
|
+
[`CryptoOrderForm`](./snaptrade_client/type/crypto_order_form.py)
|
|
2117
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
2118
|
+
|
|
2119
|
+
[`OrderUpdatedResponse`](./snaptrade_client/type/order_updated_response.py)
|
|
2120
|
+
|
|
2121
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2122
|
+
|
|
2123
|
+
`/accounts/{accountId}/trading/crypto` `post`
|
|
2124
|
+
|
|
2125
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2126
|
+
|
|
2127
|
+
---
|
|
2128
|
+
|
|
2043
2129
|
### `snaptrade.trading.place_force_order`<a id="snaptradetradingplace_force_order"></a>
|
|
2044
2130
|
|
|
2045
2131
|
Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
|
|
@@ -2237,91 +2323,7 @@ Optional, defaults to true. Determines if a wait is performed to check on order
|
|
|
2237
2323
|
|
|
2238
2324
|
---
|
|
2239
2325
|
|
|
2240
|
-
### `snaptrade.trading.
|
|
2241
|
-
|
|
2242
|
-
Places an order in the specified account.
|
|
2243
|
-
This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2247
|
-
|
|
2248
|
-
```python
|
|
2249
|
-
place_simple_order_response = snaptrade.trading.place_simple_order(
|
|
2250
|
-
instrument={
|
|
2251
|
-
"symbol": "AAPL",
|
|
2252
|
-
"type": "EQUITY",
|
|
2253
|
-
},
|
|
2254
|
-
side="BUY",
|
|
2255
|
-
type="MARKET",
|
|
2256
|
-
time_in_force="GTC",
|
|
2257
|
-
amount="123.45",
|
|
2258
|
-
user_id="snaptrade-user-123",
|
|
2259
|
-
user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2260
|
-
account_id="917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2261
|
-
limit_price="123.45",
|
|
2262
|
-
stop_price="123.45",
|
|
2263
|
-
post_only=False,
|
|
2264
|
-
expiration_date="2024-01-01T00:00:00Z",
|
|
2265
|
-
)
|
|
2266
|
-
```
|
|
2267
|
-
|
|
2268
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2269
|
-
|
|
2270
|
-
##### instrument: [`TradingInstrument`](./snaptrade_client/type/trading_instrument.py)<a id="instrument-tradinginstrumentsnaptrade_clienttypetrading_instrumentpy"></a>
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
##### side: [`ActionStrict`](./snaptrade_client/type/action_strict.py)<a id="side-actionstrictsnaptrade_clienttypeaction_strictpy"></a>
|
|
2274
|
-
|
|
2275
|
-
##### type: `str`<a id="type-str"></a>
|
|
2276
|
-
|
|
2277
|
-
The type of order to place.
|
|
2278
|
-
|
|
2279
|
-
##### time_in_force: `str`<a id="time_in_force-str"></a>
|
|
2280
|
-
|
|
2281
|
-
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.
|
|
2282
|
-
|
|
2283
|
-
##### amount: `str`<a id="amount-str"></a>
|
|
2284
|
-
|
|
2285
|
-
The amount of the base currency to buy or sell.
|
|
2286
|
-
|
|
2287
|
-
##### user_id: `str`<a id="user_id-str"></a>
|
|
2288
|
-
|
|
2289
|
-
##### user_secret: `str`<a id="user_secret-str"></a>
|
|
2290
|
-
|
|
2291
|
-
##### account_id: `str`<a id="account_id-str"></a>
|
|
2292
|
-
|
|
2293
|
-
##### limit_price: `str`<a id="limit_price-str"></a>
|
|
2294
|
-
|
|
2295
|
-
The limit price. Required if the order type is LIMIT, STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT.
|
|
2296
|
-
|
|
2297
|
-
##### stop_price: `str`<a id="stop_price-str"></a>
|
|
2298
|
-
|
|
2299
|
-
The stop price. Required if the order type is STOP_LOSS_MARKET, STOP_LOSS_LIMIT, TAKE_PROFIT_MARKET or TAKE_PROFIT_LIMIT.
|
|
2300
|
-
|
|
2301
|
-
##### post_only: `bool`<a id="post_only-bool"></a>
|
|
2302
|
-
|
|
2303
|
-
Valid and required only for order type LIMIT. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
2304
|
-
|
|
2305
|
-
##### expiration_date: `datetime`<a id="expiration_date-datetime"></a>
|
|
2306
|
-
|
|
2307
|
-
The expiration date of the order. Required if the time_in_force is GTD.
|
|
2308
|
-
|
|
2309
|
-
#### ⚙️ Request Body<a id="⚙️-request-body"></a>
|
|
2310
|
-
|
|
2311
|
-
[`SimpleOrderForm`](./snaptrade_client/type/simple_order_form.py)
|
|
2312
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
2313
|
-
|
|
2314
|
-
[`OrderUpdatedResponse`](./snaptrade_client/type/order_updated_response.py)
|
|
2315
|
-
|
|
2316
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2317
|
-
|
|
2318
|
-
`/accounts/{accountId}/trading/simple` `post`
|
|
2319
|
-
|
|
2320
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2321
|
-
|
|
2322
|
-
---
|
|
2323
|
-
|
|
2324
|
-
### `snaptrade.trading.preview_simple_order`<a id="snaptradetradingpreview_simple_order"></a>
|
|
2326
|
+
### `snaptrade.trading.preview_crypto_order`<a id="snaptradetradingpreview_crypto_order"></a>
|
|
2325
2327
|
|
|
2326
2328
|
Previews an order using the specified account.
|
|
2327
2329
|
|
|
@@ -2329,10 +2331,10 @@ Previews an order using the specified account.
|
|
|
2329
2331
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2330
2332
|
|
|
2331
2333
|
```python
|
|
2332
|
-
|
|
2334
|
+
preview_crypto_order_response = snaptrade.trading.preview_crypto_order(
|
|
2333
2335
|
instrument={
|
|
2334
|
-
"symbol": "
|
|
2335
|
-
"type": "
|
|
2336
|
+
"symbol": "BTC",
|
|
2337
|
+
"type": "CRYPTOCURRENCY",
|
|
2336
2338
|
},
|
|
2337
2339
|
side="BUY",
|
|
2338
2340
|
type="MARKET",
|
|
@@ -2350,7 +2352,7 @@ preview_simple_order_response = snaptrade.trading.preview_simple_order(
|
|
|
2350
2352
|
|
|
2351
2353
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2352
2354
|
|
|
2353
|
-
##### instrument: [`
|
|
2355
|
+
##### instrument: [`CryptoTradingInstrument`](./snaptrade_client/type/crypto_trading_instrument.py)<a id="instrument-cryptotradinginstrumentsnaptrade_clienttypecrypto_trading_instrumentpy"></a>
|
|
2354
2356
|
|
|
2355
2357
|
|
|
2356
2358
|
##### side: [`ActionStrict`](./snaptrade_client/type/action_strict.py)<a id="side-actionstrictsnaptrade_clienttypeaction_strictpy"></a>
|
|
@@ -2391,14 +2393,14 @@ The expiration date of the order. Required if the time_in_force is GTD.
|
|
|
2391
2393
|
|
|
2392
2394
|
#### ⚙️ Request Body<a id="⚙️-request-body"></a>
|
|
2393
2395
|
|
|
2394
|
-
[`
|
|
2396
|
+
[`CryptoOrderForm`](./snaptrade_client/type/crypto_order_form.py)
|
|
2395
2397
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
2396
2398
|
|
|
2397
|
-
[`
|
|
2399
|
+
[`CryptoOrderPreview`](./snaptrade_client/type/crypto_order_preview.py)
|
|
2398
2400
|
|
|
2399
2401
|
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2400
2402
|
|
|
2401
|
-
`/accounts/{accountId}/trading/
|
|
2403
|
+
`/accounts/{accountId}/trading/crypto/preview` `post`
|
|
2402
2404
|
|
|
2403
2405
|
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2404
2406
|
|
|
@@ -2415,11 +2417,11 @@ returned in the response going forward. Only supported on some brokerages
|
|
|
2415
2417
|
|
|
2416
2418
|
```python
|
|
2417
2419
|
replace_order_response = snaptrade.trading.replace_order(
|
|
2420
|
+
brokerage_order_id="66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
2418
2421
|
action="BUY",
|
|
2419
2422
|
order_type="Market",
|
|
2420
2423
|
time_in_force="Day",
|
|
2421
2424
|
account_id="2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
2422
|
-
brokerage_order_id="66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
2423
2425
|
user_id="snaptrade-user-123",
|
|
2424
2426
|
user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2425
2427
|
price=31.33,
|
|
@@ -2431,6 +2433,10 @@ replace_order_response = snaptrade.trading.replace_order(
|
|
|
2431
2433
|
|
|
2432
2434
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2433
2435
|
|
|
2436
|
+
##### brokerage_order_id: `str`<a id="brokerage_order_id-str"></a>
|
|
2437
|
+
|
|
2438
|
+
Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
|
2439
|
+
|
|
2434
2440
|
##### action: [`ActionStrict`](./snaptrade_client/type/action_strict.py)<a id="action-actionstrictsnaptrade_clienttypeaction_strictpy"></a>
|
|
2435
2441
|
|
|
2436
2442
|
##### order_type: [`OrderTypeStrict`](./snaptrade_client/type/order_type_strict.py)<a id="order_type-ordertypestrictsnaptrade_clienttypeorder_type_strictpy"></a>
|
|
@@ -2441,10 +2447,6 @@ replace_order_response = snaptrade.trading.replace_order(
|
|
|
2441
2447
|
|
|
2442
2448
|
The ID of the account to execute the trade on.
|
|
2443
2449
|
|
|
2444
|
-
##### brokerage_order_id: `str`<a id="brokerage_order_id-str"></a>
|
|
2445
|
-
|
|
2446
|
-
The Brokerage Order ID of the order to replace.
|
|
2447
|
-
|
|
2448
2450
|
##### user_id: `str`<a id="user_id-str"></a>
|
|
2449
2451
|
|
|
2450
2452
|
##### user_secret: `str`<a id="user_secret-str"></a>
|
|
@@ -2472,7 +2474,7 @@ The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
|
|
|
2472
2474
|
|
|
2473
2475
|
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2474
2476
|
|
|
2475
|
-
`/accounts/{accountId}/trading/
|
|
2477
|
+
`/accounts/{accountId}/trading/replace` `post`
|
|
2476
2478
|
|
|
2477
2479
|
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2478
2480
|
|