Skip to content

fix: complete activity history filter types - #17

Open
harley-poly wants to merge 1 commit into
mainfrom
harley/activity-history-types
Open

harley-poly wants to merge 1 commit into
mainfrom
harley/activity-history-types

Conversation

@harley-poly

@harley-poly harley-poly commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Changes

Add the missing startTime and endTime filters to GetActivitiesParams, and taker-fee-rebate and liquidity-program values to ActivityType. These already work at runtime; typed callers can now use them without bypassing the SDK annotations.

Include a filtering example with time-bound and pagination semantics. Set the patch version to 2.4.2. Follows the gateway contracts in https://github.com/Polymarket/go-gateway-us/pull/890 and https://github.com/Polymarket/go-gateway-us/commit/a1cf438ca20c24aa35fb9547365b15143b735438.

Testing

  • 296 tests pass on Python 3.13/websockets 17.2 and Python 3.10/websockets 13.0, including eight sync/async cases for omitted, single and combined bounds, repeated type parameters, timestamp precision and existing filters.
  • The public typed consumer fails against the old annotations and passes with this change, including against the installed wheel outside the checkout.
  • Ruff lint/format, mypy, and wheel/sdist builds from a clean source export pass. Two independent reviews found no issues. No live API calls.

Checklist

  • Tests pass (pytest)
  • Linting passes (ruff check .)
  • Types check (mypy polymarket_us)

Note

Low Risk
Annotation and documentation updates only; runtime request behavior is unchanged and covered by new pass-through tests.

Overview
Aligns portfolio activity history typings and docs with filters the API already accepts.

GetActivitiesParams now includes optional startTime and endTime (RFC 3339), and ActivityType adds ACTIVITY_TYPE_TAKER_FEE_REBATE and ACTIVITY_TYPE_LIQUIDITY_PROGRAM. Typed callers no longer need workarounds for time bounds or reward categories. The README documents filtering, inclusive endpoints, ordering rules, and cursor pagination for sync and async clients.

Adds parametrized HTTP mock tests so sync/async portfolio.activities forwards query params unchanged (including list types and timestamp precision). Patch release 2.4.2.

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

watashi pushed a commit to watashi/polymarket-us-python that referenced this pull request Oct 12, 2026
…ient

build: rename package to polymarket-client
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.

2 participants