ccex.py 文件源码

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

项目:bitex 作者: nlsdfnbch 项目源码 文件源码
def sign(self, uri, endpoint, endpoint_path, method_verb, *args, **kwargs):
        nonce = self.nonce()
        try:
            params = kwargs['params']
        except KeyError:
            params = {}

        params['apikey'] = self.key
        params['nonce'] = nonce
        post_params = params
        post_params.update({'nonce': nonce, 'method': endpoint})
        post_params = urllib.parse.urlencode(post_params)

        url = uri + post_params

        sig = hmac.new(url, self.secret, hashlib.sha512)
        headers = {'apisign': sig}

        return url, {'headers': headers}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号