
    ":hK                         d dl mZmZ ddlmZ ddlmZ deeef   defdZdeeef   defd	Z	d
ede
fdZdeeef   de
fdZd
ede
fdZdeeef   de
fdZy)    )AnyDict   )to_bytes   )SHA3abireturnc                     | d   }t        |t              s#t        dt        |       dt	        |             |j                  d      s|S dj                  d | d   D              }|dd	 }d
| d| }|S )a  
    Converts a tuple from a dict to a parenthesized list of its types.

    >>> from eth_utils.abi import collapse_if_tuple
    >>> collapse_if_tuple(
    ...     {
    ...         'components': [
    ...             {'name': 'anAddress', 'type': 'address'},
    ...             {'name': 'anInt', 'type': 'uint256'},
    ...             {'name': 'someBytes', 'type': 'bytes'},
    ...         ],
    ...         'type': 'tuple',
    ...     }
    ... )
    '(address,uint256,bytes)'
    typez%The 'type' must be a string, but got z	 of type tuple,c              3   2   K   | ]  }t        |        y wN)collapse_if_tuple).0cs     e/var/www/html/turnos/venv/lib/python3.12/site-packages/ccxt/static_dependencies/ethereum/utils/abi.py	<genexpr>z$collapse_if_tuple.<locals>.<genexpr>(   s     I!*1-Is   
components   N())
isinstancestr	TypeErrorreprr   
startswithjoin)r	   typ	delimited	array_dim	collapseds        r   r   r      s    " f+Cc33DI;iS	{S
 	
 ^^G$
Is<7HIII ABII;a	{+I    c                     dj                  | j                  dg       D cg c]  }t        |       c}      }| d    d| d}|S c c}w )Nr   inputsnamer   r   )r   getr   )r	   	abi_inputfn_input_typesfunction_signatures       r   _abi_to_signaturer,   1   sU    XX7:wwx7LM)	9	%MN  K=.)9; 	Ns   Aevent_signaturec                 R    t        t        | j                  dd                  d d S )N  text   keccakr   replacer-   s    r   $function_signature_to_4byte_selectorr8   9   s&    ( 7 7R @AB2AFFr$   function_abic                 .    t        |       }t        |      S r   )r,   r8   )r9   r+   s     r   function_abi_to_4byte_selectorr;   =   s    *<8/0BCCr$   c                 L    t        t        | j                  dd                  S )Nr/   r0   r1   r4   r7   s    r   event_signature_to_log_topicr=   B   s    ( 7 7R @ABBr$   	event_abic                 .    t        |       }t        |      S r   )r,   r=   )r>   r-   s     r   event_abi_to_log_topicr@   F   s    '	2O'88r$   N)typingr   r   conversionsr   r5   r   r   r   r,   bytesr8   r;   r=   r@    r$   r   <module>rE      s   

4S> c D4S> c G# G% GDc3h DE D
C# C% C9d38n 9 9r$   