From 4d29c195fcb14330eb0734195cf2436698279d18 Mon Sep 17 00:00:00 2001 From: nktkas Date: Thu, 18 Jun 2026 02:10:43 +0300 Subject: [PATCH] refactor(api): align response types with the Hyperliquid API - `outcomeMetaUpdates`: add `settledNamedOutcomes` to the `questionUpdated` event. - `userEvents`: add `time` to the funding event. - `spotMeta`: type `universe[].tokens` as a `[baseToken, quoteToken]` tuple. - `meta`: deprecate `universe[].onlyIsolated` in favor of `marginMode`. Co-authored-by: Claude Opus 4.8 --- src/api/info/_methods/meta.ts | 6 +++++- src/api/info/_methods/spotMeta.ts | 2 +- src/api/subscription/_methods/outcomeMetaUpdates.ts | 2 ++ src/api/subscription/_methods/userEvents.ts | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/api/info/_methods/meta.ts b/src/api/info/_methods/meta.ts index c5a6e925..2e1a18c1 100644 --- a/src/api/info/_methods/meta.ts +++ b/src/api/info/_methods/meta.ts @@ -35,7 +35,11 @@ export type MetaResponse = { maxLeverage: number; /** Unique identifier for the margin requirements table. */ marginTableId: number; - /** Indicates if only isolated margin trading is allowed. */ + /** + * Indicates if only isolated margin trading is allowed. + * + * @deprecated use `marginMode` instead. + */ onlyIsolated?: true; /** Indicates if the universe is delisted. */ isDelisted?: true; diff --git a/src/api/info/_methods/spotMeta.ts b/src/api/info/_methods/spotMeta.ts index c9be08aa..be34844f 100644 --- a/src/api/info/_methods/spotMeta.ts +++ b/src/api/info/_methods/spotMeta.ts @@ -24,7 +24,7 @@ export type SpotMetaResponse = { /** Trading universes available for spot trading. */ universe: { /** Token indices included in this universe. */ - tokens: number[]; + tokens: [baseToken: number, quoteToken: number]; /** Name of the universe. */ name: string; /** Unique identifier of the universe. */ diff --git a/src/api/subscription/_methods/outcomeMetaUpdates.ts b/src/api/subscription/_methods/outcomeMetaUpdates.ts index 277ebe7e..421bf7e2 100644 --- a/src/api/subscription/_methods/outcomeMetaUpdates.ts +++ b/src/api/subscription/_methods/outcomeMetaUpdates.ts @@ -63,6 +63,8 @@ export type OutcomeMetaUpdatesEvent = { fallbackOutcome: number; /** Array of named outcome identifiers. */ namedOutcomes: number[]; + /** Array of settled named outcome identifiers. */ + settledNamedOutcomes: number[]; }; } | { diff --git a/src/api/subscription/_methods/userEvents.ts b/src/api/subscription/_methods/userEvents.ts index 382c456b..f42669cc 100644 --- a/src/api/subscription/_methods/userEvents.ts +++ b/src/api/subscription/_methods/userEvents.ts @@ -35,6 +35,8 @@ export type UserEventsEvent = | { /** Funding update details. */ funding: { + /** Timestamp of the funding event (in ms since epoch). */ + time: number; /** Asset symbol (e.g., BTC). */ coin: string; /**