
    (i
                     n    d dl mZmZ d dlmZ d dlmZmZ d dlm	Z	m
Z
 d dlmZ d dlmZ  G d de      Zy	)
    )ABCabstractmethod)Any)ChecksumAddressHash32)SignedMessageSignedTransaction)SignableMessage)TransactionDictTypec                       e Zd ZdZeedefd              Zedede	fd       Z
edede	fd       Zededefd	       Zd
edefdZdefdZy)BaseAccountzN
    Specify convenience methods to sign transactions and message hashes.
    returnc                      y)z
        The checksummed public address for this account.

        .. code-block:: python

            >>> my_account.address # doctest: +SKIP
            "0xF0109fC8DF283027b6285cc889F5aA624EaC1F55"

        N selfs    I/var/www/br/venv/lib/python3.12/site-packages/eth_account/signers/base.pyaddresszBaseAccount.address           signable_messagec                      y)aH  
        Sign the EIP-191_ message.

        This uses the same structure
        as in :meth:`~eth_account.account.Account.sign_message`
        but without specifying the private key.

        :param signable_message: The encoded message, ready for signing

        .. _EIP-191: https://eips.ethereum.org/EIPS/eip-191
        Nr   )r   r   s     r   sign_messagezBaseAccount.sign_message,   r   r   message_hashc                      y)a_  
        Sign the hash of a message.

        .. WARNING:: *Never* sign a hash that you didn't generate,
            it can be an arbitrary transaction. For example, it might
            send all of your account's ether to an attacker.
            Instead, prefer :meth:`~eth_account.account.Account.sign_message`,
            which cannot accidentally sign a transaction.

        This uses the same structure
        as in :meth:`~eth_account.account.Account.unsafe_sign_hash`
        but without specifying the private key.

        :param bytes message_hash: 32 byte hash of the message to sign
        Nr   )r   r   s     r   unsafe_sign_hashzBaseAccount.unsafe_sign_hash:   r   r   transaction_dictc                      y)a  
        Sign a transaction dict.

        This uses the same structure as in
        :meth:`~eth_account.account.Account.sign_transaction`
        but without specifying the private key.

        :param dict transaction_dict: transaction with all fields specified
        Nr   )r   r   s     r   sign_transactionzBaseAccount.sign_transactionL   r   r   otherc                 d    t        |       t        |      u xr | j                  |j                  k(  S )z
        Equality test between two accounts.

        Two accounts are considered the same if they are exactly the same type,
        and can sign for the same address.
        )typer   )r   r    s     r   __eq__zBaseAccount.__eq__Z   s)     DzT%[(JT\\U]]-JJr   c                 B    t        t        |       | j                  f      S )N)hashr"   r   r   s    r   __hash__zBaseAccount.__hash__c   s    T$Z.//r   N)__name__
__module____qualname____doc__propertyr   r   r   r
   r   r   r   r   r   r	   r   r   boolr#   intr&   r   r   r   r   r      s     	 	  	 _    V   "  3	 KC KD K0# 0r   r   N)abcr   r   typingr   
eth_typingr   r   eth_account.datastructuresr   r	   eth_account.messagesr
   eth_account.typesr   r   r   r   r   <module>r4      s1   

J0# J0r   