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

Pre-transfer validation check.

Validates whether a transfer can be made before executing it. Returns information about transfer eligibility and any restrictions.

See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint

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 pre-transfer check data.

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.

Check if user is sanctioned.

Returns true if any storage backend is enabled.

Check if user exists.

Types

@type t() :: %Hyperliquid.Api.Info.PreTransferCheck{
  fee: String.t(),
  is_sanctioned: boolean(),
  user_exists: boolean(),
  user_has_sent_tx: boolean()
}

Functions

Returns metadata about this endpoint.

Example

iex> Hyperliquid.Api.Info.PreTransferCheck.__endpoint_info__()
%{
  endpoint: "preTransferCheck",
  type: :info,
  rate_limit_cost: 1,
  params: [:user, :source],
  optional_params: [],
  doc: "Check user existence before transfer",
  returns: "User existence and sanction status"
}

Returns postgres table configurations (multi-table support).

Returns storage configuration for this endpoint.

Link to this function

activation_fee(pre_transfer_check)

View Source
@spec activation_fee(t()) :: String.t()

Get activation fee.

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

Link to this function

build_request(user, source)

View Source
@spec build_request(term(), term()) :: map()

Build the request payload.

Returns true if cache storage is enabled.

Returns the cache TTL if configured.

Link to this function

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

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

Creates a changeset for pre-transfer check data.

Parameters

  • check: The pre-transfer check struct
  • attrs: Map of attributes to validate

Returns

  • Ecto.Changeset.t()

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

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

@spec request(term(), term()) :: {:ok, t()} | {:error, term()}

Make the API request and parse the response.

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

Make the API request, raising on error.

Link to this function

request_raw(user, source)

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

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

Link to this function

request_raw!(user, source)

View Source
@spec request_raw!(term(), term()) :: map()

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

Link to this function

sanctioned?(pre_transfer_check)

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

Check if user is sanctioned.

Returns true if any storage backend is enabled.

Link to this function

user_exists?(pre_transfer_check)

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

Check if user exists.