Repository navigation
v0.6.1
Error bodies from production now decode; specs synced to OpenAPI 3.30.0; four missing query filters; malformed WebSocket frames fail the connection. No API-incompatible changes.
Fixed
APIError.Code/Messagewere empty for every production error (#7). The body was decoded as the spec's flatErrorResponse, but production returns{"error":{"code":...,"message":...}}for most errors and{"msg":"..."}for parameter-binding 400s, soError()printed onlyapi error 404. All three shapes are parsed now; the flat shape still wins when present.RawBodyis unchanged.- A WebSocket text frame that was not valid JSON was skipped silently (#10). The connection now fails with an error wrapping the new
ErrWSMalformedFrame(check witherrors.Is),Messages()closes, and pending commands return that error — the same path asErrWSSlowConsumer. Frames received before the bad one are still delivered.
Added
- Vendored Kalshi OpenAPI 3.30.0 (AsyncAPI remains 2.0.0; its content change is CF Benchmarks index-ID documentation) (#8).
- Types:
Series.Categories— the full discovery-category list;Series.Categoryis now the primary one and thecategoryfilter onSeries.Listmatches any entry inCategories.GetTargetBalanceAllocationResponse.RestingMarginReservation. - Query filters (#9):
ExchangeIndexonGetOrdersOpts,GetFillsOpts,GetPositionsOpts;SubaccountonGetHistoricalPositionsOpts. All optional; nil omits the parameter as before. ErrWSMalformedFrame.- Tests: error-body shapes observed from production;
Series.categoriesandresting_margin_reservationunmarshal; the new filters (set and omitted); malformed-frame failure;Unsubscribeone-reply-per-sid andListSubscriptionssuccess paths (#12).
Changed
APIErrordocuments which body shapes populateCode/Message.RequestIDis still read fromRequest-Id, which production does not currently send.