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
|
@@ -49,6 +49,10 @@ from snaptrade_client.model.cancel_order_response_raw_response import CancelOrde
|
|
|
49
49
|
from snaptrade_client.model.child_brokerage_order_ids import ChildBrokerageOrderIDs
|
|
50
50
|
from snaptrade_client.model.child_brokerage_order_ids_nullable import ChildBrokerageOrderIDsNullable
|
|
51
51
|
from snaptrade_client.model.client_id import ClientID
|
|
52
|
+
from snaptrade_client.model.crypto_order_form import CryptoOrderForm
|
|
53
|
+
from snaptrade_client.model.crypto_order_preview import CryptoOrderPreview
|
|
54
|
+
from snaptrade_client.model.crypto_order_preview_estimated_fee import CryptoOrderPreviewEstimatedFee
|
|
55
|
+
from snaptrade_client.model.crypto_trading_instrument import CryptoTradingInstrument
|
|
52
56
|
from snaptrade_client.model.cryptocurrency_base_symbol import CryptocurrencyBaseSymbol
|
|
53
57
|
from snaptrade_client.model.cryptocurrency_pair import CryptocurrencyPair
|
|
54
58
|
from snaptrade_client.model.cryptocurrency_pair_quote import CryptocurrencyPairQuote
|
|
@@ -140,8 +144,6 @@ from snaptrade_client.model.security_type import SecurityType
|
|
|
140
144
|
from snaptrade_client.model.security_type_id import SecurityTypeID
|
|
141
145
|
from snaptrade_client.model.session_event import SessionEvent
|
|
142
146
|
from snaptrade_client.model.simple_order_form import SimpleOrderForm
|
|
143
|
-
from snaptrade_client.model.simple_order_preview import SimpleOrderPreview
|
|
144
|
-
from snaptrade_client.model.simple_order_preview_estimated_fee import SimpleOrderPreviewEstimatedFee
|
|
145
147
|
from snaptrade_client.model.snap_trade_holdings_account import SnapTradeHoldingsAccount
|
|
146
148
|
from snaptrade_client.model.snap_trade_holdings_account_meta import SnapTradeHoldingsAccountMeta
|
|
147
149
|
from snaptrade_client.model.snap_trade_holdings_total_value import SnapTradeHoldingsTotalValue
|
|
@@ -625,6 +625,46 @@ operation_parameter_map = {
|
|
|
625
625
|
},
|
|
626
626
|
]
|
|
627
627
|
},
|
|
628
|
+
'/accounts/{accountId}/trading/crypto-POST': {
|
|
629
|
+
'parameters': [
|
|
630
|
+
{
|
|
631
|
+
'name': 'instrument'
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
'name': 'side'
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
'name': 'type'
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
'name': 'time_in_force'
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
'name': 'amount'
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
'name': 'userId'
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
'name': 'userSecret'
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
'name': 'accountId'
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
'name': 'limit_price'
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
'name': 'stop_price'
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
'name': 'post_only'
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
'name': 'expiration_date'
|
|
665
|
+
},
|
|
666
|
+
]
|
|
667
|
+
},
|
|
628
668
|
'/trade/place-POST': {
|
|
629
669
|
'parameters': [
|
|
630
670
|
{
|
|
@@ -712,7 +752,7 @@ operation_parameter_map = {
|
|
|
712
752
|
},
|
|
713
753
|
]
|
|
714
754
|
},
|
|
715
|
-
'/accounts/{accountId}/trading/
|
|
755
|
+
'/accounts/{accountId}/trading/crypto/preview-POST': {
|
|
716
756
|
'parameters': [
|
|
717
757
|
{
|
|
718
758
|
'name': 'instrument'
|
|
@@ -752,48 +792,11 @@ operation_parameter_map = {
|
|
|
752
792
|
},
|
|
753
793
|
]
|
|
754
794
|
},
|
|
755
|
-
'/accounts/{accountId}/trading/
|
|
795
|
+
'/accounts/{accountId}/trading/replace-POST': {
|
|
756
796
|
'parameters': [
|
|
757
797
|
{
|
|
758
|
-
'name': '
|
|
759
|
-
},
|
|
760
|
-
{
|
|
761
|
-
'name': 'side'
|
|
762
|
-
},
|
|
763
|
-
{
|
|
764
|
-
'name': 'type'
|
|
765
|
-
},
|
|
766
|
-
{
|
|
767
|
-
'name': 'time_in_force'
|
|
768
|
-
},
|
|
769
|
-
{
|
|
770
|
-
'name': 'amount'
|
|
771
|
-
},
|
|
772
|
-
{
|
|
773
|
-
'name': 'userId'
|
|
774
|
-
},
|
|
775
|
-
{
|
|
776
|
-
'name': 'userSecret'
|
|
777
|
-
},
|
|
778
|
-
{
|
|
779
|
-
'name': 'accountId'
|
|
780
|
-
},
|
|
781
|
-
{
|
|
782
|
-
'name': 'limit_price'
|
|
783
|
-
},
|
|
784
|
-
{
|
|
785
|
-
'name': 'stop_price'
|
|
786
|
-
},
|
|
787
|
-
{
|
|
788
|
-
'name': 'post_only'
|
|
798
|
+
'name': 'brokerage_order_id'
|
|
789
799
|
},
|
|
790
|
-
{
|
|
791
|
-
'name': 'expiration_date'
|
|
792
|
-
},
|
|
793
|
-
]
|
|
794
|
-
},
|
|
795
|
-
'/accounts/{accountId}/trading/simple/{brokerageOrderId}/replace-PATCH': {
|
|
796
|
-
'parameters': [
|
|
797
800
|
{
|
|
798
801
|
'name': 'action'
|
|
799
802
|
},
|
|
@@ -806,9 +809,6 @@ operation_parameter_map = {
|
|
|
806
809
|
{
|
|
807
810
|
'name': 'accountId'
|
|
808
811
|
},
|
|
809
|
-
{
|
|
810
|
-
'name': 'brokerageOrderId'
|
|
811
|
-
},
|
|
812
812
|
{
|
|
813
813
|
'name': 'userId'
|
|
814
814
|
},
|
|
@@ -43,11 +43,11 @@ class PathValues(str, enum.Enum):
|
|
|
43
43
|
ACCOUNTS_ACCOUNT_ID_TRADING_BRACKET = "/accounts/{accountId}/trading/bracket"
|
|
44
44
|
ACCOUNTS_ACCOUNT_ID_TRADING_OPTIONS = "/accounts/{accountId}/trading/options"
|
|
45
45
|
ACCOUNTS_ACCOUNT_ID_TRADING_INSTRUMENTS_CRYPTOCURRENCY_PAIRS = "/accounts/{accountId}/trading/instruments/cryptocurrencyPairs"
|
|
46
|
-
ACCOUNTS_ACCOUNT_ID_TRADING_SIMPLE_PREVIEW = "/accounts/{accountId}/trading/simple/preview"
|
|
47
46
|
ACCOUNTS_ACCOUNT_ID_TRADING_INSTRUMENTS_CRYPTOCURRENCY_PAIRS_INSTRUMENT_SYMBOL_QUOTE = "/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote"
|
|
48
|
-
|
|
49
|
-
ACCOUNTS_ACCOUNT_ID_TRADING_SIMPLE_BROKERAGE_ORDER_ID_REPLACE = "/accounts/{accountId}/trading/simple/{brokerageOrderId}/replace"
|
|
47
|
+
ACCOUNTS_ACCOUNT_ID_TRADING_REPLACE = "/accounts/{accountId}/trading/replace"
|
|
50
48
|
ACCOUNTS_ACCOUNT_ID_TRADING_CANCEL = "/accounts/{accountId}/trading/cancel"
|
|
49
|
+
ACCOUNTS_ACCOUNT_ID_TRADING_CRYPTO = "/accounts/{accountId}/trading/crypto"
|
|
50
|
+
ACCOUNTS_ACCOUNT_ID_TRADING_CRYPTO_PREVIEW = "/accounts/{accountId}/trading/crypto/preview"
|
|
51
51
|
SNAP_TRADE_PARTNERS = "/snapTrade/partners"
|
|
52
52
|
ACCOUNTS_ACCOUNT_ID_SYMBOLS = "/accounts/{accountId}/symbols"
|
|
53
53
|
BROKERAGES = "/brokerages"
|
|
@@ -537,6 +537,7 @@ class BaseApi(api_client.Api):
|
|
|
537
537
|
class CancelUserAccountOrder(BaseApi):
|
|
538
538
|
# this class is used by api classes that refer to endpoints with operationId fn names
|
|
539
539
|
|
|
540
|
+
@api_client.DeprecationWarningOnce(prefix="trading")
|
|
540
541
|
async def acancel_user_account_order(
|
|
541
542
|
self,
|
|
542
543
|
body: typing.Optional[typing.Any] = None,
|
|
@@ -568,6 +569,7 @@ class CancelUserAccountOrder(BaseApi):
|
|
|
568
569
|
**kwargs,
|
|
569
570
|
)
|
|
570
571
|
|
|
572
|
+
@api_client.DeprecationWarningOnce(prefix="trading")
|
|
571
573
|
def cancel_user_account_order(
|
|
572
574
|
self,
|
|
573
575
|
body: typing.Optional[typing.Any] = None,
|
|
@@ -581,7 +583,7 @@ class CancelUserAccountOrder(BaseApi):
|
|
|
581
583
|
ApiResponseFor200,
|
|
582
584
|
api_client.ApiResponseWithoutDeserialization,
|
|
583
585
|
]:
|
|
584
|
-
""" Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected. """
|
|
586
|
+
""" **This endpoint is deprecated. Please switch to [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) ** Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected. """
|
|
585
587
|
args = self._cancel_user_account_order_mapped_args(
|
|
586
588
|
body=body,
|
|
587
589
|
query_params=query_params,
|
|
@@ -600,6 +602,7 @@ class CancelUserAccountOrder(BaseApi):
|
|
|
600
602
|
class ApiForpost(BaseApi):
|
|
601
603
|
# this class is used by api classes that refer to endpoints by path and http method names
|
|
602
604
|
|
|
605
|
+
@api_client.DeprecationWarningOnce(prefix="trading")
|
|
603
606
|
async def apost(
|
|
604
607
|
self,
|
|
605
608
|
body: typing.Optional[typing.Any] = None,
|
|
@@ -631,6 +634,7 @@ class ApiForpost(BaseApi):
|
|
|
631
634
|
**kwargs,
|
|
632
635
|
)
|
|
633
636
|
|
|
637
|
+
@api_client.DeprecationWarningOnce(prefix="trading")
|
|
634
638
|
def post(
|
|
635
639
|
self,
|
|
636
640
|
body: typing.Optional[typing.Any] = None,
|
|
@@ -644,7 +648,7 @@ class ApiForpost(BaseApi):
|
|
|
644
648
|
ApiResponseFor200,
|
|
645
649
|
api_client.ApiResponseWithoutDeserialization,
|
|
646
650
|
]:
|
|
647
|
-
""" Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected. """
|
|
651
|
+
""" **This endpoint is deprecated. Please switch to [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) ** Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected. """
|
|
648
652
|
args = self._cancel_user_account_order_mapped_args(
|
|
649
653
|
body=body,
|
|
650
654
|
query_params=query_params,
|
|
@@ -525,6 +525,7 @@ class BaseApi(api_client.Api):
|
|
|
525
525
|
class CancelUserAccountOrder(BaseApi):
|
|
526
526
|
# this class is used by api classes that refer to endpoints with operationId fn names
|
|
527
527
|
|
|
528
|
+
@api_client.DeprecationWarningOnce(prefix="trading")
|
|
528
529
|
async def acancel_user_account_order(
|
|
529
530
|
self,
|
|
530
531
|
body: typing.Optional[typing.Any] = None,
|
|
@@ -556,6 +557,7 @@ class CancelUserAccountOrder(BaseApi):
|
|
|
556
557
|
**kwargs,
|
|
557
558
|
)
|
|
558
559
|
|
|
560
|
+
@api_client.DeprecationWarningOnce(prefix="trading")
|
|
559
561
|
def cancel_user_account_order(
|
|
560
562
|
self,
|
|
561
563
|
body: typing.Optional[typing.Any] = None,
|
|
@@ -569,7 +571,7 @@ class CancelUserAccountOrder(BaseApi):
|
|
|
569
571
|
ApiResponseFor200,
|
|
570
572
|
api_client.ApiResponseWithoutDeserialization,
|
|
571
573
|
]:
|
|
572
|
-
""" Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected. """
|
|
574
|
+
""" **This endpoint is deprecated. Please switch to [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) ** Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected. """
|
|
573
575
|
args = self._cancel_user_account_order_mapped_args(
|
|
574
576
|
body=body,
|
|
575
577
|
query_params=query_params,
|
|
@@ -588,6 +590,7 @@ class CancelUserAccountOrder(BaseApi):
|
|
|
588
590
|
class ApiForpost(BaseApi):
|
|
589
591
|
# this class is used by api classes that refer to endpoints by path and http method names
|
|
590
592
|
|
|
593
|
+
@api_client.DeprecationWarningOnce(prefix="trading")
|
|
591
594
|
async def apost(
|
|
592
595
|
self,
|
|
593
596
|
body: typing.Optional[typing.Any] = None,
|
|
@@ -619,6 +622,7 @@ class ApiForpost(BaseApi):
|
|
|
619
622
|
**kwargs,
|
|
620
623
|
)
|
|
621
624
|
|
|
625
|
+
@api_client.DeprecationWarningOnce(prefix="trading")
|
|
622
626
|
def post(
|
|
623
627
|
self,
|
|
624
628
|
body: typing.Optional[typing.Any] = None,
|
|
@@ -632,7 +636,7 @@ class ApiForpost(BaseApi):
|
|
|
632
636
|
ApiResponseFor200,
|
|
633
637
|
api_client.ApiResponseWithoutDeserialization,
|
|
634
638
|
]:
|
|
635
|
-
""" Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected. """
|
|
639
|
+
""" **This endpoint is deprecated. Please switch to [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) ** Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected. """
|
|
636
640
|
args = self._cancel_user_account_order_mapped_args(
|
|
637
641
|
body=body,
|
|
638
642
|
query_params=query_params,
|
|
@@ -574,7 +574,7 @@ class CancelOrder(BaseApi):
|
|
|
574
574
|
ApiResponseFor200,
|
|
575
575
|
api_client.ApiResponseWithoutDeserialization,
|
|
576
576
|
]:
|
|
577
|
-
""" Cancels an order in the specified account. """
|
|
577
|
+
""" Cancels an order in the specified account. Accepts order IDs for all asset types. """
|
|
578
578
|
args = self._cancel_order_mapped_args(
|
|
579
579
|
body=body,
|
|
580
580
|
query_params=query_params,
|
|
@@ -637,7 +637,7 @@ class ApiForpost(BaseApi):
|
|
|
637
637
|
ApiResponseFor200,
|
|
638
638
|
api_client.ApiResponseWithoutDeserialization,
|
|
639
639
|
]:
|
|
640
|
-
""" Cancels an order in the specified account. """
|
|
640
|
+
""" Cancels an order in the specified account. Accepts order IDs for all asset types. """
|
|
641
641
|
args = self._cancel_order_mapped_args(
|
|
642
642
|
body=body,
|
|
643
643
|
query_params=query_params,
|
|
@@ -562,7 +562,7 @@ class CancelOrder(BaseApi):
|
|
|
562
562
|
ApiResponseFor200,
|
|
563
563
|
api_client.ApiResponseWithoutDeserialization,
|
|
564
564
|
]:
|
|
565
|
-
""" Cancels an order in the specified account. """
|
|
565
|
+
""" Cancels an order in the specified account. Accepts order IDs for all asset types. """
|
|
566
566
|
args = self._cancel_order_mapped_args(
|
|
567
567
|
body=body,
|
|
568
568
|
query_params=query_params,
|
|
@@ -625,7 +625,7 @@ class ApiForpost(BaseApi):
|
|
|
625
625
|
ApiResponseFor200,
|
|
626
626
|
api_client.ApiResponseWithoutDeserialization,
|
|
627
627
|
]:
|
|
628
|
-
""" Cancels an order in the specified account. """
|
|
628
|
+
""" Cancels an order in the specified account. Accepts order IDs for all asset types. """
|
|
629
629
|
args = self._cancel_order_mapped_args(
|
|
630
630
|
body=body,
|
|
631
631
|
query_params=query_params,
|
|
@@ -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 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
|
|
@@ -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
|
from . import path
|
|
@@ -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),
|
|
@@ -194,10 +194,10 @@ _all_accept_content_types = (
|
|
|
194
194
|
|
|
195
195
|
class BaseApi(api_client.Api):
|
|
196
196
|
|
|
197
|
-
def
|
|
197
|
+
def _place_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 _aplace_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',
|
|
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 _place_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',
|
|
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 PlaceCryptoOrder(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 aplace_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 PlaceSimpleOrder(BaseApi):
|
|
|
534
534
|
api_client.ApiResponseWithoutDeserializationAsync,
|
|
535
535
|
AsyncGeneratorResponse,
|
|
536
536
|
]:
|
|
537
|
-
args = self.
|
|
537
|
+
args = self._place_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 PlaceSimpleOrder(BaseApi):
|
|
|
551
551
|
post_only=post_only,
|
|
552
552
|
expiration_date=expiration_date,
|
|
553
553
|
)
|
|
554
|
-
return await self.
|
|
554
|
+
return await self._aplace_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 place_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 PlaceSimpleOrder(BaseApi):
|
|
|
580
580
|
api_client.ApiResponseWithoutDeserialization,
|
|
581
581
|
]:
|
|
582
582
|
""" 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. """
|
|
583
|
-
args = self.
|
|
583
|
+
args = self._place_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 PlaceSimpleOrder(BaseApi):
|
|
|
597
597
|
post_only=post_only,
|
|
598
598
|
expiration_date=expiration_date,
|
|
599
599
|
)
|
|
600
|
-
return self.
|
|
600
|
+
return self._place_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._place_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._aplace_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
|
""" 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. """
|
|
678
|
-
args = self.
|
|
678
|
+
args = self._place_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._place_crypto_order_oapg(
|
|
696
696
|
body=args.body,
|
|
697
697
|
query_params=args.query,
|
|
698
698
|
path_params=args.path,
|