MCPcopy Create free account
hub / github.com/ccxt/ccxt / hash_message

Method hash_message

python/ccxt/aster.py:3883–3889  ·  view source on GitHub ↗
(self, binaryMessage)

Source from the content-addressed store, hash-verified

3881 return self.safe_string(statuses, status, status)
3882
3883 def hash_message(self, binaryMessage):
3884 # binaryMessage = self.encode(message)
3885 binaryMessageLength = self.binary_length(binaryMessage)
3886 x19 = self.base16_to_binary('19')
3887 newline = self.base16_to_binary('0a')
3888 prefix = self.binary_concat(x19, self.encode('Ethereum Signed Message:'), newline, self.encode((self.number_to_string(binaryMessageLength))))
3889 return '0x' + self.hash(self.binary_concat(prefix, binaryMessage), 'keccak', 'hex')
3890
3891 def sign_hash(self, hash, privateKey):
3892 self.check_required_credentials()

Callers

nothing calls this directly

Calls 5

binary_lengthMethod · 0.80
base16_to_binaryMethod · 0.80
binary_concatMethod · 0.80
encodeMethod · 0.45
hashMethod · 0.45

Tested by

no test coverage detected