UNPKG

@nktkas/hyperliquid

Version:

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

54 lines 4 kB
import * as v from "valibot"; /** Error response for failed operations. */ export declare const ErrorResponse: v.SchemaWithPipe<readonly [v.ObjectSchema<{ /** Error status. */ readonly status: v.SchemaWithPipe<readonly [v.LiteralSchema<"err", undefined>, v.DescriptionAction<"err", "Error status.">]>; /** Error message. */ readonly response: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.DescriptionAction<string, "Error message.">]>; }, undefined>, v.DescriptionAction<{ status: "err"; response: string; }, "Error response for failed operations.">]>; export type ErrorResponse = v.InferOutput<typeof ErrorResponse>; /** Successful response without specific data. */ export declare const SuccessResponse: v.SchemaWithPipe<readonly [v.ObjectSchema<{ /** Successful status. */ readonly status: v.SchemaWithPipe<readonly [v.LiteralSchema<"ok", undefined>, v.DescriptionAction<"ok", "Successful status.">]>; /** Response details. */ readonly response: v.SchemaWithPipe<readonly [v.ObjectSchema<{ /** Type of response. */ readonly type: v.SchemaWithPipe<readonly [v.LiteralSchema<"default", undefined>, v.DescriptionAction<"default", "Type of response.">]>; }, undefined>, v.DescriptionAction<{ type: "default"; }, "Response details.">]>; }, undefined>, v.DescriptionAction<{ status: "ok"; response: { type: "default"; }; }, "Successful response without specific data.">]>; export type SuccessResponse = v.InferOutput<typeof SuccessResponse>; /** ECDSA signature components. */ export declare const Signature: v.SchemaWithPipe<readonly [v.ObjectSchema<{ /** First 32-byte component. */ readonly r: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>]>, v.DescriptionAction<`0x${string}`, "First 32-byte component.">]>; /** Second 32-byte component. */ readonly s: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.LengthAction<`0x${string}`, 66, undefined>]>, v.DescriptionAction<`0x${string}`, "Second 32-byte component.">]>; /** Recovery identifier. */ readonly v: v.SchemaWithPipe<readonly [v.PicklistSchema<[27, 28], undefined>, v.DescriptionAction<27 | 28, "Recovery identifier.">]>; }, undefined>, v.DescriptionAction<{ r: `0x${string}`; s: `0x${string}`; v: 27 | 28; }, "ECDSA signature components.">]>; export type Signature = v.InferOutput<typeof Signature>; /** Nonce (timestamp in ms) used to prevent replay attacks. */ export declare const Nonce: 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.MinValueAction<number, 0, undefined>]>, v.DescriptionAction<number, "Nonce (timestamp in ms) used to prevent replay attacks.">]>; export type Nonce = v.InferOutput<typeof Nonce>; /** Chain ID in hex format for EIP-712 signing. */ export declare const SignatureChainId: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.TransformAction<string, `0x${string}`>]>, v.DescriptionAction<`0x${string}`, "Chain ID in hex format for EIP-712 signing.">]>; export type SignatureChainId = v.InferOutput<typeof SignatureChainId>; /** HyperLiquid network type. */ export declare const HyperliquidChain: v.SchemaWithPipe<readonly [v.PicklistSchema<["Mainnet", "Testnet"], undefined>, v.DescriptionAction<"Testnet" | "Mainnet", "HyperLiquid network type.">]>; export type HyperliquidChain = v.InferOutput<typeof HyperliquidChain>; //# sourceMappingURL=schemas.d.ts.map