Convert 4 client methods onto request_endpoint (drop dead params)#117
Merged
Conversation
…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.
e291af9 to
8c6b9b8
Compare
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.
Closes #116
Summary
Converts 4 client methods off hardcoded
self.query("/api/v1/...")calls ontoself.request_endpoint(op_id, **wire_params), using snake_case wire params from the codegen'ddatamaxi/_endpoints.pyregistry (the live backend contract). Dead kwargs the backend silently ignores are removed from the Python signatures (pre-1.0 cleanup — passing them now raisesTypeError). 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-workingtoken_include/token_exclude; keepsmin_svbut notmax_sv), so routing it throughrequest_endpointwould silently drop working filters. Tracked separately in #119 (fix camelCase wire bug + expand registry upstream, then convert).Per method:
sort,limit(not in registry). Nowrequest_endpoint("funding_rate_latest", exchange=, symbol=).sort+ its ASC/DESC validation; removed now-unused DESC/ASC import. Nowrequest_endpoint("cex_token_updates", page=, limit=, type=). Kept (response, next_request) tuple.exchange. Signature nowvolume(base).base. Keptexchange.Note: the registry defines additional filters not yet exposed (cex_symbol delistings
market/from_ms/to_ms/include_past/limit/page, cautionsmarket/min_level/active_only/limit/page, cex_symbol_volumemarket); left out to keep scope to the issue. Can be added later.Test plan
test_token_updates_sends_query_params(removedsortassertion),test_volume_sends_base_param(droppedexchange),test_cautions_returns_dict(base → exchange).test_updates_sort_asc/desc,test_latest_with_sort,test_latest_with_limit(wouldTypeErrorunder-m integration).python -m pytest -m "not integration"→ 113 passed, 11 skipped, 116 deselected.grep -rn "/api/v" datamaxi/datamaxi/*.pyclean except doc-link comments; noself.query(remains in the 4 methods.