pymexc
pymexc copied to clipboard
{'success': False, 'code': 602, 'message': 'Signature verification failed!'}
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 MEXC Futures API is currently not operational. Information on API availability can be found here -> https://t.me/MEXCAPIsupport
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)`
It's mexc, API futures not supported( thanx