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

cancelOrder() always results in "Not logged in" error [ 401 ] +fix #10

Closed
azidyn opened this issue May 4, 2021 · 3 comments
Closed

Comments

@azidyn
Copy link

azidyn commented May 4, 2021

cancelOrder() and I'd guess any call to a non-GET http method when interal params object is undefined/null results in a quoted empty string being used to form a (bad) signature_payload. These two lines are the culprit:

https://github.com/tiagosiebler/ftx-api/blob/master/src/util/requestWrapper.ts#L191-L192

e.g. should be something like

    const paramsPayload = method == 'GET' ? params : ( params ? JSON.stringify(params) : '' );

cheers!

@tiagosiebler
Copy link
Owner

Good catch, that's a sneaky one! Pushed a beta release, can you confirm if it's working now?

npm install ftx-api@1.0.7-beta.1

Thanks!

@azidyn
Copy link
Author

azidyn commented May 5, 2021

Yep that works, confirmed

sent a USDT tip to your erc20 wallet btw

@azidyn azidyn closed this as completed May 5, 2021
tiagosiebler added a commit that referenced this issue May 5, 2021
fix(#10): signature error for param-less non-GET requests
@tiagosiebler
Copy link
Owner

Yep that works, confirmed

sent a USDT tip to your erc20 wallet btw

Thank you! Just to confirm that the latest version (v1.0.7) now contains this fix.

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

2 participants