Skip to content

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

Description

@confleux

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions