df-hyperliquid-core 0.0.8-beta.1

Hyperliquid SDK for Rust: markets, account, trading, transfers, earn and deploy, with exact decimals and signing. Native and wasm.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::markets::outcomes::coin::Coin;
use crate::utils::Dec;

/// What would be refused before anything is signed.
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum OutcomeError {
    #[error("outcome {0} has no asset id")]
    NoAsset(Coin),
    #[error("{0} is not an outcome price: 0.00001 to 0.99999 on a 0.00001 grid")]
    Price(Dec),
    #[error("{0} is not a whole number of contracts above zero")]
    Size(Dec),
    #[error("{0} is not an amount of the quote token above zero with at most eight places")]
    Amount(Dec),
    #[error("a slippage is a fraction from 0 to 0.5, which {0} is not")]
    Slippage(Dec),
}