pmxt 1.1.0__py3-none-any.whl → 1.1.0b0__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.
- pmxt/__init__.py +1 -1
- pmxt/_server/server/bundled.js +267 -21920
- pmxt/client.py +0 -104
- {pmxt-1.1.0.dist-info → pmxt-1.1.0b0.dist-info}/METADATA +1 -1
- {pmxt-1.1.0.dist-info → pmxt-1.1.0b0.dist-info}/RECORD +12 -15
- pmxt_internal/__init__.py +1 -7
- pmxt_internal/api/default_api.py +0 -578
- pmxt_internal/api_client.py +1 -1
- pmxt_internal/configuration.py +1 -1
- pmxt_internal/models/__init__.py +0 -3
- pmxt_internal/models/watch_order_book_request.py +0 -102
- pmxt_internal/models/watch_order_book_request_args_inner.py +0 -143
- pmxt_internal/models/watch_trades_request.py +0 -102
- {pmxt-1.1.0.dist-info → pmxt-1.1.0b0.dist-info}/WHEEL +0 -0
- {pmxt-1.1.0.dist-info → pmxt-1.1.0b0.dist-info}/top_level.txt +0 -0
pmxt/client.py
CHANGED
|
@@ -206,10 +206,6 @@ class Exchange(ABC):
|
|
|
206
206
|
|
|
207
207
|
self._api = DefaultApi(api_client=self._api_client)
|
|
208
208
|
|
|
209
|
-
def close(self):
|
|
210
|
-
"""No-op for now, kept for API compatibility with TS."""
|
|
211
|
-
pass
|
|
212
|
-
|
|
213
209
|
def _handle_response(self, response: Dict[str, Any]) -> Any:
|
|
214
210
|
"""Handle API response and extract data."""
|
|
215
211
|
if not response.get("success"):
|
|
@@ -446,106 +442,6 @@ class Exchange(ABC):
|
|
|
446
442
|
except ApiException as e:
|
|
447
443
|
raise Exception(f"Failed to fetch trades: {e}")
|
|
448
444
|
|
|
449
|
-
# WebSocket Streaming Methods
|
|
450
|
-
|
|
451
|
-
def watch_order_book(self, outcome_id: str, limit: Optional[int] = None) -> OrderBook:
|
|
452
|
-
"""
|
|
453
|
-
Watch real-time order book updates via WebSocket.
|
|
454
|
-
|
|
455
|
-
Returns a promise that resolves with the next order book update.
|
|
456
|
-
Call repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
457
|
-
|
|
458
|
-
Args:
|
|
459
|
-
outcome_id: Outcome ID to watch
|
|
460
|
-
limit: Optional depth limit for order book
|
|
461
|
-
|
|
462
|
-
Returns:
|
|
463
|
-
Next order book update
|
|
464
|
-
|
|
465
|
-
Example:
|
|
466
|
-
>>> # Stream order book updates
|
|
467
|
-
>>> while True:
|
|
468
|
-
... order_book = exchange.watch_order_book(outcome_id)
|
|
469
|
-
... print(f"Best bid: {order_book.bids[0].price}")
|
|
470
|
-
... print(f"Best ask: {order_book.asks[0].price}")
|
|
471
|
-
"""
|
|
472
|
-
try:
|
|
473
|
-
args = [outcome_id]
|
|
474
|
-
if limit is not None:
|
|
475
|
-
args.append(limit)
|
|
476
|
-
|
|
477
|
-
body_dict = {"args": args}
|
|
478
|
-
|
|
479
|
-
# Add credentials if available
|
|
480
|
-
creds = self._get_credentials_dict()
|
|
481
|
-
if creds:
|
|
482
|
-
body_dict["credentials"] = creds
|
|
483
|
-
|
|
484
|
-
request_body = internal_models.WatchOrderBookRequest.from_dict(body_dict)
|
|
485
|
-
|
|
486
|
-
response = self._api.watch_order_book(
|
|
487
|
-
exchange=self.exchange_name,
|
|
488
|
-
watch_order_book_request=request_body,
|
|
489
|
-
)
|
|
490
|
-
|
|
491
|
-
data = self._handle_response(response.to_dict())
|
|
492
|
-
return _convert_order_book(data)
|
|
493
|
-
except ApiException as e:
|
|
494
|
-
raise Exception(f"Failed to watch order book: {e}")
|
|
495
|
-
|
|
496
|
-
def watch_trades(
|
|
497
|
-
self,
|
|
498
|
-
outcome_id: str,
|
|
499
|
-
since: Optional[int] = None,
|
|
500
|
-
limit: Optional[int] = None
|
|
501
|
-
) -> List[Trade]:
|
|
502
|
-
"""
|
|
503
|
-
Watch real-time trade updates via WebSocket.
|
|
504
|
-
|
|
505
|
-
Returns a promise that resolves with the next trade(s).
|
|
506
|
-
Call repeatedly in a loop to stream updates (CCXT Pro pattern).
|
|
507
|
-
|
|
508
|
-
Args:
|
|
509
|
-
outcome_id: Outcome ID to watch
|
|
510
|
-
since: Optional timestamp to filter trades from
|
|
511
|
-
limit: Optional limit for number of trades
|
|
512
|
-
|
|
513
|
-
Returns:
|
|
514
|
-
Next trade update(s)
|
|
515
|
-
|
|
516
|
-
Example:
|
|
517
|
-
>>> # Stream trade updates
|
|
518
|
-
>>> while True:
|
|
519
|
-
... trades = exchange.watch_trades(outcome_id)
|
|
520
|
-
... for trade in trades:
|
|
521
|
-
... print(f"Trade: {trade.price} @ {trade.amount}")
|
|
522
|
-
"""
|
|
523
|
-
try:
|
|
524
|
-
args = [outcome_id]
|
|
525
|
-
if since is not None:
|
|
526
|
-
args.append(since)
|
|
527
|
-
if limit is not None:
|
|
528
|
-
args.append(limit)
|
|
529
|
-
|
|
530
|
-
body_dict = {"args": args}
|
|
531
|
-
|
|
532
|
-
# Add credentials if available
|
|
533
|
-
creds = self._get_credentials_dict()
|
|
534
|
-
if creds:
|
|
535
|
-
body_dict["credentials"] = creds
|
|
536
|
-
|
|
537
|
-
request_body = internal_models.WatchTradesRequest.from_dict(body_dict)
|
|
538
|
-
|
|
539
|
-
response = self._api.watch_trades(
|
|
540
|
-
exchange=self.exchange_name,
|
|
541
|
-
watch_trades_request=request_body,
|
|
542
|
-
)
|
|
543
|
-
|
|
544
|
-
data = self._handle_response(response.to_dict())
|
|
545
|
-
return [_convert_trade(t) for t in data]
|
|
546
|
-
except ApiException as e:
|
|
547
|
-
raise Exception(f"Failed to watch trades: {e}")
|
|
548
|
-
|
|
549
445
|
# Trading Methods (require authentication)
|
|
550
446
|
|
|
551
447
|
def create_order(self, params: CreateOrderParams) -> Order:
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
pmxt/__init__.py,sha256=
|
|
2
|
-
pmxt/client.py,sha256=
|
|
1
|
+
pmxt/__init__.py,sha256=6xj0mNc4AhqTNdbLwvDIxP8XByHvO7Qq05n78N90zbo,1152
|
|
2
|
+
pmxt/client.py,sha256=zetDOeeVfbPB8FAYmAJ0TKBm8ayecMXKunC3T-Rr9qM,23764
|
|
3
3
|
pmxt/models.py,sha256=Mu0hLVjQU3PM5m68poK61VQcJtPQ8ZdLdLU7pq1lqjQ,6004
|
|
4
4
|
pmxt/server_manager.py,sha256=wmHcGBM3oMNLSajCZ0xnANNSmqBYt9vWxQzeYmfo0-Y,10635
|
|
5
5
|
pmxt/_server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
pmxt/_server/bin/pmxt-ensure-server,sha256=kXIond0UbxS52FAVQD7kHmSBaL_s6cbIyapLRr4KZJw,4544
|
|
7
|
-
pmxt/_server/server/bundled.js,sha256=
|
|
8
|
-
pmxt_internal/__init__.py,sha256=
|
|
9
|
-
pmxt_internal/api_client.py,sha256=
|
|
7
|
+
pmxt/_server/server/bundled.js,sha256=xz4CbngIw6bEk9-WJx01Ot36WnksbRs2Q48VqMnXDzQ,3395261
|
|
8
|
+
pmxt_internal/__init__.py,sha256=_oMpTETs5Ox_7whO6ivpLop5i12aKmJpHOCWS65j7ms,5975
|
|
9
|
+
pmxt_internal/api_client.py,sha256=OFsrKYjmTRdeGRK-l7lbjfRKPdLRFtrZSQIjo77PWeE,27891
|
|
10
10
|
pmxt_internal/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
|
11
|
-
pmxt_internal/configuration.py,sha256=
|
|
11
|
+
pmxt_internal/configuration.py,sha256=3sKVlHCBaUXRJg2IwHnmQpgu_KAgYEvkMa_PwFuNSU8,18322
|
|
12
12
|
pmxt_internal/exceptions.py,sha256=txF8A7vlan57JS69kFPs-IZF-Qhp7IZobBTJVa4fOaM,6644
|
|
13
13
|
pmxt_internal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
pmxt_internal/rest.py,sha256=FMj4yaV6XLr842u_ScWHSzQsTFdk0jaUeuWLJoRbogQ,9760
|
|
15
15
|
pmxt_internal/api/__init__.py,sha256=ppJSCipQ5IAk2z6UZkFaGSsEmnoAnSSHb8sjb_DYUkY,101
|
|
16
|
-
pmxt_internal/api/default_api.py,sha256=
|
|
17
|
-
pmxt_internal/models/__init__.py,sha256=
|
|
16
|
+
pmxt_internal/api/default_api.py,sha256=V_-PxsEbTL4atCQR1r7GbeFvhtsVdbf3TSbTRM--Pv8,147482
|
|
17
|
+
pmxt_internal/models/__init__.py,sha256=KpXW3FEk-LTETIR0djQy7GX_NxGIElnIg_SzfHLmqAA,3196
|
|
18
18
|
pmxt_internal/models/balance.py,sha256=Dj5kFiLrsXOZyyXTC18bPjWrgw7qdWnTgTSCmk_l6xk,2962
|
|
19
19
|
pmxt_internal/models/base_request.py,sha256=ZNipF7ycXFkQJ6j3QmB1TzA0UO3fB54AMPlAgIA3KOA,2987
|
|
20
20
|
pmxt_internal/models/base_response.py,sha256=g-NG4Swxl3cg4-YOCPl65dUeHzOnA9S7ubTj8HOYZs0,2975
|
|
@@ -53,10 +53,7 @@ pmxt_internal/models/search_markets_request.py,sha256=BARoy2GXgV7RQNIGck6UaOyQqf
|
|
|
53
53
|
pmxt_internal/models/search_markets_request_args_inner.py,sha256=PkusFd_OxhUsItsBpluPJA11zg0sXXjbOK-lPmemvLs,5561
|
|
54
54
|
pmxt_internal/models/trade.py,sha256=U6Fc18rbwILs9FmX8CSDYYL8dF6763l8QzeMQNRxQdo,3328
|
|
55
55
|
pmxt_internal/models/unified_market.py,sha256=mNyUrGKWxvI2f2KCa2uhGwq22cBdDia2hD5AtzFw8fE,4487
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
pmxt-1.1.
|
|
60
|
-
pmxt-1.1.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
61
|
-
pmxt-1.1.0.dist-info/top_level.txt,sha256=J_jrcouJ-x-5lpcXMxeW0GOSi1HsBVR5_PdSfvigVrw,19
|
|
62
|
-
pmxt-1.1.0.dist-info/RECORD,,
|
|
56
|
+
pmxt-1.1.0b0.dist-info/METADATA,sha256=8we9c0VHOkxrt5kAWczxQMWXP2jVEDD3El1sKeeKGa8,6290
|
|
57
|
+
pmxt-1.1.0b0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
58
|
+
pmxt-1.1.0b0.dist-info/top_level.txt,sha256=J_jrcouJ-x-5lpcXMxeW0GOSi1HsBVR5_PdSfvigVrw,19
|
|
59
|
+
pmxt-1.1.0b0.dist-info/RECORD,,
|
pmxt_internal/__init__.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
""" # noqa: E501
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
__version__ = "1.1.
|
|
17
|
+
__version__ = "1.1.0b0"
|
|
18
18
|
|
|
19
19
|
# Define package exports
|
|
20
20
|
__all__ = [
|
|
@@ -66,9 +66,6 @@ __all__ = [
|
|
|
66
66
|
"SearchMarketsRequestArgsInner",
|
|
67
67
|
"Trade",
|
|
68
68
|
"UnifiedMarket",
|
|
69
|
-
"WatchOrderBookRequest",
|
|
70
|
-
"WatchOrderBookRequestArgsInner",
|
|
71
|
-
"WatchTradesRequest",
|
|
72
69
|
]
|
|
73
70
|
|
|
74
71
|
# import apis into sdk package
|
|
@@ -124,7 +121,4 @@ from pmxt_internal.models.search_markets_request import SearchMarketsRequest as
|
|
|
124
121
|
from pmxt_internal.models.search_markets_request_args_inner import SearchMarketsRequestArgsInner as SearchMarketsRequestArgsInner
|
|
125
122
|
from pmxt_internal.models.trade import Trade as Trade
|
|
126
123
|
from pmxt_internal.models.unified_market import UnifiedMarket as UnifiedMarket
|
|
127
|
-
from pmxt_internal.models.watch_order_book_request import WatchOrderBookRequest as WatchOrderBookRequest
|
|
128
|
-
from pmxt_internal.models.watch_order_book_request_args_inner import WatchOrderBookRequestArgsInner as WatchOrderBookRequestArgsInner
|
|
129
|
-
from pmxt_internal.models.watch_trades_request import WatchTradesRequest as WatchTradesRequest
|
|
130
124
|
|