Skip to content

Inconsistent API response handling and lack of robust type safety for websocket & REST responses #189

@endovix

Description

@endovix

While using the Rust SDK, I noticed inconsistencies between expected API response types and actual runtime behavior, particularly when handling websocket and asset context data.
For example, in some cases the API may return a different channel type than requested (e.g. activeAssetCtx returning activeSpotAssetCtx), which the SDK currently does not handle gracefully.

Problems:

  • SDK assumes strict response types but API responses may vary dynamically
  • Websocket subscriptions can return unexpected channel variants
  • Deserialization fails or requires manual handling by the user
  • Lack of fallback handling or enum coverage for variant responses

Expected behavior:

  • SDK should handle all documented and undocumented API response variants safely
  • Enums should include all possible channel types
  • Unknown or unexpected variants should not break deserialization

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions