pub enum HyperliquidRejectCode {
Show 18 variants
Tick,
MinTradeNtl,
MinTradeSpotNtl,
PerpMargin,
ReduceOnly,
BadAloPx,
IocCancel,
BadTriggerPx,
MarketOrderNoLiquidity,
PositionIncreaseAtOpenInterestCap,
PositionFlipAtOpenInterestCap,
TooAggressiveAtOpenInterestCap,
OpenInterestIncrease,
InsufficientSpotBalance,
Oracle,
PerpMaxPosition,
MissingOrder,
Unknown(String),
}Variants§
Tick
Price must be divisible by tick size.
MinTradeNtl
Order must have minimum value of $10.
MinTradeSpotNtl
Order must have minimum value of 10 {quote_token}.
PerpMargin
Insufficient margin to place order.
ReduceOnly
Reduce only order would increase position.
BadAloPx
Post only order would have immediately matched.
IocCancel
Order could not immediately match.
BadTriggerPx
Invalid TP/SL price.
MarketOrderNoLiquidity
No liquidity available for market order.
PositionIncreaseAtOpenInterestCap
Position increase at open interest cap.
PositionFlipAtOpenInterestCap
Position flip at open interest cap.
TooAggressiveAtOpenInterestCap
Too aggressive at open interest cap.
OpenInterestIncrease
Open interest increase.
InsufficientSpotBalance
Insufficient spot balance.
Oracle
Oracle issue.
PerpMaxPosition
Perp max position.
MissingOrder
Missing order.
Unknown(String)
Unknown reject reason with raw error message.
Implementations§
Source§impl HyperliquidRejectCode
impl HyperliquidRejectCode
Sourcepub fn from_api_error(error_message: &str) -> Self
pub fn from_api_error(error_message: &str) -> Self
Parse reject code from Hyperliquid API error message.
Sourcepub fn from_error_string(error: &str) -> Self
👎Deprecated since 0.50.0: String parsing is fragile; use HyperliquidRejectCode::from_api_error() instead
pub fn from_error_string(error: &str) -> Self
String parsing is fragile; use HyperliquidRejectCode::from_api_error() instead
Parses reject code from error string.
Deprecated: This method uses substring matching which is fragile and not robust.
Use from_api_error() instead, which provides a migration path for structured error handling.
Trait Implementations§
Source§impl Clone for HyperliquidRejectCode
impl Clone for HyperliquidRejectCode
Source§fn clone(&self) -> HyperliquidRejectCode
fn clone(&self) -> HyperliquidRejectCode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HyperliquidRejectCode
impl Debug for HyperliquidRejectCode
Source§impl<'de> Deserialize<'de> for HyperliquidRejectCode
impl<'de> Deserialize<'de> for HyperliquidRejectCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for HyperliquidRejectCode
impl Hash for HyperliquidRejectCode
Source§impl PartialEq for HyperliquidRejectCode
impl PartialEq for HyperliquidRejectCode
Source§impl Serialize for HyperliquidRejectCode
impl Serialize for HyperliquidRejectCode
impl Eq for HyperliquidRejectCode
impl StructuralPartialEq for HyperliquidRejectCode
Auto Trait Implementations§
impl Freeze for HyperliquidRejectCode
impl RefUnwindSafe for HyperliquidRejectCode
impl Send for HyperliquidRejectCode
impl Sync for HyperliquidRejectCode
impl Unpin for HyperliquidRejectCode
impl UnsafeUnpin for HyperliquidRejectCode
impl UnwindSafe for HyperliquidRejectCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more