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

Method authenticate

python/ccxt/pro/cex.py:1455–1475  ·  view source on GitHub ↗
(self, params={})

Source from the content-addressed store, hash-verified

1453 future.resolve(True)
1454
1455 async def authenticate(self, params={}):
1456 url = self.urls['api']['ws']
1457 client = self.client(url)
1458 messageHash = 'authenticated'
1459 future = client.reusableFuture('authenticated')
1460 authenticated = self.safe_value(client.subscriptions, messageHash)
1461 if authenticated is None:
1462 self.check_required_credentials()
1463 nonce = str(self.seconds())
1464 auth = nonce + self.apiKey
1465 signature = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256)
1466 request = {
1467 'e': 'auth',
1468 'auth': {
1469 'key': self.apiKey,
1470 'signature': signature.upper(),
1471 'timestamp': nonce,
1472 },
1473 }
1474 self.watch(url, messageHash, self.extend(request, params), messageHash)
1475 return await future

Callers 12

watch_balanceMethod · 0.95
watch_tickerMethod · 0.95
fetch_balance_wsMethod · 0.95
watch_ordersMethod · 0.95
watch_my_tradesMethod · 0.95
watch_order_bookMethod · 0.95
fetch_order_wsMethod · 0.95
fetch_open_orders_wsMethod · 0.95
create_order_wsMethod · 0.95
edit_order_wsMethod · 0.95
cancel_order_wsMethod · 0.95
cancel_orders_wsMethod · 0.95

Calls 9

safe_valueMethod · 0.80
clientMethod · 0.45
reusableFutureMethod · 0.45
secondsMethod · 0.45
hmacMethod · 0.45
encodeMethod · 0.45
watchMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected