Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用新增的okx接口,登录时调用query_open_orders函数,总是报超时的错误 #35

Open
BaoChunhui opened this issue Jul 16, 2023 · 0 comments

Comments

@BaoChunhui
Copy link

登录时会调用query_open_orders函数,总是报错超时,初步debug发现是sign中的msg不对,修改sign函数如下
def sign(self, request: Request) -> Request:
"""signature"""

    now: datetime = datetime.utcnow()
    now = now - timedelta(milliseconds=self.time_offset_ms)
    timestamp: str = now.isoformat("T", "milliseconds") + "Z"


    if request.params:
        path: str = request.path + "?" + urlencode(request.params)
    else:
        path: str = request.path

    if request.data:
        request.data = json.dumps(request.data)
        msg: str = timestamp + request.method + path + request.data
    else:
        msg: str = timestamp + request.method + path

    signature: bytes = generate_signature(msg, self.secret)

问题依然没有解决,怀疑取到timestamp之后过了很久才向服务器发送请求

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant