polymarket-apis 0.3.0__py3-none-any.whl → 0.3.9__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.

Potentially problematic release.


This version of polymarket-apis might be problematic. Click here for more details.

Files changed (32) hide show
  1. polymarket_apis/__init__.py +42 -0
  2. polymarket_apis/clients/__init__.py +23 -0
  3. polymarket_apis/clients/clob_client.py +224 -117
  4. polymarket_apis/clients/data_client.py +220 -67
  5. polymarket_apis/clients/gamma_client.py +589 -101
  6. polymarket_apis/clients/graphql_client.py +28 -11
  7. polymarket_apis/clients/web3_client.py +538 -131
  8. polymarket_apis/clients/websockets_client.py +24 -7
  9. polymarket_apis/types/__init__.py +167 -0
  10. polymarket_apis/types/clob_types.py +35 -14
  11. polymarket_apis/types/common.py +105 -35
  12. polymarket_apis/types/data_types.py +48 -3
  13. polymarket_apis/types/gamma_types.py +529 -257
  14. polymarket_apis/types/web3_types.py +45 -0
  15. polymarket_apis/types/websockets_types.py +92 -41
  16. polymarket_apis/utilities/config.py +1 -0
  17. polymarket_apis/utilities/constants.py +5 -4
  18. polymarket_apis/utilities/exceptions.py +9 -0
  19. polymarket_apis/utilities/order_builder/builder.py +38 -22
  20. polymarket_apis/utilities/order_builder/helpers.py +0 -1
  21. polymarket_apis/utilities/signing/hmac.py +5 -1
  22. polymarket_apis/utilities/signing/signer.py +2 -2
  23. polymarket_apis/utilities/web3/abis/Safe.json +1138 -0
  24. polymarket_apis/utilities/web3/abis/SafeProxyFactory.json +224 -0
  25. polymarket_apis/utilities/web3/abis/custom_contract_errors.py +1 -1
  26. polymarket_apis/utilities/web3/helpers.py +235 -0
  27. {polymarket_apis-0.3.0.dist-info → polymarket_apis-0.3.9.dist-info}/METADATA +48 -8
  28. polymarket_apis-0.3.9.dist-info/RECORD +44 -0
  29. polymarket_apis/utilities/schemas/activity-subgraph.graphql +0 -86
  30. polymarket_apis/utilities/schemas/open-interest.graphql +0 -30
  31. polymarket_apis-0.3.0.dist-info/RECORD +0 -43
  32. {polymarket_apis-0.3.0.dist-info → polymarket_apis-0.3.9.dist-info}/WHEEL +0 -0
@@ -5,7 +5,13 @@ from gql.transport.httpx import HTTPXAsyncTransport, HTTPXTransport
5
5
 
6
6
  from ..utilities.config import GRAPHQL_ENDPOINTS
7
7
 
8
- EndpointName = Literal[
8
+
9
+ class PolymarketGraphQLClient:
10
+ """Synchronous GraphQL client for Polymarket subgraphs."""
11
+
12
+ def __init__(
13
+ self,
14
+ endpoint_name: Literal[
9
15
  "activity_subgraph",
10
16
  "fpmm_subgraph",
11
17
  "open_interest_subgraph",
@@ -14,16 +20,13 @@ EndpointName = Literal[
14
20
  "positions_subgraph",
15
21
  "sports_oracle_subgraph",
16
22
  "wallet_subgraph",
17
- ]
18
-
19
-
20
- class PolymarketGraphQLClient:
21
- """Synchronous GraphQL client for Polymarket subgraphs."""
22
-
23
- def __init__(self, endpoint_name: EndpointName) -> None:
23
+ ],
24
+ ) -> None:
24
25
  endpoint_url = GRAPHQL_ENDPOINTS[endpoint_name]
25
26
  self.transport = HTTPXTransport(url=endpoint_url)
26
- self.client = Client(transport=self.transport, fetch_schema_from_transport=False)
27
+ self.client = Client(
28
+ transport=self.transport, fetch_schema_from_transport=False
29
+ )
27
30
 
28
31
  def query(self, query_string: str) -> dict:
29
32
  with self.client as session:
@@ -33,10 +36,24 @@ class PolymarketGraphQLClient:
33
36
  class AsyncPolymarketGraphQLClient:
34
37
  """Asynchronous GraphQL client for Polymarket subgraphs."""
35
38
 
36
- def __init__(self, endpoint_name: EndpointName) -> None:
39
+ def __init__(
40
+ self,
41
+ endpoint_name: Literal[
42
+ "activity_subgraph",
43
+ "fpmm_subgraph",
44
+ "open_interest_subgraph",
45
+ "orderbook_subgraph",
46
+ "pnl_subgraph",
47
+ "positions_subgraph",
48
+ "sports_oracle_subgraph",
49
+ "wallet_subgraph",
50
+ ],
51
+ ) -> None:
37
52
  endpoint_url = GRAPHQL_ENDPOINTS[endpoint_name]
38
53
  self.transport = HTTPXAsyncTransport(url=endpoint_url)
39
- self.client = Client(transport=self.transport, fetch_schema_from_transport=False)
54
+ self.client = Client(
55
+ transport=self.transport, fetch_schema_from_transport=False
56
+ )
40
57
 
41
58
  async def query(self, query_string: str) -> dict:
42
59
  async with self.client as session: