Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Polymarket/py-clob-client
Browse files Browse the repository at this point in the history
  • Loading branch information
poly-rodr committed Jul 19, 2024
2 parents f618f77 + 50cf246 commit 16e5a51
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
7 changes: 6 additions & 1 deletion py_clob_client/http_helpers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ def request(endpoint: str, method: str, headers=None, data=None):
)
if resp.status_code != 200:
raise PolyApiException(resp)
return resp.json()

try:
return resp.json()
except requests.JSONDecodeError:
return resp.text

except requests.RequestException:
raise PolyApiException(error_msg="Request exception!")

Expand Down
7 changes: 4 additions & 3 deletions py_clob_client/signing/eip712.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def sign_clob_auth_message(signer: Signer, timestamp: int, nonce: int) -> str:
message=MSG_TO_SIGN,
)
chain_id = signer.get_chain_id()
auth_struct_hash = "0x" + keccak(
clob_auth_msg.signable_bytes(get_clob_auth_domain(chain_id))
).hex()
auth_struct_hash = (
"0x"
+ keccak(clob_auth_msg.signable_bytes(get_clob_auth_domain(chain_id))).hex()
)
return "0x" + signer.sign(auth_struct_hash)
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"poly_eip712_structs>=0.0.1",
"py-order-utils>=0.3.1",
"python-dotenv",
"requests"
],
"requests",
],
project_urls={
"Bug Tracker": "https://github.com/Polymarket/py-clob-client/issues",
},
Expand Down

0 comments on commit 16e5a51

Please sign in to comment.