fix: expose SDK rate limit controls#999
Conversation
Add TypeScript and Python SDK rate limit accessors that mirror the core BaseExchange rateLimit surface, including constructor options and focused tests. Fixes #996
|
CI note: the focused static/Python compile checks pass, but the generated client sync checks are red. I inspected the failed logs; running the client-method generators would remove existing hosted-mode SDK code from client.py/client.ts (submit/cancel/fetch hosted dispatch paths, etc.) unrelated to this rate-limit accessor PR. I did not commit that broad generator drift into this focused PR. The Python exchange generator sync check is green. |
PR Review: FAILWhat This DoesThis exposes SDK-side rate-limit controls in both TypeScript and Python clients, adds constructor options, and throttles SDK HTTP requests before the underlying sidecar/hosted request is sent. For SDK consumers, it introduces Blast RadiusBoth SDKs are affected: TypeScript Consumer VerificationBefore (base branch): After (PR branch): new Polymarket({ rateLimit: 25 }).rateLimit === 25and Python: Polymarket(rate_limit=25).rate_limit == 25.0Sequential SDK requests now pass through Test Results
Findings
PMXT Pipeline Check
Semver Impactminor -- this exposes new public SDK constructor options/properties and changes SDK request pacing behavior. RiskEven after SDK generated-client setup is fixed in the test environment, the TypeScript throttler needs an async serialization mechanism (for example a per-client promise queue/mutex, similar in effect to the Python lock) and a concurrent-request test before this can be considered safe for consumers relying on rate limiting. |
Summary
rateLimitoption/getter/setter and apply it to SDK HTTP dispatchrate_limitconstructor option/property and apply it to SDK HTTP dispatchrate_limitFixes #996
Test Plan
python3 -m py_compile sdks/python/pmxt/client.py sdks/python/pmxt/models.py sdks/python/pmxt/_exchanges.pynode core/scripts/generate-python-exchanges.js(rerun stability checked by checksum)git diff --checkBlocked locally:
sdks/typescript/generated/src/index.jsis absent (same generated-client environment blocker seen in existing focused SDK PRs)./usr/bin/python3lackspip/pytest; py_compile passed.