o
    >hz                     @   s   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
de	defd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	de
fd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
de
fddZdS )   )signrecover
is_addressis_signatureis_eth_privkey
is_bytes16is_block_numberis_chain_idchainIdverifyingContractctypeopenedAtmarketId	channelIdactordelegatemarketmaker	recipientamountreturnc                 C   s*  t | sJ t|sJ t|tksJ t|sJ t|s J t|s&J t|s,J t|s2J t|s8J t|	s>J t|
tksFJ 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dddgddddd| |||||||||	|
dd}|S )z

    :param chainId:
    :param verifyingContract:
    :param ctype:
    :param openedAt:
    :param marketId:
    :param channelId:
    :param actor:
    :param delegate:
    :param marketmaker:
    :param recipient:
    :param amount:
    :return:
    namestring)r   typeversionr
   uint256r   addressr   uint8r   r   bytes16r   r   r   r   r   r   )EIP712DomainEIP712ChannelOpenr   XBR1)r   r   )r
   r   r   r   r   r   r   r   r   r   r   )typesprimaryTypedomainmessage)r	   r   r   intr   r   )r
   r   r   r   r   r   r   r   r   r   r   data r(   /var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/autobahn/xbr/_eip712_channel_open.py_create_eip712_channel_open   s   .Cr*   eth_privkeyc                 C   s2   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   )r+   r
   r   r   r   r   r   r   r   r   r   r   r'   r(   r(   r)   sign_eip712_channel_open   s
   

r,   	signaturec                 C   s2   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   r   r-   r'   r(   r(   r)   recover_eip712_channel_open   s
   	

r.   N)_eip712_baser   r   r   r   r   r   r   r	   r&   bytesdictr*   r,   r.   r(   r(   r(   r)   <module>   sp   (
d
