pmxt 1.6.0__py3-none-any.whl → 2.0.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 +714 -186
- {pmxt-1.6.0.dist-info → pmxt-2.0.0b0.dist-info}/METADATA +9 -9
- {pmxt-1.6.0.dist-info → pmxt-2.0.0b0.dist-info}/RECORD +9 -9
- pmxt_internal/__init__.py +1 -1
- pmxt_internal/api_client.py +1 -1
- pmxt_internal/configuration.py +1 -1
- {pmxt-1.6.0.dist-info → pmxt-2.0.0b0.dist-info}/WHEEL +0 -0
- {pmxt-1.6.0.dist-info → pmxt-2.0.0b0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pmxt
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0b0
|
|
4
4
|
Summary: Unified prediction market data API - The ccxt for prediction markets
|
|
5
5
|
Author: PMXT Contributors
|
|
6
6
|
License: MIT
|
|
@@ -69,14 +69,14 @@ print(markets[0].title)
|
|
|
69
69
|
outcome = markets[0].outcomes[0]
|
|
70
70
|
print(f"{outcome.label}: {outcome.price * 100:.1f}%")
|
|
71
71
|
|
|
72
|
-
# Fetch historical data (use outcome.
|
|
72
|
+
# Fetch historical data (use outcome.outcome_id!)
|
|
73
73
|
candles = poly.fetch_ohlcv(
|
|
74
|
-
outcome.
|
|
74
|
+
outcome.outcome_id,
|
|
75
75
|
pmxt.HistoryFilterParams(resolution="1d", limit=30)
|
|
76
76
|
)
|
|
77
77
|
|
|
78
78
|
# Get current order book
|
|
79
|
-
order_book = poly.fetch_order_book(outcome.
|
|
79
|
+
order_book = poly.fetch_order_book(outcome.outcome_id)
|
|
80
80
|
spread = order_book.asks[0].price - order_book.bids[0].price
|
|
81
81
|
print(f"Spread: {spread * 100:.2f}%")
|
|
82
82
|
```
|
|
@@ -182,7 +182,7 @@ All methods return clean Python dataclasses:
|
|
|
182
182
|
```python
|
|
183
183
|
@dataclass
|
|
184
184
|
class UnifiedMarket:
|
|
185
|
-
|
|
185
|
+
market_id: str # Use this for create_order
|
|
186
186
|
title: str
|
|
187
187
|
outcomes: List[MarketOutcome]
|
|
188
188
|
volume_24h: float
|
|
@@ -192,7 +192,7 @@ class UnifiedMarket:
|
|
|
192
192
|
|
|
193
193
|
@dataclass
|
|
194
194
|
class MarketOutcome:
|
|
195
|
-
|
|
195
|
+
outcome_id: str # Use this for fetch_ohlcv/fetch_order_book/fetch_trades
|
|
196
196
|
label: str # "Trump", "Yes", etc.
|
|
197
197
|
price: float # 0.0 to 1.0 (probability)
|
|
198
198
|
# ... more fields
|
|
@@ -202,16 +202,16 @@ See the [full API reference](../../API_REFERENCE.md) for complete documentation.
|
|
|
202
202
|
|
|
203
203
|
## Important Notes
|
|
204
204
|
|
|
205
|
-
### Use `outcome.
|
|
205
|
+
### Use `outcome.outcome_id`, not `market.market_id`
|
|
206
206
|
|
|
207
207
|
For deep-dive methods like `fetch_ohlcv()`, `fetch_order_book()`, and `fetch_trades()`, you must use the **outcome ID**, not the market ID:
|
|
208
208
|
|
|
209
209
|
```python
|
|
210
210
|
markets = poly.search_markets("Trump")
|
|
211
|
-
outcome_id = markets[0].outcomes[0].
|
|
211
|
+
outcome_id = markets[0].outcomes[0].outcome_id # Correct
|
|
212
212
|
|
|
213
213
|
candles = poly.fetch_ohlcv(outcome_id, ...) # Works
|
|
214
|
-
candles = poly.fetch_ohlcv(markets[0].
|
|
214
|
+
candles = poly.fetch_ohlcv(markets[0].market_id, ...) # Wrong!
|
|
215
215
|
```
|
|
216
216
|
|
|
217
217
|
### Prices are 0.0 to 1.0
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
pmxt/__init__.py,sha256=
|
|
1
|
+
pmxt/__init__.py,sha256=8cMyYOprOh9nhT8Ceukq_OGDR73NONQ-XtGFg6LxGXg,1522
|
|
2
2
|
pmxt/client.py,sha256=lpDT0zDw1OXal_hbjcV69DidlgyyzKMmPMqvm4waNGg,43488
|
|
3
3
|
pmxt/models.py,sha256=LYfbd_SEtvqI9gYnVz6wAqlijJkSODrodE7v0owbyok,10291
|
|
4
4
|
pmxt/server_manager.py,sha256=kkbvQOgCBBDUbe0X4KGLZsWpuHxz3Yvb9ECDhjQxMOE,12050
|
|
5
5
|
pmxt/_server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
pmxt/_server/bin/pmxt-ensure-server,sha256=kXIond0UbxS52FAVQD7kHmSBaL_s6cbIyapLRr4KZJw,4544
|
|
7
7
|
pmxt/_server/bin/pmxt-ensure-server.js,sha256=kXIond0UbxS52FAVQD7kHmSBaL_s6cbIyapLRr4KZJw,4544
|
|
8
|
-
pmxt/_server/server/bundled.js,sha256=
|
|
9
|
-
pmxt_internal/__init__.py,sha256=
|
|
10
|
-
pmxt_internal/api_client.py,sha256=
|
|
8
|
+
pmxt/_server/server/bundled.js,sha256=D7h-JcadL3EZUphJHUVaVHxrQAYpeCdfWqO5cI8Udmk,4272523
|
|
9
|
+
pmxt_internal/__init__.py,sha256=_peAwiouLMtnZNdlI057pgJCSIE1gW-cFj5ien9rKgc,7758
|
|
10
|
+
pmxt_internal/api_client.py,sha256=j8CFRkpmuFGUKTAh9cZjFz50lVHgdqnYHBdhBLR3siA,27891
|
|
11
11
|
pmxt_internal/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
|
12
|
-
pmxt_internal/configuration.py,sha256=
|
|
12
|
+
pmxt_internal/configuration.py,sha256=YiyiNSW8pzLT1xE9tnvbU2ezXr8JZjHP4gfKnugtxwU,18322
|
|
13
13
|
pmxt_internal/exceptions.py,sha256=txF8A7vlan57JS69kFPs-IZF-Qhp7IZobBTJVa4fOaM,6644
|
|
14
14
|
pmxt_internal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
pmxt_internal/rest.py,sha256=FMj4yaV6XLr842u_ScWHSzQsTFdk0jaUeuWLJoRbogQ,9760
|
|
@@ -66,7 +66,7 @@ pmxt_internal/models/unified_market.py,sha256=0y917aPCUNtlToDhfJWwVh3lGT-1VRFh_p
|
|
|
66
66
|
pmxt_internal/models/watch_order_book_request.py,sha256=kavGUI-SLz2-Kam_jcJ_h0GDe0-9UkxqCmVsAi6Uios,3726
|
|
67
67
|
pmxt_internal/models/watch_order_book_request_args_inner.py,sha256=ZHrjmFDGxRG5MXbuz4mUp9KFfo3XS7zuXWTyMNgi4xI,5464
|
|
68
68
|
pmxt_internal/models/watch_trades_request.py,sha256=brrg8JbEe-aeg7mIe_Y2HzRPogp-IfRhkXChrxzqoLU,3722
|
|
69
|
-
pmxt-
|
|
70
|
-
pmxt-
|
|
71
|
-
pmxt-
|
|
72
|
-
pmxt-
|
|
69
|
+
pmxt-2.0.0b0.dist-info/METADATA,sha256=WfrnRMnKn9m7834PrIc38OTSxBlUekmW3yIj0kX2vXY,6559
|
|
70
|
+
pmxt-2.0.0b0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
71
|
+
pmxt-2.0.0b0.dist-info/top_level.txt,sha256=J_jrcouJ-x-5lpcXMxeW0GOSi1HsBVR5_PdSfvigVrw,19
|
|
72
|
+
pmxt-2.0.0b0.dist-info/RECORD,,
|
pmxt_internal/__init__.py
CHANGED
pmxt_internal/api_client.py
CHANGED
|
@@ -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/
|
|
94
|
+
self.user_agent = 'OpenAPI-Generator/2.0.0b0/python'
|
|
95
95
|
self.client_side_validation = configuration.client_side_validation
|
|
96
96
|
|
|
97
97
|
def __enter__(self):
|
pmxt_internal/configuration.py
CHANGED
|
@@ -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:
|
|
509
|
+
"SDK Package Version: 2.0.0b0".\
|
|
510
510
|
format(env=sys.platform, pyversion=sys.version)
|
|
511
511
|
|
|
512
512
|
def get_host_settings(self) -> List[HostSetting]:
|
|
File without changes
|
|
File without changes
|