You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, dear, problem with signature for futures
query_string = "&".join([f"{k}={v}" for k, v in sorted(kwargs.items())])
query_string = self.api_key + timestamp + query_string
signature = hmac.new(self.api_secret.encode('utf-8'), query_string.encode('utf-8'), hashlib.sha256).hexdigest()
i tried change:
signature = hmac.new(query_string.encode('utf-8'), self.api_secret.encode('utf-8'), hashlib.sha256).hexdigest()
but same, checked everything is ok i dont know what can be wrong?
The text was updated successfully, but these errors were encountered:
what endpoints you were having problems with? When I first came across this message I just concluded that in the lines 151-162 of base.py the api_key and api_secret were only being passed when kwargs contained params/json. Add an else statement and remove the kwargs from the self.sign call. Or something like this ` if kwargs.get('params'):
kwargs['params'] = {k: v for k, v in kwargs['params'].items() if v is not None}
if self.api_key and self.api_secret:
# add signature
timestamp = str(int(time.time() * 1000))
kwargs['headers'] = {
"Request-Time": timestamp,
"Signature": self.sign(timestamp) if not kwargs.get('params') else self.sign(timestamp, **kwargs['params'])
}
response = self.session.request(method, f"{self.base_url}{router}", *args, **kwargs)`
Hi, dear, problem with signature for futures
query_string = "&".join([f"{k}={v}" for k, v in sorted(kwargs.items())])
query_string = self.api_key + timestamp + query_string
signature = hmac.new(self.api_secret.encode('utf-8'), query_string.encode('utf-8'), hashlib.sha256).hexdigest()
i tried change:
signature = hmac.new(query_string.encode('utf-8'), self.api_secret.encode('utf-8'), hashlib.sha256).hexdigest()
but same, checked everything is ok i dont know what can be wrong?
The text was updated successfully, but these errors were encountered: