Skip to main content

Module helpers

Module helpers 

Source

Constants§

BALANCE_EPSILON
DEFAULT_STATIC_WS_TOKEN
Default static token from official Indodax Market Data WebSocket documentation. Used for authenticating with the Public Market Data WebSocket (ws3).
ONE_DAY_MS
ONE_DAY_SECS
PUBLIC_WS_TOKEN_URL

Functions§

build_withdraw_params
Build withdrawal parameters HashMap shared between CLI and MCP.
cancel_all_open_orders
Fetch all open orders and cancel them one by one. Returns (cancelled_ids, failed_ids).
extract_pairs
fetch_public_ws_token
Fetch a public WebSocket token, with fallback to user configuration and then a hardcoded default.
first_of
flatten_json_to_table
format_balance
Currency-aware balance formatting: 2 decimals for IDR/fiat/stablecoins, 8 for crypto. Handles extreme values gracefully (no scientific notation).
format_timestamp
is_fiat_or_stable
Check if a currency is fiat (IDR) or a stablecoin.
normalize_pair
normalize_pair_v2
now_millis
parse_balance
Parse a balance value for a given currency from API account info response.
validate_tick_size
Validate a price against the price increment (tick size) for a pair. Returns a warning string if validation fails, or None if the price is valid or can’t be checked.
value_to_string