Repository navigation
feat: reconcile Klear spec drift #563 (22.6.0) - #564
Merged
Merged
Conversation
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 #563
Fixes the spec drift from Spec Drift run 41197408777. Minor (22.6.0): no public Python attribute or method was renamed or removed, and no new required request field was added.
What changed
*_fpfixed-point dollar strings next to the existingint64*_centicentsfields; the old fields are still in the spec. So the 13 affected models get new optional*_fp: DollarDecimal | Noneattributes, and*_centicentsstays a plainint. (An earlier WIP commit aliased the two onto one attribute. That was reverted because it would have silently turned centicent ints into dollar Decimals.)margin.withdraw_settlement_balance(sync and async) now posts toPOST /margin/settlement_balance_withdrawal. Method name and request/response models are unchanged.rfq_batch_id(RFQ, RfqCreated/RfqDeleted), orderbook snapshot/deltaclock,UserOrdersPayload.last_update_reason, perpsExchangeStatusresume-time/index-statuses/intra-transfers fields (+ExchangeIndexStatus),MarginMarket.market_id,IntraExchangeInstanceTransfer.client_transfer_id.Blast radius (by hand, GitNexus isn't available)
kalshi/perps/klear/models/margin.py: only additive optional fields. Existing attribute types are unchanged. Responses that leave out*_fpstill parse.kalshi/perps/klear/resources/margin.py: only the URL path changed. Anyone still calling the old path directly would get a 404 upstream anyway, because Kalshi removed it.communications,portfolio,orderbook_delta,user_orders,exchange,markets): optional fields default toNone. Models withextra="forbid"are response models only, so no request body changes.ExchangeIndexStatusinkalshi.perps. Additive.kalshi/_generated/.Gates
uv run ruff check .: passuv run mypy kalshi/: pass (161 files)uv run pytest tests/ --ignore=tests/integration -q: 5062 passed, 3 skippeduv run pytest tests/test_contracts.py -W error::UserWarning: 930 passed