View Source Hyperliquid.Api.Info.FrontendOpenOrders (hyperliquid v0.2.2)

Open orders with frontend display information.

Similar to openOrders but includes additional display fields used by the frontend.

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders-with-additional-frontend-info

Usage

{:ok, orders} = FrontendOpenOrders.request("0x1234...")
buys = FrontendOpenOrders.buys(orders)

Summary

Functions

Returns metadata about this endpoint.

Returns postgres table configurations (multi-table support).

Returns storage configuration for this endpoint.

Build a cache key from response data using the configured pattern. Returns nil if cache is not enabled or no pattern configured.

Build the request payload.

Get buy orders.

Get orders for a specific coin.

Returns true if cache storage is enabled.

Returns the cache TTL if configured.

Creates a changeset for frontend open orders data.

Get total order count.

Fetch is an alias for request when no storage is configured.

Parse and validate the API response.

Returns true if postgres storage is enabled.

Returns the postgres table name if configured (primary table for legacy support).

Returns the upsert config for postgres (primary table for legacy support).

Get the rate limit cost for this endpoint.

Make the API request and parse the response.

Make the API request, raising on error.

Make the API request and return the raw response map (no key transformation).

Make the API request returning raw map, raising on error.

Get sell orders.

Returns true if any storage backend is enabled.

Get trigger orders only.

Types

@type t() :: %Hyperliquid.Api.Info.FrontendOpenOrders{orders: [Order.t()]}

Functions

Returns metadata about this endpoint.

Example

iex> Hyperliquid.Api.Info.FrontendOpenOrders.__endpoint_info__()
%{
  endpoint: "frontendOpenOrders",
  type: :info,
  rate_limit_cost: 2,
  params: [:user],
  optional_params: [],
  doc: "Retrieve open orders with frontend display information",
  returns: "List of open orders with additional display fields"
}

Returns postgres table configurations (multi-table support).

Returns storage configuration for this endpoint.

Build a cache key from response data using the configured pattern. Returns nil if cache is not enabled or no pattern configured.

@spec build_request(term()) :: map()

Build the request payload.

Link to this function

buys(frontend_open_orders)

View Source
@spec buys(t()) :: [map()]

Get buy orders.

Parameters

  • orders: The frontend open orders struct

Returns

  • List of buy orders
Link to this function

by_coin(frontend_open_orders, coin)

View Source
@spec by_coin(t(), String.t()) :: [map()]

Get orders for a specific coin.

Parameters

  • orders: The frontend open orders struct
  • coin: Coin symbol

Returns

  • List of orders for the coin

Returns true if cache storage is enabled.

Returns the cache TTL if configured.

Link to this function

changeset(orders \\ %__MODULE__{}, attrs)

View Source
@spec changeset(t(), map()) :: Ecto.Changeset.t()

Creates a changeset for frontend open orders data.

Parameters

  • orders: The frontend open orders struct
  • attrs: Map with orders key

Returns

  • Ecto.Changeset.t()
Link to this function

count(frontend_open_orders)

View Source
@spec count(t()) :: non_neg_integer()

Get total order count.

Parameters

  • orders: The frontend open orders struct

Returns

  • non_neg_integer()

Fetch is an alias for request when no storage is configured.

Link to this function

find_by_oid(frontend_open_orders, oid)

View Source
@spec find_by_oid(t(), integer()) :: {:ok, map()} | {:error, :not_found}

Find order by OID.

Parameters

  • orders: The frontend open orders struct
  • oid: Order ID

Returns

  • {:ok, Order.t()} if found
  • {:error, :not_found} if not found
@spec parse_response(map()) :: {:ok, t()} | {:error, term()}

Parse and validate the API response.

Returns true if postgres storage is enabled.

Returns the postgres table name if configured (primary table for legacy support).

Link to this function

postgres_upsert_config()

View Source

Returns the upsert config for postgres (primary table for legacy support).

@spec rate_limit_cost() :: non_neg_integer()

Get the rate limit cost for this endpoint.

Link to this function

reduce_only_orders(frontend_open_orders)

View Source
@spec reduce_only_orders(t()) :: [map()]

Get reduce-only orders.

Parameters

  • orders: The frontend open orders struct

Returns

  • List of reduce-only orders
@spec request(term()) :: {:ok, t()} | {:error, term()}

Make the API request and parse the response.

@spec request!(term()) :: t()

Make the API request, raising on error.

@spec request_raw(term()) :: {:ok, map()} | {:error, term()}

Make the API request and return the raw response map (no key transformation).

@spec request_raw!(term()) :: map()

Make the API request returning raw map, raising on error.

Link to this function

sells(frontend_open_orders)

View Source
@spec sells(t()) :: [map()]

Get sell orders.

Parameters

  • orders: The frontend open orders struct

Returns

  • List of sell orders

Returns true if any storage backend is enabled.

Link to this function

trigger_orders(frontend_open_orders)

View Source
@spec trigger_orders(t()) :: [map()]

Get trigger orders only.

Parameters

  • orders: The frontend open orders struct

Returns

  • List of trigger orders