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

import datetime
import decimal
import enum
import typing

from nautilus_trader import model
from nautilus_trader import network

__all__ = [
    "HYPERLIQUID",
    "HYPERLIQUID_CLIENT_ID",
    "HYPERLIQUID_VENUE",
    "HyperliquidAllDexsAssetCtxs",
    "HyperliquidAllMids",
    "HyperliquidDataClientConfig",
    "HyperliquidDataClientFactory",
    "HyperliquidEnvironment",
    "HyperliquidExecutionClientConfig",
    "HyperliquidExecutionClientFactory",
    "HyperliquidOpenInterest",
    "HyperliquidProductType",
    "HyperliquidPublicTrade",
    "HyperliquidTwapHistory",
    "HyperliquidTwapSliceFill",
]

HYPERLIQUID: str
HYPERLIQUID_CLIENT_ID: model.ClientId
HYPERLIQUID_VENUE: model.Venue

@typing.final
class HyperliquidAllDexsAssetCtxs:
    @property
    def entries(self) -> typing.Any: ...
    @property
    def ts_event(self) -> int: ...
    @property
    def ts_init(self) -> int: ...
    def __new__(
        cls, entries: typing.Any, ts_event: int, ts_init: int
    ) -> HyperliquidAllDexsAssetCtxs: ...
    def to_json(self) -> str: ...
    @classmethod
    def from_json(cls, data: typing.Any) -> typing.Any: ...

@typing.final
class HyperliquidAllMids:
    @property
    def mids(self) -> typing.Any: ...
    @property
    def ts_event(self) -> int: ...
    @property
    def ts_init(self) -> int: ...
    def __new__(cls, mids: typing.Any, ts_event: int, ts_init: int) -> HyperliquidAllMids: ...
    def to_json(self) -> str: ...
    @classmethod
    def from_json(cls, data: typing.Any) -> typing.Any: ...
    @classmethod
    def decode_record_batch_py(
        cls, metadata: typing.Mapping[str, str], py_batch: typing.Any
    ) -> typing.Any: ...
    def encode_record_batch_py(self, items: list) -> typing.Any: ...

@typing.final
class HyperliquidDataClientConfig:
    @property
    def environment(self) -> HyperliquidEnvironment: ...
    @property
    def base_url_ws(self) -> str | None: ...
    @property
    def base_url_http(self) -> str | None: ...
    @property
    def http_timeout_secs(self) -> int: ...
    @property
    def ws_timeout_secs(self) -> int: ...
    @property
    def update_instruments_interval_mins(self) -> int: ...
    @property
    def transport_backend(self) -> network.TransportBackend: ...
    @property
    def stale_stream_receive_timeout_secs(self) -> int: ...
    @property
    def stream_health_check_interval_secs(self) -> int: ...
    @property
    def stale_stream_warning_cooldown_secs(self) -> int: ...
    @property
    def stale_stream_recovery_enabled(self) -> bool: ...
    @property
    def stale_stream_recovery_cooldown_secs(self) -> int: ...
    @property
    def stale_stream_max_targeted_resubscribes(self) -> int: ...
    def __init__(
        self,
        environment: HyperliquidEnvironment | None = None,
        private_key: str | None = None,
        base_url_ws: str | None = None,
        base_url_http: str | None = None,
        proxy_url: str | None = None,
        http_timeout_secs: int | None = None,
        ws_timeout_secs: int | None = None,
        update_instruments_interval_mins: int | None = None,
        transport_backend: network.TransportBackend | None = None,
        stale_stream_receive_timeout_secs: int | None = None,
        stream_health_check_interval_secs: int | None = None,
        stale_stream_warning_cooldown_secs: int | None = None,
        stale_stream_recovery_enabled: bool | None = None,
        stale_stream_recovery_cooldown_secs: int | None = None,
        stale_stream_max_targeted_resubscribes: int | None = None,
    ) -> None: ...
    @property
    def has_proxy_url(self) -> bool: ...

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

@typing.final
class HyperliquidExecutionClientConfig:
    @property
    def account_id(self) -> model.AccountId: ...
    @property
    def vault_address(self) -> str | None: ...
    @property
    def account_address(self) -> str | None: ...
    @property
    def environment(self) -> HyperliquidEnvironment: ...
    @property
    def base_url_ws(self) -> str | None: ...
    @property
    def base_url_http(self) -> str | None: ...
    @property
    def base_url_exchange(self) -> str | None: ...
    @property
    def http_timeout_secs(self) -> int: ...
    @property
    def max_retries(self) -> int: ...
    @property
    def retry_delay_initial_ms(self) -> int: ...
    @property
    def retry_delay_max_ms(self) -> int: ...
    @property
    def normalize_prices(self) -> bool: ...
    @property
    def market_order_slippage_bps(self) -> int: ...
    @property
    def include_builder_attribution(self) -> bool: ...
    @property
    def ws_post_timeout_secs(self) -> int: ...
    @property
    def transport_backend(self) -> network.TransportBackend: ...
    def __init__(
        self,
        account_id: model.AccountId | None = None,
        private_key: str | None = None,
        vault_address: str | None = None,
        account_address: str | None = None,
        environment: HyperliquidEnvironment | None = None,
        base_url_ws: str | None = None,
        base_url_http: str | None = None,
        base_url_exchange: str | None = None,
        proxy_url: str | None = None,
        http_timeout_secs: int | None = None,
        max_retries: int | None = None,
        retry_delay_initial_ms: int | None = None,
        retry_delay_max_ms: int | None = None,
        normalize_prices: bool | None = None,
        market_order_slippage_bps: int | None = None,
        include_builder_attribution: bool | None = None,
        ws_post_timeout_secs: int | None = None,
        transport_backend: network.TransportBackend | None = None,
    ) -> None: ...
    @property
    def has_proxy_url(self) -> bool: ...

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

@typing.final
class HyperliquidHttpClient:
    def __init__(
        self,
        private_key: str | None = None,
        vault_address: str | None = None,
        account_address: str | None = None,
        environment: HyperliquidEnvironment = ...,
        timeout_secs: int = 60,
        proxy_url: str | None = None,
        normalize_prices: bool = True,
        include_builder_attribution: bool = True,
    ) -> None: ...
    @staticmethod
    def from_env(
        environment: HyperliquidEnvironment = ..., include_builder_attribution: bool = True
    ) -> HyperliquidHttpClient: ...
    @staticmethod
    def from_credentials(
        private_key: str,
        vault_address: str | None = None,
        environment: HyperliquidEnvironment = ...,
        timeout_secs: int = 60,
        proxy_url: str | None = None,
        include_builder_attribution: bool = True,
    ) -> HyperliquidHttpClient: ...
    def cache_instrument(self, instrument: typing.Any) -> None: ...
    def set_account_id(self, account_id: str) -> None: ...
    def get_user_address(self) -> str: ...
    def get_spot_fill_coin_mapping(self) -> dict[str, str]: ...
    def get_spot_meta(self) -> typing.Any: ...
    def get_perp_meta(self) -> typing.Any: ...
    def build_all_dex_asset_ctxs_instrument_ids(self) -> typing.Any: ...
    def load_instrument_definitions(
        self,
        include_spot: bool = True,
        include_perps: bool = True,
        include_perps_hip3: bool = False,
        include_outcomes: bool = False,
    ) -> typing.Any: ...
    def request_quote_ticks(
        self,
        instrument_id: model.InstrumentId,
        start: datetime.datetime | None = None,
        end: datetime.datetime | None = None,
        limit: int | None = None,
    ) -> typing.Any: ...
    def request_trade_ticks(
        self,
        instrument_id: model.InstrumentId,
        start: datetime.datetime | None = None,
        end: datetime.datetime | None = None,
        limit: int | None = None,
    ) -> typing.Any: ...
    def request_public_trades(
        self,
        instrument_id: model.InstrumentId,
        start: datetime.datetime | None = None,
        end: datetime.datetime | None = None,
        limit: int | None = None,
    ) -> typing.Any: ...
    def request_bars(
        self,
        bar_type: model.BarType,
        start: datetime.datetime | None = None,
        end: datetime.datetime | None = None,
        limit: int | None = None,
    ) -> typing.Any: ...
    def submit_order(
        self,
        instrument_id: model.InstrumentId,
        client_order_id: model.ClientOrderId,
        order_side: model.OrderSide,
        order_type: model.OrderType,
        quantity: model.Quantity,
        time_in_force: model.TimeInForce,
        price: model.Price | None = None,
        trigger_price: model.Price | None = None,
        post_only: bool = False,
        reduce_only: bool = False,
    ) -> typing.Any: ...
    def cancel_order(
        self,
        instrument_id: model.InstrumentId,
        client_order_id: model.ClientOrderId | None = None,
        venue_order_id: model.VenueOrderId | None = None,
    ) -> typing.Any: ...
    def modify_order(
        self,
        instrument_id: model.InstrumentId,
        venue_order_id: model.VenueOrderId | None,
        order_side: model.OrderSide,
        order_type: model.OrderType,
        price: model.Price,
        quantity: model.Quantity,
        trigger_price: model.Price | None,
        reduce_only: bool,
        post_only: bool,
        time_in_force: model.TimeInForce,
        client_order_id: model.ClientOrderId | None = ...,
    ) -> typing.Any: ...
    def submit_orders(self, orders: typing.Sequence[typing.Any]) -> typing.Any: ...
    def request_order_status_reports(self, instrument_id: str | None = ...) -> typing.Any: ...
    def request_order_status_report(
        self, venue_order_id: str | None = None, client_order_id: str | None = None
    ) -> typing.Any: ...
    def request_fill_reports(self, instrument_id: str | None = ...) -> typing.Any: ...
    def request_position_status_reports(self, instrument_id: str | None = ...) -> typing.Any: ...
    def request_account_state(self) -> typing.Any: ...
    def request_spot_balances(self) -> typing.Any: ...
    def request_spot_position_status_reports(
        self, instrument_id: str | None = ...
    ) -> typing.Any: ...
    def info_spot_clearinghouse_state(self) -> typing.Any: ...
    def info_user_fees(self) -> typing.Any: ...
    def submit_split_outcome(self, outcome: int, amount: decimal.Decimal) -> typing.Any: ...
    def submit_merge_outcome(
        self, outcome: int, amount: decimal.Decimal | None = None
    ) -> typing.Any: ...
    def submit_merge_question(
        self, question: int, amount: decimal.Decimal | None = None
    ) -> typing.Any: ...
    def submit_negate_outcome(
        self, question: int, outcome: int, amount: decimal.Decimal
    ) -> typing.Any: ...

@typing.final
class HyperliquidOpenInterest:
    @property
    def instrument_id(self) -> model.InstrumentId: ...
    @property
    def open_interest(self) -> typing.Any: ...
    @property
    def ts_event(self) -> int: ...
    @property
    def ts_init(self) -> int: ...
    def __new__(
        cls,
        instrument_id: model.InstrumentId,
        open_interest: typing.Any,
        ts_event: int,
        ts_init: int,
    ) -> HyperliquidOpenInterest: ...
    def to_json(self) -> str: ...
    @classmethod
    def from_json(cls, data: typing.Any) -> typing.Any: ...
    @classmethod
    def decode_record_batch_py(
        cls, metadata: typing.Mapping[str, str], py_batch: typing.Any
    ) -> typing.Any: ...
    def encode_record_batch_py(self, items: list) -> typing.Any: ...

@typing.final
class HyperliquidPublicTrade:
    @property
    def instrument_id(self) -> model.InstrumentId: ...
    @property
    def price(self) -> typing.Any: ...
    @property
    def size(self) -> typing.Any: ...
    @property
    def aggressor_side(self) -> typing.Any: ...
    @property
    def trade_id(self) -> str: ...
    @property
    def buyer(self) -> str: ...
    @property
    def seller(self) -> str: ...
    @property
    def hash(self) -> str: ...
    @property
    def ts_event(self) -> int: ...
    @property
    def ts_init(self) -> int: ...
    def __new__(
        cls,
        instrument_id: model.InstrumentId,
        price: typing.Any,
        size: typing.Any,
        aggressor_side: typing.Any,
        trade_id: str,
        buyer: str,
        seller: str,
        hash: str,
        ts_event: int,
        ts_init: int,
    ) -> HyperliquidPublicTrade: ...
    def to_json(self) -> str: ...
    @classmethod
    def from_json(cls, data: typing.Any) -> typing.Any: ...
    @classmethod
    def decode_record_batch_py(
        cls, metadata: typing.Mapping[str, str], py_batch: typing.Any
    ) -> typing.Any: ...
    def encode_record_batch_py(self, items: list) -> typing.Any: ...
    @staticmethod
    def to_arrow_record_batch_bytes(data: typing.Sequence[HyperliquidPublicTrade]) -> bytes: ...

@typing.final
class HyperliquidTwapHistory:
    @property
    def user(self) -> str: ...
    @property
    def twap_id(self) -> typing.Any: ...
    @property
    def coin(self) -> str: ...
    @property
    def instrument_id(self) -> typing.Any: ...
    @property
    def side(self) -> typing.Any: ...
    @property
    def size(self) -> typing.Any: ...
    @property
    def executed_size(self) -> typing.Any: ...
    @property
    def executed_notional(self) -> typing.Any: ...
    @property
    def minutes(self) -> int: ...
    @property
    def reduce_only(self) -> bool: ...
    @property
    def randomize(self) -> bool: ...
    @property
    def status(self) -> typing.Any: ...
    @property
    def status_description(self) -> str: ...
    @property
    def state_timestamp(self) -> int: ...
    @property
    def is_snapshot(self) -> bool: ...
    @property
    def ts_event(self) -> int: ...
    @property
    def ts_init(self) -> int: ...
    def __new__(
        cls,
        user: str,
        twap_id: typing.Any,
        coin: str,
        instrument_id: typing.Any,
        side: typing.Any,
        size: typing.Any,
        executed_size: typing.Any,
        executed_notional: typing.Any,
        minutes: int,
        reduce_only: bool,
        randomize: bool,
        status: typing.Any,
        status_description: str,
        state_timestamp: int,
        is_snapshot: bool,
        ts_event: int,
        ts_init: int,
    ) -> HyperliquidTwapHistory: ...
    def to_json(self) -> str: ...
    @classmethod
    def from_json(cls, data: typing.Any) -> typing.Any: ...
    @classmethod
    def decode_record_batch_py(
        cls, metadata: typing.Mapping[str, str], py_batch: typing.Any
    ) -> typing.Any: ...
    def encode_record_batch_py(self, items: list) -> typing.Any: ...

@typing.final
class HyperliquidTwapSliceFill:
    @property
    def user(self) -> str: ...
    @property
    def twap_id(self) -> int: ...
    @property
    def coin(self) -> str: ...
    @property
    def instrument_id(self) -> typing.Any: ...
    @property
    def price(self) -> typing.Any: ...
    @property
    def size(self) -> typing.Any: ...
    @property
    def side(self) -> typing.Any: ...
    @property
    def hash(self) -> str: ...
    @property
    def oid(self) -> int: ...
    @property
    def tid(self) -> int: ...
    @property
    def crossed(self) -> bool: ...
    @property
    def fee(self) -> typing.Any: ...
    @property
    def fee_token(self) -> str: ...
    @property
    def dir(self) -> str: ...
    @property
    def closed_pnl(self) -> typing.Any: ...
    @property
    def is_snapshot(self) -> bool: ...
    @property
    def ts_event(self) -> int: ...
    @property
    def ts_init(self) -> int: ...
    def __new__(
        cls,
        user: str,
        twap_id: int,
        coin: str,
        instrument_id: typing.Any,
        price: typing.Any,
        size: typing.Any,
        side: typing.Any,
        hash: str,
        oid: int,
        tid: int,
        crossed: bool,
        fee: typing.Any,
        fee_token: str,
        dir: str,
        closed_pnl: typing.Any,
        is_snapshot: bool,
        ts_event: int,
        ts_init: int,
    ) -> HyperliquidTwapSliceFill: ...
    def to_json(self) -> str: ...
    @classmethod
    def from_json(cls, data: typing.Any) -> typing.Any: ...
    @classmethod
    def decode_record_batch_py(
        cls, metadata: typing.Mapping[str, str], py_batch: typing.Any
    ) -> typing.Any: ...
    def encode_record_batch_py(self, items: list) -> typing.Any: ...

@typing.final
class HyperliquidConditionalOrderType(enum.Enum):
    STOP_MARKET = ...
    STOP_LIMIT = ...
    TAKE_PROFIT_MARKET = ...
    TAKE_PROFIT_LIMIT = ...
    TRAILING_STOP_MARKET = ...
    TRAILING_STOP_LIMIT = ...

    def __init__(self, value: typing.Any) -> None: ...
    def __hash__(self) -> int: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> str: ...
    @staticmethod
    def variants() -> list[str]: ...
    @classmethod
    def from_str(cls, data: typing.Any) -> HyperliquidConditionalOrderType: ...

@typing.final
class HyperliquidEnvironment(enum.Enum):
    MAINNET = ...
    TESTNET = ...

    def __init__(self, value: typing.Any) -> None: ...
    def __hash__(self) -> int: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> int: ...
    @classmethod
    def variants(cls) -> list[str]: ...
    @classmethod
    def from_str(cls, data: typing.Any) -> HyperliquidEnvironment: ...

@typing.final
class HyperliquidProductType(enum.Enum):
    PERP = ...
    SPOT = ...
    OUTCOME = ...

    def __init__(self, value: typing.Any) -> None: ...
    def __hash__(self) -> int: ...
    def __eq__(self, other: HyperliquidProductType) -> bool: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> str: ...
    @staticmethod
    def variants() -> list[str]: ...
    @classmethod
    def from_str(cls, data: typing.Any) -> HyperliquidProductType: ...

@typing.final
class HyperliquidTpSl(enum.Enum):
    TP = ...
    SL = ...

    def __init__(self, value: typing.Any) -> None: ...
    def __hash__(self) -> int: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> str: ...
    @staticmethod
    def variants() -> list[str]: ...
    @classmethod
    def from_str(cls, data: typing.Any) -> HyperliquidTpSl: ...

@typing.final
class HyperliquidTrailingOffsetType(enum.Enum):
    PRICE = ...
    PERCENTAGE = ...
    BASIS_POINTS = ...

    def __init__(self, value: typing.Any) -> None: ...
    def __hash__(self) -> int: ...
    @property
    def name(self) -> str: ...
    @property
    def value(self) -> str: ...
    @staticmethod
    def variants() -> list[str]: ...
    @classmethod
    def from_str(cls, data: typing.Any) -> HyperliquidTrailingOffsetType: ...

def builder_fee_approve() -> bool: ...
def builder_fee_revoke() -> bool: ...
def hyperliquid_cloid_from_client_order_id(client_order_id: model.ClientOrderId) -> str: ...
def hyperliquid_product_type_from_symbol(symbol: str) -> HyperliquidProductType: ...
def hyperliquid_resolve_execution_account_address(
    private_key: str | None = None,
    vault_address: str | None = None,
    account_address: str | None = None,
    environment: HyperliquidEnvironment = HyperliquidEnvironment.MAINNET,
) -> str | None: ...
