pmxt 1.0.0__tar.gz → 1.0.0b2__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.0 → pmxt-1.0.0b2}/PKG-INFO +1 -1
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/__init__.py +1 -5
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/api_client.py +1 -1
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/configuration.py +1 -1
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/__init__.py +0 -2
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/cancel_order_request.py +3 -9
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/create_order_request.py +3 -9
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_markets_request.py +2 -8
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_ohlcv_request.py +3 -9
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_open_orders_request.py +2 -8
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_order_book_request.py +3 -9
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_positions_request.py +2 -8
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_trades_request.py +3 -9
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/get_markets_by_slug_request.py +3 -9
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/market_outcome.py +3 -7
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/order.py +2 -14
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/order_book.py +3 -5
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/search_markets_request.py +3 -9
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/unified_market.py +3 -18
- {pmxt-1.0.0 → pmxt-1.0.0b2}/pmxt/__init__.py +1 -1
- {pmxt-1.0.0 → pmxt-1.0.0b2}/pmxt/client.py +0 -53
- {pmxt-1.0.0 → pmxt-1.0.0b2}/pmxt.egg-info/PKG-INFO +1 -1
- {pmxt-1.0.0 → pmxt-1.0.0b2}/pmxt.egg-info/SOURCES.txt +0 -2
- {pmxt-1.0.0 → pmxt-1.0.0b2}/pyproject.toml +1 -1
- pmxt-1.0.0/generated/pmxt_internal/models/base_request.py +0 -91
- pmxt-1.0.0/generated/pmxt_internal/models/exchange_credentials.py +0 -93
- {pmxt-1.0.0 → pmxt-1.0.0b2}/README.md +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/api/__init__.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/api/default_api.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/api_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/exceptions.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/balance.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/base_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/create_order200_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/create_order_params.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/error_detail.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/error_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_balance200_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_markets200_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_ohlcv200_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_ohlcv_request_args_inner.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_open_orders200_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_order_book200_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_positions200_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/fetch_trades200_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/health_check200_response.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/history_filter_params.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/market_filter_params.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/order_level.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/position.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/price_candle.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/search_markets_request_args_inner.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/models/trade.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/py.typed +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/generated/pmxt_internal/rest.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/pmxt/models.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/pmxt/server_manager.py +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/pmxt.egg-info/dependency_links.txt +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/pmxt.egg-info/requires.txt +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/pmxt.egg-info/top_level.txt +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/setup.cfg +0 -0
- {pmxt-1.0.0 → pmxt-1.0.0b2}/tests/test_integration.py +0 -0
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
""" # noqa: E501
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
__version__ = "1.0.
|
|
17
|
+
__version__ = "1.0.0b2"
|
|
18
18
|
|
|
19
19
|
# Define package exports
|
|
20
20
|
__all__ = [
|
|
@@ -29,7 +29,6 @@ __all__ = [
|
|
|
29
29
|
"ApiAttributeError",
|
|
30
30
|
"ApiException",
|
|
31
31
|
"Balance",
|
|
32
|
-
"BaseRequest",
|
|
33
32
|
"BaseResponse",
|
|
34
33
|
"CancelOrderRequest",
|
|
35
34
|
"CreateOrder200Response",
|
|
@@ -37,7 +36,6 @@ __all__ = [
|
|
|
37
36
|
"CreateOrderRequest",
|
|
38
37
|
"ErrorDetail",
|
|
39
38
|
"ErrorResponse",
|
|
40
|
-
"ExchangeCredentials",
|
|
41
39
|
"FetchBalance200Response",
|
|
42
40
|
"FetchMarkets200Response",
|
|
43
41
|
"FetchMarketsRequest",
|
|
@@ -84,7 +82,6 @@ from pmxt_internal.exceptions import ApiException as ApiException
|
|
|
84
82
|
|
|
85
83
|
# import models into sdk package
|
|
86
84
|
from pmxt_internal.models.balance import Balance as Balance
|
|
87
|
-
from pmxt_internal.models.base_request import BaseRequest as BaseRequest
|
|
88
85
|
from pmxt_internal.models.base_response import BaseResponse as BaseResponse
|
|
89
86
|
from pmxt_internal.models.cancel_order_request import CancelOrderRequest as CancelOrderRequest
|
|
90
87
|
from pmxt_internal.models.create_order200_response import CreateOrder200Response as CreateOrder200Response
|
|
@@ -92,7 +89,6 @@ from pmxt_internal.models.create_order_params import CreateOrderParams as Create
|
|
|
92
89
|
from pmxt_internal.models.create_order_request import CreateOrderRequest as CreateOrderRequest
|
|
93
90
|
from pmxt_internal.models.error_detail import ErrorDetail as ErrorDetail
|
|
94
91
|
from pmxt_internal.models.error_response import ErrorResponse as ErrorResponse
|
|
95
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials as ExchangeCredentials
|
|
96
92
|
from pmxt_internal.models.fetch_balance200_response import FetchBalance200Response as FetchBalance200Response
|
|
97
93
|
from pmxt_internal.models.fetch_markets200_response import FetchMarkets200Response as FetchMarkets200Response
|
|
98
94
|
from pmxt_internal.models.fetch_markets_request import FetchMarketsRequest as FetchMarketsRequest
|
|
@@ -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.0b2/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.0b2".\
|
|
510
510
|
format(env=sys.platform, pyversion=sys.version)
|
|
511
511
|
|
|
512
512
|
def get_host_settings(self) -> List[HostSetting]:
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
# import models into model package
|
|
16
16
|
from pmxt_internal.models.balance import Balance
|
|
17
|
-
from pmxt_internal.models.base_request import BaseRequest
|
|
18
17
|
from pmxt_internal.models.base_response import BaseResponse
|
|
19
18
|
from pmxt_internal.models.cancel_order_request import CancelOrderRequest
|
|
20
19
|
from pmxt_internal.models.create_order200_response import CreateOrder200Response
|
|
@@ -22,7 +21,6 @@ from pmxt_internal.models.create_order_params import CreateOrderParams
|
|
|
22
21
|
from pmxt_internal.models.create_order_request import CreateOrderRequest
|
|
23
22
|
from pmxt_internal.models.error_detail import ErrorDetail
|
|
24
23
|
from pmxt_internal.models.error_response import ErrorResponse
|
|
25
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
26
24
|
from pmxt_internal.models.fetch_balance200_response import FetchBalance200Response
|
|
27
25
|
from pmxt_internal.models.fetch_markets200_response import FetchMarkets200Response
|
|
28
26
|
from pmxt_internal.models.fetch_markets_request import FetchMarketsRequest
|
|
@@ -18,9 +18,8 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
24
23
|
from typing import Optional, Set
|
|
25
24
|
from typing_extensions import Self
|
|
26
25
|
|
|
@@ -29,8 +28,7 @@ class CancelOrderRequest(BaseModel):
|
|
|
29
28
|
CancelOrderRequest
|
|
30
29
|
""" # noqa: E501
|
|
31
30
|
args: Annotated[List[StrictStr], Field(min_length=1, max_length=1)]
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["args", "credentials"]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["args"]
|
|
34
32
|
|
|
35
33
|
model_config = ConfigDict(
|
|
36
34
|
populate_by_name=True,
|
|
@@ -71,9 +69,6 @@ class CancelOrderRequest(BaseModel):
|
|
|
71
69
|
exclude=excluded_fields,
|
|
72
70
|
exclude_none=True,
|
|
73
71
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of credentials
|
|
75
|
-
if self.credentials:
|
|
76
|
-
_dict['credentials'] = self.credentials.to_dict()
|
|
77
72
|
return _dict
|
|
78
73
|
|
|
79
74
|
@classmethod
|
|
@@ -86,8 +81,7 @@ class CancelOrderRequest(BaseModel):
|
|
|
86
81
|
return cls.model_validate(obj)
|
|
87
82
|
|
|
88
83
|
_obj = cls.model_validate({
|
|
89
|
-
"args": obj.get("args")
|
|
90
|
-
"credentials": ExchangeCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None
|
|
84
|
+
"args": obj.get("args")
|
|
91
85
|
})
|
|
92
86
|
return _obj
|
|
93
87
|
|
|
@@ -18,10 +18,9 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from pmxt_internal.models.create_order_params import CreateOrderParams
|
|
24
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
25
24
|
from typing import Optional, Set
|
|
26
25
|
from typing_extensions import Self
|
|
27
26
|
|
|
@@ -30,8 +29,7 @@ class CreateOrderRequest(BaseModel):
|
|
|
30
29
|
CreateOrderRequest
|
|
31
30
|
""" # noqa: E501
|
|
32
31
|
args: Annotated[List[CreateOrderParams], Field(min_length=1, max_length=1)]
|
|
33
|
-
|
|
34
|
-
__properties: ClassVar[List[str]] = ["args", "credentials"]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["args"]
|
|
35
33
|
|
|
36
34
|
model_config = ConfigDict(
|
|
37
35
|
populate_by_name=True,
|
|
@@ -79,9 +77,6 @@ class CreateOrderRequest(BaseModel):
|
|
|
79
77
|
if _item_args:
|
|
80
78
|
_items.append(_item_args.to_dict())
|
|
81
79
|
_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
80
|
return _dict
|
|
86
81
|
|
|
87
82
|
@classmethod
|
|
@@ -94,8 +89,7 @@ class CreateOrderRequest(BaseModel):
|
|
|
94
89
|
return cls.model_validate(obj)
|
|
95
90
|
|
|
96
91
|
_obj = cls.model_validate({
|
|
97
|
-
"args": [CreateOrderParams.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
|
|
92
|
+
"args": [CreateOrderParams.from_dict(_item) for _item in obj["args"]] if obj.get("args") is not None else None
|
|
99
93
|
})
|
|
100
94
|
return _obj
|
|
101
95
|
|
|
@@ -20,7 +20,6 @@ import json
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
24
23
|
from pmxt_internal.models.market_filter_params import MarketFilterParams
|
|
25
24
|
from typing import Optional, Set
|
|
26
25
|
from typing_extensions import Self
|
|
@@ -30,8 +29,7 @@ class FetchMarketsRequest(BaseModel):
|
|
|
30
29
|
FetchMarketsRequest
|
|
31
30
|
""" # noqa: E501
|
|
32
31
|
args: Optional[Annotated[List[MarketFilterParams], Field(max_length=1)]] = None
|
|
33
|
-
|
|
34
|
-
__properties: ClassVar[List[str]] = ["args", "credentials"]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["args"]
|
|
35
33
|
|
|
36
34
|
model_config = ConfigDict(
|
|
37
35
|
populate_by_name=True,
|
|
@@ -79,9 +77,6 @@ class FetchMarketsRequest(BaseModel):
|
|
|
79
77
|
if _item_args:
|
|
80
78
|
_items.append(_item_args.to_dict())
|
|
81
79
|
_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
80
|
return _dict
|
|
86
81
|
|
|
87
82
|
@classmethod
|
|
@@ -94,8 +89,7 @@ class FetchMarketsRequest(BaseModel):
|
|
|
94
89
|
return cls.model_validate(obj)
|
|
95
90
|
|
|
96
91
|
_obj = cls.model_validate({
|
|
97
|
-
"args": [MarketFilterParams.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
|
|
92
|
+
"args": [MarketFilterParams.from_dict(_item) for _item in obj["args"]] if obj.get("args") is not None else None
|
|
99
93
|
})
|
|
100
94
|
return _obj
|
|
101
95
|
|
|
@@ -18,9 +18,8 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
24
23
|
from pmxt_internal.models.fetch_ohlcv_request_args_inner import FetchOHLCVRequestArgsInner
|
|
25
24
|
from typing import Optional, Set
|
|
26
25
|
from typing_extensions import Self
|
|
@@ -30,8 +29,7 @@ class FetchOHLCVRequest(BaseModel):
|
|
|
30
29
|
FetchOHLCVRequest
|
|
31
30
|
""" # noqa: E501
|
|
32
31
|
args: Annotated[List[FetchOHLCVRequestArgsInner], Field(min_length=2, max_length=2)] = Field(description="[id, params]")
|
|
33
|
-
|
|
34
|
-
__properties: ClassVar[List[str]] = ["args", "credentials"]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["args"]
|
|
35
33
|
|
|
36
34
|
model_config = ConfigDict(
|
|
37
35
|
populate_by_name=True,
|
|
@@ -79,9 +77,6 @@ class FetchOHLCVRequest(BaseModel):
|
|
|
79
77
|
if _item_args:
|
|
80
78
|
_items.append(_item_args.to_dict())
|
|
81
79
|
_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
80
|
return _dict
|
|
86
81
|
|
|
87
82
|
@classmethod
|
|
@@ -94,8 +89,7 @@ class FetchOHLCVRequest(BaseModel):
|
|
|
94
89
|
return cls.model_validate(obj)
|
|
95
90
|
|
|
96
91
|
_obj = cls.model_validate({
|
|
97
|
-
"args": [FetchOHLCVRequestArgsInner.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
|
|
92
|
+
"args": [FetchOHLCVRequestArgsInner.from_dict(_item) for _item in obj["args"]] if obj.get("args") is not None else None
|
|
99
93
|
})
|
|
100
94
|
return _obj
|
|
101
95
|
|
|
@@ -20,7 +20,6 @@ import json
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
24
23
|
from typing import Optional, Set
|
|
25
24
|
from typing_extensions import Self
|
|
26
25
|
|
|
@@ -29,8 +28,7 @@ class FetchOpenOrdersRequest(BaseModel):
|
|
|
29
28
|
FetchOpenOrdersRequest
|
|
30
29
|
""" # noqa: E501
|
|
31
30
|
args: Optional[Annotated[List[StrictStr], Field(max_length=1)]] = None
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["args", "credentials"]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["args"]
|
|
34
32
|
|
|
35
33
|
model_config = ConfigDict(
|
|
36
34
|
populate_by_name=True,
|
|
@@ -71,9 +69,6 @@ class FetchOpenOrdersRequest(BaseModel):
|
|
|
71
69
|
exclude=excluded_fields,
|
|
72
70
|
exclude_none=True,
|
|
73
71
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of credentials
|
|
75
|
-
if self.credentials:
|
|
76
|
-
_dict['credentials'] = self.credentials.to_dict()
|
|
77
72
|
return _dict
|
|
78
73
|
|
|
79
74
|
@classmethod
|
|
@@ -86,8 +81,7 @@ class FetchOpenOrdersRequest(BaseModel):
|
|
|
86
81
|
return cls.model_validate(obj)
|
|
87
82
|
|
|
88
83
|
_obj = cls.model_validate({
|
|
89
|
-
"args": obj.get("args")
|
|
90
|
-
"credentials": ExchangeCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None
|
|
84
|
+
"args": obj.get("args")
|
|
91
85
|
})
|
|
92
86
|
return _obj
|
|
93
87
|
|
|
@@ -18,9 +18,8 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
24
23
|
from typing import Optional, Set
|
|
25
24
|
from typing_extensions import Self
|
|
26
25
|
|
|
@@ -29,8 +28,7 @@ class FetchOrderBookRequest(BaseModel):
|
|
|
29
28
|
FetchOrderBookRequest
|
|
30
29
|
""" # noqa: E501
|
|
31
30
|
args: Annotated[List[StrictStr], Field(min_length=1, max_length=1)]
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["args", "credentials"]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["args"]
|
|
34
32
|
|
|
35
33
|
model_config = ConfigDict(
|
|
36
34
|
populate_by_name=True,
|
|
@@ -71,9 +69,6 @@ class FetchOrderBookRequest(BaseModel):
|
|
|
71
69
|
exclude=excluded_fields,
|
|
72
70
|
exclude_none=True,
|
|
73
71
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of credentials
|
|
75
|
-
if self.credentials:
|
|
76
|
-
_dict['credentials'] = self.credentials.to_dict()
|
|
77
72
|
return _dict
|
|
78
73
|
|
|
79
74
|
@classmethod
|
|
@@ -86,8 +81,7 @@ class FetchOrderBookRequest(BaseModel):
|
|
|
86
81
|
return cls.model_validate(obj)
|
|
87
82
|
|
|
88
83
|
_obj = cls.model_validate({
|
|
89
|
-
"args": obj.get("args")
|
|
90
|
-
"credentials": ExchangeCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None
|
|
84
|
+
"args": obj.get("args")
|
|
91
85
|
})
|
|
92
86
|
return _obj
|
|
93
87
|
|
|
@@ -20,7 +20,6 @@ import json
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
24
23
|
from typing import Optional, Set
|
|
25
24
|
from typing_extensions import Self
|
|
26
25
|
|
|
@@ -29,8 +28,7 @@ class FetchPositionsRequest(BaseModel):
|
|
|
29
28
|
FetchPositionsRequest
|
|
30
29
|
""" # noqa: E501
|
|
31
30
|
args: Optional[Annotated[List[Any], Field(max_length=0)]] = Field(default=None, description="Empty array (no arguments)")
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["args", "credentials"]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["args"]
|
|
34
32
|
|
|
35
33
|
model_config = ConfigDict(
|
|
36
34
|
populate_by_name=True,
|
|
@@ -71,9 +69,6 @@ class FetchPositionsRequest(BaseModel):
|
|
|
71
69
|
exclude=excluded_fields,
|
|
72
70
|
exclude_none=True,
|
|
73
71
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of credentials
|
|
75
|
-
if self.credentials:
|
|
76
|
-
_dict['credentials'] = self.credentials.to_dict()
|
|
77
72
|
return _dict
|
|
78
73
|
|
|
79
74
|
@classmethod
|
|
@@ -86,8 +81,7 @@ class FetchPositionsRequest(BaseModel):
|
|
|
86
81
|
return cls.model_validate(obj)
|
|
87
82
|
|
|
88
83
|
_obj = cls.model_validate({
|
|
89
|
-
"args": obj.get("args")
|
|
90
|
-
"credentials": ExchangeCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None
|
|
84
|
+
"args": obj.get("args")
|
|
91
85
|
})
|
|
92
86
|
return _obj
|
|
93
87
|
|
|
@@ -18,9 +18,8 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
24
23
|
from pmxt_internal.models.fetch_ohlcv_request_args_inner import FetchOHLCVRequestArgsInner
|
|
25
24
|
from typing import Optional, Set
|
|
26
25
|
from typing_extensions import Self
|
|
@@ -30,8 +29,7 @@ class FetchTradesRequest(BaseModel):
|
|
|
30
29
|
FetchTradesRequest
|
|
31
30
|
""" # noqa: E501
|
|
32
31
|
args: Annotated[List[FetchOHLCVRequestArgsInner], Field(min_length=2, max_length=2)] = Field(description="[id, params]")
|
|
33
|
-
|
|
34
|
-
__properties: ClassVar[List[str]] = ["args", "credentials"]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["args"]
|
|
35
33
|
|
|
36
34
|
model_config = ConfigDict(
|
|
37
35
|
populate_by_name=True,
|
|
@@ -79,9 +77,6 @@ class FetchTradesRequest(BaseModel):
|
|
|
79
77
|
if _item_args:
|
|
80
78
|
_items.append(_item_args.to_dict())
|
|
81
79
|
_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
80
|
return _dict
|
|
86
81
|
|
|
87
82
|
@classmethod
|
|
@@ -94,8 +89,7 @@ class FetchTradesRequest(BaseModel):
|
|
|
94
89
|
return cls.model_validate(obj)
|
|
95
90
|
|
|
96
91
|
_obj = cls.model_validate({
|
|
97
|
-
"args": [FetchOHLCVRequestArgsInner.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
|
|
92
|
+
"args": [FetchOHLCVRequestArgsInner.from_dict(_item) for _item in obj["args"]] if obj.get("args") is not None else None
|
|
99
93
|
})
|
|
100
94
|
return _obj
|
|
101
95
|
|
|
@@ -18,9 +18,8 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
24
23
|
from typing import Optional, Set
|
|
25
24
|
from typing_extensions import Self
|
|
26
25
|
|
|
@@ -29,8 +28,7 @@ class GetMarketsBySlugRequest(BaseModel):
|
|
|
29
28
|
GetMarketsBySlugRequest
|
|
30
29
|
""" # noqa: E501
|
|
31
30
|
args: Annotated[List[StrictStr], Field(min_length=1, max_length=1)]
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["args", "credentials"]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["args"]
|
|
34
32
|
|
|
35
33
|
model_config = ConfigDict(
|
|
36
34
|
populate_by_name=True,
|
|
@@ -71,9 +69,6 @@ class GetMarketsBySlugRequest(BaseModel):
|
|
|
71
69
|
exclude=excluded_fields,
|
|
72
70
|
exclude_none=True,
|
|
73
71
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of credentials
|
|
75
|
-
if self.credentials:
|
|
76
|
-
_dict['credentials'] = self.credentials.to_dict()
|
|
77
72
|
return _dict
|
|
78
73
|
|
|
79
74
|
@classmethod
|
|
@@ -86,8 +81,7 @@ class GetMarketsBySlugRequest(BaseModel):
|
|
|
86
81
|
return cls.model_validate(obj)
|
|
87
82
|
|
|
88
83
|
_obj = cls.model_validate({
|
|
89
|
-
"args": obj.get("args")
|
|
90
|
-
"credentials": ExchangeCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None
|
|
84
|
+
"args": obj.get("args")
|
|
91
85
|
})
|
|
92
86
|
return _obj
|
|
93
87
|
|
|
@@ -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, 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,9 +29,7 @@ class MarketOutcome(BaseModel):
|
|
|
29
29
|
id: Optional[StrictStr] = None
|
|
30
30
|
label: Optional[StrictStr] = None
|
|
31
31
|
price: Optional[Union[StrictFloat, StrictInt]] = None
|
|
32
|
-
|
|
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"]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["id", "label", "price"]
|
|
35
33
|
|
|
36
34
|
model_config = ConfigDict(
|
|
37
35
|
populate_by_name=True,
|
|
@@ -86,9 +84,7 @@ class MarketOutcome(BaseModel):
|
|
|
86
84
|
_obj = cls.model_validate({
|
|
87
85
|
"id": obj.get("id"),
|
|
88
86
|
"label": obj.get("label"),
|
|
89
|
-
"price": obj.get("price")
|
|
90
|
-
"priceChange24h": obj.get("priceChange24h"),
|
|
91
|
-
"metadata": obj.get("metadata")
|
|
87
|
+
"price": obj.get("price")
|
|
92
88
|
})
|
|
93
89
|
return _obj
|
|
94
90
|
|
|
@@ -37,8 +37,7 @@ 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
|
-
|
|
41
|
-
__properties: ClassVar[List[str]] = ["id", "marketId", "outcomeId", "side", "type", "price", "amount", "status", "filled", "remaining", "timestamp", "fee"]
|
|
40
|
+
__properties: ClassVar[List[str]] = ["id", "marketId", "outcomeId", "side", "type", "price", "amount", "status", "filled", "remaining", "timestamp"]
|
|
42
41
|
|
|
43
42
|
@field_validator('side')
|
|
44
43
|
def side_validate_enum(cls, value):
|
|
@@ -60,16 +59,6 @@ class Order(BaseModel):
|
|
|
60
59
|
raise ValueError("must be one of enum values ('limit', 'market')")
|
|
61
60
|
return value
|
|
62
61
|
|
|
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
|
-
|
|
73
62
|
model_config = ConfigDict(
|
|
74
63
|
populate_by_name=True,
|
|
75
64
|
validate_assignment=True,
|
|
@@ -131,8 +120,7 @@ class Order(BaseModel):
|
|
|
131
120
|
"status": obj.get("status"),
|
|
132
121
|
"filled": obj.get("filled"),
|
|
133
122
|
"remaining": obj.get("remaining"),
|
|
134
|
-
"timestamp": obj.get("timestamp")
|
|
135
|
-
"fee": obj.get("fee")
|
|
123
|
+
"timestamp": obj.get("timestamp")
|
|
136
124
|
})
|
|
137
125
|
return _obj
|
|
138
126
|
|
|
@@ -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
|
|
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,8 +29,7 @@ class OrderBook(BaseModel):
|
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
bids: Optional[List[OrderLevel]] = None
|
|
31
31
|
asks: Optional[List[OrderLevel]] = None
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["bids", "asks", "timestamp"]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["bids", "asks"]
|
|
34
33
|
|
|
35
34
|
model_config = ConfigDict(
|
|
36
35
|
populate_by_name=True,
|
|
@@ -98,8 +97,7 @@ class OrderBook(BaseModel):
|
|
|
98
97
|
|
|
99
98
|
_obj = cls.model_validate({
|
|
100
99
|
"bids": [OrderLevel.from_dict(_item) for _item in obj["bids"]] if obj.get("bids") 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")
|
|
100
|
+
"asks": [OrderLevel.from_dict(_item) for _item in obj["asks"]] if obj.get("asks") is not None else None
|
|
103
101
|
})
|
|
104
102
|
return _obj
|
|
105
103
|
|
|
@@ -18,9 +18,8 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
24
23
|
from pmxt_internal.models.search_markets_request_args_inner import SearchMarketsRequestArgsInner
|
|
25
24
|
from typing import Optional, Set
|
|
26
25
|
from typing_extensions import Self
|
|
@@ -30,8 +29,7 @@ class SearchMarketsRequest(BaseModel):
|
|
|
30
29
|
SearchMarketsRequest
|
|
31
30
|
""" # noqa: E501
|
|
32
31
|
args: Annotated[List[SearchMarketsRequestArgsInner], Field(min_length=1, max_length=2)] = Field(description="[query, params?]")
|
|
33
|
-
|
|
34
|
-
__properties: ClassVar[List[str]] = ["args", "credentials"]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["args"]
|
|
35
33
|
|
|
36
34
|
model_config = ConfigDict(
|
|
37
35
|
populate_by_name=True,
|
|
@@ -79,9 +77,6 @@ class SearchMarketsRequest(BaseModel):
|
|
|
79
77
|
if _item_args:
|
|
80
78
|
_items.append(_item_args.to_dict())
|
|
81
79
|
_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
80
|
return _dict
|
|
86
81
|
|
|
87
82
|
@classmethod
|
|
@@ -94,8 +89,7 @@ class SearchMarketsRequest(BaseModel):
|
|
|
94
89
|
return cls.model_validate(obj)
|
|
95
90
|
|
|
96
91
|
_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
|
|
92
|
+
"args": [SearchMarketsRequestArgsInner.from_dict(_item) for _item in obj["args"]] if obj.get("args") is not None else None
|
|
99
93
|
})
|
|
100
94
|
return _obj
|
|
101
95
|
|
|
@@ -17,8 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
|
|
22
21
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
22
|
from pmxt_internal.models.market_outcome import MarketOutcome
|
|
24
23
|
from typing import Optional, Set
|
|
@@ -30,18 +29,11 @@ class UnifiedMarket(BaseModel):
|
|
|
30
29
|
""" # noqa: E501
|
|
31
30
|
id: Optional[StrictStr] = None
|
|
32
31
|
title: Optional[StrictStr] = None
|
|
33
|
-
description: Optional[StrictStr] = None
|
|
34
32
|
outcomes: Optional[List[MarketOutcome]] = None
|
|
35
|
-
resolution_date: Optional[datetime] = Field(default=None, alias="resolutionDate")
|
|
36
33
|
volume24h: Optional[Union[StrictFloat, StrictInt]] = None
|
|
37
|
-
volume: Optional[Union[StrictFloat, StrictInt]] = None
|
|
38
34
|
liquidity: Optional[Union[StrictFloat, StrictInt]] = None
|
|
39
|
-
open_interest: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="openInterest")
|
|
40
35
|
url: Optional[StrictStr] = None
|
|
41
|
-
|
|
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"]
|
|
36
|
+
__properties: ClassVar[List[str]] = ["id", "title", "outcomes", "volume24h", "liquidity", "url"]
|
|
45
37
|
|
|
46
38
|
model_config = ConfigDict(
|
|
47
39
|
populate_by_name=True,
|
|
@@ -103,17 +95,10 @@ class UnifiedMarket(BaseModel):
|
|
|
103
95
|
_obj = cls.model_validate({
|
|
104
96
|
"id": obj.get("id"),
|
|
105
97
|
"title": obj.get("title"),
|
|
106
|
-
"description": obj.get("description"),
|
|
107
98
|
"outcomes": [MarketOutcome.from_dict(_item) for _item in obj["outcomes"]] if obj.get("outcomes") is not None else None,
|
|
108
|
-
"resolutionDate": obj.get("resolutionDate"),
|
|
109
99
|
"volume24h": obj.get("volume24h"),
|
|
110
|
-
"volume": obj.get("volume"),
|
|
111
100
|
"liquidity": obj.get("liquidity"),
|
|
112
|
-
"
|
|
113
|
-
"url": obj.get("url"),
|
|
114
|
-
"image": obj.get("image"),
|
|
115
|
-
"category": obj.get("category"),
|
|
116
|
-
"tags": obj.get("tags")
|
|
101
|
+
"url": obj.get("url")
|
|
117
102
|
})
|
|
118
103
|
return _obj
|
|
119
104
|
|
|
@@ -201,18 +201,6 @@ class Exchange(ABC):
|
|
|
201
201
|
raise Exception(error.get("message", "Unknown error"))
|
|
202
202
|
return response.get("data")
|
|
203
203
|
|
|
204
|
-
def _get_credentials_dict(self) -> Optional[Dict[str, Any]]:
|
|
205
|
-
"""Build credentials dictionary for API requests."""
|
|
206
|
-
if not self.api_key and not self.private_key:
|
|
207
|
-
return None
|
|
208
|
-
|
|
209
|
-
creds = {}
|
|
210
|
-
if self.api_key:
|
|
211
|
-
creds["apiKey"] = self.api_key
|
|
212
|
-
if self.private_key:
|
|
213
|
-
creds["privateKey"] = self.private_key
|
|
214
|
-
return creds if creds else None
|
|
215
|
-
|
|
216
204
|
# Market Data Methods
|
|
217
205
|
|
|
218
206
|
def fetch_markets(self, params: Optional[MarketFilterParams] = None) -> List[UnifiedMarket]:
|
|
@@ -233,11 +221,6 @@ class Exchange(ABC):
|
|
|
233
221
|
if params:
|
|
234
222
|
body_dict["args"] = [params.__dict__]
|
|
235
223
|
|
|
236
|
-
# Add credentials if available
|
|
237
|
-
creds = self._get_credentials_dict()
|
|
238
|
-
if creds:
|
|
239
|
-
body_dict["credentials"] = creds
|
|
240
|
-
|
|
241
224
|
request_body = internal_models.FetchMarketsRequest.from_dict(body_dict)
|
|
242
225
|
|
|
243
226
|
response = self._api.fetch_markets(
|
|
@@ -464,12 +447,6 @@ class Exchange(ABC):
|
|
|
464
447
|
params_dict["price"] = params.price
|
|
465
448
|
|
|
466
449
|
request_body_dict = {"args": [params_dict]}
|
|
467
|
-
|
|
468
|
-
# Add credentials if available
|
|
469
|
-
creds = self._get_credentials_dict()
|
|
470
|
-
if creds:
|
|
471
|
-
request_body_dict["credentials"] = creds
|
|
472
|
-
|
|
473
450
|
request_body = internal_models.CreateOrderRequest.from_dict(request_body_dict)
|
|
474
451
|
|
|
475
452
|
response = self._api.create_order(
|
|
@@ -494,12 +471,6 @@ class Exchange(ABC):
|
|
|
494
471
|
"""
|
|
495
472
|
try:
|
|
496
473
|
body_dict = {"args": [order_id]}
|
|
497
|
-
|
|
498
|
-
# Add credentials if available
|
|
499
|
-
creds = self._get_credentials_dict()
|
|
500
|
-
if creds:
|
|
501
|
-
body_dict["credentials"] = creds
|
|
502
|
-
|
|
503
474
|
request_body = internal_models.CancelOrderRequest.from_dict(body_dict)
|
|
504
475
|
|
|
505
476
|
response = self._api.cancel_order(
|
|
@@ -524,12 +495,6 @@ class Exchange(ABC):
|
|
|
524
495
|
"""
|
|
525
496
|
try:
|
|
526
497
|
body_dict = {"args": [order_id]}
|
|
527
|
-
|
|
528
|
-
# Add credentials if available
|
|
529
|
-
creds = self._get_credentials_dict()
|
|
530
|
-
if creds:
|
|
531
|
-
body_dict["credentials"] = creds
|
|
532
|
-
|
|
533
498
|
request_body = internal_models.FetchOrderRequest.from_dict(body_dict)
|
|
534
499
|
|
|
535
500
|
response = self._api.fetch_order(
|
|
@@ -558,12 +523,6 @@ class Exchange(ABC):
|
|
|
558
523
|
args.append(market_id)
|
|
559
524
|
|
|
560
525
|
body_dict = {"args": args}
|
|
561
|
-
|
|
562
|
-
# Add credentials if available
|
|
563
|
-
creds = self._get_credentials_dict()
|
|
564
|
-
if creds:
|
|
565
|
-
body_dict["credentials"] = creds
|
|
566
|
-
|
|
567
526
|
request_body = internal_models.FetchOpenOrdersRequest.from_dict(body_dict)
|
|
568
527
|
|
|
569
528
|
response = self._api.fetch_open_orders(
|
|
@@ -587,12 +546,6 @@ class Exchange(ABC):
|
|
|
587
546
|
"""
|
|
588
547
|
try:
|
|
589
548
|
body_dict = {"args": []}
|
|
590
|
-
|
|
591
|
-
# Add credentials if available
|
|
592
|
-
creds = self._get_credentials_dict()
|
|
593
|
-
if creds:
|
|
594
|
-
body_dict["credentials"] = creds
|
|
595
|
-
|
|
596
549
|
request_body = internal_models.FetchPositionsRequest.from_dict(body_dict)
|
|
597
550
|
|
|
598
551
|
response = self._api.fetch_positions(
|
|
@@ -614,12 +567,6 @@ class Exchange(ABC):
|
|
|
614
567
|
"""
|
|
615
568
|
try:
|
|
616
569
|
body_dict = {"args": []}
|
|
617
|
-
|
|
618
|
-
# Add credentials if available
|
|
619
|
-
creds = self._get_credentials_dict()
|
|
620
|
-
if creds:
|
|
621
|
-
body_dict["credentials"] = creds
|
|
622
|
-
|
|
623
570
|
# Note: Generator name for this request might be reused from FetchPositionsRequest
|
|
624
571
|
# if the schemas are identical (empty args array)
|
|
625
572
|
request_body = internal_models.FetchPositionsRequest.from_dict(body_dict)
|
|
@@ -11,7 +11,6 @@ generated/pmxt_internal/api/__init__.py
|
|
|
11
11
|
generated/pmxt_internal/api/default_api.py
|
|
12
12
|
generated/pmxt_internal/models/__init__.py
|
|
13
13
|
generated/pmxt_internal/models/balance.py
|
|
14
|
-
generated/pmxt_internal/models/base_request.py
|
|
15
14
|
generated/pmxt_internal/models/base_response.py
|
|
16
15
|
generated/pmxt_internal/models/cancel_order_request.py
|
|
17
16
|
generated/pmxt_internal/models/create_order200_response.py
|
|
@@ -19,7 +18,6 @@ generated/pmxt_internal/models/create_order_params.py
|
|
|
19
18
|
generated/pmxt_internal/models/create_order_request.py
|
|
20
19
|
generated/pmxt_internal/models/error_detail.py
|
|
21
20
|
generated/pmxt_internal/models/error_response.py
|
|
22
|
-
generated/pmxt_internal/models/exchange_credentials.py
|
|
23
21
|
generated/pmxt_internal/models/fetch_balance200_response.py
|
|
24
22
|
generated/pmxt_internal/models/fetch_markets200_response.py
|
|
25
23
|
generated/pmxt_internal/models/fetch_markets_request.py
|
|
@@ -1,91 +0,0 @@
|
|
|
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
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from pmxt_internal.models.exchange_credentials import ExchangeCredentials
|
|
23
|
-
from typing import Optional, Set
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
class BaseRequest(BaseModel):
|
|
27
|
-
"""
|
|
28
|
-
Base request structure with optional credentials
|
|
29
|
-
""" # noqa: E501
|
|
30
|
-
credentials: Optional[ExchangeCredentials] = None
|
|
31
|
-
__properties: ClassVar[List[str]] = ["credentials"]
|
|
32
|
-
|
|
33
|
-
model_config = ConfigDict(
|
|
34
|
-
populate_by_name=True,
|
|
35
|
-
validate_assignment=True,
|
|
36
|
-
protected_namespaces=(),
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def to_str(self) -> str:
|
|
41
|
-
"""Returns the string representation of the model using alias"""
|
|
42
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
-
|
|
44
|
-
def to_json(self) -> str:
|
|
45
|
-
"""Returns the JSON representation of the model using alias"""
|
|
46
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
-
return json.dumps(self.to_dict())
|
|
48
|
-
|
|
49
|
-
@classmethod
|
|
50
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
-
"""Create an instance of BaseRequest from a JSON string"""
|
|
52
|
-
return cls.from_dict(json.loads(json_str))
|
|
53
|
-
|
|
54
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
-
"""Return the dictionary representation of the model using alias.
|
|
56
|
-
|
|
57
|
-
This has the following differences from calling pydantic's
|
|
58
|
-
`self.model_dump(by_alias=True)`:
|
|
59
|
-
|
|
60
|
-
* `None` is only added to the output dict for nullable fields that
|
|
61
|
-
were set at model initialization. Other fields with value `None`
|
|
62
|
-
are ignored.
|
|
63
|
-
"""
|
|
64
|
-
excluded_fields: Set[str] = set([
|
|
65
|
-
])
|
|
66
|
-
|
|
67
|
-
_dict = self.model_dump(
|
|
68
|
-
by_alias=True,
|
|
69
|
-
exclude=excluded_fields,
|
|
70
|
-
exclude_none=True,
|
|
71
|
-
)
|
|
72
|
-
# override the default output from pydantic by calling `to_dict()` of credentials
|
|
73
|
-
if self.credentials:
|
|
74
|
-
_dict['credentials'] = self.credentials.to_dict()
|
|
75
|
-
return _dict
|
|
76
|
-
|
|
77
|
-
@classmethod
|
|
78
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
-
"""Create an instance of BaseRequest from a dict"""
|
|
80
|
-
if obj is None:
|
|
81
|
-
return None
|
|
82
|
-
|
|
83
|
-
if not isinstance(obj, dict):
|
|
84
|
-
return cls.model_validate(obj)
|
|
85
|
-
|
|
86
|
-
_obj = cls.model_validate({
|
|
87
|
-
"credentials": ExchangeCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None
|
|
88
|
-
})
|
|
89
|
-
return _obj
|
|
90
|
-
|
|
91
|
-
|
|
@@ -1,93 +0,0 @@
|
|
|
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, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class ExchangeCredentials(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
Optional authentication credentials for exchange operations
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
api_key: Optional[StrictStr] = Field(default=None, description="API key for the exchange", alias="apiKey")
|
|
30
|
-
private_key: Optional[StrictStr] = Field(default=None, description="Private key for signing transactions", alias="privateKey")
|
|
31
|
-
api_secret: Optional[StrictStr] = Field(default=None, description="API secret (if required by exchange)", alias="apiSecret")
|
|
32
|
-
passphrase: Optional[StrictStr] = Field(default=None, description="Passphrase (if required by exchange)")
|
|
33
|
-
__properties: ClassVar[List[str]] = ["apiKey", "privateKey", "apiSecret", "passphrase"]
|
|
34
|
-
|
|
35
|
-
model_config = ConfigDict(
|
|
36
|
-
populate_by_name=True,
|
|
37
|
-
validate_assignment=True,
|
|
38
|
-
protected_namespaces=(),
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
def to_str(self) -> str:
|
|
43
|
-
"""Returns the string representation of the model using alias"""
|
|
44
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
-
|
|
46
|
-
def to_json(self) -> str:
|
|
47
|
-
"""Returns the JSON representation of the model using alias"""
|
|
48
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
-
return json.dumps(self.to_dict())
|
|
50
|
-
|
|
51
|
-
@classmethod
|
|
52
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
-
"""Create an instance of ExchangeCredentials from a JSON string"""
|
|
54
|
-
return cls.from_dict(json.loads(json_str))
|
|
55
|
-
|
|
56
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
-
"""Return the dictionary representation of the model using alias.
|
|
58
|
-
|
|
59
|
-
This has the following differences from calling pydantic's
|
|
60
|
-
`self.model_dump(by_alias=True)`:
|
|
61
|
-
|
|
62
|
-
* `None` is only added to the output dict for nullable fields that
|
|
63
|
-
were set at model initialization. Other fields with value `None`
|
|
64
|
-
are ignored.
|
|
65
|
-
"""
|
|
66
|
-
excluded_fields: Set[str] = set([
|
|
67
|
-
])
|
|
68
|
-
|
|
69
|
-
_dict = self.model_dump(
|
|
70
|
-
by_alias=True,
|
|
71
|
-
exclude=excluded_fields,
|
|
72
|
-
exclude_none=True,
|
|
73
|
-
)
|
|
74
|
-
return _dict
|
|
75
|
-
|
|
76
|
-
@classmethod
|
|
77
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
-
"""Create an instance of ExchangeCredentials from a dict"""
|
|
79
|
-
if obj is None:
|
|
80
|
-
return None
|
|
81
|
-
|
|
82
|
-
if not isinstance(obj, dict):
|
|
83
|
-
return cls.model_validate(obj)
|
|
84
|
-
|
|
85
|
-
_obj = cls.model_validate({
|
|
86
|
-
"apiKey": obj.get("apiKey"),
|
|
87
|
-
"privateKey": obj.get("privateKey"),
|
|
88
|
-
"apiSecret": obj.get("apiSecret"),
|
|
89
|
-
"passphrase": obj.get("passphrase")
|
|
90
|
-
})
|
|
91
|
-
return _obj
|
|
92
|
-
|
|
93
|
-
|
|
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.0 → pmxt-1.0.0b2}/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
|
{pmxt-1.0.0 → pmxt-1.0.0b2}/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
|