Repository navigation
feat(gamma): add typed Gamma API client - #38
Merged
Merged
Conversation
Owner
|
Thanks for keeping contributing! Looks good |
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
The SDK had no typed Gamma client. Gamma was parsed ad hoc in three places, so there was no SDK API for market discovery.
GammaClient, matching the official Python SDK's Gamma calls: markets and events (by ID, slug or URL, plus filtered lists), tags, series, sports, teams, search, comments and public profiles.rawJSON copy of each object. Lists skip non-binary markets, as the Python SDK does.Paginatorgains the paging styles Gamma needs: keyset, page-numbered, and offset pages that count only some rows (top-level comments).PositionClient::resolve_marketnow looks markets up throughGammaClient, using/markets/keysetinstead of/markets. Its checks and error messages are unchanged.scripts/ci_local.sh, which runs this workflow's checks locally, and the missing<cstddef>include insrc/evm_rlp.cpp.Verification
Commands run and their actual results:
scripts/ci_local.sh --title "feat(gamma): add typed Gamma API client"(WSL Ubuntu, GCC 12, Clang 18):websocket_messages440,922 runs,rest_responses36,331 runs, no crashes.Checks not run and the reason (or none):
ubuntu-22.04runners): not installed locally, so CI covers it.test_clob_rate_limitfailed intermittently under WSL, passing on every rerun. It checks wall-clock timestamps and isn't touched by this PR.Compatibility and evidence
Public API, binary compatibility, or release implications (or none):
gamma_client.hpp,gamma_types.hpp,gamma_catalog_types.hpp,gamma_social_types.hppandgamma_requests.hpp.PageRequestgainspageandexhausted, andPage<T>gainscountedandhas_more.done()right after its last page.PositionClient:gamma_api_url(http or https) when constructed, instead of on the first lookup.GammaClient.Protocol source: py-sdk
72297f05d6d8(_internal/actions/gamma.py,models/gamma/*).Live checks (read-only GETs to the public Gamma API, 2026-10-16):
/tagsat 100 and/seriesat 50./markets/keysetreturns the same markets as/marketsfor open markets, and for closed markets both with and withoutclosed=true.