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

@@ -5,6 +5,7 @@ from pydantic import AliasChoices, BaseModel, Field, field_validator
5
5
 
6
6
  from ..types.clob_types import MakerOrder, OrderBookSummary, TickSize
7
7
  from ..types.common import EthAddress, Keccak256, TimeseriesPoint
8
+ from ..types.gamma_types import Comment, Reaction
8
9
 
9
10
  # wss://ws-subscriptions-clob.polymarket.com/ws/market types
10
11
 
@@ -151,35 +152,6 @@ class ActivityTrade(BaseModel):
151
152
  profile_image_optimized: Optional[str] = Field(None, alias="profileImageOptimized")
152
153
 
153
154
 
154
- class Comment(BaseModel):
155
- id: str # Unique identifier of comment
156
- body: str # Content of the comment
157
- parent_entity_type: str = Field(
158
- alias="parentEntityType"
159
- ) # Type of the parent entity (Event or Series)
160
- parent_entity_id: int = Field(alias="parentEntityID") # ID of the parent entity
161
- parent_comment_id: Optional[str] = Field(
162
- None, alias="parentCommentID"
163
- ) # ID of the parent comment
164
- user_address: str = Field(alias="userAddress") # Address of the user
165
- reply_address: Optional[str] = Field(
166
- None, alias="replyAddress"
167
- ) # Address of the reply user
168
- created_at: datetime = Field(alias="createdAt") # Creation timestamp
169
- updated_at: Optional[datetime] = Field(
170
- None, alias="updatedAt"
171
- ) # Last update timestamp
172
-
173
-
174
- class Reaction(BaseModel):
175
- id: str # Unique identifier of reaction
176
- comment_id: int = Field(alias="commentID") # ID of the comment
177
- reaction_type: str = Field(alias="reactionType") # Type of the reaction
178
- icon: Optional[str] = None # Icon representing the reaction
179
- user_address: str = Field(alias="userAddress") # Address of the user
180
- created_at: datetime = Field(alias="createdAt") # Creation timestamp
181
-
182
-
183
155
  class Request(BaseModel):
184
156
  request_id: str = Field(alias="requestId") # Unique identifier for the request
185
157
  proxy_address: str = Field(alias="proxyAddress") # Proxy address
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polymarket-apis
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Unified Polymarket APIs with Pydantic data validation - Clob, Gamma, Data, Web3, Websockets, GraphQL clients.
5
5
  Author-email: Razvan Gheorghe <razvan@gheorghe.me>
6
6
  Requires-Python: >=3.12
@@ -94,15 +94,36 @@ flowchart LR
94
94
  ### PolymarketGammaClient - Market/Event related operations
95
95
  - #### Market
96
96
  - get **GammaMarket** by `market_id`
97
+ - get **GammaMarket** by `slug`
97
98
  - get **GammaMarkets** with pagination (offset and limit), filter by `slug`s, `market_id`s, `token_id`s, `condition_id`s, `tag_id` or filtered by active, closed, archived, liquidity window, volume window, start date window, end date window and ordered
99
+ - get **Tags** for a **Market** by `market_id`
98
100
  - #### Event
99
101
  - get **Event** by `event_id`
102
+ - get **Event** by `slug`
100
103
  - get **Events** with pagination, filter by `slug`s, `event_id`s, `tag_id` or filtered by active, closed, archived, liquidity window, volume window, start date window, end date window and ordered
101
104
  - get all **Events** given some filtration
102
- - search **Events**, filter by text query, active/resolved, sort by volume/volume_24hr/liquidity/start_date/end_date/competitive (tries to mimic the web app search bar)
103
- - #### Miscellaneous
105
+ - search **Events**, **Tags**, **Profiles**, filter by text query, tags, active/resolved, recurrence, sort by volume/volume_24hr/liquidity/start_date/end_date/competitive
104
106
  - grok event summary by **Event** `slug`
105
107
  - grok election market explanation by candidate name and election title
108
+ - get **Tags** for an **Event** by `event_id`
109
+ - #### Tag
110
+ - get **Tags** with pagination, order by any **Tag** field
111
+ - get all **Tags**
112
+ - get **Tag** by `tag_id`
113
+ - get **Tag** relations by `tag_id` or `slug`
114
+ - get **Tags** related to a **Tag** by `tag_id` or `slug`
115
+ - #### Sport
116
+ - get **Teams** with pagination, filter by `league`, `name`, `abbreviation`
117
+ - get all **Teams** given some filtration
118
+ - get **Sports** with pagination, filter by `name`
119
+ - get **Sports** metadata
120
+ - #### Series
121
+ - get **Series** with pagination, filter by `slug`, closed status, order by any **Series** field
122
+ - get all **Series** given some filtration
123
+ - #### Comments
124
+ - get comments by `parent_entity_type` and `parent_entity_id` with pagination, order by any **Comment** field
125
+ - get comments by `comment_id` - gets all comments in a thread.
126
+ - get comments by user base address (not proxy address) with pagination, order by any **Comment** field
106
127
 
107
128
  ### PolymarketDataClient - Portfolio related operations
108
129
  - #### Positions
@@ -118,7 +139,12 @@ flowchart LR
118
139
  - `condition_ids` is ***None*** → total value of positions
119
140
  - `condition_ids` is ***str*** → value of positions on a market
120
141
  - `condition_ids` is ***list[str]*** → sum of values of positions on multiple markets
142
+ - #### Closed positions
143
+ - get closed positions, filter by condition_ids
121
144
  - #### Miscellaneous
145
+ - get total number of markets traded by user address
146
+ - get open interest for a list of condition_ids
147
+ - get live volume for an event by `event_id`
122
148
  - get pnl timeseries by user address for a period (1d, 1w, 1m, all) with frequency (1h, 3h, 12h, 1d)
123
149
  - get overall pnl/volume by user address for a recent window (1d, 7d, 30d, all)
124
150
  - get user rank on the profit/volume leaderboards by user address for a recent window (1d, 7d, 30d, all)
@@ -1,17 +1,17 @@
1
- polymarket_apis/__init__.py,sha256=ObH4CmMcXUsccDBDzQ30EBlUkkcb71eAYwEu2FnRJ24,1098
1
+ polymarket_apis/__init__.py,sha256=UATdxksEshjBCHE_f8Jk666sKjoFUxHIn0T1yDKnfqs,1098
2
2
  polymarket_apis/clients/__init__.py,sha256=ruMvFEA4HNkbWEYqbnrCuYXR4PUwkV1XWG0w63we-LA,759
3
- polymarket_apis/clients/clob_client.py,sha256=0w3ZheNo_sQrBGF0AnGwWszMAU0GoUfQEt-nc1pliiU,32063
4
- polymarket_apis/clients/data_client.py,sha256=vSTjzPeEFaN2_eCuilQuC4OtASvUVxkUZ_RtFuKzTbM,8750
5
- polymarket_apis/clients/gamma_client.py,sha256=8HtfLc0ZUHvT-QJqViKmIwvr0Uft8U6hXB03nAj2R5k,12286
3
+ polymarket_apis/clients/clob_client.py,sha256=dDXkEf31tQnLHC7KsN7UIMfnLDJJFHrJ4VD_WwaTFbI,32102
4
+ polymarket_apis/clients/data_client.py,sha256=SAPxgfWwPK_YuNBOvDxKgUIzdh-hMo2YlnTZ0rFDMXE,12000
5
+ polymarket_apis/clients/gamma_client.py,sha256=_wY5gU-H-qLBHNjaIxxFY7XilYapqUT70hLNRiVFCJI,27566
6
6
  polymarket_apis/clients/graphql_client.py,sha256=KgjxbXNWEXp82ZEz464in5mCn1PydnZqWq-g11xu9YU,1839
7
7
  polymarket_apis/clients/web3_client.py,sha256=spCZzftMS19D62GBBpIN5I8JosZuNITNXDr7MrGoHwc,12191
8
8
  polymarket_apis/clients/websockets_client.py,sha256=gaGcsjqp1ZRyxrL6EWvZ9XaTv7koTPDzlcShj0u0B2A,7737
9
- polymarket_apis/types/__init__.py,sha256=rw8HiDvmgwxa0iskCC710o09ZgUc9ocyeNiaMrsBdJM,3868
9
+ polymarket_apis/types/__init__.py,sha256=cyrAPNX0ty0wkMwZqB0lNA7n3JoOJCSeTpclmamMh9k,3258
10
10
  polymarket_apis/types/clob_types.py,sha256=xWnHmsYoilJWfkw2Fxga8cUm9JXuymDRYggJhPKt50Q,11744
11
- polymarket_apis/types/common.py,sha256=CceB6B9w_-HWRSKSMGdAinAq-Pwd0ezGSlPzlNdpzgk,1639
12
- polymarket_apis/types/data_types.py,sha256=n8nHwZx97O81u0MjTWOUh6rIA9EzDavsUz00aa5DXkc,4426
13
- polymarket_apis/types/gamma_types.py,sha256=VwyKTHS3wZvzHwFqP_5IaZey1WF8C3n14SF0cpb4MYs,12637
14
- polymarket_apis/types/websockets_types.py,sha256=YOlGTeoPaCNCj1Hwr0cnPItx3PMPFjcUjS2_fOJOOTM,12367
11
+ polymarket_apis/types/common.py,sha256=RYu6Dfh0HUIogpK_kZ1AQQQEiqQD3hHACU5fMKSUoMU,1003
12
+ polymarket_apis/types/data_types.py,sha256=F6GDhWNtIoQ8kvLvUdlRt596aUfnuc1aHg8m8UweT_M,4641
13
+ polymarket_apis/types/gamma_types.py,sha256=BqoVOfHvTFII3sYkNmjT1S-J-0_R90bVdx_9d5urmMQ,30159
14
+ polymarket_apis/types/websockets_types.py,sha256=XGTpfix2rFFQg-97ZkPagS_tHJJpSnB5mCMf_sT2MOI,11180
15
15
  polymarket_apis/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  polymarket_apis/utilities/config.py,sha256=kQymQRy9fVg5jt8CcQJxsSgIZFbfjPx2q_gNnZI5b24,2449
17
17
  polymarket_apis/utilities/constants.py,sha256=OdxaAsyYzAK1RXty5VtvidMgan8YW-JfHS3Rdxp6n_U,580
@@ -36,6 +36,6 @@ polymarket_apis/utilities/web3/abis/ProxyWalletFactory.json,sha256=5KjBHUWdkc_kd
36
36
  polymarket_apis/utilities/web3/abis/UChildERC20Proxy.json,sha256=ZyQC38U0uxInlmnW2VXDVD3TJfTIRmSNMkTxQsaG7oA,27396
37
37
  polymarket_apis/utilities/web3/abis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  polymarket_apis/utilities/web3/abis/custom_contract_errors.py,sha256=GjCVn2b6iRheT7s-kc8Po9uwH9LfaHA1yRpJyjXRcxs,1172
39
- polymarket_apis-0.3.1.dist-info/METADATA,sha256=TGrtCHEi0PnuDZCBBIeTVXz_-ELhsab4zlCIIibK3cc,10723
40
- polymarket_apis-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
41
- polymarket_apis-0.3.1.dist-info/RECORD,,
39
+ polymarket_apis-0.3.2.dist-info/METADATA,sha256=9ov4uwnSra_kcTD31KLg977T82YnN56HPiPKqQ6ERVY,12086
40
+ polymarket_apis-0.3.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
41
+ polymarket_apis-0.3.2.dist-info/RECORD,,