feat(gamma): add active filter to MarketsRequest#323
Open
skyc1e wants to merge 1 commit intoPolymarket:mainfrom
Open
feat(gamma): add active filter to MarketsRequest#323skyc1e wants to merge 1 commit intoPolymarket:mainfrom
skyc1e wants to merge 1 commit intoPolymarket:mainfrom
Conversation
Add `active: Option<bool>` to `MarketsRequest`, matching the existing pattern used by `EventsRequest`. The Gamma backend already supports the `active` query parameter for markets — this exposes it natively so consumers no longer need to filter client-side. Closes Polymarket#267
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #323 +/- ##
=======================================
Coverage 85.54% 85.54%
=======================================
Files 32 32
Lines 5167 5167
=======================================
Hits 4420 4420
Misses 747 747
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
active: Option<bool>toMarketsRequestEventsRequest(same field, same position relative toclosed)?active=on the markets endpoint; this exposes it natively so consumers don't need client-side filteringChanges
src/gamma/types/request.rs: one field added toMarketsRequesttests/gamma.rs:active(true)added tomarkets_request_all_params, plus three focused tests (active=true,active=false, omitted when unset)Builder method is auto-generated by
bon::Builder. Serialization handled by existing#[skip_serializing_none]. No behavior change for callers that don't setactive.Closes #267
Note
Low Risk
Low risk: adds an optional boolean query parameter to
MarketsRequestand extends serialization tests; no behavior change unless callers setactive.Overview
Adds an
active: Option<bool>filter toMarketsRequest, allowing callers to send?active=true|falsewhen listing markets.Updates query-string unit tests to cover
activeserialization (true/false) and verify it is omitted when unset, and includesactivein the all-params markets request test.Reviewed by Cursor Bugbot for commit 6afff53. Bugbot is set up for automated code reviews on this repo. Configure here.