nonce must be str

This commit is contained in:
itsdeka
2023-02-27 19:55:53 +01:00
committed by Davide Casale
parent 8266898212
commit b06476e0d4
2 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ class Middleware(object):
assert isinstance(self.API_KEY, str) and isinstance(self.API_SECRET, str), \
"API_KEY and API_SECRET must be both str to call __build_authentication_headers"
nonce = int(round(time.time() * 1_000_000))
nonce = str(round(time.time() * 1_000_000))
if data == None:
path = f"/api/v2/{endpoint}{nonce}"

View File

@@ -174,9 +174,9 @@ class BfxWebsocketClient(object):
async def __authenticate(self, API_KEY, API_SECRET, filter=None):
data = { "event": "auth", "filter": filter, "apiKey": API_KEY }
data["authNonce"] = int(round(time.time() * 1_000_000))
data["authNonce"] = str(round(time.time() * 1_000_000))
data["authPayload"] = "AUTH" + str(data["authNonce"])
data["authPayload"] = "AUTH" + data["authNonce"]
data["authSig"] = hmac.new(
API_SECRET.encode("utf8"),