(self, params={})
| 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 |
no test coverage detected