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

Go demo SpotAccountInfo results in "Signature for this request is not valid" #42

Open
confleux opened this issue Mar 15, 2024 · 0 comments

Comments

@confleux
Copy link

Description
I've needed to test signature generation for GET /api/v3/account endpoint. Running mexc-api-demo/go/run demo/Spot Trade results in an error: {"code":700002,"msg":"Signature for this request is not valid."}

Steps to Reproduce

  1. Set up API keys in config/config.go
  2. Make request: go run /run demo/Spot Trade/SpotAccountInfo.go

Actual behavior
Response is: {"code":700002,"msg":"Signature for this request is not valid."}

Expected behavior
Response is {"makerCommission":null, ..., "permissions":["SPOT"]}

Additional context
I've resolved the error for this endpoint.

message := fmt.Sprintf("%s&timestamp=%d", strParams, timestamp)

Changing to this resolved an error:

message := fmt.Sprintf("%stimestamp=%d", strParams, timestamp)

This fix works for GET /api/v3/account, but further testing needed for other endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant