client_auth_v1.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:trading-api-wrappers 作者: delta575 项目源码 文件源码
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.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号