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

Method hash_message

python/ccxt/async_support/aster.py:3884–3890  ·  view source on GitHub ↗
(self, binaryMessage)

Source from the content-addressed store, hash-verified

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