df-hyperliquid-core 0.2.4

Hyperliquid SDK for Rust with full API parity: info, exchange, websockets, HIP-3, HIP-4, HyperEVM and CoreWriter. Exact decimals, the fastest order signing and websocket parsing of the SDKs benchmarked, native and wasm.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! What a named agent may be called.

use super::*;

#[test]
fn a_name_is_one_to_sixteen_characters_and_never_the_expiry_form() {
    // The builder's live agent's name is sixteen characters.
    for good in ["desk", "Desk-3712f660", "Builder Markets", "x"] {
        assert_eq!(AgentName::new(good).map(|name| name.as_str().to_owned()), Ok(good.to_owned()), "{good}");
    }
    for bad in ["", "   ", "seventeen chars!!", "desk valid_until 1"] {
        assert_eq!(AgentName::new(bad), Err(BadAgentName(bad.to_owned())), "{bad}");
    }
}