
    E#iK                         S SK JrJr  SSKJr  SSKJr  S\\\4   S\4S jrS\\\4   S\4S	 jr	S
\S\
4S jrS\\\4   S\
4S jrS
\S\
4S jrS\\\4   S\
4S jrg)    )AnyDict   )to_bytes   )SHA3abireturnc                     U S   n[        U[        5      (       d#  [        S[        U5       S[	        U5       35      eUR                  S5      (       d  U$ SR                  S U S    5       5      nUSS	 nS
U SU 3nU$ )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   8   #    U  H  n[        U5      v   M     g 7fN)collapse_if_tuple).0cs     e/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/static_dependencies/ethereum/utils/abi.py	<genexpr>$collapse_if_tuple.<locals>.<genexpr>(   s     I7H!*1--7Hs   
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                     SR                  U R                  S/ 5       Vs/ s H  n[        U5      PM     sn5      nU S    SU S3nU$ s  snf )Nr   inputsnamer   r   )r    getr   )r	   	abi_inputfn_input_typesfunction_signatures       r   _abi_to_signaturer-   1   s[    XX7:wwx7LM7L)	9	%7LMN  K=.)9; 	Ns   A	event_signaturec                 L    [        [        U R                  SS5      S95      S S $ )N  text   keccakr   replacer.   s    r   $function_signature_to_4byte_selectorr9   9   s&    ( 7 7R @AB2AFFr%   function_abic                 .    [        U 5      n[        U5      $ r   )r-   r9   )r:   r,   s     r   function_abi_to_4byte_selectorr<   =   s    *<8/0BCCr%   c                 F    [        [        U R                  SS5      S95      $ )Nr0   r1   r2   r5   r8   s    r   event_signature_to_log_topicr>   B   s    ( 7 7R @ABBr%   	event_abic                 .    [        U 5      n[        U5      $ r   )r-   r>   )r?   r.   s     r   event_abi_to_log_topicrA   F   s    '	2O'88r%   N)typingr   r   conversionsr   r6   r   r   r   r-   bytesr9   r<   r>   rA    r%   r   <module>rF      s   

4S> c D4S> c G# G% GDc3h DE D
C# C% C9d38n 9 9r%   