def sign_message_after_soliditySha3(self, message): n = self.client._convert_prime([44 + BIP32_HARDEN, 60 + BIP32_HARDEN, BIP32_HARDEN, 0, self.index]) return self.client.call(proto.EthereumSignMessage(address_n=n, message=message)).signature
def sign_message(self, message, out_f, agent_version=2): n = self.client._convert_prime([ 44 + bip32utils.BIP32_HARDEN, 60 + bip32utils.BIP32_HARDEN, bip32utils.BIP32_HARDEN, 0, self.index ]) print("Sending message to trezor for signature...\n", file=out_f) if agent_version == 1: message = self.w3.sha3(hexstr=message) else: message = message.lower().encode("utf-8") return self.client.call( proto.EthereumSignMessage(address_n=n, message=message)).signature