UNPKG

@nktkas/hyperliquid

Version:

Hyperliquid API SDK for all major JS runtimes, written in TypeScript.

75 lines (74 loc) 2.94 kB
/// <amd-module name="file:///home/runner/work/hyperliquid/hyperliquid/src/api/info/_methods/outcomeMeta.ts" /> import * as v from "valibot"; /** * Request prediction market outcome metadata. * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-outcome-metadata */ export declare const OutcomeMetaRequest: v.ObjectSchema<{ /** Type of request. */ readonly type: v.LiteralSchema<"outcomeMeta", undefined>; }, undefined>; export type OutcomeMetaRequest = v.InferOutput<typeof OutcomeMetaRequest>; /** * Prediction market outcome metadata including outcomes and questions. * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-outcome-metadata */ export type OutcomeMetaResponse = { /** Array of prediction market outcomes. */ outcomes: { /** Outcome identifier. */ outcome: number; /** Name of the outcome. */ name: string; /** Description of the outcome. */ description: string; /** Array of side specifications for this outcome. */ sideSpecs: { /** Name of the side. */ name: string; /** Token identifier for this side. */ token?: number; }[]; /** Quote token for this outcome. */ quoteToken: string; }[]; /** Array of prediction market questions. */ questions: { /** Question identifier. */ question: number; /** Name of the question. */ name: string; /** Description of the question. */ description: string; /** Fallback outcome identifier. */ fallbackOutcome: number; /** Array of named outcome identifiers. */ namedOutcomes: number[]; /** Array of settled named outcome identifiers. */ settledNamedOutcomes: number[]; }[]; }; import type { InfoConfig } from "./_base/mod.js"; /** * Request prediction market outcome metadata. * * @param config General configuration for Info API requests. * @param signal {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | AbortSignal} to cancel the request. * @return Prediction market outcome metadata including outcomes and questions. * * @throws {ValidationError} When the request parameters fail validation (before sending). * @throws {TransportError} When the transport layer throws an error. * * @example * ```ts * import { HttpTransport } from "@nktkas/hyperliquid"; * import { outcomeMeta } from "@nktkas/hyperliquid/api/info"; * * const transport = new HttpTransport(); // or `WebSocketTransport` * * const data = await outcomeMeta({ transport }); * ``` * * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-outcome-metadata */ export declare function outcomeMeta(config: InfoConfig, signal?: AbortSignal): Promise<OutcomeMetaResponse>;