# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501

import os
import pathlib
import typing

from nautilus_trader import model

__all__ = [
    "ReplayNormalizedRequestOptions",
    "StreamNormalizedRequestOptions",
    "TardisDataClientConfig",
    "TardisDataClientFactory",
    "convert_tardis_options_chain_csv",
    "load_tardis_deltas",
    "load_tardis_depth10_from_snapshot5",
    "load_tardis_depth10_from_snapshot25",
    "load_tardis_funding_rates",
    "load_tardis_options_chain",
    "load_tardis_quotes",
    "load_tardis_trades",
    "run_tardis_machine_replay",
    "stream_tardis_batched_deltas",
    "stream_tardis_deltas",
    "stream_tardis_depth10_from_snapshot5",
    "stream_tardis_depth10_from_snapshot25",
    "stream_tardis_funding_rates",
    "stream_tardis_options_chain",
    "stream_tardis_quotes",
    "stream_tardis_trades",
]

@typing.final
class ReplayNormalizedRequestOptions:
    @staticmethod
    def from_json(data: bytes) -> ReplayNormalizedRequestOptions: ...
    @staticmethod
    def from_json_array(data: bytes) -> list[ReplayNormalizedRequestOptions]: ...

@typing.final
class StreamNormalizedRequestOptions:
    @staticmethod
    def from_json(data: bytes) -> StreamNormalizedRequestOptions: ...
    @staticmethod
    def from_json_array(data: bytes) -> list[StreamNormalizedRequestOptions]: ...

@typing.final
class TardisBatchedDeltasStreamIterator:
    def __iter__(self) -> TardisBatchedDeltasStreamIterator: ...
    def __next__(self) -> list[typing.Any] | None: ...

@typing.final
class TardisDataClientConfig:
    @property
    def normalize_symbols(self) -> bool: ...
    @property
    def extract_bbo_as_quotes(self) -> bool: ...
    @property
    def options(self) -> list[ReplayNormalizedRequestOptions]: ...
    @property
    def stream_options(self) -> list[StreamNormalizedRequestOptions]: ...
    def __init__(
        self,
        api_key: str | None = None,
        tardis_ws_url: str | None = None,
        proxy_url: str | None = None,
        normalize_symbols: bool | None = None,
        options: typing.Sequence[ReplayNormalizedRequestOptions] | None = None,
        stream_options: typing.Sequence[StreamNormalizedRequestOptions] | None = None,
        extract_bbo_as_quotes: bool | None = None,
    ) -> None: ...
    @property
    def has_proxy_url(self) -> bool: ...

@typing.final
class TardisDataClientFactory:
    def __init__(self) -> None: ...
    def name(self) -> str: ...

@typing.final
class TardisDeltaStreamIterator:
    def __iter__(self) -> TardisDeltaStreamIterator: ...
    def __next__(self) -> list[model.OrderBookDelta] | None: ...

@typing.final
class TardisDepth10StreamIterator:
    def __iter__(self) -> TardisDepth10StreamIterator: ...
    def __next__(self) -> list[model.OrderBookDepth10] | None: ...

@typing.final
class TardisFundingRateStreamIterator:
    def __iter__(self) -> TardisFundingRateStreamIterator: ...
    def __next__(self) -> list[model.FundingRateUpdate] | None: ...

@typing.final
class TardisHttpClient:
    def __init__(
        self,
        api_key: str | None = None,
        base_url: str | None = None,
        timeout_secs: int | None = None,
        normalize_symbols: bool = True,
        proxy_url: str | None = None,
    ) -> None: ...
    @property
    def api_key(self) -> str | None: ...
    @property
    def api_key_masked(self) -> str | None: ...
    def instruments(
        self,
        exchange: str,
        symbol: str | None = None,
        base_currency: typing.Sequence[str] | None = None,
        quote_currency: typing.Sequence[str] | None = None,
        instrument_type: typing.Sequence[str] | None = None,
        contract_type: typing.Sequence[str] | None = None,
        active: bool | None = None,
        start: int | None = None,
        end: int | None = None,
        available_offset: int | None = None,
        effective: int | None = None,
        ts_init: int | None = None,
    ) -> typing.Any: ...

@typing.final
class TardisInstrumentMiniInfo:
    def __init__(
        self,
        instrument_id: model.InstrumentId,
        raw_symbol: str,
        exchange: str,
        price_precision: int,
        size_precision: int,
    ) -> None: ...
    @property
    def instrument_id(self) -> model.InstrumentId: ...
    @property
    def raw_symbol(self) -> str: ...
    @property
    def exchange(self) -> str: ...
    @property
    def price_precision(self) -> int: ...
    @property
    def size_precision(self) -> int: ...

@typing.final
class TardisMachineClient:
    def __init__(
        self,
        base_url: str | None = None,
        normalize_symbols: bool = True,
        book_snapshot_output: str = "deltas",
        extract_bbo_as_quotes: bool = False,
    ) -> None: ...
    def is_closed(self) -> bool: ...
    def close(self) -> None: ...
    def replay(
        self,
        instruments: typing.Sequence[TardisInstrumentMiniInfo],
        options: typing.Sequence[ReplayNormalizedRequestOptions],
        callback: typing.Any,
    ) -> typing.Any: ...
    def replay_bars(
        self,
        instruments: typing.Sequence[TardisInstrumentMiniInfo],
        options: typing.Sequence[ReplayNormalizedRequestOptions],
    ) -> typing.Any: ...
    def stream(
        self,
        instruments: typing.Sequence[TardisInstrumentMiniInfo],
        options: typing.Sequence[StreamNormalizedRequestOptions],
        callback: typing.Any,
    ) -> typing.Any: ...

@typing.final
class TardisOptionsChainStreamIterator:
    def __iter__(self) -> TardisOptionsChainStreamIterator: ...
    def __next__(self) -> list[typing.Any] | None: ...

@typing.final
class TardisQuoteStreamIterator:
    def __iter__(self) -> TardisQuoteStreamIterator: ...
    def __next__(self) -> list[model.QuoteTick] | None: ...

@typing.final
class TardisTradeStreamIterator:
    def __iter__(self) -> TardisTradeStreamIterator: ...
    def __next__(self) -> list[model.TradeTick] | None: ...

def bar_spec_to_tardis_trade_bar_string(bar_spec: model.BarSpecification) -> str: ...
def convert_tardis_options_chain_csv(
    filepaths: typing.Sequence[str | os.PathLike | pathlib.Path],
    catalog_path: str | os.PathLike | pathlib.Path,
    underlyings: typing.Sequence[str] | None = None,
    snapshot_interval_ms: int | None = None,
    extract_bbo_as_quotes: bool = True,
    write_instruments: bool = True,
    price_precision: int | None = None,
    size_precision: int | None = None,
) -> None: ...
def load_tardis_deltas(
    filepath: str | os.PathLike | pathlib.Path,
    price_precision: int | None = None,
    size_precision: int | None = None,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> list[model.OrderBookDelta]: ...
def load_tardis_depth10_from_snapshot25(
    filepath: str | os.PathLike | pathlib.Path,
    price_precision: int | None = None,
    size_precision: int | None = None,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> list[model.OrderBookDepth10]: ...
def load_tardis_depth10_from_snapshot5(
    filepath: str | os.PathLike | pathlib.Path,
    price_precision: int | None = None,
    size_precision: int | None = None,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> list[model.OrderBookDepth10]: ...
def load_tardis_funding_rates(
    filepath: str | os.PathLike | pathlib.Path,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> list[model.FundingRateUpdate]: ...
def load_tardis_options_chain(
    filepath: str | os.PathLike | pathlib.Path,
    underlyings: typing.Sequence[str] | None = None,
    price_precision: int | None = None,
    size_precision: int | None = None,
    limit: int | None = None,
) -> list[typing.Any]: ...
def load_tardis_quotes(
    filepath: str | os.PathLike | pathlib.Path,
    price_precision: int | None = None,
    size_precision: int | None = None,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> list[model.QuoteTick]: ...
def load_tardis_trades(
    filepath: str | os.PathLike | pathlib.Path,
    price_precision: int | None = None,
    size_precision: int | None = None,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> list[model.TradeTick]: ...
def run_tardis_machine_replay(config_filepath: str) -> typing.Any: ...
def stream_tardis_batched_deltas(
    filepath: str | os.PathLike | pathlib.Path,
    chunk_size: int = 100000,
    price_precision: int | None = None,
    size_precision: int | None = None,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> TardisBatchedDeltasStreamIterator: ...
def stream_tardis_deltas(
    filepath: str | os.PathLike | pathlib.Path,
    chunk_size: int = 100000,
    price_precision: int | None = None,
    size_precision: int | None = None,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> TardisDeltaStreamIterator: ...
def stream_tardis_depth10_from_snapshot25(
    filepath: str | os.PathLike | pathlib.Path,
    chunk_size: int = 100000,
    price_precision: int | None = None,
    size_precision: int | None = None,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> TardisDepth10StreamIterator: ...
def stream_tardis_depth10_from_snapshot5(
    filepath: str | os.PathLike | pathlib.Path,
    chunk_size: int = 100000,
    price_precision: int | None = None,
    size_precision: int | None = None,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> TardisDepth10StreamIterator: ...
def stream_tardis_funding_rates(
    filepath: str | os.PathLike | pathlib.Path,
    chunk_size: int = 100000,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> TardisFundingRateStreamIterator: ...
def stream_tardis_options_chain(
    filepath: str | os.PathLike | pathlib.Path,
    chunk_size: int = 100000,
    underlyings: typing.Sequence[str] | None = None,
    price_precision: int | None = None,
    size_precision: int | None = None,
    limit: int | None = None,
) -> TardisOptionsChainStreamIterator: ...
def stream_tardis_quotes(
    filepath: str | os.PathLike | pathlib.Path,
    chunk_size: int = 100000,
    price_precision: int | None = None,
    size_precision: int | None = None,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> TardisQuoteStreamIterator: ...
def stream_tardis_trades(
    filepath: str | os.PathLike | pathlib.Path,
    chunk_size: int = 100000,
    price_precision: int | None = None,
    size_precision: int | None = None,
    instrument_id: model.InstrumentId | None = None,
    limit: int | None = None,
) -> TardisTradeStreamIterator: ...
def tardis_exchange_from_venue_str(venue_str: str) -> list[str]: ...
def tardis_exchange_is_option_exchange(exchange_str: str) -> bool: ...
def tardis_exchange_to_venue_str(exchange_str: str) -> str: ...
def tardis_exchanges() -> list[str]: ...
def tardis_normalize_symbol_str(
    symbol: str, exchange: str, instrument_type: str, is_inverse: bool | None = None
) -> str: ...
