We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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 request sign error
the original _sign function in nautilus_trader/adapters/okx/http/client.py
def _sign(self, timestamp: str, method: str, url_path: str, body: str) -> str: if body == "{}" or body == "None": body = "" message = str(timestamp) + method.upper() + url_path + body digest = hmac_signature(self._api_secret, message).encode() return base64.b64encode(digest).decode()
and _login function in nautilus_trader/adapters/okx/websocket/client.py
async def _login(self): if self._api_secret is None: raise ValueError("`api_secret` was `None` for private websocket") timestamp = int(self._clock.timestamp()) message = str(timestamp) + "GET/users/self/verify" digest = bytes.fromhex(hmac_signature(self._api_secret, message)) sign = base64.b64encode(digest).decode() payload = { "op": "login", "args": [ { "apiKey": self._api_key, "passphrase": self._passphrase, "timestamp": str(timestamp), "sign": sign, }, ], } await self._send(payload)
result is not expected and get rejected from exchange. cast to byte string solve the error in both websocket and http
digest = bytes.fromhex(hmac_signature(self._api_secret, message))
The text was updated successfully, but these errors were encountered:
Hi @S3toGreen
Thanks for the report.
The OKX integration is still in building status, and so potentially not in a working state.
building
I'll make sure to apply your suggested fix though and credit you in the release notes.
Sorry, something went wrong.
Now fixed from 86b0c0c.
cjdsellers
No branches or pull requests
Bug Report
okx request sign error
the original _sign function in nautilus_trader/adapters/okx/http/client.py
and _login function in nautilus_trader/adapters/okx/websocket/client.py
result is not expected and get rejected from exchange.
cast to byte string solve the error in both websocket and http
The text was updated successfully, but these errors were encountered: