Skip to main content

Module params

Module params 

Source
Expand description

Exchange-specific extra parameters, without exposing Value.

Every unified method ends with a params argument carrying the knobs a particular venue understands (timeInForce, reduceOnly, marginMode, …). The typed layer takes a Params here rather than a raw Value, so a caller only ever handles Rust primitives:

ⓘ
// nothing extra
ex.create_order("BTC/USDT", "limit", "buy", 0.01, Some(50_000.0), Params::none()).await?;

// a couple of venue-specific knobs
ex.create_order("BTC/USDT", "limit", "buy", 0.01, Some(50_000.0),
    Params::new()
        .with_str("timeInForce", "GTC")
        .with_bool("postOnly", true)
        .with_float("stopPrice", 49_000.0),
).await?;

Values keep insertion order, matching the JS object ordering the transpiled code and every signing routine expect.

Structs§

Config
Constructor configuration for an exchange, without exposing Value.
Params
Extra exchange-specific parameters for a unified call.