Skip to content

userFees stakingLink union + UserFill schema drift #102

Description

@joeblau

Problem

Two user-data schemas drifted (upstream nktkas#181, nktkas#183):

userFees (src/api/info/_methods/userFees.ts):

  • nextTrialAvailableTimestamp is unknown | null; should be number | null.
  • stakingLink shape is stale: upstream discriminates by type — the stakingUser key is present for "requested" / "tradingUser" variants, but the tradingUser key for the "stakingUser" variant. The current single shape (lines 175-189) mis-types the third case.

UserFill (src/api/info/_methods/userFills.ts):

  • Missing optional feeTrialEscrow.
  • liquidatedUser (line 42) is required in the SDK but is now optional upstream.

Fix

Discriminate stakingLink by type, type the timestamp, add feeTrialEscrow, make liquidatedUser optional. Add tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-syncSync with latest Hyperliquid API surface/schemas

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions