UNPKG

@nktkas/hyperliquid

Version:

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

71 lines 3.46 kB
import * as v from "valibot"; /** * Request validator L1 votes. */ export declare const ValidatorL1VotesRequest: v.SchemaWithPipe<readonly [v.ObjectSchema<{ /** Type of request. */ readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"validatorL1Votes", undefined>, v.DescriptionAction<"validatorL1Votes", "Type of request.">]>; }, undefined>, v.DescriptionAction<{ type: "validatorL1Votes"; }, "Request validator L1 votes.">]>; export type ValidatorL1VotesRequest = v.InferOutput<typeof ValidatorL1VotesRequest>; /** * Array of L1 governance votes cast by validators. */ export declare const ValidatorL1VotesResponse: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{ /** Timestamp when the vote expires (in ms since epoch). */ readonly expireTime: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, v.TransformAction<any, number>, v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.SafeIntegerAction<number, undefined>]>, v.DescriptionAction<number, "Timestamp when the vote expires (in ms since epoch).">]>; /** Type of the vote. */ readonly action: v.SchemaWithPipe<readonly [v.UnionSchema<[v.ObjectSchema<{ readonly D: v.StringSchema<undefined>; }, undefined>, v.ObjectSchema<{ readonly C: v.ArraySchema<v.StringSchema<undefined>, undefined>; }, undefined>], undefined>, v.DescriptionAction<{ D: string; } | { C: string[]; }, "Type of the vote.">]>; /** List of validator addresses that cast this vote. */ readonly votes: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 42, undefined>]>, undefined>, v.DescriptionAction<`0x${string}`[], "List of validator addresses that cast this vote.">]>; }, undefined>, v.DescriptionAction<{ expireTime: number; action: { D: string; } | { C: string[]; }; votes: `0x${string}`[]; }, "L1 governance vote cast by validators.">]>, undefined>, v.DescriptionAction<{ expireTime: number; action: { D: string; } | { C: string[]; }; votes: `0x${string}`[]; }[], "Array of L1 governance votes cast by validators.">]>; export type ValidatorL1VotesResponse = v.InferOutput<typeof ValidatorL1VotesResponse>; import type { InfoConfig } from "./_types.js"; /** * Request validator L1 votes. * * @param config - General configuration for Info API requests. * @param signal - [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) to cancel the request. * * @returns Array of L1 governance votes cast by validators. * * @throws {ValiError} 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 { validatorL1Votes } from "@nktkas/hyperliquid/api/info"; * * const transport = new HttpTransport(); // or `WebSocketTransport` * * const data = await validatorL1Votes({ transport }); * ``` */ export declare function validatorL1Votes(config: InfoConfig, signal?: AbortSignal): Promise<ValidatorL1VotesResponse>; //# sourceMappingURL=validatorL1Votes.d.ts.map