xt-manager 0.2.0__tar.gz

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.
@@ -0,0 +1,51 @@
1
+ Metadata-Version: 2.3
2
+ Name: xt-manager
3
+ Version: 0.2.0
4
+ Summary: XT Manager client (pip install, same shape as mt5manager).
5
+ Author: Xtention
6
+ Author-email: Xtention <pulkit.sahu@xtentioncrew.tech>
7
+ Requires-Dist: httpx>=0.28.1
8
+ Requires-Dist: pydantic>=2.14.1
9
+ Requires-Dist: fastapi[standard]>=0.162.0 ; extra == 'api'
10
+ Requires-Python: >=3.11
11
+ Project-URL: Homepage, https://github.com/xt-crew-org/xt-terminal-monorepo
12
+ Provides-Extra: api
13
+ Description-Content-Type: text/markdown
14
+
15
+ # xt-manager
16
+
17
+ Python client for XT Manager, used the same way as MetaQuotes `mt5manager`:
18
+
19
+ ```python
20
+ import XTManager
21
+
22
+ manager = XTManager.ManagerAPI()
23
+ manager.Connect("127.0.0.1:8443", 2504, "password", 0, 30000)
24
+ ```
25
+
26
+ ```bash
27
+ pip install xt-manager
28
+ ```
29
+
30
+ From this repo during development:
31
+
32
+ ```bash
33
+ pip install -e apps/xt-manager
34
+ ```
35
+
36
+ Connect uses the manager id and the trading-account master password. Callers connect to the Access Server. Access forwards `/xt-manager/` to `broker-api-go`, which is the process started with `pnpm nx run broker-api-go:serve`. There is no separate manager API process.
37
+
38
+ ## Order
39
+
40
+ 1. Start broker-api-go and the Access Server.
41
+ 2. Connect with the manager login, that account's master password, and the Access address (`127.0.0.1:8443` in local development).
42
+
43
+ The Python package remains the client library. Account, order, deal, and position records are stored by broker-api-go. The password stays out of the repository.
44
+
45
+ While a session is open, broker-api-go logs the manager login and caller address. A connected manager can call `OnlineTotal`, `OnlineNext`, and `OnlineGet`. `Type` is `34` for a manager connection.
46
+
47
+ User calls use the Manager API names and the user record field names: `UserRequest`, `UserGet`, `UserRequestByGroup`, `UserRequestByLogins`, `UserRequestArray`, `UserTotal`, `UserGroup`, `UserLogins`, `UserUpdate`, `UserUpdateBatch`, `UserAdd`, `UserDelete`, `UserPasswordCheck`, `UserPasswordChange`, and `UserBalanceCheck`. `UserPasswordCheck` and `UserPasswordChange` take `(type, login, password)`. Type `0` is the main password. The password is not returned. `UserAdd` creates the next trading login under the connected manager id.
48
+
49
+ Trading calls use the same names: orders (`OrderAdd`, `OrderUpdate`, `OrderCancel`, `OrderRequest`, `OrderRequestOpen`, and the by-group, by-logins, and by-tickets forms), closed orders (`HistoryRequest` and the same filters), positions (`PositionRequest`, `PositionGet`, `PositionUpdate`, `PositionDelete`), and deals (`DealAdd`, `DealPerform`, `DealRequest`, `DealUpdate`, `DealDelete`). `DealRequest(login, start, end)` and `PositionRequest(login)` return lists. `DealPerform` with entry `0` opens a position and entry `1` closes it and adds profit to the balance.
50
+
51
+ `DealerBalance(login, amount, type, comment)` writes a balance deal when type is `2` and a credit deal when type is `3`, and returns the deal ticket. `GroupUpdate`, `GroupRequest`, `GroupTotal`, `SymbolUpdate`, `SymbolRequest`, `SymbolExist`, `UserAccountRequest`, and `TimeServer` read and write the matching records. Prices, volumes, and money fields are decimal strings.
@@ -0,0 +1,37 @@
1
+ # xt-manager
2
+
3
+ Python client for XT Manager, used the same way as MetaQuotes `mt5manager`:
4
+
5
+ ```python
6
+ import XTManager
7
+
8
+ manager = XTManager.ManagerAPI()
9
+ manager.Connect("127.0.0.1:8443", 2504, "password", 0, 30000)
10
+ ```
11
+
12
+ ```bash
13
+ pip install xt-manager
14
+ ```
15
+
16
+ From this repo during development:
17
+
18
+ ```bash
19
+ pip install -e apps/xt-manager
20
+ ```
21
+
22
+ Connect uses the manager id and the trading-account master password. Callers connect to the Access Server. Access forwards `/xt-manager/` to `broker-api-go`, which is the process started with `pnpm nx run broker-api-go:serve`. There is no separate manager API process.
23
+
24
+ ## Order
25
+
26
+ 1. Start broker-api-go and the Access Server.
27
+ 2. Connect with the manager login, that account's master password, and the Access address (`127.0.0.1:8443` in local development).
28
+
29
+ The Python package remains the client library. Account, order, deal, and position records are stored by broker-api-go. The password stays out of the repository.
30
+
31
+ While a session is open, broker-api-go logs the manager login and caller address. A connected manager can call `OnlineTotal`, `OnlineNext`, and `OnlineGet`. `Type` is `34` for a manager connection.
32
+
33
+ User calls use the Manager API names and the user record field names: `UserRequest`, `UserGet`, `UserRequestByGroup`, `UserRequestByLogins`, `UserRequestArray`, `UserTotal`, `UserGroup`, `UserLogins`, `UserUpdate`, `UserUpdateBatch`, `UserAdd`, `UserDelete`, `UserPasswordCheck`, `UserPasswordChange`, and `UserBalanceCheck`. `UserPasswordCheck` and `UserPasswordChange` take `(type, login, password)`. Type `0` is the main password. The password is not returned. `UserAdd` creates the next trading login under the connected manager id.
34
+
35
+ Trading calls use the same names: orders (`OrderAdd`, `OrderUpdate`, `OrderCancel`, `OrderRequest`, `OrderRequestOpen`, and the by-group, by-logins, and by-tickets forms), closed orders (`HistoryRequest` and the same filters), positions (`PositionRequest`, `PositionGet`, `PositionUpdate`, `PositionDelete`), and deals (`DealAdd`, `DealPerform`, `DealRequest`, `DealUpdate`, `DealDelete`). `DealRequest(login, start, end)` and `PositionRequest(login)` return lists. `DealPerform` with entry `0` opens a position and entry `1` closes it and adds profit to the balance.
36
+
37
+ `DealerBalance(login, amount, type, comment)` writes a balance deal when type is `2` and a credit deal when type is `3`, and returns the deal ticket. `GroupUpdate`, `GroupRequest`, `GroupTotal`, `SymbolUpdate`, `SymbolRequest`, `SymbolExist`, `UserAccountRequest`, and `TimeServer` read and write the matching records. Prices, volumes, and money fields are decimal strings.
@@ -0,0 +1,40 @@
1
+ [project]
2
+ name = "xt-manager"
3
+ version = "0.2.0"
4
+ description = "XT Manager client (pip install, same shape as mt5manager)."
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ dependencies = [
8
+ "httpx>=0.28.1",
9
+ "pydantic>=2.14.1",
10
+ ]
11
+
12
+ [[project.authors]]
13
+ name = "Xtention"
14
+ email = "pulkit.sahu@xtentioncrew.tech"
15
+
16
+ [project.urls]
17
+ Homepage = "https://github.com/xt-crew-org/xt-terminal-monorepo"
18
+
19
+ [project.optional-dependencies]
20
+ api = ["fastapi[standard]>=0.162.0"]
21
+
22
+ [project.scripts]
23
+ xt-manager = "xt_manager:main"
24
+ xt-manager-api = "xt_manager.serve:main"
25
+
26
+ [build-system]
27
+ requires = ["uv_build>=0.13.6,<0.14.0"]
28
+ build-backend = "uv_build"
29
+
30
+ [tool.uv.build-backend]
31
+ module-name = [
32
+ "xt_manager",
33
+ "XTManager",
34
+ ]
35
+
36
+ [dependency-groups]
37
+ dev = [
38
+ "fastapi[standard]>=0.162.0",
39
+ "pytest>=9.2.0",
40
+ ]
@@ -0,0 +1,38 @@
1
+ [project]
2
+ name = "xt-manager"
3
+ version = "0.2.0"
4
+ description = "XT Manager client (pip install, same shape as mt5manager)."
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ authors = [
8
+ { name = "Xtention", email = "pulkit.sahu@xtentioncrew.tech" },
9
+ ]
10
+ dependencies = [
11
+ "httpx>=0.28.1",
12
+ "pydantic>=2.14.1",
13
+ ]
14
+
15
+ [project.urls]
16
+ Homepage = "https://github.com/xt-crew-org/xt-terminal-monorepo"
17
+
18
+ [project.optional-dependencies]
19
+ api = [
20
+ "fastapi[standard]>=0.162.0",
21
+ ]
22
+
23
+ [project.scripts]
24
+ xt-manager = "xt_manager:main"
25
+ xt-manager-api = "xt_manager.serve:main"
26
+
27
+ [build-system]
28
+ requires = ["uv_build>=0.13.6,<0.14.0"]
29
+ build-backend = "uv_build"
30
+
31
+ [tool.uv.build-backend]
32
+ module-name = ["xt_manager", "XTManager"]
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ "fastapi[standard]>=0.162.0",
37
+ "pytest>=9.2.0",
38
+ ]
@@ -0,0 +1,39 @@
1
+ """MT5-style import for the XT Manager client.
2
+
3
+ import XTManager
4
+ manager = XTManager.ManagerAPI()
5
+ manager.Connect("127.0.0.1:8443", login, password, 0, 30000)
6
+ """
7
+
8
+ from xt_manager.manager import ManagerAPI
9
+ from xt_manager.online import Online
10
+ from xt_manager.records import Account, Deal, Group, Position, Symbol, TradeOrder
11
+ from xt_manager.user import User
12
+
13
+
14
+ class EnPumpModes:
15
+ PUMP_MODE_NONE = 0
16
+ PUMP_MODE_USERS = 1
17
+ PUMP_MODE_ACTIVITY = 2
18
+ PUMP_MODE_MAIL = 4
19
+ PUMP_MODE_NEWS = 8
20
+ PUMP_MODE_ORDERS = 16
21
+ PUMP_MODE_GROUPS = 32
22
+ PUMP_MODE_SYMBOLS = 64
23
+ PUMP_MODE_FULL = 65535
24
+
25
+
26
+ ManagerAPI.EnPumpModes = EnPumpModes
27
+
28
+ __all__ = [
29
+ "Account",
30
+ "Deal",
31
+ "EnPumpModes",
32
+ "Group",
33
+ "ManagerAPI",
34
+ "Online",
35
+ "Position",
36
+ "Symbol",
37
+ "TradeOrder",
38
+ "User",
39
+ ]
@@ -0,0 +1,20 @@
1
+ """Python library for connecting to XT with a Manager-style session."""
2
+
3
+ from xt_manager.cli import main
4
+ from xt_manager.manager import ManagerAPI
5
+ from xt_manager.online import Online
6
+ from xt_manager.records import Account, Deal, Group, Position, Symbol, TradeOrder
7
+ from xt_manager.user import User
8
+
9
+ __all__ = [
10
+ "Account",
11
+ "Deal",
12
+ "Group",
13
+ "ManagerAPI",
14
+ "Online",
15
+ "Position",
16
+ "Symbol",
17
+ "TradeOrder",
18
+ "User",
19
+ "main",
20
+ ]