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

Summary of user's delegation status.

Returns totals for delegated, undelegated, and pending withdrawal amounts.

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-delegator-summary

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.

Returns true if cache storage is enabled.

Returns the cache TTL if configured.

Creates a changeset for delegator summary data.

Get delegated amount as float.

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

Check if there are pending withdrawals.

Parse and validate the API response.

Get pending withdrawal amount as float.

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.

Returns true if any storage backend is enabled.

Get total staking balance (delegated + undelegated).

Types

@type t() :: %Hyperliquid.Api.Info.DelegatorSummary{
  delegated: String.t(),
  n_pending_withdrawals: non_neg_integer(),
  total_pending_withdrawal: String.t(),
  undelegated: String.t()
}

Functions

Returns metadata about this endpoint.

Example

iex> Hyperliquid.Api.Info.DelegatorSummary.__endpoint_info__()
%{
  endpoint: "delegatorSummary",
  type: :info,
  rate_limit_cost: 2,
  params: [:user],
  optional_params: [],
  doc: "Retrieve summary of user's delegation status",
  returns: "Totals for delegated, undelegated, and pending withdrawal amounts"
}

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.

Returns true if cache storage is enabled.

Returns the cache TTL if configured.

Link to this function

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

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

Creates a changeset for delegator summary data.

Parameters

  • summary: The delegator summary struct
  • attrs: Map of attributes to validate

Returns

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

delegated_amount(delegator_summary)

View Source
@spec delegated_amount(t()) :: {:ok, float()} | {:error, :parse_error}

Get delegated amount as float.

Parameters

  • summary: The delegator summary struct

Returns

  • {:ok, float()} - Delegated amount
  • {:error, :parse_error} - If parsing fails

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

Link to this function

has_pending_withdrawals?(delegator_summary)

View Source
@spec has_pending_withdrawals?(t()) :: boolean()

Check if there are pending withdrawals.

Parameters

  • summary: The delegator summary struct

Returns

  • boolean()
@spec parse_response(map()) :: {:ok, t()} | {:error, term()}

Parse and validate the API response.

Link to this function

pending_amount(delegator_summary)

View Source
@spec pending_amount(t()) :: {:ok, float()} | {:error, :parse_error}

Get pending withdrawal amount as float.

Parameters

  • summary: The delegator summary struct

Returns

  • {:ok, float()} - Pending amount
  • {:error, :parse_error} - If parsing fails

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.

@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.

Returns true if any storage backend is enabled.

Link to this function

total_balance(delegator_summary)

View Source
@spec total_balance(t()) :: {:ok, float()} | {:error, :parse_error}

Get total staking balance (delegated + undelegated).

Parameters

  • summary: The delegator summary struct

Returns

  • {:ok, float()} - Total balance
  • {:error, :parse_error} - If parsing fails