Skip to content

fix: use CLOB_HOST constant in examples (#27)#29

Open
MackDing wants to merge 1 commit intoPolymarket:mainfrom
MackDing:fix/issue-27
Open

fix: use CLOB_HOST constant in examples (#27)#29
MackDing wants to merge 1 commit intoPolymarket:mainfrom
MackDing:fix/issue-27

Conversation

@MackDing
Copy link
Copy Markdown

@MackDing MackDing commented Apr 29, 2026

Fixes #27.

The examples hardcoded https://clob-v2.polymarket.com, but per the v2 migration docs (https://docs.polymarket.com/v2-migration), as of April 28 2026 the CLOB endpoint is https://clob.polymarket.com.

This PR:

  • Adds a top-level pub const CLOB_HOST: &str = "https://clob.polymarket.com"; in src/lib.rs.
  • Updates all examples/clob/** to import and use CLOB_HOST rather than the stale literal.

cargo check --examples --all-features passes locally.


Note

Low Risk
Only changes example default URLs and introduces a new public constant; no core client logic or request/response handling is modified.

Overview
Updates the CLOB Rust examples to stop hardcoding the legacy https://clob-v2.polymarket.com endpoint and instead default to a shared CLOB_HOST constant (while still allowing override via CLOB_API_URL).

Adds pub const CLOB_HOST: &str = "https://clob.polymarket.com"; to src/lib.rs and switches all examples/clob/** client construction to reference it for consistency with the v2 migration docs.

Reviewed by Cursor Bugbot for commit 6364c9a. Bugbot is set up for automated code reviews on this repo. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client examples use wrong URL

2 participants