o
    _�¿jü  ã                   @  sN   d Z ddlmZ ddlmZmZmZ ddlmZ eG dd„ deƒƒZ	dgZ
dS )uÿ   Exchange client protocol and base class.

All exchange-specific clients implement the :class:`ExchangeClient` Protocol.
This enables structural subtyping â€” any class with the right methods works,
without needing to explicitly inherit from a base class.
é    )Úannotations)ÚProtocolÚruntime_checkableÚAny)ÚOptionChainResultc                   @  sP   e Zd ZdZddœdd
d„Zdddœddd„Zddd„Zd dd„Zd!dd„ZdS )"ÚExchangeClientzÈProtocol defining the minimal interface for an exchange client.

    Any class implementing these methods is a valid exchange client, whether
    or not it subclasses :class:`BaseExchangeClient`.
    T)Úis_indexÚsymbolÚstrr   ÚboolÚreturnr   c                Ã  ó   �dS )a  Fetch the full option chain for *symbol*.

        Args:
            symbol:   Trading symbol (e.g. ``"NIFTY"``).
            is_index: ``True`` for index instruments, ``False`` for equities.

        Returns:
            :class:`~indiaopt.models.option_chain.OptionChainResult`
        N© )Úselfr	   r   r   r   úR/home/dinkstrade/pdmp/venv/lib/python3.10/site-packages/indiaopt/exchanges/base.pyÚfetch_option_chain   s   €z!ExchangeClient.fetch_option_chainN)r   Úexpiryr   ú
str | Noneúdict[str, Any]c                Ã  r   )z9Fetch the unparsed raw JSON dictionary from the exchange.Nr   )r   r	   r   r   r   r   r   Úfetch_raw_option_chain(   s   €z%ExchangeClient.fetch_raw_option_chainú	list[str]c                 Ã  r   )z’Return available expiry date strings for *symbol*.

        Returns:
            List of expiry date strings in exchange-specific format.
        Nr   )r   r	   r   r   r   Úget_expiry_dates2   s   €zExchangeClient.get_expiry_datesc                 Ã  ó   �d S ©Nr   )r   r   r   r   Ú
__aenter__:   ó   €zExchangeClient.__aenter__ÚargsÚobjectÚNonec                 Ç  r   r   r   )r   r   r   r   r   Ú	__aexit__=   r   zExchangeClient.__aexit__)r	   r
   r   r   r   r   )r	   r
   r   r   r   r   r   r   )r	   r
   r   r   )r   r   )r   r   r   r   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   r      s    
üû


r   N)r#   Ú
__future__r   Útypingr   r   r   Úindiaopt.models.option_chainr   r   Ú__all__r   r   r   r   Ú<module>   s    
1