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

Method authenticate

python/ccxt/pro/bybit.py:2187–2207  ·  view source on GitHub ↗
(self, url, params={})

Source from the content-addressed store, hash-verified

2185 return await self.watch_multiple(url, messageHashes, message, messageHashes, self.extend(subscription, subExtension))
2186
2187 async def authenticate(self, url, params={}):
2188 self.check_required_credentials()
2189 messageHash = 'authenticated'
2190 client = self.client(url)
2191 future = client.reusableFuture(messageHash)
2192 authenticated = self.safe_value(client.subscriptions, messageHash)
2193 if authenticated is None:
2194 expiresInt = self.milliseconds() + 10000
2195 expires = self.number_to_string(expiresInt)
2196 path = 'GET/realtime'
2197 auth = path + expires
2198 signature = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256, 'hex')
2199 request = {
2200 'op': 'auth',
2201 'args': [
2202 self.apiKey, expires, signature,
2203 ],
2204 }
2205 message = self.extend(request, params)
2206 self.watch(url, messageHash, message, messageHash)
2207 return await future
2208
2209 def handle_error_message(self, client: Client, message) -> Bool:
2210 #

Callers 10

create_order_wsMethod · 0.95
edit_order_wsMethod · 0.95
cancel_order_wsMethod · 0.95
watch_my_tradesMethod · 0.95
un_watch_my_tradesMethod · 0.95
watch_positionsMethod · 0.95
un_watch_positionsMethod · 0.95
watch_ordersMethod · 0.95
un_watch_ordersMethod · 0.95
watch_balanceMethod · 0.95

Calls 9

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

Tested by

no test coverage detected