Skip to content

v0.2.5

Choose a tag to compare

@Mlaz-code Mlaz-code released this 22 Apr 22:20
· 6 commits to main since this release

Highlights

Three releases worth of work since v0.2.2 — coverage parity with the REST API, full error-code registry, and Bearer auth.

feat: Bearer token auth

  • New auth_method: Literal['x-api-key', 'bearer'] = 'x-api-key' kwarg on SharpAPI + AsyncSharpAPI
  • auth_method='bearer' sends Authorization: Bearer <key> instead of X-API-Key
  • Useful for IAM/SSO setups and proxies that strip custom headers
  • SSE intentionally unchanged (EventSource can't set headers)

feat: Endpoint coverage parity

  • Odds.closing(event_id, sportsbook=None)GET /odds/closing (Pro+ closing-line snapshots for CLV)
  • Events.markets(event_id)GET /events/{event_id}/markets
  • New Keys namespace: list(), create(name), revoke(key_id), rotate(key_id)/account/keys
  • Sync (SharpAPI) and async (AsyncSharpAPI) parity throughout
  • New models: ClosingSnapshot, ClosingOddsLine, Market, APIKey

fix: Honor SSE retry: hint

  • SSE reconnect honours the server's retry: hint (3s default) for the first 3 attempts
  • Falls back to exponential backoff (anchored on the hint, capped at 30s) after sustained failures
  • Resets backoff after a graceful reconnect

feat: Full error code registry

  • All 19 HTTP + 6 WebSocket-frame error codes from the canonical pkg/errcodes Go package
  • ERROR_CODE_DESCRIPTIONS, ERROR_CODE_TO_EXCEPTION lookup maps
  • canonical_code() helper resolves deprecated aliases (bad_request, invalid_requestvalidation_error)

Compatibility

All additions; existing code keeps working unchanged. Default behaviour (no auth_method arg, etc.) is identical to v0.2.2.