Skip to content

v0.6.1

Choose a tag to compare

@github-actions github-actions released this 12 Sep 17:47
· 11 commits to main since this release
748b4ad

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 / Message were empty for every production error (#7). The body was decoded as the spec's flat ErrorResponse, but production returns {"error":{"code":...,"message":...}} for most errors and {"msg":"..."} for parameter-binding 400s, so Error() printed only api error 404. All three shapes are parsed now; the flat shape still wins when present. RawBody is 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 with errors.Is), Messages() closes, and pending commands return that error — the same path as ErrWSSlowConsumer. 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.Category is now the primary one and the category filter on Series.List matches any entry in Categories. GetTargetBalanceAllocationResponse.RestingMarginReservation.
  • Query filters (#9): ExchangeIndex on GetOrdersOpts, GetFillsOpts, GetPositionsOpts; Subaccount on GetHistoricalPositionsOpts. All optional; nil omits the parameter as before.
  • ErrWSMalformedFrame.
  • Tests: error-body shapes observed from production; Series.categories and resting_margin_reservation unmarshal; the new filters (set and omitted); malformed-frame failure; Unsubscribe one-reply-per-sid and ListSubscriptions success paths (#12).

Changed

  • APIError documents which body shapes populate Code / Message. RequestID is still read from Request-Id, which production does not currently send.