def _sign_payload(self, payload):
j = json.dumps(payload).encode('utf-8')
encoded_body = base64.standard_b64encode(j)
h = hmac.new(self.SECRET.encode('utf-8'), encoded_body, hashlib.sha384)
signature = h.hexdigest()
return {
'X-BFX-APIKEY': self.KEY,
'X-BFX-SIGNATURE': signature,
'X-BFX-PAYLOAD': encoded_body,
}
# Packs and sign the payload and send the request with GET.
评论列表
文章目录