Repository navigation
fix(perps): transfer request body spec drift; release 22.1.0 (#547) - #548
Merged
Merged
Conversation
Add optional source_subaccount/destination_subaccount to IntraExchangeInstanceTransferRequest and optional exchange_index to the perps ApplySubaccountTransferRequest, threaded through sync+async transfers.transfer_instance / transfer_subaccount. Re-vendor specs. Release 22.1.0 (additive, optional only). Closes #547
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 #547
What drifted
Nightly strict contract run 39023301422 failed on two perps request bodies (
specs/perps_openapi.yaml):IntraExchangeInstanceTransferRequestgainedsource_subaccountanddestination_subaccount(integer,gte=0, spec default 0; "only supported for event contract to event contract transfers").ApplySubaccountTransferRequest(perpsPOST /portfolio/margin/subaccounts/transfer) gainedexchange_index(ExchangeIndex,gte=0; "Perps subaccount transfers ignore this field").None of them are in
required, so this is a minor release: 22.1.0.Change
kalshi/perps/models/transfers.py: new fields asStrictInt | None = Field(default=None, ge=0)(models stayextra="forbid").Nonedefaults keep today's wire payloads byte-identical (exclude_none); an explicit0is still sent.kalshi/perps/resources/transfers.py: new keyword-only kwargs threaded through sync + asynctransfer_instance/transfer_subaccount(overloads, implementations, body builders), and included in therequest=vs kwargs exclusivity check.tests/perps/test_transfers.py: model serialization (incl. explicit 0), omitted-by-default, negative / bool rejection, sync + async wire tests,request=path.specs/(OpenAPI 3.34.0 unchanged version; perps/AsyncAPI). Other upstream changes are descriptions, examples,x-rust-*/x-omitemptyvendor extensions, and response-side additive-optional fields (perpsExchangeStatus.intra_exchange_transfers_active/exchange_estimated_resume_time/exchange_index_statuses) that only warn and are left for a follow-up.kalshi/_generatedregenerated with no diff.pyproject.toml,kalshi/__init__.py,CHANGELOG.md(## 22.1.0 — 2026-10-17). Not breaking, so nodocs/migration.mdentry.METHOD_ENDPOINT_MAP,PERPS_BODY_MODEL_MAP); no exclusions added.Blast radius (manual — GitNexus unavailable)
IntraExchangeInstanceTransferRequest, perpsApplySubaccountTransferRequest,_build_instance_transfer_body,_build_subaccount_transfer_body,TransfersResource.transfer_instance/transfer_subaccount,AsyncTransfersResource.transfer_instance/transfer_subaccount.client.transfers.*methods; no other SDK code builds these models (rgconfirmed). The event-contractkalshi.models.subaccounts.ApplySubaccountTransferRequestis a separate class and is untouched.Nonedefaults; existing calls and request bodies are unchanged.Gates
uv run ruff check .— passuv run mypy kalshi/— passuv run pytest tests/ --ignore=tests/integration -q— 4735 passed, 3 skippeduv run pytest tests/test_contracts.py -W error::UserWarning— 856 passed