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

Method authenticate

python/ccxt/pro/upbit.py:313–332  ·  view source on GitHub ↗
(self, params={})

Source from the content-addressed store, hash-verified

311 client.resolve(ohlcv, messageHash)
312
313 async def authenticate(self, params={}):
314 self.check_required_credentials()
315 wsOptions = self.safe_dict(self.options, 'ws', {})
316 authenticated = self.safe_string(wsOptions, 'token')
317 if authenticated is None:
318 auth = {
319 'access_key': self.apiKey,
320 'nonce': self.uuid(),
321 }
322 token = self.jwt(auth, self.encode(self.secret), 'sha256', False)
323 wsOptions['token'] = token
324 wsOptions['options'] = {
325 'headers': {
326 'authorization': 'Bearer ' + token,
327 },
328 }
329 self.options['ws'] = wsOptions
330 url = self.urls['api']['ws'] + '/private'
331 client = self.client(url)
332 return client
333
334 async def watch_private(self, symbol, channel, messageHash, params={}):
335 await self.authenticate()

Callers 1

watch_privateMethod · 0.95

Calls 7

safe_dictMethod · 0.80
safe_stringMethod · 0.80
uuidMethod · 0.45
jwtMethod · 0.45
encodeMethod · 0.45
clientMethod · 0.45

Tested by

no test coverage detected