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
//! A HIP-3 perp's two names: its coin, `dex:SYMBOL`, and its asset id,
//! `100000 + dex * 10000 + index` ([`Asset::hip3`]).

use crate::utils::Asset;

/// The dex a coin trades on, and `xyz:TSLA` as `("xyz", "TSLA")` and back.
pub use crate::markets::dex::{Dex, coin, split_coin};

/// A HIP-3 perp's dex place in `perpDexs` and its index in that dex's meta; `None` for any other
/// kind of id.
#[must_use]
pub const fn asset_parts(asset: Asset) -> Option<(u32, u32)> {
    asset.hip3_parts()
}