Repository navigation
feat(data): add typed Data API client - #39
Merged
Merged
Conversation
…istory and resolutions
Owner
|
LGTM, thanks! |
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
DataClient, a typed client for the Data API v2 (#8). It covers:kind == "combo")Lists page by server cursor through
Paginator<T>. Amounts aredouble, and every row keeps itsrawJSON. Argument checks follow py-sdk, and invalid input fails withInvalidArgumentbefore any request is sent. The JSON field readers, query builder, and paging helpers moved out of the Gamma client so both clients share them. Gamma behavior is unchanged.Verification
Commands run and their actual results:
scripts/ci_local.sh --title "feat(data): add typed Data API client": title, release, debug, sanitizers, fuzz, and clang passed. Quality failed on formatting in five portfolio files. Afterstyle(data): format portfolio sources with clang-format 21,--jobs qualitypassed.Checks not run and the reason (or none):
Compatibility and evidence
Public API, binary compatibility, or release implications (or none):
Additive only. New headers are
data_client.hpp,data_types.hpp,data_portfolio_types.hpp,data_analytics_types.hpp,data_leaderboard_types.hpp, anddata_requests.hpp. Existing public headers are unchanged, and the shared helpers are internal.For protocol changes: official docs links and the Python SDK commit or fixture source.
Endpoints, parameters, validation rules, and models follow py-sdk commit
72297f05d6d8. Fixtures are recordeddata-api.polymarket.comresponses from 2026-10-17. Wallets, names, pseudonyms, avatars, handles, and transaction hashes are replaced with synthetic values, including the wallet embedded in the positions cursor.For live checks: distinguish observed outcomes from local fixture coverage.
Observed live with read-only GETs:
{data, pagination}envelopelimit> 1000 rejectiondata: nullfor unknown standingsGLOBALopen interest row69"no price" valueBiggest winners returned no combo rows, so combo handling is covered only by synthetic rows built from the py-sdk model.