
    af                        d dl mZmZ d dlmZ d dlmZ dZdefdZ	dedee
ef         defd	Zdee
ef         d
edefdZdedefdZdedefdZdedefdZdedefdZdedefdZdedefdZdedefdZdedefdZdS )    )DictAny)a2b_hex)signingA   returnc                     dS )a9  
    keccak256(abi.encode(
            EIP712_MEMBER_REGISTER_TYPEHASH,
            obj.chainId,
            obj.verifyingContract,
            obj.member,
            obj.registered,
            keccak256(bytes(obj.eula)),
            keccak256(bytes(obj.profile))
        ));

    :param data:
    :return:
    N )datas    K/var/www/html/env/lib/python3.11/site-packages/autobahn/xbr/_eip712_base.py_hashr   "   s          eth_privkeyr   c                     t          j        ||           }t          j        | }t          |          t          k    rt          |          t          k    sJ |S )z
    Sign the given data using the given Ethereum private key.

    :param eth_privkey: Signing key.
    :param data: Data to sign.
    :return: Signature.
    )r   sign_typed_datav_r_s_to_signaturetypebyteslen_EIP712_SIG_LEN)r   r   _args	signatures       r   signr   3   sT     #D+66E *E2I 	??e##I/(I(I(IIr   r   c                     t          |          t          k    rt          |          t          k    sJ t	          j        | gt	          j        |          R  }t          |dd                   S )z
    Recover the Ethereum address of the signer, given the data and signature.

    :param data: Signed data.
    :param signature: Signature.
    :return: Signing address.
       N)r   r   r   r   r   recover_typed_datasignature_to_v_r_sr   )r   r   signer_addresss      r   recoverr   G   sf     	??e##I/(I(I(II/]w7QR[7\7\]]]N>!""%&&&r   providedc                 X    t          |           t          k    ot          |           dk    S )z
    Check if the value is a proper Ethereum address.

    :param provided: The value to check.
    :return: True iff the value is of correct type.
       r   r   r   r    s    r   
is_addressr%   U   %     >>U":s8}}'::r   c                 X    t          |           t          k    ot          |           dk    S )z
    Check if the value is a proper (binary) UUID.

    :param provided: The value to check.
    :return: True iff the value is of correct type.
       r#   r$   s    r   
is_bytes16r)   _   r&   r   c                 X    t          |           t          k    ot          |           dk    S )z
    Check if the value is of type bytes and length 32.

    :param provided: The value to check.
    :return: True iff the value is of correct type.
        r#   r$   s    r   
is_bytes32r,   i   r&   r   c                 b    t          |           t          k    ot          |           t          k    S )z
    Check if the value is a proper Ethereum signature.

    :param provided: The value to check.
    :return: True iff the value is of correct type.
    )r   r   r   r   r$   s    r   is_signaturer.   s   s%     >>U"Gs8}}'GGr   c                 X    t          |           t          k    ot          |           dk    S )z
    Check if the value is a proper Ethereum private key (seed).

    :param provided: The value to check.
    :return: True iff the value is of correct type.
    r+   r#   r$   s    r   is_eth_privkeyr0   }   r&   r   c                 X    t          |           t          k    ot          |           dk    S )z
    Check if the value is a proper WAMP-cryptosign public key.

    :param provided: The value to check.
    :return: True iff the value is of correct type.
    r+   r#   r$   s    r   is_cs_pubkeyr2      r&   r   c                 2    t          |           t          k    S )z
    Check if the value is a proper Ethereum block number.

    :param provided: The value to check.
    :return: True iff the value is of correct type.
    r   intr$   s    r   is_block_numberr6      s     >>S  r   c                 >    t          |           t          k    o| dk    S )z
    Check if the value is a proper Ethereum chain ID.

    :param provided: The value to check.
    :return: True iff the value is of correct type.
    r   r4   r$   s    r   is_chain_idr8      s     >>S 1X\1r   N)typingr   r   binasciir   py_eth_sig_utilsr   r   r   r   strr   r   boolr%   r)   r,   r.   r0   r2   r6   r8   r
   r   r   <module>r>      s  6               $ $ $ $ $ $5    "e 4S> e    ('$sCx. 'U 'u ' ' ' '; ; ; ; ; ;; ; ; ; ; ;; ; ; ; ; ;H3 H4 H H H H;S ;T ; ; ; ;;3 ;4 ; ; ; ;!c !d ! ! ! !	2# 	2$ 	2 	2 	2 	2 	2 	2r   