code: def sign_preimage(self, preimage):
          
          if self.te is None:
              self.gen_te()
          self.te.sign_hashX(preimage)
docs: Sign the generated transaction envelope using a Hash(x) signature.
  
          :param preimage: The value to be hashed and used as a signer on the
              transaction envelope.
          :type preimage: str, bytes