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

Method authenticate

python/ccxt/pro/ascendex.py:941–964  ·  view source on GitHub ↗
(self, url, params={})

Source from the content-addressed store, hash-verified

939 self.spawn(self.pong, client, message)
940
941 async def authenticate(self, url, params={}):
942 self.check_required_credentials()
943 messageHash = 'authenticated'
944 client = self.client(url)
945 future = self.safe_value(client.subscriptions, messageHash)
946 if future is None:
947 timestamp = str(self.milliseconds())
948 urlParts = url.split('/')
949 partsLength = len(urlParts)
950 path = self.safe_string(urlParts, partsLength - 1)
951 version = self.safe_string(urlParts, partsLength - 2)
952 auth = timestamp + '+' + version + '/' + path
953 secret = self.base64_to_binary(self.secret)
954 signature = self.hmac(self.encode(auth), secret, hashlib.sha256, 'base64')
955 request = {
956 'op': 'auth',
957 'id': str(self.nonce()),
958 't': timestamp,
959 'key': self.apiKey,
960 'sig': signature,
961 }
962 future = await self.watch(url, messageHash, self.extend(request, params), messageHash)
963 client.subscriptions[messageHash] = future
964 return future

Callers 1

watch_privateMethod · 0.95

Calls 12

safe_valueMethod · 0.80
splitMethod · 0.80
safe_stringMethod · 0.80
base64_to_binaryMethod · 0.80
clientMethod · 0.45
millisecondsMethod · 0.45
hmacMethod · 0.45
encodeMethod · 0.45
nonceMethod · 0.45
watchMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected