Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
teambelarus opened this issue Sep 1, 2023 · 3 comments

Comments

@teambelarus
Copy link

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?

@makarworld
Copy link
Owner

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

@Bucanero06
Copy link

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

@teambelarus
Copy link
Author

teambelarus commented Nov 17, 2023 via email

Repository owner locked and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants