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

Method authenticate

python/ccxt/pro/bithumb.py:430–450  ·  view source on GitHub ↗
(self, params={})

Source from the content-addressed store, hash-verified

428 client.resolve(self.balance, messageHash)
429
430 async def authenticate(self, params={}):
431 self.check_required_credentials()
432 wsOptions = self.safe_dict(self.options, 'ws', {})
433 authenticated = self.safe_string(wsOptions, 'token')
434 if authenticated is None:
435 payload = {
436 'access_key': self.apiKey,
437 'nonce': self.uuid(),
438 'timestamp': self.milliseconds(),
439 }
440 jwtToken = self.jwt(payload, self.encode(self.secret), 'sha256')
441 wsOptions['token'] = jwtToken
442 wsOptions['options'] = {
443 'headers': {
444 'authorization': 'Bearer ' + jwtToken,
445 },
446 }
447 self.options['ws'] = wsOptions
448 url = self.urls['api']['ws']['privateV2']
449 client = self.client(url)
450 return client
451
452 async def watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
453 """

Callers 2

watch_balanceMethod · 0.95
watch_ordersMethod · 0.95

Calls 8

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

Tested by

no test coverage detected