Skip to main content

Module parse

Module parse 

Source
Expand description

Conversion functions that translate AX API schemas into Nautilus types.

Functionsยง

ax_timestamp_ns_to_unix_nanos
Converts an AX nanosecond timestamp to [UnixNanos].
ax_timestamp_s_to_unix_nanos
Converts an AX epoch-seconds timestamp to [UnixNanos].
cid_to_client_order_id
Creates a [ClientOrderId] from a cid value.
client_order_id_to_cid
Converts a [ClientOrderId] to a 64-bit unsigned integer for AX cid field.
deserialize_decimal_or_zero
Deserializes a Decimal from a string field that might be empty.
deserialize_optional_decimal_from_str
Deserializes an optional Decimal from a string-only field.
deserialize_optional_decimal_or_zero
Deserializes a Decimal from an optional string field, defaulting to zero.
deserialize_optional_decimal_str
Deserializes an optional Decimal from a string field.
map_bar_spec_to_candle_width
Maps a Nautilus [BarSpecification] to an AxCandleWidth.
parse_decimal
Parses a string to Decimal, returning an error if parsing fails.
parse_optional_decimal
Parses an optional string to Decimal, returning None if the string is None or empty.
quantity_to_contracts
Converts a [Quantity] to an i64 contract count for AX orders.
serialize_decimal_as_str
Serializes a Decimal as a string (lossless, no scientific notation).
serialize_optional_decimal_as_str
Serializes an optional Decimal as a string.