Skip to content

Convert 4 client methods onto request_endpoint (drop dead params)#117

Merged
martinkersner merged 2 commits into
mainfrom
issue-116-convert-5-client-methods
Jul 1, 2026
Merged

Convert 4 client methods onto request_endpoint (drop dead params)#117
martinkersner merged 2 commits into
mainfrom
issue-116-convert-5-client-methods

Conversation

@martinkersner

@martinkersner martinkersner commented Jul 1, 2026

Copy link
Copy Markdown
Member

Closes #116

Summary

Converts 4 client methods off hardcoded self.query("/api/v1/...") calls onto self.request_endpoint(op_id, **wire_params), using snake_case wire params from the codegen'd datamaxi/_endpoints.py registry (the live backend contract). Dead kwargs the backend silently ignores are removed from the Python signatures (pre-1.0 cleanup — passing them now raises TypeError). Over-specified mocked tests updated to the real contract.

Premium was pulled from this PR — the registry is incomplete for premium (missing ~35 filter params, incl. known-working token_include/token_exclude; keeps min_sv but not max_sv), so routing it through request_endpoint would silently drop working filters. Tracked separately in #119 (fix camelCase wire bug + expand registry upstream, then convert).

Per method:

  • funding_rate.latest — dropped sort, limit (not in registry). Now request_endpoint("funding_rate_latest", exchange=, symbol=).
  • cex_token.updates — dropped sort + its ASC/DESC validation; removed now-unused DESC/ASC import. Now request_endpoint("cex_token_updates", page=, limit=, type=). Kept (response, next_request) tuple.
  • cex_symbol.volume — dropped exchange. Signature now volume(base).
  • cex_symbol.cautions / delistings — dropped base. Kept exchange.

Note: the registry defines additional filters not yet exposed (cex_symbol delistings market/from_ms/to_ms/include_past/limit/page, cautions market/min_level/active_only/limit/page, cex_symbol_volume market); left out to keep scope to the issue. Can be added later.

Test plan

  • Updated mocked tests to real contract: test_token_updates_sends_query_params (removed sort assertion), test_volume_sends_base_param (dropped exchange), test_cautions_returns_dict (base → exchange).
  • Removed integration cases for removed kwargs: test_updates_sort_asc/desc, test_latest_with_sort, test_latest_with_limit (would TypeError under -m integration).
  • Offline suite green: python -m pytest -m "not integration" → 113 passed, 11 skipped, 116 deselected.
  • Integration file collects clean; black + flake8 clean on touched files. grep -rn "/api/v" datamaxi/datamaxi/*.py clean except doc-link comments; no self.query( remains in the 4 methods.

…tions/delistings onto request_endpoint

drop dead kwargs: latest sort/limit, updates sort, volume exchange, cautions/delistings base. snake_case wire params from registry. update over-specified mocked tests to real contract.
@martinkersner martinkersner changed the title Convert 5 remaining client methods onto request_endpoint (drop dead/mis-cased params) Convert 4 client methods onto request_endpoint (drop dead params) Jul 1, 2026
@martinkersner martinkersner merged commit 567c3a2 into main Jul 1, 2026
7 checks passed
@martinkersner martinkersner deleted the issue-116-convert-5-client-methods branch July 1, 2026 05:14
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.

Convert 4 client methods off dead params onto request_endpoint (SDK-side fix)

1 participant