pymexc icon indicating copy to clipboard operation
pymexc copied to clipboard

{'success': False, 'code': 602, 'message': 'Signature verification failed!'}

Open teambelarus opened this issue 1 year ago • 3 comments

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?

teambelarus avatar Sep 01 '23 13:09 teambelarus

The MEXC Futures API is currently not operational. Information on API availability can be found here -> https://t.me/MEXCAPIsupport

makarworld avatar Sep 08 '23 10:09 makarworld

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)` 

Bucanero06 avatar Nov 17 '23 01:11 Bucanero06

It's mexc, API futures not supported( thanx

teambelarus avatar Nov 17 '23 16:11 teambelarus