feat: add CLOB_HOST constant for the production endpoint (closes #30) - #80
Closed
Nexory wants to merge 1 commit into
Closed
feat: add CLOB_HOST constant for the production endpoint (closes #30)#80Nexory wants to merge 1 commit into
Nexory wants to merge 1 commit into
Conversation
Closes Polymarket#30 Adds `CLOB_HOST = "https://clob.polymarket.com"` to `constants.py` so consumers do not have to hard-code the production CLOB endpoint in their own code. The URL is currently duplicated across the README, every example in `examples/`, and the test suite. Usage: from py_clob_client_v2.constants import CLOB_HOST client = ClobClient(host=CLOB_HOST, chain_id=POLYGON, key=PK)
Author
|
Closing in favour of #35, which predates this (2026-04-29) and does the same thing plus exports the constant via |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
CLOB_HOST = "https://clob.polymarket.com"topy_clob_client_v2/constants.pyso consumers do not have to hard-code the production CLOB endpoint in their own code.The URL is currently duplicated across:
README.mdexamplesexamples/tests/test_client_order_adjustment.py)Closes #30.
Change
Added to
constants.pyalongside the existingZERO_ADDRESS,POLYGON,AMOY, etc.Usage
Scope
Intentionally minimal — just the production mainnet host. I didn't add an Amoy/testnet host because I don't know whether one is publicly maintained, and a wrong constant would be worse than no constant. Happy to add one in a follow-up if maintainers can confirm the endpoint.
Test plan
from py_clob_client_v2.constants import CLOB_HOSTworks.Note
Low Risk
Single additive constant with no behavior or API changes.
Overview
Adds a shared
CLOB_HOSTconstant (https://clob.polymarket.com) inpy_clob_client_v2/constants.pynext to existing network constants likePOLYGONandAMOY, so callers can passhost=CLOB_HOSTtoClobClientinstead of repeating the production URL in app code, docs, and examples.Reviewed by Cursor Bugbot for commit f9e6092. Bugbot is set up for automated code reviews on this repo. Configure here.