polymarket-apis 0.2.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.

Files changed (40) hide show
  1. polymarket_apis/__init__.py +2 -0
  2. polymarket_apis/clients/__init__.py +0 -0
  3. polymarket_apis/clients/clob_client.py +730 -0
  4. polymarket_apis/clients/data_client.py +234 -0
  5. polymarket_apis/clients/gamma_client.py +311 -0
  6. polymarket_apis/clients/web3_client.py +261 -0
  7. polymarket_apis/clients/websockets_client.py +131 -0
  8. polymarket_apis/types/__init__.py +0 -0
  9. polymarket_apis/types/clob_types.py +494 -0
  10. polymarket_apis/types/common.py +49 -0
  11. polymarket_apis/types/data_types.py +161 -0
  12. polymarket_apis/types/gamma_types.py +313 -0
  13. polymarket_apis/types/websockets_types.py +191 -0
  14. polymarket_apis/utilities/__init__.py +0 -0
  15. polymarket_apis/utilities/config.py +36 -0
  16. polymarket_apis/utilities/constants.py +26 -0
  17. polymarket_apis/utilities/endpoints.py +37 -0
  18. polymarket_apis/utilities/exceptions.py +11 -0
  19. polymarket_apis/utilities/headers.py +54 -0
  20. polymarket_apis/utilities/order_builder/__init__.py +0 -0
  21. polymarket_apis/utilities/order_builder/builder.py +240 -0
  22. polymarket_apis/utilities/order_builder/helpers.py +61 -0
  23. polymarket_apis/utilities/signing/__init__.py +0 -0
  24. polymarket_apis/utilities/signing/eip712.py +28 -0
  25. polymarket_apis/utilities/signing/hmac.py +20 -0
  26. polymarket_apis/utilities/signing/model.py +8 -0
  27. polymarket_apis/utilities/signing/signer.py +25 -0
  28. polymarket_apis/utilities/web3/__init__.py +0 -0
  29. polymarket_apis/utilities/web3/abis/CTFExchange.json +1851 -0
  30. polymarket_apis/utilities/web3/abis/ConditionalTokens.json +705 -0
  31. polymarket_apis/utilities/web3/abis/NegRiskAdapter.json +999 -0
  32. polymarket_apis/utilities/web3/abis/NegRiskCtfExchange.json +1856 -0
  33. polymarket_apis/utilities/web3/abis/ProxyWalletFactory.json +319 -0
  34. polymarket_apis/utilities/web3/abis/UChildERC20Proxy.json +1438 -0
  35. polymarket_apis/utilities/web3/abis/__init__.py +0 -0
  36. polymarket_apis/utilities/web3/abis/custom_contract_errors.py +31 -0
  37. polymarket_apis/utilities/web3/helpers.py +8 -0
  38. polymarket_apis-0.2.2.dist-info/METADATA +18 -0
  39. polymarket_apis-0.2.2.dist-info/RECORD +40 -0
  40. polymarket_apis-0.2.2.dist-info/WHEEL +4 -0
File without changes
@@ -0,0 +1,31 @@
1
+ CUSTOM_ERROR_DICT = {
2
+ "0x3a81d6fc": "AlreadyRegistered()",
3
+ "0xcd4e6167": "FeeTooHigh()",
4
+ "0x66f8620a": "InvalidComplement()",
5
+ "0x756688fe": "InvalidNonce()",
6
+ "0x8baa579f": "InvalidSignature()",
7
+ "0x3f6cc768": "InvalidTokenId()",
8
+ "0xe2cc6ad6": "MakingGtRemaining()",
9
+ "0xa0b94465": "MismatchedTokenIds()",
10
+ "0x7bfa4b9f": "NotAdmin()",
11
+ "0x7f9a6f46": "NotCrossing()",
12
+ "0x7c214f04": "NotOperator()",
13
+ "0x30cd7471": "NotOwner()",
14
+ "0x5211a079": "NotTaker()",
15
+ "0xc56873ba": "OrderExpired()",
16
+ "0x7b38b76e": "OrderFilledOrCancelled()",
17
+ "0x9e87fac8": "Paused()",
18
+ "0xdf4d8080": "TooLittleTokensReceived()",
19
+ "0xb36eb036": "DeterminedFlagAlreadySet()",
20
+ "0xfc520af5": "FeeBipsOutOfBounds()",
21
+ "0x4e23d035": "IndexOutOfBounds()",
22
+ "0x9667d381": "InvalidIndexSet()",
23
+ "0xff633a38": "LengthMismatch()",
24
+ "0xe3b02389": "MarketAlreadyDetermined()",
25
+ "0xd2b4c0c6": "MarketAlreadyPrepared()",
26
+ "0xb6649495": "MarketNotPrepared()",
27
+ "0x24f2dfe7": "NoConvertiblePositions()",
28
+ "0xcd7769ff": "NotApprovedForAll()",
29
+ "0x80fee105": "OnlyOracle()",
30
+ "0x155a4b5c": "UnexpectedCollateralToken()",
31
+ }
@@ -0,0 +1,8 @@
1
+ def get_market_index(question_id: str) -> int:
2
+ """Extract the market index from a question ID (last 2 hex characters)."""
3
+ return int(question_id[-2:], 16)
4
+
5
+ def get_index_set(question_ids: list[str]) -> int:
6
+ """Calculate bitwise index set from question IDs."""
7
+ indices = [get_market_index(question_id) for question_id in question_ids]
8
+ return sum(1 << index for index in set(indices))
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: polymarket-apis
3
+ Version: 0.2.2
4
+ Summary: Unified Polymarket APIs - clob, gamma, data, web3, websockets
5
+ Author-email: Razvan Gheorghe <razvan@gheorghe.me>
6
+ Requires-Python: >=3.12
7
+ Requires-Dist: httpx[http2]>=0.25.1
8
+ Requires-Dist: lomond>=0.3.3
9
+ Requires-Dist: poly-eip712-structs>=0.0.1
10
+ Requires-Dist: py-order-utils>=0.3.2
11
+ Requires-Dist: pydantic>=2.10.5
12
+ Requires-Dist: web3>=7.0
13
+ Requires-Dist: wsaccel>=0.6.7
14
+ Description-Content-Type: text/markdown
15
+
16
+ # polymarket-apis
17
+
18
+ Polymarket CLOB, Gamma, Data and Web3 and Websockets clients.
@@ -0,0 +1,40 @@
1
+ polymarket_apis/__init__.py,sha256=8a6dT19YqnOcLEmprl8vavi97JpaRrcDWBTllGsrmbE,61
2
+ polymarket_apis/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ polymarket_apis/clients/clob_client.py,sha256=2Mgh-WRPJ3CqlcuBMrXAgKQRzWr-dNthynZf2Q0jsiY,29549
4
+ polymarket_apis/clients/data_client.py,sha256=sAJqesjKT8cRNr-j4OsXj-xYHEOzt0WWCvXcvejX7uI,8641
5
+ polymarket_apis/clients/gamma_client.py,sha256=y-qBzU21qKXpluO3-mWPY_h9N6KSbiq4cpvR-X8Awqo,11972
6
+ polymarket_apis/clients/web3_client.py,sha256=lIE-xXYmlk0sO0OFy2OQ9ylJPIL39gMnSg2bAjD6HmQ,11215
7
+ polymarket_apis/clients/websockets_client.py,sha256=Spdp_8L_RzNJEZ867Vk9BMTW3J-lMAwyx3P0R98x_j4,4646
8
+ polymarket_apis/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ polymarket_apis/types/clob_types.py,sha256=TlbSH6P3BpDz1xX9hhcHjH6Y5HogZVnhjL-wTE9hF2Q,11703
10
+ polymarket_apis/types/common.py,sha256=eqgTPYQaRe_kl4XpixLgQlVlP0iB1jd3ThiJs_xwHx0,1568
11
+ polymarket_apis/types/data_types.py,sha256=K-bE5g1owFozvznmQZ0MicxGccqVSuEibuVzXFAoa4E,4408
12
+ polymarket_apis/types/gamma_types.py,sha256=zREASm8jrQokxNC-VYvghYtorhdHebvxww803iRadSU,10377
13
+ polymarket_apis/types/websockets_types.py,sha256=o55PkBksDgy4yxAWEM_qB3JifxuP70ev5IyQuj9Krfk,8278
14
+ polymarket_apis/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ polymarket_apis/utilities/config.py,sha256=t1cN9nLy949nL-kO8-m3ODS9g-rcYVduxJ2J1LNUqdc,1358
16
+ polymarket_apis/utilities/constants.py,sha256=OdxaAsyYzAK1RXty5VtvidMgan8YW-JfHS3Rdxp6n_U,580
17
+ polymarket_apis/utilities/endpoints.py,sha256=OX6KBeS7XHC8t50s0QpBw8KMg7IS279Jq6xIk8I05Kc,1208
18
+ polymarket_apis/utilities/exceptions.py,sha256=agbe5OZD9kRoQVTGJvBK3mbnZgLTXI4FJNESM0zsKqM,187
19
+ polymarket_apis/utilities/headers.py,sha256=dl3ONZU56nsrGkAishwYtALT-Qn8P3Ts_z58-XgPARg,1514
20
+ polymarket_apis/utilities/order_builder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
+ polymarket_apis/utilities/order_builder/builder.py,sha256=-eQ092J6Wkproy2SY6USFGWAniS5ZMBg85Ij_cnqqPs,8332
22
+ polymarket_apis/utilities/order_builder/helpers.py,sha256=QN39noGcWrGAy89dJc8DvEGJwiX0fMVc62R-pkclAu4,1714
23
+ polymarket_apis/utilities/signing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
+ polymarket_apis/utilities/signing/eip712.py,sha256=fGLurznnfY5M0VCP1Txyq_FYQRfggyHoTwz-PGIK2Eg,895
25
+ polymarket_apis/utilities/signing/hmac.py,sha256=vAYb98tMHWqNqAJNFXUnAddS38dA_aOy3Wp3DcP_7PM,702
26
+ polymarket_apis/utilities/signing/model.py,sha256=kVduuJGth7WSCUDCVVydCgPd4yEVI85gEmMxohXsvp0,191
27
+ polymarket_apis/utilities/signing/signer.py,sha256=7-nFALFrz0qg4F4lZRyHI41S7IWxr7t0WMLOHqHzJcg,732
28
+ polymarket_apis/utilities/web3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
+ polymarket_apis/utilities/web3/helpers.py,sha256=ZeZWO6Le8mYG4GiblGph3hnaTV2owa9eEWrhAYcggek,403
30
+ polymarket_apis/utilities/web3/abis/CTFExchange.json,sha256=zt8fZnUaOrD8Vh5njM0EEUpeITWhuu0SZrIZigWxgV8,38499
31
+ polymarket_apis/utilities/web3/abis/ConditionalTokens.json,sha256=3TUcX7He74VMkoL1kxbDbtULZ70VY_EBe01pfByprsk,12584
32
+ polymarket_apis/utilities/web3/abis/NegRiskAdapter.json,sha256=HABIoRF1s1NgctpRTdaaNDqzODzgdZLE-s2E6ef4nAY,18867
33
+ polymarket_apis/utilities/web3/abis/NegRiskCtfExchange.json,sha256=QOgLKekWnPVcMGXExcLjEIOHLS89tPUoZFkVm-yRnbY,38612
34
+ polymarket_apis/utilities/web3/abis/ProxyWalletFactory.json,sha256=5KjBHUWdkc_kdlWPNax84o1vStpFuLgZKTMn3jc4zvU,5553
35
+ polymarket_apis/utilities/web3/abis/UChildERC20Proxy.json,sha256=ZyQC38U0uxInlmnW2VXDVD3TJfTIRmSNMkTxQsaG7oA,27396
36
+ polymarket_apis/utilities/web3/abis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
+ polymarket_apis/utilities/web3/abis/custom_contract_errors.py,sha256=ZCeJPK5tobPAR9vaNxw_pQZwKyZc_R0GdggfWaeXvOs,1176
38
+ polymarket_apis-0.2.2.dist-info/METADATA,sha256=Ghid2hQzHlSGgv4BzxuQHy6GgkBLUDgvx6XVytm6UQM,558
39
+ polymarket_apis-0.2.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
40
+ polymarket_apis-0.2.2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any