View Source Hyperliquid.Api.Info.UsdcRouting (hyperliquid v0.3.0)
Current USDC deposit and withdrawal routing.
Each route is either "bridge" (the native Arbitrum bridge) or "cctp"
(Circle's Cross-Chain Transfer Protocol). The routes can change independently,
so check the one for the direction you care about.
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/usdc
Usage
{:ok, routing} = UsdcRouting.request()
UsdcRouting.deposit_via_cctp?(routing)
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 USDC routing data.
Whether deposits currently route over CCTP.
Fetch data and persist to configured storage backends.
Fetch data and persist. Raises on error.
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.
Known routing values.
Returns true if any storage backend is enabled.
Whether withdrawals currently route over CCTP.
Types
@type route() :: String.t()
Functions
Returns metadata about this endpoint.
Example
iex> Hyperliquid.Api.Info.UsdcRouting.__endpoint_info__()
%{
endpoint: "usdcRouting",
type: :info,
rate_limit_cost: 2,
params: [],
optional_params: [],
doc: "Retrieve current USDC deposit and withdrawal routing",
returns: "Deposit and withdrawal routes, each bridge or cctp"
}
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() :: map()
Build the request payload.
Returns true if cache storage is enabled.
Returns the cache TTL if configured.
@spec changeset(t(), map()) :: Ecto.Changeset.t()
Creates a changeset for USDC routing data.
Parameters
routing: The routing structattrs: Map of attributes
Returns
Ecto.Changeset.t()
Whether deposits currently route over CCTP.
Parameters
routing: The routing struct
Returns
boolean()
Fetch data and persist to configured storage backends.
This calls request/0 and then stores the result using Storage.Writer.
@spec fetch!() :: t()
Fetch data and persist. Raises on error.
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).
@spec rate_limit_cost() :: non_neg_integer()
Get the rate limit cost for this endpoint.
Make the API request and parse the response.
@spec request!() :: t()
Make the API request, raising on error.
Make the API request and return the raw response map (no key transformation).
@spec request_raw!() :: map()
Make the API request returning raw map, raising on error.
@spec routes() :: [route()]
Known routing values.
Returns
- List of valid route strings
Returns true if any storage backend is enabled.
Whether withdrawals currently route over CCTP.
Parameters
routing: The routing struct
Returns
boolean()