Skip to main content

Crate hl_types

Crate hl_types 

Source
Expand description

§hl-types

Shared domain types for the motosan-hyperliquid SDK.

This crate defines the Rust structs that map to Hyperliquid’s API data model: orders, positions, candles, signatures, and a unified error type. Every other crate in the SDK depends on hl-types.

This crate has no network dependencies.

Re-exports§

pub use account::HlAccountState;
pub use account::HlActiveAssetData;
pub use account::HlBorrowLendState;
pub use account::HlExtraAgent;
pub use account::HlFill;
pub use account::HlFundingEntry;
pub use account::HlHistoricalOrder;
pub use account::HlOpenOrder;
pub use account::HlOrderDetail;
pub use account::HlPosition;
pub use account::HlRateLimitStatus;
pub use account::HlReferralState;
pub use account::HlStakingDelegation;
pub use account::HlUserFees;
pub use account::HlUserFundingEntry;
pub use account::HlVaultDetails;
pub use account::HlVaultSummary;
pub use candle::HlCandle;
pub use error::HlError;
pub use market::AssetContext;
pub use market::HlAssetInfo;
pub use market::HlFundingRate;
pub use market::HlOrderbook;
pub use market::HlPerpDexStatus;
pub use market::HlSpotAssetInfo;
pub use market::HlSpotBalance;
pub use market::HlSpotMeta;
pub use market::HlTrade;
pub use market::SpotAssetContext;
pub use market::TradeSide;
pub use order::CancelByCloidRequest;
pub use order::CancelRequest;
pub use order::LimitOrderType;
pub use order::ModifyRequest;
pub use order::OrderStatus;
pub use order::OrderTypeWire;
pub use order::OrderWire;
pub use order::OrderWireBuilder;
pub use order::PositionSide;
pub use order::Side;
pub use order::Tif;
pub use order::Tpsl;
pub use order::TriggerOrderType;
pub use response::HlActionResponse;
pub use response::OrderResponse;
pub use signature::Signature;
pub use util::normalize_coin;
pub use util::parse_mid_price_from_l2book;
pub use util::parse_position_szi;
pub use util::parse_str_decimal;

Modules§

account
Account state types (positions, fills, vaults, fees, etc.).
candle
OHLCV candlestick types.
error
Unified error type used across all SDK crates.
market
Market data types (orderbook, asset info, funding rates, trades).
order
Order wire types (order builders, cancel/modify requests, enums).
response
Exchange action and order response types.
signature
ECDSA signature type (r, s, v components).
util
Utility functions (coin normalization, JSON parsing helpers).

Structs§

Decimal
Decimal represents a 128 bit representation of a fixed-precision decimal number. The finite set of values of type Decimal are of the form m / 10e, where m is an integer such that -296 < m < 296, and e is an integer between 0 and 28 inclusive.