pmxt 1.1.4__tar.gz → 1.3.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.1.4 → pmxt-1.3.1}/PKG-INFO +1 -1
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/__init__.py +7 -1
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/api/default_api.py +290 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/api_client.py +1 -1
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/configuration.py +1 -1
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/__init__.py +3 -0
- pmxt-1.3.1/generated/pmxt_internal/models/search_events200_response.py +103 -0
- pmxt-1.3.1/generated/pmxt_internal/models/search_events_request.py +102 -0
- pmxt-1.3.1/generated/pmxt_internal/models/unified_event.py +111 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/unified_market.py +22 -2
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt/__init__.py +1 -1
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt/client.py +16 -10
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt/models.py +12 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt.egg-info/PKG-INFO +1 -1
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt.egg-info/SOURCES.txt +3 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/pyproject.toml +1 -1
- {pmxt-1.1.4 → pmxt-1.3.1}/README.md +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/api/__init__.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/api_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/exceptions.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/balance.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/base_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/base_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/cancel_order_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/create_order200_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/create_order_params.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/create_order_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/error_detail.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/error_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/exchange_credentials.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_balance200_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_markets200_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_markets_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_ohlcv200_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_ohlcv_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_ohlcv_request_args_inner.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_open_orders200_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_open_orders_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_order_book200_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_order_book_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_positions200_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_positions_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_trades200_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/fetch_trades_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/get_markets_by_slug_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/health_check200_response.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/history_filter_params.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/market_filter_params.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/market_outcome.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/order.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/order_book.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/order_level.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/position.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/price_candle.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/search_markets_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/search_markets_request_args_inner.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/trade.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/watch_order_book_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/watch_order_book_request_args_inner.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/watch_trades_request.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/py.typed +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/rest.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt/_server/__init__.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt/_server/bin/pmxt-ensure-server +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt/_server/server/bundled.js +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt/server_manager.py +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt.egg-info/dependency_links.txt +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt.egg-info/requires.txt +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/pmxt.egg-info/top_level.txt +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/setup.cfg +0 -0
- {pmxt-1.1.4 → pmxt-1.3.1}/tests/test_integration.py +0 -0
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
""" # noqa: E501
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
__version__ = "1.1
|
|
17
|
+
__version__ = "1.3.1"
|
|
18
18
|
|
|
19
19
|
# Define package exports
|
|
20
20
|
__all__ = [
|
|
@@ -62,9 +62,12 @@ __all__ = [
|
|
|
62
62
|
"OrderLevel",
|
|
63
63
|
"Position",
|
|
64
64
|
"PriceCandle",
|
|
65
|
+
"SearchEvents200Response",
|
|
66
|
+
"SearchEventsRequest",
|
|
65
67
|
"SearchMarketsRequest",
|
|
66
68
|
"SearchMarketsRequestArgsInner",
|
|
67
69
|
"Trade",
|
|
70
|
+
"UnifiedEvent",
|
|
68
71
|
"UnifiedMarket",
|
|
69
72
|
"WatchOrderBookRequest",
|
|
70
73
|
"WatchOrderBookRequestArgsInner",
|
|
@@ -120,9 +123,12 @@ from pmxt_internal.models.order_book import OrderBook as OrderBook
|
|
|
120
123
|
from pmxt_internal.models.order_level import OrderLevel as OrderLevel
|
|
121
124
|
from pmxt_internal.models.position import Position as Position
|
|
122
125
|
from pmxt_internal.models.price_candle import PriceCandle as PriceCandle
|
|
126
|
+
from pmxt_internal.models.search_events200_response import SearchEvents200Response as SearchEvents200Response
|
|
127
|
+
from pmxt_internal.models.search_events_request import SearchEventsRequest as SearchEventsRequest
|
|
123
128
|
from pmxt_internal.models.search_markets_request import SearchMarketsRequest as SearchMarketsRequest
|
|
124
129
|
from pmxt_internal.models.search_markets_request_args_inner import SearchMarketsRequestArgsInner as SearchMarketsRequestArgsInner
|
|
125
130
|
from pmxt_internal.models.trade import Trade as Trade
|
|
131
|
+
from pmxt_internal.models.unified_event import UnifiedEvent as UnifiedEvent
|
|
126
132
|
from pmxt_internal.models.unified_market import UnifiedMarket as UnifiedMarket
|
|
127
133
|
from pmxt_internal.models.watch_order_book_request import WatchOrderBookRequest as WatchOrderBookRequest
|
|
128
134
|
from pmxt_internal.models.watch_order_book_request_args_inner import WatchOrderBookRequestArgsInner as WatchOrderBookRequestArgsInner
|
|
@@ -37,6 +37,8 @@ from pmxt_internal.models.fetch_trades200_response import FetchTrades200Response
|
|
|
37
37
|
from pmxt_internal.models.fetch_trades_request import FetchTradesRequest
|
|
38
38
|
from pmxt_internal.models.get_markets_by_slug_request import GetMarketsBySlugRequest
|
|
39
39
|
from pmxt_internal.models.health_check200_response import HealthCheck200Response
|
|
40
|
+
from pmxt_internal.models.search_events200_response import SearchEvents200Response
|
|
41
|
+
from pmxt_internal.models.search_events_request import SearchEventsRequest
|
|
40
42
|
from pmxt_internal.models.search_markets_request import SearchMarketsRequest
|
|
41
43
|
from pmxt_internal.models.watch_order_book_request import WatchOrderBookRequest
|
|
42
44
|
from pmxt_internal.models.watch_trades_request import WatchTradesRequest
|
|
@@ -3436,6 +3438,294 @@ class DefaultApi:
|
|
|
3436
3438
|
|
|
3437
3439
|
|
|
3438
3440
|
|
|
3441
|
+
@validate_call
|
|
3442
|
+
def search_events(
|
|
3443
|
+
self,
|
|
3444
|
+
exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
|
|
3445
|
+
search_events_request: Optional[SearchEventsRequest] = None,
|
|
3446
|
+
_request_timeout: Union[
|
|
3447
|
+
None,
|
|
3448
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
3449
|
+
Tuple[
|
|
3450
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
3451
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
3452
|
+
]
|
|
3453
|
+
] = None,
|
|
3454
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
3455
|
+
_content_type: Optional[StrictStr] = None,
|
|
3456
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
3457
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
3458
|
+
) -> SearchEvents200Response:
|
|
3459
|
+
"""Search Events
|
|
3460
|
+
|
|
3461
|
+
Search for events (groups of related markets) by title or description.
|
|
3462
|
+
|
|
3463
|
+
:param exchange: The prediction market exchange to target. (required)
|
|
3464
|
+
:type exchange: str
|
|
3465
|
+
:param search_events_request:
|
|
3466
|
+
:type search_events_request: SearchEventsRequest
|
|
3467
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
3468
|
+
number provided, it will be total request
|
|
3469
|
+
timeout. It can also be a pair (tuple) of
|
|
3470
|
+
(connection, read) timeouts.
|
|
3471
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
3472
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
3473
|
+
request; this effectively ignores the
|
|
3474
|
+
authentication in the spec for a single request.
|
|
3475
|
+
:type _request_auth: dict, optional
|
|
3476
|
+
:param _content_type: force content-type for the request.
|
|
3477
|
+
:type _content_type: str, Optional
|
|
3478
|
+
:param _headers: set to override the headers for a single
|
|
3479
|
+
request; this effectively ignores the headers
|
|
3480
|
+
in the spec for a single request.
|
|
3481
|
+
:type _headers: dict, optional
|
|
3482
|
+
:param _host_index: set to override the host_index for a single
|
|
3483
|
+
request; this effectively ignores the host_index
|
|
3484
|
+
in the spec for a single request.
|
|
3485
|
+
:type _host_index: int, optional
|
|
3486
|
+
:return: Returns the result object.
|
|
3487
|
+
""" # noqa: E501
|
|
3488
|
+
|
|
3489
|
+
_param = self._search_events_serialize(
|
|
3490
|
+
exchange=exchange,
|
|
3491
|
+
search_events_request=search_events_request,
|
|
3492
|
+
_request_auth=_request_auth,
|
|
3493
|
+
_content_type=_content_type,
|
|
3494
|
+
_headers=_headers,
|
|
3495
|
+
_host_index=_host_index
|
|
3496
|
+
)
|
|
3497
|
+
|
|
3498
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
3499
|
+
'200': "SearchEvents200Response",
|
|
3500
|
+
}
|
|
3501
|
+
response_data = self.api_client.call_api(
|
|
3502
|
+
*_param,
|
|
3503
|
+
_request_timeout=_request_timeout
|
|
3504
|
+
)
|
|
3505
|
+
response_data.read()
|
|
3506
|
+
return self.api_client.response_deserialize(
|
|
3507
|
+
response_data=response_data,
|
|
3508
|
+
response_types_map=_response_types_map,
|
|
3509
|
+
).data
|
|
3510
|
+
|
|
3511
|
+
|
|
3512
|
+
@validate_call
|
|
3513
|
+
def search_events_with_http_info(
|
|
3514
|
+
self,
|
|
3515
|
+
exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
|
|
3516
|
+
search_events_request: Optional[SearchEventsRequest] = None,
|
|
3517
|
+
_request_timeout: Union[
|
|
3518
|
+
None,
|
|
3519
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
3520
|
+
Tuple[
|
|
3521
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
3522
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
3523
|
+
]
|
|
3524
|
+
] = None,
|
|
3525
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
3526
|
+
_content_type: Optional[StrictStr] = None,
|
|
3527
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
3528
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
3529
|
+
) -> ApiResponse[SearchEvents200Response]:
|
|
3530
|
+
"""Search Events
|
|
3531
|
+
|
|
3532
|
+
Search for events (groups of related markets) by title or description.
|
|
3533
|
+
|
|
3534
|
+
:param exchange: The prediction market exchange to target. (required)
|
|
3535
|
+
:type exchange: str
|
|
3536
|
+
:param search_events_request:
|
|
3537
|
+
:type search_events_request: SearchEventsRequest
|
|
3538
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
3539
|
+
number provided, it will be total request
|
|
3540
|
+
timeout. It can also be a pair (tuple) of
|
|
3541
|
+
(connection, read) timeouts.
|
|
3542
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
3543
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
3544
|
+
request; this effectively ignores the
|
|
3545
|
+
authentication in the spec for a single request.
|
|
3546
|
+
:type _request_auth: dict, optional
|
|
3547
|
+
:param _content_type: force content-type for the request.
|
|
3548
|
+
:type _content_type: str, Optional
|
|
3549
|
+
:param _headers: set to override the headers for a single
|
|
3550
|
+
request; this effectively ignores the headers
|
|
3551
|
+
in the spec for a single request.
|
|
3552
|
+
:type _headers: dict, optional
|
|
3553
|
+
:param _host_index: set to override the host_index for a single
|
|
3554
|
+
request; this effectively ignores the host_index
|
|
3555
|
+
in the spec for a single request.
|
|
3556
|
+
:type _host_index: int, optional
|
|
3557
|
+
:return: Returns the result object.
|
|
3558
|
+
""" # noqa: E501
|
|
3559
|
+
|
|
3560
|
+
_param = self._search_events_serialize(
|
|
3561
|
+
exchange=exchange,
|
|
3562
|
+
search_events_request=search_events_request,
|
|
3563
|
+
_request_auth=_request_auth,
|
|
3564
|
+
_content_type=_content_type,
|
|
3565
|
+
_headers=_headers,
|
|
3566
|
+
_host_index=_host_index
|
|
3567
|
+
)
|
|
3568
|
+
|
|
3569
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
3570
|
+
'200': "SearchEvents200Response",
|
|
3571
|
+
}
|
|
3572
|
+
response_data = self.api_client.call_api(
|
|
3573
|
+
*_param,
|
|
3574
|
+
_request_timeout=_request_timeout
|
|
3575
|
+
)
|
|
3576
|
+
response_data.read()
|
|
3577
|
+
return self.api_client.response_deserialize(
|
|
3578
|
+
response_data=response_data,
|
|
3579
|
+
response_types_map=_response_types_map,
|
|
3580
|
+
)
|
|
3581
|
+
|
|
3582
|
+
|
|
3583
|
+
@validate_call
|
|
3584
|
+
def search_events_without_preload_content(
|
|
3585
|
+
self,
|
|
3586
|
+
exchange: Annotated[StrictStr, Field(description="The prediction market exchange to target.")],
|
|
3587
|
+
search_events_request: Optional[SearchEventsRequest] = None,
|
|
3588
|
+
_request_timeout: Union[
|
|
3589
|
+
None,
|
|
3590
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
3591
|
+
Tuple[
|
|
3592
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
3593
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
3594
|
+
]
|
|
3595
|
+
] = None,
|
|
3596
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
3597
|
+
_content_type: Optional[StrictStr] = None,
|
|
3598
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
3599
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
3600
|
+
) -> RESTResponseType:
|
|
3601
|
+
"""Search Events
|
|
3602
|
+
|
|
3603
|
+
Search for events (groups of related markets) by title or description.
|
|
3604
|
+
|
|
3605
|
+
:param exchange: The prediction market exchange to target. (required)
|
|
3606
|
+
:type exchange: str
|
|
3607
|
+
:param search_events_request:
|
|
3608
|
+
:type search_events_request: SearchEventsRequest
|
|
3609
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
3610
|
+
number provided, it will be total request
|
|
3611
|
+
timeout. It can also be a pair (tuple) of
|
|
3612
|
+
(connection, read) timeouts.
|
|
3613
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
3614
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
3615
|
+
request; this effectively ignores the
|
|
3616
|
+
authentication in the spec for a single request.
|
|
3617
|
+
:type _request_auth: dict, optional
|
|
3618
|
+
:param _content_type: force content-type for the request.
|
|
3619
|
+
:type _content_type: str, Optional
|
|
3620
|
+
:param _headers: set to override the headers for a single
|
|
3621
|
+
request; this effectively ignores the headers
|
|
3622
|
+
in the spec for a single request.
|
|
3623
|
+
:type _headers: dict, optional
|
|
3624
|
+
:param _host_index: set to override the host_index for a single
|
|
3625
|
+
request; this effectively ignores the host_index
|
|
3626
|
+
in the spec for a single request.
|
|
3627
|
+
:type _host_index: int, optional
|
|
3628
|
+
:return: Returns the result object.
|
|
3629
|
+
""" # noqa: E501
|
|
3630
|
+
|
|
3631
|
+
_param = self._search_events_serialize(
|
|
3632
|
+
exchange=exchange,
|
|
3633
|
+
search_events_request=search_events_request,
|
|
3634
|
+
_request_auth=_request_auth,
|
|
3635
|
+
_content_type=_content_type,
|
|
3636
|
+
_headers=_headers,
|
|
3637
|
+
_host_index=_host_index
|
|
3638
|
+
)
|
|
3639
|
+
|
|
3640
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
3641
|
+
'200': "SearchEvents200Response",
|
|
3642
|
+
}
|
|
3643
|
+
response_data = self.api_client.call_api(
|
|
3644
|
+
*_param,
|
|
3645
|
+
_request_timeout=_request_timeout
|
|
3646
|
+
)
|
|
3647
|
+
return response_data.response
|
|
3648
|
+
|
|
3649
|
+
|
|
3650
|
+
def _search_events_serialize(
|
|
3651
|
+
self,
|
|
3652
|
+
exchange,
|
|
3653
|
+
search_events_request,
|
|
3654
|
+
_request_auth,
|
|
3655
|
+
_content_type,
|
|
3656
|
+
_headers,
|
|
3657
|
+
_host_index,
|
|
3658
|
+
) -> RequestSerialized:
|
|
3659
|
+
|
|
3660
|
+
_host = None
|
|
3661
|
+
|
|
3662
|
+
_collection_formats: Dict[str, str] = {
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
_path_params: Dict[str, str] = {}
|
|
3666
|
+
_query_params: List[Tuple[str, str]] = []
|
|
3667
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
3668
|
+
_form_params: List[Tuple[str, str]] = []
|
|
3669
|
+
_files: Dict[
|
|
3670
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
3671
|
+
] = {}
|
|
3672
|
+
_body_params: Optional[bytes] = None
|
|
3673
|
+
|
|
3674
|
+
# process the path parameters
|
|
3675
|
+
if exchange is not None:
|
|
3676
|
+
_path_params['exchange'] = exchange
|
|
3677
|
+
# process the query parameters
|
|
3678
|
+
# process the header parameters
|
|
3679
|
+
# process the form parameters
|
|
3680
|
+
# process the body parameter
|
|
3681
|
+
if search_events_request is not None:
|
|
3682
|
+
_body_params = search_events_request
|
|
3683
|
+
|
|
3684
|
+
|
|
3685
|
+
# set the HTTP header `Accept`
|
|
3686
|
+
if 'Accept' not in _header_params:
|
|
3687
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
3688
|
+
[
|
|
3689
|
+
'application/json'
|
|
3690
|
+
]
|
|
3691
|
+
)
|
|
3692
|
+
|
|
3693
|
+
# set the HTTP header `Content-Type`
|
|
3694
|
+
if _content_type:
|
|
3695
|
+
_header_params['Content-Type'] = _content_type
|
|
3696
|
+
else:
|
|
3697
|
+
_default_content_type = (
|
|
3698
|
+
self.api_client.select_header_content_type(
|
|
3699
|
+
[
|
|
3700
|
+
'application/json'
|
|
3701
|
+
]
|
|
3702
|
+
)
|
|
3703
|
+
)
|
|
3704
|
+
if _default_content_type is not None:
|
|
3705
|
+
_header_params['Content-Type'] = _default_content_type
|
|
3706
|
+
|
|
3707
|
+
# authentication setting
|
|
3708
|
+
_auth_settings: List[str] = [
|
|
3709
|
+
]
|
|
3710
|
+
|
|
3711
|
+
return self.api_client.param_serialize(
|
|
3712
|
+
method='POST',
|
|
3713
|
+
resource_path='/api/{exchange}/searchEvents',
|
|
3714
|
+
path_params=_path_params,
|
|
3715
|
+
query_params=_query_params,
|
|
3716
|
+
header_params=_header_params,
|
|
3717
|
+
body=_body_params,
|
|
3718
|
+
post_params=_form_params,
|
|
3719
|
+
files=_files,
|
|
3720
|
+
auth_settings=_auth_settings,
|
|
3721
|
+
collection_formats=_collection_formats,
|
|
3722
|
+
_host=_host,
|
|
3723
|
+
_request_auth=_request_auth
|
|
3724
|
+
)
|
|
3725
|
+
|
|
3726
|
+
|
|
3727
|
+
|
|
3728
|
+
|
|
3439
3729
|
@validate_call
|
|
3440
3730
|
def search_markets(
|
|
3441
3731
|
self,
|
|
@@ -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.1
|
|
94
|
+
self.user_agent = 'OpenAPI-Generator/1.3.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.1
|
|
509
|
+
"SDK Package Version: 1.3.1".\
|
|
510
510
|
format(env=sys.platform, pyversion=sys.version)
|
|
511
511
|
|
|
512
512
|
def get_host_settings(self) -> List[HostSetting]:
|
|
@@ -47,9 +47,12 @@ from pmxt_internal.models.order_book import OrderBook
|
|
|
47
47
|
from pmxt_internal.models.order_level import OrderLevel
|
|
48
48
|
from pmxt_internal.models.position import Position
|
|
49
49
|
from pmxt_internal.models.price_candle import PriceCandle
|
|
50
|
+
from pmxt_internal.models.search_events200_response import SearchEvents200Response
|
|
51
|
+
from pmxt_internal.models.search_events_request import SearchEventsRequest
|
|
50
52
|
from pmxt_internal.models.search_markets_request import SearchMarketsRequest
|
|
51
53
|
from pmxt_internal.models.search_markets_request_args_inner import SearchMarketsRequestArgsInner
|
|
52
54
|
from pmxt_internal.models.trade import Trade
|
|
55
|
+
from pmxt_internal.models.unified_event import UnifiedEvent
|
|
53
56
|
from pmxt_internal.models.unified_market import UnifiedMarket
|
|
54
57
|
from pmxt_internal.models.watch_order_book_request import WatchOrderBookRequest
|
|
55
58
|
from pmxt_internal.models.watch_order_book_request_args_inner import WatchOrderBookRequestArgsInner
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
PMXT Sidecar API
|
|
5
|
+
|
|
6
|
+
A unified local sidecar API for prediction markets (Polymarket, Kalshi). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.4.4
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictBool
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from pmxt_internal.models.error_detail import ErrorDetail
|
|
23
|
+
from pmxt_internal.models.unified_event import UnifiedEvent
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class SearchEvents200Response(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SearchEvents200Response
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
success: Optional[StrictBool] = None
|
|
32
|
+
error: Optional[ErrorDetail] = None
|
|
33
|
+
data: Optional[List[UnifiedEvent]] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["success", "error", "data"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of SearchEvents200Response from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of error
|
|
76
|
+
if self.error:
|
|
77
|
+
_dict['error'] = self.error.to_dict()
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of each item in data (list)
|
|
79
|
+
_items = []
|
|
80
|
+
if self.data:
|
|
81
|
+
for _item_data in self.data:
|
|
82
|
+
if _item_data:
|
|
83
|
+
_items.append(_item_data.to_dict())
|
|
84
|
+
_dict['data'] = _items
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of SearchEvents200Response from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"success": obj.get("success"),
|
|
98
|
+
"error": ErrorDetail.from_dict(obj["error"]) if obj.get("error") is not None else None,
|
|
99
|
+
"data": [UnifiedEvent.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None
|
|
100
|
+
})
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
PMXT Sidecar API
|
|
5
|
+
|
|
6
|
+
A unified local sidecar API for prediction markets (Polymarket, Kalshi). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.4.4
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
24
|
+
from pmxt_internal.models.search_markets_request_args_inner import SearchMarketsRequestArgsInner
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class SearchEventsRequest(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
SearchEventsRequest
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
args: Annotated[List[SearchMarketsRequestArgsInner], Field(min_length=1, max_length=2)] = Field(description="[query, params?]")
|
|
33
|
+
credentials: Optional[ExchangeCredentials] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["args", "credentials"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of SearchEventsRequest from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of each item in args (list)
|
|
76
|
+
_items = []
|
|
77
|
+
if self.args:
|
|
78
|
+
for _item_args in self.args:
|
|
79
|
+
if _item_args:
|
|
80
|
+
_items.append(_item_args.to_dict())
|
|
81
|
+
_dict['args'] = _items
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of credentials
|
|
83
|
+
if self.credentials:
|
|
84
|
+
_dict['credentials'] = self.credentials.to_dict()
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of SearchEventsRequest from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"args": [SearchMarketsRequestArgsInner.from_dict(_item) for _item in obj["args"]] if obj.get("args") is not None else None,
|
|
98
|
+
"credentials": ExchangeCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
101
|
+
|
|
102
|
+
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
PMXT Sidecar API
|
|
5
|
+
|
|
6
|
+
A unified local sidecar API for prediction markets (Polymarket, Kalshi). This API acts as a JSON-RPC-style gateway. Each endpoint corresponds to a specific method on the generic exchange implementation.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.4.4
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from pmxt_internal.models.unified_market import UnifiedMarket
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class UnifiedEvent(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
A grouped collection of related markets (e.g., \"Who will be Fed Chair?\" contains multiple candidate markets)
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
id: Optional[StrictStr] = None
|
|
31
|
+
title: Optional[StrictStr] = None
|
|
32
|
+
description: Optional[StrictStr] = None
|
|
33
|
+
slug: Optional[StrictStr] = None
|
|
34
|
+
markets: Optional[List[UnifiedMarket]] = None
|
|
35
|
+
url: Optional[StrictStr] = None
|
|
36
|
+
image: Optional[StrictStr] = None
|
|
37
|
+
category: Optional[StrictStr] = None
|
|
38
|
+
tags: Optional[List[StrictStr]] = None
|
|
39
|
+
__properties: ClassVar[List[str]] = ["id", "title", "description", "slug", "markets", "url", "image", "category", "tags"]
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of UnifiedEvent from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of each item in markets (list)
|
|
81
|
+
_items = []
|
|
82
|
+
if self.markets:
|
|
83
|
+
for _item_markets in self.markets:
|
|
84
|
+
if _item_markets:
|
|
85
|
+
_items.append(_item_markets.to_dict())
|
|
86
|
+
_dict['markets'] = _items
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of UnifiedEvent from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({
|
|
99
|
+
"id": obj.get("id"),
|
|
100
|
+
"title": obj.get("title"),
|
|
101
|
+
"description": obj.get("description"),
|
|
102
|
+
"slug": obj.get("slug"),
|
|
103
|
+
"markets": [UnifiedMarket.from_dict(_item) for _item in obj["markets"]] if obj.get("markets") is not None else None,
|
|
104
|
+
"url": obj.get("url"),
|
|
105
|
+
"image": obj.get("image"),
|
|
106
|
+
"category": obj.get("category"),
|
|
107
|
+
"tags": obj.get("tags")
|
|
108
|
+
})
|
|
109
|
+
return _obj
|
|
110
|
+
|
|
111
|
+
|
|
@@ -41,7 +41,11 @@ class UnifiedMarket(BaseModel):
|
|
|
41
41
|
image: Optional[StrictStr] = None
|
|
42
42
|
category: Optional[StrictStr] = None
|
|
43
43
|
tags: Optional[List[StrictStr]] = None
|
|
44
|
-
|
|
44
|
+
yes: Optional[MarketOutcome] = None
|
|
45
|
+
no: Optional[MarketOutcome] = None
|
|
46
|
+
up: Optional[MarketOutcome] = None
|
|
47
|
+
down: Optional[MarketOutcome] = None
|
|
48
|
+
__properties: ClassVar[List[str]] = ["id", "title", "description", "outcomes", "resolutionDate", "volume24h", "volume", "liquidity", "openInterest", "url", "image", "category", "tags", "yes", "no", "up", "down"]
|
|
45
49
|
|
|
46
50
|
model_config = ConfigDict(
|
|
47
51
|
populate_by_name=True,
|
|
@@ -89,6 +93,18 @@ class UnifiedMarket(BaseModel):
|
|
|
89
93
|
if _item_outcomes:
|
|
90
94
|
_items.append(_item_outcomes.to_dict())
|
|
91
95
|
_dict['outcomes'] = _items
|
|
96
|
+
# override the default output from pydantic by calling `to_dict()` of yes
|
|
97
|
+
if self.yes:
|
|
98
|
+
_dict['yes'] = self.yes.to_dict()
|
|
99
|
+
# override the default output from pydantic by calling `to_dict()` of no
|
|
100
|
+
if self.no:
|
|
101
|
+
_dict['no'] = self.no.to_dict()
|
|
102
|
+
# override the default output from pydantic by calling `to_dict()` of up
|
|
103
|
+
if self.up:
|
|
104
|
+
_dict['up'] = self.up.to_dict()
|
|
105
|
+
# override the default output from pydantic by calling `to_dict()` of down
|
|
106
|
+
if self.down:
|
|
107
|
+
_dict['down'] = self.down.to_dict()
|
|
92
108
|
return _dict
|
|
93
109
|
|
|
94
110
|
@classmethod
|
|
@@ -113,7 +129,11 @@ class UnifiedMarket(BaseModel):
|
|
|
113
129
|
"url": obj.get("url"),
|
|
114
130
|
"image": obj.get("image"),
|
|
115
131
|
"category": obj.get("category"),
|
|
116
|
-
"tags": obj.get("tags")
|
|
132
|
+
"tags": obj.get("tags"),
|
|
133
|
+
"yes": MarketOutcome.from_dict(obj["yes"]) if obj.get("yes") is not None else None,
|
|
134
|
+
"no": MarketOutcome.from_dict(obj["no"]) if obj.get("no") is not None else None,
|
|
135
|
+
"up": MarketOutcome.from_dict(obj["up"]) if obj.get("up") is not None else None,
|
|
136
|
+
"down": MarketOutcome.from_dict(obj["down"]) if obj.get("down") is not None else None
|
|
117
137
|
})
|
|
118
138
|
return _obj
|
|
119
139
|
|
|
@@ -38,18 +38,20 @@ from .models import (
|
|
|
38
38
|
from .server_manager import ServerManager
|
|
39
39
|
|
|
40
40
|
|
|
41
|
+
def _convert_outcome(raw: Dict[str, Any]) -> MarketOutcome:
|
|
42
|
+
"""Convert raw API response to MarketOutcome."""
|
|
43
|
+
return MarketOutcome(
|
|
44
|
+
id=raw.get("id"),
|
|
45
|
+
label=raw.get("label"),
|
|
46
|
+
price=raw.get("price"),
|
|
47
|
+
price_change_24h=raw.get("priceChange24h"),
|
|
48
|
+
metadata=raw.get("metadata"),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
41
52
|
def _convert_market(raw: Dict[str, Any]) -> UnifiedMarket:
|
|
42
53
|
"""Convert raw API response to UnifiedMarket."""
|
|
43
|
-
outcomes = [
|
|
44
|
-
MarketOutcome(
|
|
45
|
-
id=o.get("id"),
|
|
46
|
-
label=o.get("label"),
|
|
47
|
-
price=o.get("price"),
|
|
48
|
-
price_change_24h=o.get("priceChange24h"),
|
|
49
|
-
metadata=o.get("metadata"),
|
|
50
|
-
)
|
|
51
|
-
for o in raw.get("outcomes", [])
|
|
52
|
-
]
|
|
54
|
+
outcomes = [_convert_outcome(o) for o in raw.get("outcomes", [])]
|
|
53
55
|
|
|
54
56
|
return UnifiedMarket(
|
|
55
57
|
id=raw.get("id"),
|
|
@@ -65,6 +67,10 @@ def _convert_market(raw: Dict[str, Any]) -> UnifiedMarket:
|
|
|
65
67
|
image=raw.get("image"),
|
|
66
68
|
category=raw.get("category"),
|
|
67
69
|
tags=raw.get("tags"),
|
|
70
|
+
yes=_convert_outcome(raw["yes"]) if raw.get("yes") else None,
|
|
71
|
+
no=_convert_outcome(raw["no"]) if raw.get("no") else None,
|
|
72
|
+
up=_convert_outcome(raw["up"]) if raw.get("up") else None,
|
|
73
|
+
down=_convert_outcome(raw["down"]) if raw.get("down") else None,
|
|
68
74
|
)
|
|
69
75
|
|
|
70
76
|
|
|
@@ -75,6 +75,18 @@ class UnifiedMarket:
|
|
|
75
75
|
tags: Optional[List[str]] = None
|
|
76
76
|
"""Market tags"""
|
|
77
77
|
|
|
78
|
+
yes: Optional[MarketOutcome] = None
|
|
79
|
+
"""Convenience access to the Yes outcome for binary markets."""
|
|
80
|
+
|
|
81
|
+
no: Optional[MarketOutcome] = None
|
|
82
|
+
"""Convenience access to the No outcome for binary markets."""
|
|
83
|
+
|
|
84
|
+
up: Optional[MarketOutcome] = None
|
|
85
|
+
"""Convenience access to the Up outcome for binary markets."""
|
|
86
|
+
|
|
87
|
+
down: Optional[MarketOutcome] = None
|
|
88
|
+
"""Convenience access to the Down outcome for binary markets."""
|
|
89
|
+
|
|
78
90
|
|
|
79
91
|
@dataclass
|
|
80
92
|
class PriceCandle:
|
|
@@ -44,9 +44,12 @@ generated/pmxt_internal/models/order_book.py
|
|
|
44
44
|
generated/pmxt_internal/models/order_level.py
|
|
45
45
|
generated/pmxt_internal/models/position.py
|
|
46
46
|
generated/pmxt_internal/models/price_candle.py
|
|
47
|
+
generated/pmxt_internal/models/search_events200_response.py
|
|
48
|
+
generated/pmxt_internal/models/search_events_request.py
|
|
47
49
|
generated/pmxt_internal/models/search_markets_request.py
|
|
48
50
|
generated/pmxt_internal/models/search_markets_request_args_inner.py
|
|
49
51
|
generated/pmxt_internal/models/trade.py
|
|
52
|
+
generated/pmxt_internal/models/unified_event.py
|
|
50
53
|
generated/pmxt_internal/models/unified_market.py
|
|
51
54
|
generated/pmxt_internal/models/watch_order_book_request.py
|
|
52
55
|
generated/pmxt_internal/models/watch_order_book_request_args_inner.py
|
|
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
|
|
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.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/search_markets_request_args_inner.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pmxt-1.1.4 → pmxt-1.3.1}/generated/pmxt_internal/models/watch_order_book_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
|