Skip to content

Sign

Signature Introduction

Restful API Signature Public Parameters

Headers:

Name Types Mandatory Description
api-key string Y api-key applied
nonce string Y Random string,32bits
timestamp string Y Current timestamp, milliseconds
sign string Y Singanture string

Signature steps:

  1. All queryParams are sorted in ascending ASCII order by Key, Example: String queryParams = "id=1uid=200"
  2. Parameters in body, compressed into a string, remember to remove all spaces, Example:String body = {"uid":"2899","arr":[{"id":1,"name":"maple"},{"id":2,"name":"lily"}]}
  3. Signature, needs to be encrypted 2 times
    • String digest = SHA256(nonce + timestamp + api-key + queryParams + body)
    • String sign = SHA256(digest + secretKey)
    • Note: secretKey is together when applying for api-key. Please keep them safely and do not pass it around.

WebSocket API Singature Parameters

WebSocket API requests require authentication, and the following fields need to be included in all request parameter params:

Name Type Mandatory Description
apiKey string Y API Key
timestamp string Y Timestapmp
nonce string Y Random string
sign string Y Signature string

Signature steps:

  1. Sort all fields in params except the sign field in ascending ASCII order by Key, remember to remove all spaces, Example: String params = "apiKey9a25209b66004da404d9ddcb48d1e11fnonce123456symbolBTCtimestamp1724285700000"
  2. Signature, needs to be encrypted 2 times
    • String digest = SHA256(nonce + timestamp + apiKey + params)
    • String sign = SHA256(digest + secretKey)
    • Note: secretKey is together when applying for apiKey. Please keep them safely and do not pass it around.