-
Notifications
You must be signed in to change notification settings - Fork 162
[fix] Unauthorized error #173
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
base: main
Are you sure you want to change the base?
Conversation
|
@cullenwatson Thanks for this fix, I can confirm that it works. Post order doesn't throw unauthenticated errors anymore |
|
@fednerpolymarket @JonathanAmenechi Could you please guys check this PR? It does fixes an issue with |
|
same issue. @cullenwatson and Remember to |
|
OH MY GOD THANK YOU SO MUCH FOR THIS WELL NEEDED PR @cullenwatson DEV. Basically the Python client was doing So the HMAC was computed over a non-canonical string representation of the body ( {"error":"Unauthorized/Invalid api key"} By changing The server gets what it expects I can confirmed it worked after modifying it. I'm no longer getting this API Exception when placing trades:
|
|
Some issue, it works for me. Thanks |
|
Going to test this today |
|
Thanks we'll get this merged |
|
i wouldnt merge yet actually, trying now and it breaks other orders. interesting.. |
Hey, it'd be great to know which ones broke for you. And alright I'll add some more unit testing to see if I can find your issue |
Fixes "Unauthorized/Invalid api key" error
Note
Serialize the request body with compact JSON when building HMAC signatures to ensure cross-language consistency and prevent auth errors.
json.dumps(..., separators=(",", ":"))to serializebodyinbuild_hmac_signature, ensuring a canonical HMAC message across languages.Written by Cursor Bugbot for commit b478b46. This will update automatically on new commits. Configure here.