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

import typing

from nautilus_trader import _libnautilus
from nautilus_trader import infrastructure
from nautilus_trader import model
from nautilus_trader import network
from nautilus_trader.model import DexType

__all__ = [
    "BlockchainChainAnchorConfig",
    "BlockchainDataClientConfig",
    "BlockchainDataClientFactory",
    "BlockchainExecutionClientConfig",
    "BlockchainProviderIdentity",
    "BlockchainVerificationConfig",
    "BlockchainVerificationProviderConfig",
    "DexPoolFilters",
    "QuoteSpendLimit",
    "load_pool_snapshot",
]

@typing.final
class BlockchainChainAnchorConfig:
    @property
    def chain_id(self) -> int: ...
    @property
    def chain_name(self) -> str: ...
    @property
    def checkpoint_hash(self) -> str: ...
    @property
    def checkpoint_height(self) -> int: ...
    @property
    def checkpoint_timestamp(self) -> int: ...
    @property
    def max_future_drift_secs(self) -> int: ...
    @property
    def max_head_age_secs(self) -> int: ...
    @property
    def max_head_skew_blocks(self) -> int: ...
    def __init__(
        self,
        chain_id: int,
        chain_name: str,
        checkpoint_height: int,
        checkpoint_hash: str,
        checkpoint_timestamp: int,
        max_head_skew_blocks: int,
        max_head_age_secs: int,
        max_future_drift_secs: int,
    ) -> None: ...

@typing.final
class BlockchainDataClientConfig:
    @property
    def dex_ids(self) -> list[DexType]: ...
    @property
    def multicall_calls_per_rpc_request(self) -> int: ...
    @property
    def pool_filters(self) -> DexPoolFilters: ...
    @property
    def transport_backend(self) -> network.TransportBackend: ...
    def __init__(
        self,
        chain: model.Chain,
        dex_ids: typing.Sequence[model.DexType],
        http_rpc_url: str,
        rpc_requests_per_second: int | None = None,
        multicall_calls_per_rpc_request: int | None = None,
        wss_rpc_url: str | None = None,
        use_hypersync_for_live_data: bool = True,
        from_block: int | None = None,
        pool_filters: DexPoolFilters | None = None,
        postgres_cache_database_config: infrastructure.PostgresConnectOptions | None = None,
        proxy_url: str | None = None,
        transport_backend: network.TransportBackend | None = None,
    ) -> None: ...
    @property
    def chain(self) -> model.Chain: ...
    @property
    def rpc_requests_per_second(self) -> int | None: ...
    @property
    def use_hypersync_for_live_data(self) -> bool: ...
    @property
    def from_block(self) -> int | None: ...
    @property
    def has_postgres_cache_database_config(self) -> bool: ...
    @property
    def has_proxy_url(self) -> bool: ...

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

@typing.final
class BlockchainExecutionClientConfig:
    @property
    def base_fee_buffer_bps(self) -> int: ...
    @property
    def deadline_seconds(self) -> int | None: ...
    @property
    def gas_buffer_bps(self) -> int: ...
    @property
    def gas_limit(self) -> int: ...
    @property
    def verification(self) -> BlockchainVerificationConfig | None: ...
    @property
    def max_fee_per_gas_wei(self) -> int: ...
    @property
    def max_order_amount(self) -> int | None: ...
    @property
    def max_quote_age_blocks(self) -> int | None: ...
    @property
    def max_slippage_bps(self) -> int | None: ...
    @property
    def quote_spend_limits(self) -> list[QuoteSpendLimit] | None: ...
    @property
    def receipt_timeout_secs(self) -> int | None: ...
    @property
    def router_addresses(self) -> list[str]: ...
    @property
    def payload_deployment_id(self) -> str | None: ...
    @property
    def payload_key_env(self) -> str | None: ...
    @property
    def payload_key_retired_env(self) -> list[str]: ...
    @property
    def signer_private_key_env(self) -> str: ...
    @property
    def slippage_bps(self) -> int | None: ...
    @property
    def tokens(self) -> list[str] | None: ...
    @property
    def transport_backend(self) -> network.TransportBackend: ...
    @property
    def unlimited_approval(self) -> bool: ...
    @property
    def wallet_address(self) -> str: ...
    @property
    def weth_address(self) -> str: ...
    def __init__(
        self,
        client_id: model.AccountId,
        chain: model.Chain,
        wallet_address: str,
        http_rpc_url: str,
        signer_private_key_env: str,
        router_addresses: typing.Sequence[str],
        weth_address: str,
        max_fee_per_gas_wei: int,
        base_fee_buffer_bps: int,
        gas_limit: int,
        gas_buffer_bps: int,
        tokens: typing.Sequence[str] | None = None,
        rpc_requests_per_second: int | None = None,
        unlimited_approval: bool = False,
        postgres_cache_database_config: infrastructure.PostgresConnectOptions | None = None,
        transport_backend: network.TransportBackend | None = None,
        allowed_token_pairs: typing.Sequence[tuple[str, str]] | None = None,
        quote_spend_limits: typing.Sequence[QuoteSpendLimit] | None = None,
        slippage_bps: int | None = None,
        max_slippage_bps: int | None = None,
        max_order_amount: int | None = None,
        deadline_seconds: int | None = None,
        max_quote_age_blocks: int | None = None,
        receipt_timeout_secs: int | None = None,
        payload_key_env: str | None = None,
        payload_key_retired_env: typing.Sequence[str] | None = None,
        payload_deployment_id: str | None = None,
        verification: BlockchainVerificationConfig | None = None,
    ) -> None: ...
    @property
    def allowed_token_pairs(self) -> list[tuple[str, str]] | None: ...
    @property
    def client_id(self) -> model.AccountId: ...
    @property
    def chain(self) -> model.Chain: ...
    @property
    def rpc_requests_per_second(self) -> int | None: ...
    @property
    def has_postgres_cache_database_config(self) -> bool: ...

@typing.final
class BlockchainProviderIdentity:
    @property
    def failure_domain_ids(self) -> list[str]: ...
    @property
    def operator_id(self) -> str: ...
    @property
    def provider_id(self) -> str: ...
    def __init__(
        self, provider_id: str, operator_id: str, failure_domain_ids: typing.Sequence[str]
    ) -> None: ...

@typing.final
class BlockchainVerificationConfig:
    @property
    def authoritative(self) -> BlockchainProviderIdentity: ...
    @property
    def chain_anchor(self) -> BlockchainChainAnchorConfig: ...
    @property
    def manifest_digest(self) -> str: ...
    @property
    def manifest_version(self) -> str: ...
    @property
    def verifiers(self) -> list[BlockchainVerificationProviderConfig]: ...
    def __init__(
        self,
        authoritative: BlockchainProviderIdentity,
        verifiers: typing.Sequence[BlockchainVerificationProviderConfig],
        chain_anchor: BlockchainChainAnchorConfig,
        manifest_version: str,
        manifest_digest: str,
        deployment_manifest_json: str,
    ) -> None: ...
    @property
    def deployment_manifest_json(self) -> str: ...

@typing.final
class BlockchainVerificationProviderConfig:
    @property
    def identity(self) -> BlockchainProviderIdentity: ...
    def __init__(self, identity: BlockchainProviderIdentity, http_rpc_url: str) -> None: ...

@typing.final
class DexPoolFilters:
    def __init__(self, remove_pools_with_empty_erc20_fields: bool | None = ...) -> None: ...

@typing.final
class QuoteSpendLimit:
    @property
    def max_amount(self) -> str: ...
    @property
    def spend_token(self) -> str: ...
    @property
    def spend_token_decimals(self) -> int: ...
    @property
    def token_in(self) -> str: ...
    @property
    def token_out(self) -> str: ...
    def __init__(
        self,
        token_in: str,
        token_out: str,
        spend_token: str,
        spend_token_decimals: int,
        max_amount: str,
    ) -> None: ...

def load_pool_snapshot(
    pg_config: infrastructure.PostgresConnectOptions,
    chain_id: int,
    pool_address: str,
    before_block: int | None = None,
    require_valid: bool = True,
) -> model.PoolSnapshot | None: ...
