architect-py 5.1.0b1__py3-none-any.whl → 5.1.2__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 (35) hide show
  1. architect_py/__init__.py +3 -1
  2. architect_py/async_client.py +116 -28
  3. architect_py/client.py +56 -70
  4. architect_py/client.pyi +54 -12
  5. architect_py/common_types/time_in_force.py +1 -0
  6. architect_py/common_types/tradable_product.py +1 -1
  7. architect_py/graphql_client/juniper_base_client.py +4 -0
  8. architect_py/grpc/client.py +3 -0
  9. architect_py/grpc/models/Cpty/CptyStatus.py +17 -18
  10. architect_py/grpc/models/Marketdata/Ticker.py +14 -1
  11. architect_py/grpc/models/Oms/Order.py +12 -1
  12. architect_py/grpc/models/definitions.py +41 -0
  13. architect_py/grpc/resolve_endpoint.py +11 -2
  14. architect_py/tests/conftest.py +2 -5
  15. architect_py/tests/test_encoding.py +37 -0
  16. architect_py/tests/test_marketdata.py +9 -0
  17. architect_py/tests/test_order_entry.py +3 -1
  18. architect_py/tests/test_portfolio_management.py +2 -0
  19. architect_py/tests/test_symbology.py +20 -0
  20. architect_py/tests/test_sync_client.py +40 -0
  21. {architect_py-5.1.0b1.dist-info → architect_py-5.1.2.dist-info}/METADATA +4 -1
  22. {architect_py-5.1.0b1.dist-info → architect_py-5.1.2.dist-info}/RECORD +35 -33
  23. {architect_py-5.1.0b1.dist-info → architect_py-5.1.2.dist-info}/WHEEL +1 -1
  24. examples/book_subscription.py +2 -0
  25. examples/candles.py +2 -0
  26. examples/funding_rate_mean_reversion_algo.py +1 -0
  27. examples/order_sending.py +5 -3
  28. examples/stream_l1_marketdata.py +2 -0
  29. examples/stream_l2_marketdata.py +2 -0
  30. examples/trades.py +2 -0
  31. examples/tutorial_async.py +3 -1
  32. examples/tutorial_sync.py +4 -1
  33. templates/juniper_base_client.py +4 -0
  34. {architect_py-5.1.0b1.dist-info → architect_py-5.1.2.dist-info}/licenses/LICENSE +0 -0
  35. {architect_py-5.1.0b1.dist-info → architect_py-5.1.2.dist-info}/top_level.txt +0 -0
@@ -20,5 +20,7 @@ async def main():
20
20
  best_ask_s = f"{snap.best_ask[0]} x {snap.best_ask[1]}" # price x size
21
21
  print(f"{snap.symbol} {snap.timestamp} {best_bid_s} {best_ask_s}")
22
22
 
23
+ await c.close()
24
+
23
25
 
24
26
  asyncio.run(main())
@@ -33,5 +33,7 @@ async def main():
33
33
  venue = "CME"
34
34
  await print_l2_book(c, market_symbol, venue=venue)
35
35
 
36
+ await c.close()
37
+
36
38
 
37
39
  asyncio.run(main())
examples/trades.py CHANGED
@@ -16,5 +16,7 @@ async def main():
16
16
  print(e.status_code)
17
17
  print(e.response.json())
18
18
 
19
+ await c.close()
20
+
19
21
 
20
22
  asyncio.run(main())
@@ -49,7 +49,7 @@ async def main():
49
49
  order = await c.place_limit_order(
50
50
  symbol=market,
51
51
  execution_venue=execution_venue,
52
- odir=OrderDir.BUY,
52
+ dir=OrderDir.BUY,
53
53
  quantity=quantity,
54
54
  limit_price=limit_price,
55
55
  account=str(account_id),
@@ -79,6 +79,8 @@ async def main():
79
79
  print(f"Order was filled for qty: {order.filled_quantity}")
80
80
  print(f"Average execution price: {order.average_fill_price}")
81
81
 
82
+ await c.close()
83
+
82
84
 
83
85
  if __name__ == "__main__":
84
86
  asyncio.run(main())
examples/tutorial_sync.py CHANGED
@@ -68,7 +68,7 @@ if confirm(
68
68
  order = c.send_limit_order(
69
69
  symbol=symbol,
70
70
  execution_venue=venue,
71
- odir=OrderDir.BUY,
71
+ dir=OrderDir.BUY,
72
72
  quantity=best_bid_quantity,
73
73
  limit_price=limit_price,
74
74
  account=account.account.name,
@@ -92,3 +92,6 @@ elif order.status is OrderStatus.Canceled:
92
92
  elif order.status is OrderStatus.Out:
93
93
  print(f"Order was filled for qty: {order.filled_quantity}")
94
94
  print(f"Average execution price: {order.average_fill_price}")
95
+
96
+
97
+ c.close()
@@ -89,6 +89,10 @@ class JuniperBaseClient:
89
89
  exc_tb: object,
90
90
  ) -> None:
91
91
  await self.http_client.aclose()
92
+
93
+ async def close(self) -> None:
94
+ """Close the HTTP client connection."""
95
+ await self.http_client.aclose()
92
96
 
93
97
  async def execute(
94
98
  self,