@@ -592,8 +592,9 @@ def signHash(self, message_hash, private_key):
592592 Instead, prefer :meth:`~eth_account.account.Account.sign_message`,
593593 which cannot accidentally sign a transaction.
594594
595- .. CAUTION:: Deprecated for :meth:`~eth_account.account.Account.sign_message`.
596- This method will be removed in v0.6
595+ .. CAUTION:: Deprecated for
596+ :meth:`~eth_account.account.Account.unsafe_sign_hash`.
597+ This method will be removed in v0.13
597598
598599 :param message_hash: the 32-byte message hash to be signed
599600 :type message_hash: hex str, bytes or int
@@ -604,12 +605,34 @@ def signHash(self, message_hash, private_key):
604605 :rtype: ~eth_account.datastructures.SignedMessage
605606 """
606607 warnings .warn (
607- "signHash is deprecated in favor of sign_message" ,
608+ "signHash is deprecated in favor of sign_message or unsafe_sign_hash"
609+ " depending on your use case" ,
608610 category = DeprecationWarning ,
609611 stacklevel = 2 ,
610612 )
611613 return self ._sign_hash (message_hash , private_key )
612614
615+ @combomethod
616+ def unsafe_sign_hash (self , message_hash , private_key ):
617+ """
618+ Sign the provided hash.
619+
620+ .. WARNING:: *Never* sign a hash that you didn't generate,
621+ it can be an arbitrary transaction. For example, it might
622+ send all of your account's ether to an attacker.
623+ Instead, prefer :meth:`~eth_account.account.Account.sign_message`,
624+ which cannot accidentally sign a transaction.
625+
626+ :param message_hash: the 32-byte message hash to be signed
627+ :type message_hash: hex str, bytes or int
628+ :param private_key: the key to sign the message with
629+ :type private_key: hex str, bytes, int or :class:`eth_keys.datatypes.PrivateKey`
630+ :returns: Various details about the signature - most
631+ importantly the fields: v, r, and s
632+ :rtype: ~eth_account.datastructures.SignedMessage
633+ """
634+ return self ._sign_hash (message_hash , private_key )
635+
613636 @combomethod
614637 def _sign_hash (
615638 self ,
0 commit comments