snaptrade-python-sdk 11.0.118__py3-none-any.whl → 11.0.120__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. snaptrade_client/__init__.py +1 -1
  2. snaptrade_client/api_client.py +1 -1
  3. snaptrade_client/apis/path_to_api.py +9 -9
  4. snaptrade_client/apis/paths/accounts_account_id_trading_crypto.py +7 -0
  5. snaptrade_client/apis/paths/accounts_account_id_trading_crypto_preview.py +7 -0
  6. snaptrade_client/apis/paths/accounts_account_id_trading_replace.py +7 -0
  7. snaptrade_client/apis/tags/trading_api_generated.py +5 -5
  8. snaptrade_client/configuration.py +1 -1
  9. snaptrade_client/model/crypto_order_form.py +249 -0
  10. snaptrade_client/model/crypto_order_form.pyi +229 -0
  11. snaptrade_client/model/{simple_order_preview.pyi → crypto_order_preview.py} +8 -8
  12. snaptrade_client/model/{simple_order_preview.py → crypto_order_preview.pyi} +8 -8
  13. snaptrade_client/model/{simple_order_preview_estimated_fee.py → crypto_order_preview_estimated_fee.py} +2 -2
  14. snaptrade_client/model/{simple_order_preview_estimated_fee.pyi → crypto_order_preview_estimated_fee.pyi} +2 -2
  15. snaptrade_client/model/crypto_trading_instrument.py +113 -0
  16. snaptrade_client/model/crypto_trading_instrument.pyi +106 -0
  17. snaptrade_client/model/manual_trade_replace_form.py +15 -3
  18. snaptrade_client/model/manual_trade_replace_form.pyi +15 -3
  19. snaptrade_client/model/simple_order_form.py +14 -15
  20. snaptrade_client/model/simple_order_form.pyi +14 -15
  21. snaptrade_client/models/__init__.py +4 -2
  22. snaptrade_client/operation_parameter_map.py +43 -43
  23. snaptrade_client/paths/__init__.py +3 -3
  24. snaptrade_client/paths/accounts_account_id_orders_cancel/post.py +6 -2
  25. snaptrade_client/paths/accounts_account_id_orders_cancel/post.pyi +6 -2
  26. snaptrade_client/paths/accounts_account_id_trading_cancel/post.py +2 -2
  27. snaptrade_client/paths/accounts_account_id_trading_cancel/post.pyi +2 -2
  28. snaptrade_client/paths/{accounts_account_id_trading_simple → accounts_account_id_trading_crypto}/__init__.py +2 -2
  29. snaptrade_client/paths/{accounts_account_id_trading_simple → accounts_account_id_trading_crypto}/post.py +34 -34
  30. snaptrade_client/paths/{accounts_account_id_trading_simple → accounts_account_id_trading_crypto}/post.pyi +34 -34
  31. snaptrade_client/paths/{accounts_account_id_trading_simple_preview → accounts_account_id_trading_crypto_preview}/__init__.py +2 -2
  32. snaptrade_client/paths/{accounts_account_id_trading_simple_preview → accounts_account_id_trading_crypto_preview}/post.py +39 -39
  33. snaptrade_client/paths/{accounts_account_id_trading_simple_preview → accounts_account_id_trading_crypto_preview}/post.pyi +39 -39
  34. snaptrade_client/paths/{accounts_account_id_trading_simple_brokerage_order_id_replace → accounts_account_id_trading_replace}/__init__.py +2 -2
  35. snaptrade_client/paths/{accounts_account_id_trading_simple_brokerage_order_id_replace/patch.py → accounts_account_id_trading_replace/post.py} +18 -28
  36. snaptrade_client/paths/{accounts_account_id_trading_simple_brokerage_order_id_replace/patch.pyi → accounts_account_id_trading_replace/post.pyi} +18 -28
  37. snaptrade_client/type/crypto_order_form.py +50 -0
  38. snaptrade_client/type/{simple_order_preview.py → crypto_order_preview.py} +5 -5
  39. snaptrade_client/type/{simple_order_preview_estimated_fee.py → crypto_order_preview_estimated_fee.py} +3 -3
  40. snaptrade_client/type/crypto_trading_instrument.py +30 -0
  41. snaptrade_client/type/manual_trade_form_with_options.py +1 -1
  42. snaptrade_client/type/manual_trade_replace_form.py +3 -0
  43. {snaptrade_python_sdk-11.0.118.dist-info → snaptrade_python_sdk-11.0.120.dist-info}/METADATA +108 -106
  44. {snaptrade_python_sdk-11.0.118.dist-info → snaptrade_python_sdk-11.0.120.dist-info}/RECORD +46 -40
  45. snaptrade_client/apis/paths/accounts_account_id_trading_simple.py +0 -7
  46. snaptrade_client/apis/paths/accounts_account_id_trading_simple_brokerage_order_id_replace.py +0 -7
  47. snaptrade_client/apis/paths/accounts_account_id_trading_simple_preview.py +0 -7
  48. {snaptrade_python_sdk-11.0.118.dist-info → snaptrade_python_sdk-11.0.120.dist-info}/LICENSE +0 -0
  49. {snaptrade_python_sdk-11.0.118.dist-info → snaptrade_python_sdk-11.0.120.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 = 'patch'.upper()
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/simple/{brokerageOrderId}/replace',
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 = 'patch'.upper()
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/simple/{brokerageOrderId}/replace',
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 ApiForpatch(BaseApi):
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 apatch(
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 patch(
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.simple_order_preview_estimated_fee import SimpleOrderPreviewEstimatedFee
18
+ from snaptrade_client.type.crypto_order_preview_estimated_fee import CryptoOrderPreviewEstimatedFee
19
19
 
20
- class RequiredSimpleOrderPreview(TypedDict):
20
+ class RequiredCryptoOrderPreview(TypedDict):
21
21
  pass
22
22
 
23
- class OptionalSimpleOrderPreview(TypedDict, total=False):
24
- estimated_fee: SimpleOrderPreviewEstimatedFee
23
+ class OptionalCryptoOrderPreview(TypedDict, total=False):
24
+ estimated_fee: CryptoOrderPreviewEstimatedFee
25
25
 
26
- class SimpleOrderPreview(RequiredSimpleOrderPreview, OptionalSimpleOrderPreview):
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 RequiredSimpleOrderPreviewEstimatedFee(TypedDict):
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 OptionalSimpleOrderPreviewEstimatedFee(TypedDict, total=False):
25
+ class OptionalCryptoOrderPreviewEstimatedFee(TypedDict, total=False):
26
26
  pass
27
27
 
28
- class SimpleOrderPreviewEstimatedFee(RequiredSimpleOrderPreviewEstimatedFee, OptionalSimpleOrderPreviewEstimatedFee):
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
@@ -36,7 +36,7 @@ class OptionalManualTradeFormWithOptions(TypedDict, total=False):
36
36
  # The universal symbol ID of the security to trade. Must be 'null' if `symbol` is provided, otherwise must be provided.
37
37
  universal_symbol_id: UniversalSymbolIDNullable
38
38
 
39
- # The security's trading ticker symbol. This currently supports stock symbols and Options symbols in the 21 character OCC format. For example `AAPL 131124C00240000` represents a call option on AAPL expiring on 2024-11-13 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format). If 'symbol' is provided, then 'universal_symbol_id' must be 'null'.
39
+ # The security's trading ticker symbol. If 'symbol' is provided, then 'universal_symbol_id' must be 'null'.
40
40
  symbol: typing.Optional[str]
41
41
 
42
42
  # The limit price for `Limit` and `StopLimit` orders.
@@ -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