
    ei                     ~    d dl Z d dlmZmZmZmZmZ ddlmZ erd dlm	Z	 ee
eeeeef         Z G d de          ZdS )    N)TYPE_CHECKINGTypeUnioncastoverload   )to_bytes)SupportsIndexc                        e Zd ZdZdee         dedd f fdZ	 ddee	ef         d	d
de	f fdZ
edd
defd            Zededd fd            Zded
ef         deeed f         f fdZde	fdZ xZS )HexBytesa`  
    HexBytes is a *very* thin wrapper around the python built-in :class:`bytes` class.

    It has these three changes:
        1. Accepts more initializing values, like hex strings, non-negative integers,
           and booleans
        2. Returns hex with prefix '0x' from :meth:`HexBytes.hex`
        3. The representation at console is in hex
    clsvalreturnc                     t          |          }t          t          t                                          | |                    S N)r	   r   r   super__new__)r   r   bytesval	__class__s      m/var/www/html/volatility/venv/lib/python3.11/site-packages/ccxt/static_dependencies/ethereum/hexbytes/main.pyr   zHexBytes.__new__!   s0    C==Heggooc8<<===    Nr   sepbytes_per_sepr
   c                 J    dt                                                      z   S )z
        Output hex-encoded bytes, with an "0x" prefix.

        Everything following the "0x" is output exactly like :meth:`bytes.hex`.
        0x)r   hex)selfr   r   r   s      r   r   zHexBytes.hex%   s     eggkkmm##r   keyc                     d S r    r   r   s     r   __getitem__zHexBytes.__getitem__/       r   c                     d S r   r    r!   s     r   r"   zHexBytes.__getitem__3   r#   r   c                     t                                          |          }t          |d          r t          |           |          S |S )Nr   )r   r"   hasattrtype)r   r   resultr   s      r   r"   zHexBytes.__getitem__7   sI     $$S))65!! 	4::f%%%Mr   c                 2    d|                                  dS )Nz	HexBytes())r   )r   s    r   __repr__zHexBytes.__repr__@   s    *488::****r   )Nr   )__name__
__module____qualname____doc__r   bytes	BytesLiker   r   strr   r   intr"   slicer+   __classcell__)r   s   @r   r   r      sf        >T%[ >y >Z > > > > > >
 OP$ $e$$<K$	$ $ $ $ $ $  3    X u     X%/0	sE:%	&     +# + + + + + + + +r   r   )systypingr   r   r   r   r   _utilsr	   r
   bool	bytearrayr0   r3   r2   
memoryviewr1   r   r    r   r   <module>r<      s    



                          $	5#sJ>?	++ ++ ++ ++ ++u ++ ++ ++ ++ ++r   