architect-py 5.0.0b1__py3-none-any.whl → 5.0.0b3__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 (74) hide show
  1. architect_py/__init__.py +10 -3
  2. architect_py/async_client.py +291 -174
  3. architect_py/client_interface.py +19 -18
  4. architect_py/common_types/order_dir.py +12 -6
  5. architect_py/graphql_client/__init__.py +2 -0
  6. architect_py/graphql_client/enums.py +5 -0
  7. architect_py/grpc/__init__.py +25 -7
  8. architect_py/grpc/client.py +13 -5
  9. architect_py/grpc/models/Accounts/AccountsRequest.py +4 -1
  10. architect_py/grpc/models/Algo/AlgoOrder.py +114 -0
  11. architect_py/grpc/models/Algo/{ModifyAlgoOrderRequestForTwapAlgo.py → AlgoOrderRequest.py} +11 -10
  12. architect_py/grpc/models/Algo/AlgoOrdersRequest.py +72 -0
  13. architect_py/grpc/models/Algo/AlgoOrdersResponse.py +27 -0
  14. architect_py/grpc/models/Algo/CreateAlgoOrderRequest.py +56 -0
  15. architect_py/grpc/models/Algo/PauseAlgoRequest.py +42 -0
  16. architect_py/grpc/models/Algo/PauseAlgoResponse.py +20 -0
  17. architect_py/grpc/models/Algo/StartAlgoRequest.py +42 -0
  18. architect_py/grpc/models/Algo/StartAlgoResponse.py +20 -0
  19. architect_py/grpc/models/Algo/StopAlgoRequest.py +42 -0
  20. architect_py/grpc/models/Algo/StopAlgoResponse.py +20 -0
  21. architect_py/grpc/models/Boss/DepositsRequest.py +40 -0
  22. architect_py/grpc/models/Boss/DepositsResponse.py +27 -0
  23. architect_py/grpc/models/Boss/RqdAccountStatisticsRequest.py +42 -0
  24. architect_py/grpc/models/Boss/RqdAccountStatisticsResponse.py +25 -0
  25. architect_py/grpc/models/Boss/StatementUrlRequest.py +40 -0
  26. architect_py/grpc/models/Boss/StatementUrlResponse.py +23 -0
  27. architect_py/grpc/models/Boss/StatementsRequest.py +40 -0
  28. architect_py/grpc/models/Boss/StatementsResponse.py +27 -0
  29. architect_py/grpc/models/Boss/WithdrawalsRequest.py +40 -0
  30. architect_py/grpc/models/Boss/WithdrawalsResponse.py +27 -0
  31. architect_py/grpc/models/Boss/__init__.py +2 -0
  32. architect_py/grpc/models/Folio/HistoricalFillsRequest.py +4 -1
  33. architect_py/grpc/models/Marketdata/L1BookSnapshot.py +16 -2
  34. architect_py/grpc/models/Oms/Cancel.py +67 -19
  35. architect_py/grpc/models/Oms/Order.py +4 -11
  36. architect_py/grpc/models/Oms/PlaceOrderRequest.py +13 -20
  37. architect_py/grpc/models/OptionsMarketdata/OptionsChain.py +30 -0
  38. architect_py/grpc/models/OptionsMarketdata/OptionsChainGreeks.py +30 -0
  39. architect_py/grpc/models/OptionsMarketdata/OptionsChainGreeksRequest.py +47 -0
  40. architect_py/grpc/models/OptionsMarketdata/OptionsChainRequest.py +45 -0
  41. architect_py/grpc/models/OptionsMarketdata/OptionsExpirations.py +29 -0
  42. architect_py/grpc/models/OptionsMarketdata/OptionsExpirationsRequest.py +42 -0
  43. architect_py/grpc/models/OptionsMarketdata/__init__.py +2 -0
  44. architect_py/grpc/models/Symbology/ExecutionInfoRequest.py +47 -0
  45. architect_py/grpc/models/Symbology/ExecutionInfoResponse.py +27 -0
  46. architect_py/grpc/models/definitions.py +457 -790
  47. architect_py/grpc/resolve_endpoint.py +4 -1
  48. architect_py/internal_utils/__init__.py +0 -0
  49. architect_py/internal_utils/no_pandas.py +3 -0
  50. architect_py/tests/conftest.py +11 -6
  51. architect_py/tests/test_marketdata.py +19 -19
  52. architect_py/tests/test_orderflow.py +31 -28
  53. {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b3.dist-info}/METADATA +2 -3
  54. {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b3.dist-info}/RECORD +72 -42
  55. {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b3.dist-info}/WHEEL +1 -1
  56. examples/book_subscription.py +2 -3
  57. examples/candles.py +3 -3
  58. examples/common.py +29 -20
  59. examples/external_cpty.py +4 -4
  60. examples/funding_rate_mean_reversion_algo.py +14 -20
  61. examples/order_sending.py +32 -33
  62. examples/stream_l1_marketdata.py +2 -2
  63. examples/stream_l2_marketdata.py +1 -3
  64. examples/trades.py +2 -2
  65. examples/tutorial_async.py +9 -7
  66. examples/tutorial_sync.py +5 -5
  67. scripts/generate_functions_md.py +3 -1
  68. scripts/generate_sync_interface.py +30 -11
  69. scripts/postprocess_grpc.py +21 -11
  70. scripts/preprocess_grpc_schema.py +174 -113
  71. architect_py/grpc/models/Algo/AlgoOrderForTwapAlgo.py +0 -61
  72. architect_py/grpc/models/Algo/CreateAlgoOrderRequestForTwapAlgo.py +0 -59
  73. {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b3.dist-info}/licenses/LICENSE +0 -0
  74. {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,20 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Algo/PauseAlgoResponse.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from msgspec import Struct
7
+
8
+
9
+ class PauseAlgoResponse(Struct, omit_defaults=True):
10
+ pass
11
+
12
+ # Constructor that takes all field titles as arguments for convenience
13
+ @classmethod
14
+ def new(
15
+ cls,
16
+ ):
17
+ return cls()
18
+
19
+ def __str__(self) -> str:
20
+ return f"PauseAlgoResponse()"
@@ -0,0 +1,42 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Algo/StartAlgoRequest.json
3
+
4
+ from __future__ import annotations
5
+ from architect_py.grpc.models.Algo.StartAlgoResponse import StartAlgoResponse
6
+
7
+ from msgspec import Struct
8
+
9
+ from .. import definitions
10
+
11
+
12
+ class StartAlgoRequest(Struct, omit_defaults=True):
13
+ algo_order_id: definitions.OrderId
14
+
15
+ # Constructor that takes all field titles as arguments for convenience
16
+ @classmethod
17
+ def new(
18
+ cls,
19
+ algo_order_id: definitions.OrderId,
20
+ ):
21
+ return cls(
22
+ algo_order_id,
23
+ )
24
+
25
+ def __str__(self) -> str:
26
+ return f"StartAlgoRequest(algo_order_id={self.algo_order_id})"
27
+
28
+ @staticmethod
29
+ def get_response_type():
30
+ return StartAlgoResponse
31
+
32
+ @staticmethod
33
+ def get_unannotated_response_type():
34
+ return StartAlgoResponse
35
+
36
+ @staticmethod
37
+ def get_route() -> str:
38
+ return "/json.architect.Algo/StartAlgo"
39
+
40
+ @staticmethod
41
+ def get_rpc_method():
42
+ return "unary"
@@ -0,0 +1,20 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Algo/StartAlgoResponse.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from msgspec import Struct
7
+
8
+
9
+ class StartAlgoResponse(Struct, omit_defaults=True):
10
+ pass
11
+
12
+ # Constructor that takes all field titles as arguments for convenience
13
+ @classmethod
14
+ def new(
15
+ cls,
16
+ ):
17
+ return cls()
18
+
19
+ def __str__(self) -> str:
20
+ return f"StartAlgoResponse()"
@@ -0,0 +1,42 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Algo/StopAlgoRequest.json
3
+
4
+ from __future__ import annotations
5
+ from architect_py.grpc.models.Algo.StopAlgoResponse import StopAlgoResponse
6
+
7
+ from msgspec import Struct
8
+
9
+ from .. import definitions
10
+
11
+
12
+ class StopAlgoRequest(Struct, omit_defaults=True):
13
+ algo_order_id: definitions.OrderId
14
+
15
+ # Constructor that takes all field titles as arguments for convenience
16
+ @classmethod
17
+ def new(
18
+ cls,
19
+ algo_order_id: definitions.OrderId,
20
+ ):
21
+ return cls(
22
+ algo_order_id,
23
+ )
24
+
25
+ def __str__(self) -> str:
26
+ return f"StopAlgoRequest(algo_order_id={self.algo_order_id})"
27
+
28
+ @staticmethod
29
+ def get_response_type():
30
+ return StopAlgoResponse
31
+
32
+ @staticmethod
33
+ def get_unannotated_response_type():
34
+ return StopAlgoResponse
35
+
36
+ @staticmethod
37
+ def get_route() -> str:
38
+ return "/json.architect.Algo/StopAlgo"
39
+
40
+ @staticmethod
41
+ def get_rpc_method():
42
+ return "unary"
@@ -0,0 +1,20 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Algo/StopAlgoResponse.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from msgspec import Struct
7
+
8
+
9
+ class StopAlgoResponse(Struct, omit_defaults=True):
10
+ pass
11
+
12
+ # Constructor that takes all field titles as arguments for convenience
13
+ @classmethod
14
+ def new(
15
+ cls,
16
+ ):
17
+ return cls()
18
+
19
+ def __str__(self) -> str:
20
+ return f"StopAlgoResponse()"
@@ -0,0 +1,40 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/DepositsRequest.json
3
+
4
+ from __future__ import annotations
5
+ from architect_py.grpc.models.Boss.DepositsResponse import DepositsResponse
6
+
7
+ from msgspec import Struct
8
+
9
+
10
+ class DepositsRequest(Struct, omit_defaults=True):
11
+ account_id: str
12
+
13
+ # Constructor that takes all field titles as arguments for convenience
14
+ @classmethod
15
+ def new(
16
+ cls,
17
+ account_id: str,
18
+ ):
19
+ return cls(
20
+ account_id,
21
+ )
22
+
23
+ def __str__(self) -> str:
24
+ return f"DepositsRequest(account_id={self.account_id})"
25
+
26
+ @staticmethod
27
+ def get_response_type():
28
+ return DepositsResponse
29
+
30
+ @staticmethod
31
+ def get_unannotated_response_type():
32
+ return DepositsResponse
33
+
34
+ @staticmethod
35
+ def get_route() -> str:
36
+ return "/json.architect.Boss/Deposits"
37
+
38
+ @staticmethod
39
+ def get_rpc_method():
40
+ return "unary"
@@ -0,0 +1,27 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/DepositsResponse.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import List
7
+
8
+ from msgspec import Struct
9
+
10
+ from .. import definitions
11
+
12
+
13
+ class DepositsResponse(Struct, omit_defaults=True):
14
+ deposits: List[definitions.Deposit]
15
+
16
+ # Constructor that takes all field titles as arguments for convenience
17
+ @classmethod
18
+ def new(
19
+ cls,
20
+ deposits: List[definitions.Deposit],
21
+ ):
22
+ return cls(
23
+ deposits,
24
+ )
25
+
26
+ def __str__(self) -> str:
27
+ return f"DepositsResponse(deposits={self.deposits})"
@@ -0,0 +1,42 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/RqdAccountStatisticsRequest.json
3
+
4
+ from __future__ import annotations
5
+ from architect_py.grpc.models.Boss.RqdAccountStatisticsResponse import (
6
+ RqdAccountStatisticsResponse,
7
+ )
8
+
9
+ from msgspec import Struct
10
+
11
+
12
+ class RqdAccountStatisticsRequest(Struct, omit_defaults=True):
13
+ account_id: str
14
+
15
+ # Constructor that takes all field titles as arguments for convenience
16
+ @classmethod
17
+ def new(
18
+ cls,
19
+ account_id: str,
20
+ ):
21
+ return cls(
22
+ account_id,
23
+ )
24
+
25
+ def __str__(self) -> str:
26
+ return f"RqdAccountStatisticsRequest(account_id={self.account_id})"
27
+
28
+ @staticmethod
29
+ def get_response_type():
30
+ return RqdAccountStatisticsResponse
31
+
32
+ @staticmethod
33
+ def get_unannotated_response_type():
34
+ return RqdAccountStatisticsResponse
35
+
36
+ @staticmethod
37
+ def get_route() -> str:
38
+ return "/json.architect.Boss/RqdAccountStatistics"
39
+
40
+ @staticmethod
41
+ def get_rpc_method():
42
+ return "unary"
@@ -0,0 +1,25 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/RqdAccountStatisticsResponse.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from msgspec import Struct
7
+
8
+ from .. import definitions
9
+
10
+
11
+ class RqdAccountStatisticsResponse(Struct, omit_defaults=True):
12
+ rqd_account_statistics: definitions.RqdAccountStatistics
13
+
14
+ # Constructor that takes all field titles as arguments for convenience
15
+ @classmethod
16
+ def new(
17
+ cls,
18
+ rqd_account_statistics: definitions.RqdAccountStatistics,
19
+ ):
20
+ return cls(
21
+ rqd_account_statistics,
22
+ )
23
+
24
+ def __str__(self) -> str:
25
+ return f"RqdAccountStatisticsResponse(rqd_account_statistics={self.rqd_account_statistics})"
@@ -0,0 +1,40 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/StatementUrlRequest.json
3
+
4
+ from __future__ import annotations
5
+ from architect_py.grpc.models.Boss.StatementUrlResponse import StatementUrlResponse
6
+
7
+ from msgspec import Struct
8
+
9
+
10
+ class StatementUrlRequest(Struct, omit_defaults=True):
11
+ statement_uuid: str
12
+
13
+ # Constructor that takes all field titles as arguments for convenience
14
+ @classmethod
15
+ def new(
16
+ cls,
17
+ statement_uuid: str,
18
+ ):
19
+ return cls(
20
+ statement_uuid,
21
+ )
22
+
23
+ def __str__(self) -> str:
24
+ return f"StatementUrlRequest(statement_uuid={self.statement_uuid})"
25
+
26
+ @staticmethod
27
+ def get_response_type():
28
+ return StatementUrlResponse
29
+
30
+ @staticmethod
31
+ def get_unannotated_response_type():
32
+ return StatementUrlResponse
33
+
34
+ @staticmethod
35
+ def get_route() -> str:
36
+ return "/json.architect.Boss/StatementUrl"
37
+
38
+ @staticmethod
39
+ def get_rpc_method():
40
+ return "unary"
@@ -0,0 +1,23 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/StatementUrlResponse.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from msgspec import Struct
7
+
8
+
9
+ class StatementUrlResponse(Struct, omit_defaults=True):
10
+ statement_url: str
11
+
12
+ # Constructor that takes all field titles as arguments for convenience
13
+ @classmethod
14
+ def new(
15
+ cls,
16
+ statement_url: str,
17
+ ):
18
+ return cls(
19
+ statement_url,
20
+ )
21
+
22
+ def __str__(self) -> str:
23
+ return f"StatementUrlResponse(statement_url={self.statement_url})"
@@ -0,0 +1,40 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/StatementsRequest.json
3
+
4
+ from __future__ import annotations
5
+ from architect_py.grpc.models.Boss.StatementsResponse import StatementsResponse
6
+
7
+ from msgspec import Struct
8
+
9
+
10
+ class StatementsRequest(Struct, omit_defaults=True):
11
+ account_id: str
12
+
13
+ # Constructor that takes all field titles as arguments for convenience
14
+ @classmethod
15
+ def new(
16
+ cls,
17
+ account_id: str,
18
+ ):
19
+ return cls(
20
+ account_id,
21
+ )
22
+
23
+ def __str__(self) -> str:
24
+ return f"StatementsRequest(account_id={self.account_id})"
25
+
26
+ @staticmethod
27
+ def get_response_type():
28
+ return StatementsResponse
29
+
30
+ @staticmethod
31
+ def get_unannotated_response_type():
32
+ return StatementsResponse
33
+
34
+ @staticmethod
35
+ def get_route() -> str:
36
+ return "/json.architect.Boss/Statements"
37
+
38
+ @staticmethod
39
+ def get_rpc_method():
40
+ return "unary"
@@ -0,0 +1,27 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/StatementsResponse.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import List
7
+
8
+ from msgspec import Struct
9
+
10
+ from .. import definitions
11
+
12
+
13
+ class StatementsResponse(Struct, omit_defaults=True):
14
+ statements: List[definitions.Statement]
15
+
16
+ # Constructor that takes all field titles as arguments for convenience
17
+ @classmethod
18
+ def new(
19
+ cls,
20
+ statements: List[definitions.Statement],
21
+ ):
22
+ return cls(
23
+ statements,
24
+ )
25
+
26
+ def __str__(self) -> str:
27
+ return f"StatementsResponse(statements={self.statements})"
@@ -0,0 +1,40 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/WithdrawalsRequest.json
3
+
4
+ from __future__ import annotations
5
+ from architect_py.grpc.models.Boss.WithdrawalsResponse import WithdrawalsResponse
6
+
7
+ from msgspec import Struct
8
+
9
+
10
+ class WithdrawalsRequest(Struct, omit_defaults=True):
11
+ account_id: str
12
+
13
+ # Constructor that takes all field titles as arguments for convenience
14
+ @classmethod
15
+ def new(
16
+ cls,
17
+ account_id: str,
18
+ ):
19
+ return cls(
20
+ account_id,
21
+ )
22
+
23
+ def __str__(self) -> str:
24
+ return f"WithdrawalsRequest(account_id={self.account_id})"
25
+
26
+ @staticmethod
27
+ def get_response_type():
28
+ return WithdrawalsResponse
29
+
30
+ @staticmethod
31
+ def get_unannotated_response_type():
32
+ return WithdrawalsResponse
33
+
34
+ @staticmethod
35
+ def get_route() -> str:
36
+ return "/json.architect.Boss/Withdrawals"
37
+
38
+ @staticmethod
39
+ def get_rpc_method():
40
+ return "unary"
@@ -0,0 +1,27 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/WithdrawalsResponse.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import List
7
+
8
+ from msgspec import Struct
9
+
10
+ from .. import definitions
11
+
12
+
13
+ class WithdrawalsResponse(Struct, omit_defaults=True):
14
+ withdrawals: List[definitions.Withdrawal]
15
+
16
+ # Constructor that takes all field titles as arguments for convenience
17
+ @classmethod
18
+ def new(
19
+ cls,
20
+ withdrawals: List[definitions.Withdrawal],
21
+ ):
22
+ return cls(
23
+ withdrawals,
24
+ )
25
+
26
+ def __str__(self) -> str:
27
+ return f"WithdrawalsResponse(withdrawals={self.withdrawals})"
@@ -0,0 +1,2 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: schemas
@@ -24,6 +24,7 @@ class HistoricalFillsRequest(Struct, omit_defaults=True):
24
24
  Default maximum is 1000.
25
25
  """
26
26
  order_id: Optional[definitions.OrderId] = None
27
+ symbol: Optional[str] = None
27
28
  to_exclusive: Optional[datetime] = None
28
29
  trader: Optional[definitions.TraderIdOrEmail] = None
29
30
  venue: Optional[str] = None
@@ -36,6 +37,7 @@ class HistoricalFillsRequest(Struct, omit_defaults=True):
36
37
  from_inclusive: Optional[datetime] = None,
37
38
  limit: Optional[int] = None,
38
39
  order_id: Optional[definitions.OrderId] = None,
40
+ symbol: Optional[str] = None,
39
41
  to_exclusive: Optional[datetime] = None,
40
42
  trader: Optional[definitions.TraderIdOrEmail] = None,
41
43
  venue: Optional[str] = None,
@@ -45,13 +47,14 @@ class HistoricalFillsRequest(Struct, omit_defaults=True):
45
47
  from_inclusive,
46
48
  limit,
47
49
  order_id,
50
+ symbol,
48
51
  to_exclusive,
49
52
  trader,
50
53
  venue,
51
54
  )
52
55
 
53
56
  def __str__(self) -> str:
54
- return f"HistoricalFillsRequest(account={self.account},from_inclusive={self.from_inclusive},limit={self.limit},order_id={self.order_id},to_exclusive={self.to_exclusive},trader={self.trader},venue={self.venue})"
57
+ return f"HistoricalFillsRequest(account={self.account},from_inclusive={self.from_inclusive},limit={self.limit},order_id={self.order_id},symbol={self.symbol},to_exclusive={self.to_exclusive},trader={self.trader},venue={self.venue})"
55
58
 
56
59
  @staticmethod
57
60
  def get_response_type():
@@ -14,8 +14,22 @@ class L1BookSnapshot(Struct, omit_defaults=True):
14
14
  s: Annotated[str, Meta(title="symbol")]
15
15
  tn: Annotated[int, Meta(ge=0, title="timestamp_ns")]
16
16
  ts: Annotated[int, Meta(title="timestamp")]
17
- a: Optional[Annotated[List[Decimal], Meta(title="best_ask")]] = None
18
- b: Optional[Annotated[List[Decimal], Meta(title="best_bid")]] = None
17
+ a: Optional[
18
+ Annotated[
19
+ List[Decimal], Meta(description="(price, quantity)", title="best_ask")
20
+ ]
21
+ ] = None
22
+ """
23
+ (price, quantity)
24
+ """
25
+ b: Optional[
26
+ Annotated[
27
+ List[Decimal], Meta(description="(price, quantity)", title="best_bid")
28
+ ]
29
+ ] = None
30
+ """
31
+ (price, quantity)
32
+ """
19
33
  rt: Optional[
20
34
  Annotated[
21
35
  Optional[int],
@@ -11,32 +11,80 @@ from .. import definitions
11
11
 
12
12
 
13
13
  class Cancel(Struct, omit_defaults=True):
14
- id: definitions.OrderId
15
- o: definitions.CancelStatus
16
- tn: Annotated[int, Meta(ge=0)]
17
- ts: int
18
- xid: str
19
- r: Optional[str] = None
14
+ id: Annotated[definitions.OrderId, Meta(title="order_id")]
15
+ o: Annotated[definitions.CancelStatus, Meta(title="status")]
16
+ tn: Annotated[int, Meta(ge=0, title="recv_time_ns")]
17
+ ts: Annotated[int, Meta(title="recv_time")]
18
+ xid: Annotated[str, Meta(title="cancel_id")]
19
+ r: Optional[Annotated[Optional[str], Meta(title="reject_reason")]] = None
20
20
 
21
21
  # Constructor that takes all field titles as arguments for convenience
22
22
  @classmethod
23
23
  def new(
24
24
  cls,
25
- id: definitions.OrderId,
26
- o: definitions.CancelStatus,
27
- tn: int,
28
- ts: int,
29
- xid: str,
30
- r: Optional[str] = None,
25
+ order_id: definitions.OrderId,
26
+ status: definitions.CancelStatus,
27
+ recv_time_ns: int,
28
+ recv_time: int,
29
+ cancel_id: str,
30
+ reject_reason: Optional[str] = None,
31
31
  ):
32
32
  return cls(
33
- id,
34
- o,
35
- tn,
36
- ts,
37
- xid,
38
- r,
33
+ order_id,
34
+ status,
35
+ recv_time_ns,
36
+ recv_time,
37
+ cancel_id,
38
+ reject_reason,
39
39
  )
40
40
 
41
41
  def __str__(self) -> str:
42
- return f"Cancel(id={self.id},o={self.o},tn={self.tn},ts={self.ts},xid={self.xid},r={self.r})"
42
+ return f"Cancel(order_id={self.id},status={self.o},recv_time_ns={self.tn},recv_time={self.ts},cancel_id={self.xid},reject_reason={self.r})"
43
+
44
+ @property
45
+ def order_id(self) -> definitions.OrderId:
46
+ return self.id
47
+
48
+ @order_id.setter
49
+ def order_id(self, value: definitions.OrderId) -> None:
50
+ self.id = value
51
+
52
+ @property
53
+ def status(self) -> definitions.CancelStatus:
54
+ return self.o
55
+
56
+ @status.setter
57
+ def status(self, value: definitions.CancelStatus) -> None:
58
+ self.o = value
59
+
60
+ @property
61
+ def recv_time_ns(self) -> int:
62
+ return self.tn
63
+
64
+ @recv_time_ns.setter
65
+ def recv_time_ns(self, value: int) -> None:
66
+ self.tn = value
67
+
68
+ @property
69
+ def recv_time(self) -> int:
70
+ return self.ts
71
+
72
+ @recv_time.setter
73
+ def recv_time(self, value: int) -> None:
74
+ self.ts = value
75
+
76
+ @property
77
+ def cancel_id(self) -> str:
78
+ return self.xid
79
+
80
+ @cancel_id.setter
81
+ def cancel_id(self, value: str) -> None:
82
+ self.xid = value
83
+
84
+ @property
85
+ def reject_reason(self) -> Optional[str]:
86
+ return self.r
87
+
88
+ @reject_reason.setter
89
+ def reject_reason(self, value: Optional[str]) -> None:
90
+ self.r = value