Repository navigation
feat(spec): FCM IM cap, DLP programs, cover market lifecycle — 22.19.0 (#594) - #595
Merged
Merged
Conversation
Add perps FCM account-level IM cap (GET/PUT/DELETE /margin/fcm/im_cap), core GET /dlp_programs, Settlement.value_dollars, Klear obligation_type and withholding fields, WebSocket cover_market_lifecycle plus milestone_updated on market_lifecycle_v2. Additive only; PUT/DELETE remain non-retried.
Minor bump for the additive OpenAPI 3.39.0 spec-drift work.
Owner
Author
|
Re-opening this PR to retrigger GitHub Actions; workflows did not queue on the initial open. |
Workflows did not queue on the initial PR open or reopen.
Owner
Author
|
GitHub is not queuing |
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 #594
Reconciles the nightly spec-drift failure on main (OpenAPI 3.39.0; AsyncAPI, perps, and SCM specs also changed). Additive only — releases as 22.19.0 (minor). No breaking changes.
The failing run was https://github.com/TexasCoding/kalshi-python-sdk/actions/runs/46783195129 (
TestWsSpecDrift::test_batch_communications_channel_removedandtest_every_spec_endpoint_is_mapped[perps]; after the local spec sync,test_every_spec_endpoint_is_mapped[core]and SCM response drift onObligationEntry/CorporateActionPaymentDetailalso failed). Those tests now pass.Spec changes → SDK
fcm.get_im_cap(),update_im_cap(*, im_cap=),delete_im_cap()—GET/PUT/DELETE /margin/fcm/im_cap.GetFCMIMCapResponse.im_capandcurrent_imare optionalDollarDecimal(wire namesim_cap/current_im, no_dollarssuffix; both absent when unset or unavailable). PUT body isUpdateFCMIMCapRequest(extra="forbid"); returns no body. PUT/DELETE are never retried.incentive_programs.dlp_programs()(sync + async) —GET /dlp_programs. Public. ReturnsGetDlpProgramsResponsewithbidding_periodsandincentivized_series(null/missing lists parse as[]).Settlement.value_dollars(DollarDecimal | None).value(integer cents) is deprecated and kept.ObligationEntry.obligation_typeand optionalCorporateActionPaymentDetail.withholding_fp/withholding_rate_bps/withholding_reason, withserver_omits_despite_requiredexclusions so older payloads still parse.cover_market_lifecyclechannel andsubscribe_cover_market_lifecycle(). PayloadCoverMarketLifecycleMessage(same msg shape asmarket_lifecycle_v2).market_lifecycle_v2also carriesmilestone_updated(MilestoneUpdatedMessage:milestone_id,last_updated_ts_us, free-formmilestonedict). AsyncAPI 16 → 17 channels; 14 typedsubscribe_*.exchange_statussnapshot note, SCM obligation/withholding docs, "on-request" → "cover") needed no code.Blast radius (manual; GitNexus not installed)
UpdateFCMIMCapRequestis new andextra="forbid"; no existing request body changes.RETRYABLE_METHODSremains GET/HEAD/OPTIONS).market_lifecycle_v2subscribers may now also receive typedmilestone_updatedmessages through the SDK dispatcher (additive; previously this type was not in the spec).Settlement.valueis unchanged.value_dollarsis a new optional field.CI note (out of #594 scope; kept)
After this PR opened,
pull_requestworkflows did not queue (close/reopen and an empty retrigger commit4fe0cd6also did not).workflow_dispatchstill worked. I added a one-lineworkflow_dispatch:trigger to.github/workflows/ci.yml(922e6b6) so the required checks could be dispatched by hand. A laterpull_requestsynchronize then did queue, and CI is green. The empty retrigger commit is included in this squash only as history and has no file changes. Reverting theworkflow_dispatchline would risk another stuck PR, so it is kept. It is additive and harmless (CI still runs on PR/main as before, and can also be started manually).Gates
uv run ruff check .✅uv run mypy kalshi/✅uv run pytest tests/ --ignore=tests/integration -q✅ 5577 passed, 3 skippeduv run pytest tests/test_contracts.py -W error::UserWarning✅ 1030 passedtest (3.12),test (3.13),drift-check