• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nktkas / hyperliquid / 22525620077

28 Feb 2026 05:36PM UTC coverage: 94.608% (+2.0%) from 92.652%
22525620077

push

github

nktkas
test(exchange/topUpIsolatedOnlyMargin): update asset

606 of 778 branches covered (77.89%)

Branch coverage included in aggregate %.

7640 of 7938 relevant lines covered (96.25%)

724.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.82
/src/api/info/_methods/metaAndAssetCtxs.ts
1
import * as v from "@valibot/valibot";
158✔
2

3
// ============================================================
4
// API Schemas
5
// ============================================================
6

7
import type { PerpAssetCtxSchema } from "./_base/commonSchemas.ts";
8
import type { MetaResponse } from "./meta.ts";
9

10
/**
11
 * Request metadata and asset contexts.
12
 * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
13
 */
14
export const MetaAndAssetCtxsRequest = /* @__PURE__ */ (() => {
158✔
15
  return v.object({
316✔
16
    /** Type of request. */
17
    type: v.literal("metaAndAssetCtxs"),
316✔
18
    /** DEX name (empty string for main dex). */
19
    dex: v.optional(v.string()),
316✔
20
  });
316✔
21
})();
158✔
22
export type MetaAndAssetCtxsRequest = v.InferOutput<typeof MetaAndAssetCtxsRequest>;
23

24
/**
25
 * Tuple containing metadata and array of asset contexts.
26
 * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
27
 */
28
export type MetaAndAssetCtxsResponse = [meta: MetaResponse, assetCtxs: PerpAssetCtxSchema[]];
29

30
// ============================================================
31
// Execution Logic
32
// ============================================================
33

34
import { parse } from "../../../_base.ts";
158✔
35
import type { InfoConfig } from "./_base/types.ts";
36

37
/** Request parameters for the {@linkcode metaAndAssetCtxs} function. */
38
export type MetaAndAssetCtxsParameters = Omit<v.InferInput<typeof MetaAndAssetCtxsRequest>, "type">;
39

40
/**
41
 * Request metadata and asset contexts.
42
 *
43
 * @param config General configuration for Info API requests.
44
 * @param params Parameters specific to the API request.
45
 * @param signal {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal | AbortSignal} to cancel the request.
46
 * @return Metadata and context for perpetual assets.
47
 *
48
 * @throws {ValidationError} When the request parameters fail validation (before sending).
49
 * @throws {TransportError} When the transport layer throws an error.
50
 *
51
 * @example
52
 * ```ts
53
 * import { HttpTransport } from "@nktkas/hyperliquid";
54
 * import { metaAndAssetCtxs } from "@nktkas/hyperliquid/api/info";
55
 *
56
 * const transport = new HttpTransport(); // or `WebSocketTransport`
57
 *
58
 * const data = await metaAndAssetCtxs({ transport });
59
 * ```
60
 *
61
 * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
62
 */
63
export function metaAndAssetCtxs(
64
  config: InfoConfig,
65
  params?: MetaAndAssetCtxsParameters,
66
  signal?: AbortSignal,
67
): Promise<MetaAndAssetCtxsResponse>;
68
export function metaAndAssetCtxs(
69
  config: InfoConfig,
70
  signal?: AbortSignal,
71
): Promise<MetaAndAssetCtxsResponse>;
72
export function metaAndAssetCtxs(
158✔
73
  config: InfoConfig,
158✔
74
  paramsOrSignal?: MetaAndAssetCtxsParameters | AbortSignal,
158✔
75
  maybeSignal?: AbortSignal,
158✔
76
): Promise<MetaAndAssetCtxsResponse> {
77
  const params = paramsOrSignal instanceof AbortSignal ? {} : paramsOrSignal;
×
78
  const signal = paramsOrSignal instanceof AbortSignal ? paramsOrSignal : maybeSignal;
×
79

80
  const request = parse(MetaAndAssetCtxsRequest, {
161✔
81
    type: "metaAndAssetCtxs",
161✔
82
    ...params,
161✔
83
  });
161✔
84
  return config.transport.request("info", request, signal);
161✔
85
}
161✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc