
    Lf                         d dl mZ ddlmZmZmZmZmZmZm	Z	m
Z
 dededededed	ed
edededee   defdZdedededededed	ed
ededededefdZdededededed	ed
edededededefdZy)    )Optional   )signrecover
is_address
is_bytes16is_eth_privkeyis_signatureis_chain_idis_block_numberchainIdverifyingContractmemberupdatedmarketIddelegatedelegateType
apiCatalogconsentservicePrefixreturnc
                    t        |       sJ t        |      sJ t        |      sJ t        |      sJ t        |      sJ t        |      sJ t	        |      t
        k(  sJ t        |      sJ t	        |      t        k(  sJ |	t	        |	      t        k(  sJ ddddddgddddddd	ddd
ddddddddddddddddddddg
ddddd| |||||||||	xs dd
d}
|
S )z

    :param chainId:
    :param verifyingContract:
    :param member:
    :param updated:
    :param marketId:
    :param delegate:
    :param delegateType:
    :param apiCatalog:
    :param consent:
    :param servicePrefix:
    :return:
    namestring)r   typeversionr   uint256r   addressr   r   r   bytes16r   r   uint8r   r   boolr   )EIP712DomainEIP712Consentr#   XBR1)r   r    )
r   r   r   r   r   r   r   r   r   r   )typesprimaryTypedomainmessage)r   r   r   r   r   intr!   str)r   r   r   r   r   r   r   r   r   r   datas              W/var/www/cs2snipe.com/venv/lib/python3.12/site-packages/autobahn/xbr/_eip712_consent.py_create_eip712_consentr/       s   " w'(((f7###hh$$$j!!!=D    D$73$>>> #$
 &$	 &%
 0%
 %%
 &%
 '%
 '%
 +#
 )%
 &"
 ,$K)5
l '

 !2  ($*0b
yHDT K    eth_privkeyc                 \    t        |       sJ t        |||||||||	|

      }t        | |      S )z

    :param eth_privkey: Ethereum address of buyer (a raw 20 bytes Ethereum address).
    :type eth_privkey: bytes

    :return: The signature according to EIP712 (32+32+1 raw bytes).
    :rtype: bytes
    )r	   r/   r   )r1   r   r   r   r   r   r   r   r   r   r   r-   s               r.   sign_eip712_consentr3      sA     +&&&!'+<fgxYa".
G]TDT""r0   	signaturec                 \    t        |
      sJ t        | |||||||||	
      }t        ||
      S )z
    Recover the signer address the given EIP712 signature was signed with.

    :return: The (computed) signer address the signature was signed with.
    :rtype: bytes
    )r
   r/   r   )r   r   r   r   r   r   r   r   r   r   r4   r-   s               r.   recover_eip712_consentr6      sA     	"""!'+<fgxYa".
G]TD4##r0   N)typingr   _eip712_baser   r   r   r   r	   r
   r   r   r+   bytesr!   r,   dictr/   r3   r6    r0   r.   <module>r<      sH  6 / / /fC fE f5 f[^ f%*f6;fKNf\af$(f9A#fKOfR#U #S #U #\a #!$#05#AF#VY#gl#!%#69#>C#$$C $E $5 $[^ $%*$6;$KN$\a$$($9<$IN$SX$r0   