pmxt 1.0.0b7__tar.gz → 1.0.1__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.
- {pmxt-1.0.0b7 → pmxt-1.0.1}/PKG-INFO +1 -1
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/__init__.py +1 -1
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/api_client.py +1 -1
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/configuration.py +1 -1
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/market_outcome.py +7 -3
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/order.py +14 -2
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/order_book.py +5 -3
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/unified_market.py +18 -3
- {pmxt-1.0.0b7 → pmxt-1.0.1}/pmxt/__init__.py +1 -1
- {pmxt-1.0.0b7 → pmxt-1.0.1}/pmxt/client.py +7 -1
- {pmxt-1.0.0b7 → pmxt-1.0.1}/pmxt/server_manager.py +15 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/pmxt.egg-info/PKG-INFO +1 -1
- {pmxt-1.0.0b7 → pmxt-1.0.1}/pyproject.toml +1 -1
- {pmxt-1.0.0b7 → pmxt-1.0.1}/README.md +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/api/__init__.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/api/default_api.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/api_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/exceptions.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/__init__.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/balance.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/base_request.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/base_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/cancel_order_request.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/create_order200_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/create_order_params.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/create_order_request.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/error_detail.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/error_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/exchange_credentials.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_balance200_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_markets200_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_markets_request.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_ohlcv200_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_ohlcv_request.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_ohlcv_request_args_inner.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_open_orders200_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_open_orders_request.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_order_book200_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_order_book_request.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_positions200_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_positions_request.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_trades200_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_trades_request.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/get_markets_by_slug_request.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/health_check200_response.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/history_filter_params.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/market_filter_params.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/order_level.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/position.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/price_candle.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/search_markets_request.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/search_markets_request_args_inner.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/trade.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/py.typed +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/rest.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/pmxt/models.py +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/pmxt.egg-info/SOURCES.txt +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/pmxt.egg-info/dependency_links.txt +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/pmxt.egg-info/requires.txt +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/pmxt.egg-info/top_level.txt +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/setup.cfg +0 -0
- {pmxt-1.0.0b7 → pmxt-1.0.1}/tests/test_integration.py +0 -0
|
@@ -91,7 +91,7 @@ class ApiClient:
|
|
|
91
91
|
self.default_headers[header_name] = header_value
|
|
92
92
|
self.cookie = cookie
|
|
93
93
|
# Set default User-Agent.
|
|
94
|
-
self.user_agent = 'OpenAPI-Generator/1.0.
|
|
94
|
+
self.user_agent = 'OpenAPI-Generator/1.0.1/python'
|
|
95
95
|
self.client_side_validation = configuration.client_side_validation
|
|
96
96
|
|
|
97
97
|
def __enter__(self):
|
|
@@ -506,7 +506,7 @@ class Configuration:
|
|
|
506
506
|
"OS: {env}\n"\
|
|
507
507
|
"Python Version: {pyversion}\n"\
|
|
508
508
|
"Version of the API: 0.4.4\n"\
|
|
509
|
-
"SDK Package Version: 1.0.
|
|
509
|
+
"SDK Package Version: 1.0.1".\
|
|
510
510
|
format(env=sys.platform, pyversion=sys.version)
|
|
511
511
|
|
|
512
512
|
def get_host_settings(self) -> List[HostSetting]:
|
|
@@ -17,7 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
@@ -29,7 +29,9 @@ class MarketOutcome(BaseModel):
|
|
|
29
29
|
id: Optional[StrictStr] = None
|
|
30
30
|
label: Optional[StrictStr] = None
|
|
31
31
|
price: Optional[Union[StrictFloat, StrictInt]] = None
|
|
32
|
-
|
|
32
|
+
price_change24h: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="priceChange24h")
|
|
33
|
+
metadata: Optional[Dict[str, Any]] = Field(default=None, description="Exchange-specific metadata (e.g., clobTokenId for Polymarket)")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["id", "label", "price", "priceChange24h", "metadata"]
|
|
33
35
|
|
|
34
36
|
model_config = ConfigDict(
|
|
35
37
|
populate_by_name=True,
|
|
@@ -84,7 +86,9 @@ class MarketOutcome(BaseModel):
|
|
|
84
86
|
_obj = cls.model_validate({
|
|
85
87
|
"id": obj.get("id"),
|
|
86
88
|
"label": obj.get("label"),
|
|
87
|
-
"price": obj.get("price")
|
|
89
|
+
"price": obj.get("price"),
|
|
90
|
+
"priceChange24h": obj.get("priceChange24h"),
|
|
91
|
+
"metadata": obj.get("metadata")
|
|
88
92
|
})
|
|
89
93
|
return _obj
|
|
90
94
|
|
|
@@ -37,7 +37,8 @@ class Order(BaseModel):
|
|
|
37
37
|
filled: Optional[Union[StrictFloat, StrictInt]] = None
|
|
38
38
|
remaining: Optional[Union[StrictFloat, StrictInt]] = None
|
|
39
39
|
timestamp: Optional[StrictInt] = None
|
|
40
|
-
|
|
40
|
+
fee: Optional[Union[StrictFloat, StrictInt]] = None
|
|
41
|
+
__properties: ClassVar[List[str]] = ["id", "marketId", "outcomeId", "side", "type", "price", "amount", "status", "filled", "remaining", "timestamp", "fee"]
|
|
41
42
|
|
|
42
43
|
@field_validator('side')
|
|
43
44
|
def side_validate_enum(cls, value):
|
|
@@ -59,6 +60,16 @@ class Order(BaseModel):
|
|
|
59
60
|
raise ValueError("must be one of enum values ('limit', 'market')")
|
|
60
61
|
return value
|
|
61
62
|
|
|
63
|
+
@field_validator('status')
|
|
64
|
+
def status_validate_enum(cls, value):
|
|
65
|
+
"""Validates the enum"""
|
|
66
|
+
if value is None:
|
|
67
|
+
return value
|
|
68
|
+
|
|
69
|
+
if value not in set(['pending', 'open', 'filled', 'cancelled', 'rejected']):
|
|
70
|
+
raise ValueError("must be one of enum values ('pending', 'open', 'filled', 'cancelled', 'rejected')")
|
|
71
|
+
return value
|
|
72
|
+
|
|
62
73
|
model_config = ConfigDict(
|
|
63
74
|
populate_by_name=True,
|
|
64
75
|
validate_assignment=True,
|
|
@@ -120,7 +131,8 @@ class Order(BaseModel):
|
|
|
120
131
|
"status": obj.get("status"),
|
|
121
132
|
"filled": obj.get("filled"),
|
|
122
133
|
"remaining": obj.get("remaining"),
|
|
123
|
-
"timestamp": obj.get("timestamp")
|
|
134
|
+
"timestamp": obj.get("timestamp"),
|
|
135
|
+
"fee": obj.get("fee")
|
|
124
136
|
})
|
|
125
137
|
return _obj
|
|
126
138
|
|
|
@@ -17,7 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from pmxt_internal.models.order_level import OrderLevel
|
|
23
23
|
from typing import Optional, Set
|
|
@@ -29,7 +29,8 @@ class OrderBook(BaseModel):
|
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
bids: Optional[List[OrderLevel]] = None
|
|
31
31
|
asks: Optional[List[OrderLevel]] = None
|
|
32
|
-
|
|
32
|
+
timestamp: Optional[StrictInt] = None
|
|
33
|
+
__properties: ClassVar[List[str]] = ["bids", "asks", "timestamp"]
|
|
33
34
|
|
|
34
35
|
model_config = ConfigDict(
|
|
35
36
|
populate_by_name=True,
|
|
@@ -97,7 +98,8 @@ class OrderBook(BaseModel):
|
|
|
97
98
|
|
|
98
99
|
_obj = cls.model_validate({
|
|
99
100
|
"bids": [OrderLevel.from_dict(_item) for _item in obj["bids"]] if obj.get("bids") is not None else None,
|
|
100
|
-
"asks": [OrderLevel.from_dict(_item) for _item in obj["asks"]] if obj.get("asks") is not None else None
|
|
101
|
+
"asks": [OrderLevel.from_dict(_item) for _item in obj["asks"]] if obj.get("asks") is not None else None,
|
|
102
|
+
"timestamp": obj.get("timestamp")
|
|
101
103
|
})
|
|
102
104
|
return _obj
|
|
103
105
|
|
|
@@ -17,7 +17,8 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
21
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
23
|
from pmxt_internal.models.market_outcome import MarketOutcome
|
|
23
24
|
from typing import Optional, Set
|
|
@@ -29,11 +30,18 @@ class UnifiedMarket(BaseModel):
|
|
|
29
30
|
""" # noqa: E501
|
|
30
31
|
id: Optional[StrictStr] = None
|
|
31
32
|
title: Optional[StrictStr] = None
|
|
33
|
+
description: Optional[StrictStr] = None
|
|
32
34
|
outcomes: Optional[List[MarketOutcome]] = None
|
|
35
|
+
resolution_date: Optional[datetime] = Field(default=None, alias="resolutionDate")
|
|
33
36
|
volume24h: Optional[Union[StrictFloat, StrictInt]] = None
|
|
37
|
+
volume: Optional[Union[StrictFloat, StrictInt]] = None
|
|
34
38
|
liquidity: Optional[Union[StrictFloat, StrictInt]] = None
|
|
39
|
+
open_interest: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="openInterest")
|
|
35
40
|
url: Optional[StrictStr] = None
|
|
36
|
-
|
|
41
|
+
image: Optional[StrictStr] = None
|
|
42
|
+
category: Optional[StrictStr] = None
|
|
43
|
+
tags: Optional[List[StrictStr]] = None
|
|
44
|
+
__properties: ClassVar[List[str]] = ["id", "title", "description", "outcomes", "resolutionDate", "volume24h", "volume", "liquidity", "openInterest", "url", "image", "category", "tags"]
|
|
37
45
|
|
|
38
46
|
model_config = ConfigDict(
|
|
39
47
|
populate_by_name=True,
|
|
@@ -95,10 +103,17 @@ class UnifiedMarket(BaseModel):
|
|
|
95
103
|
_obj = cls.model_validate({
|
|
96
104
|
"id": obj.get("id"),
|
|
97
105
|
"title": obj.get("title"),
|
|
106
|
+
"description": obj.get("description"),
|
|
98
107
|
"outcomes": [MarketOutcome.from_dict(_item) for _item in obj["outcomes"]] if obj.get("outcomes") is not None else None,
|
|
108
|
+
"resolutionDate": obj.get("resolutionDate"),
|
|
99
109
|
"volume24h": obj.get("volume24h"),
|
|
110
|
+
"volume": obj.get("volume"),
|
|
100
111
|
"liquidity": obj.get("liquidity"),
|
|
101
|
-
"
|
|
112
|
+
"openInterest": obj.get("openInterest"),
|
|
113
|
+
"url": obj.get("url"),
|
|
114
|
+
"image": obj.get("image"),
|
|
115
|
+
"category": obj.get("category"),
|
|
116
|
+
"tags": obj.get("tags")
|
|
102
117
|
})
|
|
103
118
|
return _obj
|
|
104
119
|
|
|
@@ -182,6 +182,12 @@ class Exchange(ABC):
|
|
|
182
182
|
if auto_start_server:
|
|
183
183
|
try:
|
|
184
184
|
self._server_manager.ensure_server_running()
|
|
185
|
+
|
|
186
|
+
# Get the actual port the server is running on
|
|
187
|
+
# (may differ from default if default port was busy)
|
|
188
|
+
actual_port = self._server_manager.get_running_port()
|
|
189
|
+
base_url = f"http://localhost:{actual_port}"
|
|
190
|
+
|
|
185
191
|
except Exception as e:
|
|
186
192
|
raise Exception(
|
|
187
193
|
f"Failed to start PMXT server: {e}\n\n"
|
|
@@ -189,7 +195,7 @@ class Exchange(ABC):
|
|
|
189
195
|
f"Or start the server manually: pmxt-server"
|
|
190
196
|
)
|
|
191
197
|
|
|
192
|
-
# Configure the API client
|
|
198
|
+
# Configure the API client with the actual base URL
|
|
193
199
|
config = Configuration(host=base_url)
|
|
194
200
|
self._api_client = ApiClient(configuration=config)
|
|
195
201
|
self._api = DefaultApi(api_client=self._api_client)
|
|
@@ -240,3 +240,18 @@ class ServerManager:
|
|
|
240
240
|
return json.loads(self.lock_path.read_text())
|
|
241
241
|
except:
|
|
242
242
|
return None
|
|
243
|
+
|
|
244
|
+
def get_running_port(self) -> int:
|
|
245
|
+
"""
|
|
246
|
+
Get the actual port the server is running on.
|
|
247
|
+
|
|
248
|
+
This reads the lock file to determine the actual port,
|
|
249
|
+
which may differ from the default if the default port was busy.
|
|
250
|
+
|
|
251
|
+
Returns:
|
|
252
|
+
Port number the server is running on, or DEFAULT_PORT if unknown
|
|
253
|
+
"""
|
|
254
|
+
info = self.get_server_info()
|
|
255
|
+
if info and 'port' in info:
|
|
256
|
+
return info['port']
|
|
257
|
+
return self.DEFAULT_PORT
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/fetch_ohlcv_request_args_inner.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pmxt-1.0.0b7 → pmxt-1.0.1}/generated/pmxt_internal/models/search_markets_request_args_inner.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|