pmxt 1.2.0__py3-none-any.whl → 1.3.1__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 CHANGED
@@ -33,7 +33,7 @@ from .models import (
33
33
  CreateOrderParams,
34
34
  )
35
35
 
36
- __version__ = "1.2.0"
36
+ __version__ = "1.3.1"
37
37
  __all__ = [
38
38
  # Exchanges
39
39
  "Polymarket",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pmxt
3
- Version: 1.2.0
3
+ Version: 1.3.1
4
4
  Summary: Unified prediction market data API - The ccxt for prediction markets
5
5
  Author: PMXT Contributors
6
6
  License: MIT
@@ -1,20 +1,20 @@
1
- pmxt/__init__.py,sha256=j56wDMQ7UDMKuCfCG21_Yyu5sRfQZYAJr_O5KgazqAs,1150
1
+ pmxt/__init__.py,sha256=mm5_kfUsSx190jvgYhc7y04ZQZRA7REcwua8cWGDsZM,1150
2
2
  pmxt/client.py,sha256=pTU7MYP_k0lj-0eJifbHVcpGQVn5U7MTTDisKbv3fVI,27755
3
3
  pmxt/models.py,sha256=ZqRu__L8jnhZOYjE_Zy20dpft177Jb4lOZIkvBwuorg,6438
4
4
  pmxt/server_manager.py,sha256=-G97dYEdKl7F3HK9bAOKYl-SGWP6HsvzZIx2QxiZm24,11494
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/server/bundled.js,sha256=bgJSNnbYAsY2opHDoF-EfnJZgD03Ws2FmKpWGGKcGYg,4187137
8
- pmxt_internal/__init__.py,sha256=5scd_3UsIdcgcasF_lMtLRrmio0gNi-AqDefszhlCuE,6400
9
- pmxt_internal/api_client.py,sha256=t5ZZ-asj3thoDVhqc0XqzS6XsVqtjYrCBnIBb_zMERw,27889
8
+ pmxt_internal/__init__.py,sha256=nuOM-A8asA5lJO2qP9q9uBwLXwlex-pazKQNdWtkR5g,6762
9
+ pmxt_internal/api_client.py,sha256=7y61gqLd-HeKujV0svE1aeZRW7l1xpYSkonb-HQLCt8,27889
10
10
  pmxt_internal/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
11
- pmxt_internal/configuration.py,sha256=mxljZIa_w0ecXcUnhWUSvlfp9ItsSAy7G2Srhmc4Ohg,18320
11
+ pmxt_internal/configuration.py,sha256=tnBzBQ_X9_II0E0dwZaHKWd9pU0YbLDXxxm8qYjPEIc,18320
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=h1vGidUmbkXhBHAE1THOWsGjiJc0RnIQTy1fRVSye7M,171451
17
- pmxt_internal/models/__init__.py,sha256=vjHF9UaS2iEhSGavMQL9PtS5NFaFUMTEKKzg-qJwKeE,3449
16
+ pmxt_internal/api/default_api.py,sha256=4ySNtjkT9zJBfaHzX4fmXN5IgE-zIsr-uJs6WMO_N28,183099
17
+ pmxt_internal/models/__init__.py,sha256=VPMpFsTZYckNs5JLcdO_8UwcZn4xEK3xQ58LUO0rxv4,3667
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
@@ -49,14 +49,17 @@ pmxt_internal/models/order_book.py,sha256=FZQ5g81szBtpCun3vFFTDZb_xZkwUMVyEIF1ZZ
49
49
  pmxt_internal/models/order_level.py,sha256=dMeuXlhBqe1kA-R1ysFjt77qJxx6ukrZHwO1y3hZ6EM,2735
50
50
  pmxt_internal/models/position.py,sha256=a2v8JudGks66xtSU_BILwnEhxqfTu1o01g-ShWHpkeA,3740
51
51
  pmxt_internal/models/price_candle.py,sha256=AebmNrnVl_JI0Vqy_IRoRh08qX9ZUdzzazKmnVTuyio,3151
52
+ pmxt_internal/models/search_events200_response.py,sha256=70Nope-KWr4MBAFSMyjNugkOPgQZ1bZZym7HPdYR9vE,3560
53
+ pmxt_internal/models/search_events_request.py,sha256=F9Y8fUARgIKUmMKkIZn3SviCVn-3CF8jJzUz9byWOB8,3710
52
54
  pmxt_internal/models/search_markets_request.py,sha256=BARoy2GXgV7RQNIGck6UaOyQqf0NIJkyGGbFf2cfZKc,3714
53
55
  pmxt_internal/models/search_markets_request_args_inner.py,sha256=PkusFd_OxhUsItsBpluPJA11zg0sXXjbOK-lPmemvLs,5561
54
56
  pmxt_internal/models/trade.py,sha256=U6Fc18rbwILs9FmX8CSDYYL8dF6763l8QzeMQNRxQdo,3328
57
+ pmxt_internal/models/unified_event.py,sha256=zJVokyA3_Ny9cFxI_kZaJShB_V-KMqr5rY-i6oMDXCU,3896
55
58
  pmxt_internal/models/unified_market.py,sha256=DoYhiH4HycYGlq858PEeB-CIA7haT6rxmJeYZJuulMA,5646
56
59
  pmxt_internal/models/watch_order_book_request.py,sha256=kavGUI-SLz2-Kam_jcJ_h0GDe0-9UkxqCmVsAi6Uios,3726
57
60
  pmxt_internal/models/watch_order_book_request_args_inner.py,sha256=ZHrjmFDGxRG5MXbuz4mUp9KFfo3XS7zuXWTyMNgi4xI,5464
58
61
  pmxt_internal/models/watch_trades_request.py,sha256=brrg8JbEe-aeg7mIe_Y2HzRPogp-IfRhkXChrxzqoLU,3722
59
- pmxt-1.2.0.dist-info/METADATA,sha256=r9aUUGW_AalVxZIHnLRDdyt40XIqBYl5XrYv1nE7oLA,6288
60
- pmxt-1.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
61
- pmxt-1.2.0.dist-info/top_level.txt,sha256=J_jrcouJ-x-5lpcXMxeW0GOSi1HsBVR5_PdSfvigVrw,19
62
- pmxt-1.2.0.dist-info/RECORD,,
62
+ pmxt-1.3.1.dist-info/METADATA,sha256=5mXZyNIa4bGaNYCgyGOpv02knCgXn4J8J5xyjCe9rBM,6288
63
+ pmxt-1.3.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
64
+ pmxt-1.3.1.dist-info/top_level.txt,sha256=J_jrcouJ-x-5lpcXMxeW0GOSi1HsBVR5_PdSfvigVrw,19
65
+ pmxt-1.3.1.dist-info/RECORD,,
pmxt_internal/__init__.py CHANGED
@@ -14,7 +14,7 @@
14
14
  """ # noqa: E501
15
15
 
16
16
 
17
- __version__ = "1.2.0"
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.2.0/python'
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.2.0".\
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
+
File without changes