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

Method sign_hash

python/ccxt/aster.py:3891–3897  ·  view source on GitHub ↗
(self, hash, privateKey)

Source from the content-addressed store, hash-verified

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()
3893 signature = self.ecdsa(hash[-64:], privateKey[-64:], 'secp256k1', None)
3894 r = signature['r']
3895 s = signature['s']
3896 v = self.int_to_base16(self.sum(27, signature['v']))
3897 return '0x' + r.rjust(64, '0') + s.rjust(64, '0') + v
3898
3899 def sign(self, path, api: Any = 'public', method='GET', params={}, headers: dict = None, body: Any = None):
3900 url = self.urls['api'][api] + '/' + path

Callers 1

sign_messageMethod · 0.95

Calls 4

int_to_base16Method · 0.80
ecdsaMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected