-
Notifications
You must be signed in to change notification settings - Fork 49
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
Return OrderResponse struct from buy & sell limit #14
Return OrderResponse struct from buy & sell limit #14
Conversation
146d1d3
to
8d1b2af
Compare
@rupurt finally had some time to take a closer look. The problem is that you replaced the config for key/secret with The library needs a string for creating the signature
|
Gotcha. How do you think I should go about testing that? Are you ok with this approach with the environment variables? |
Remove the Also |
@dvcrn I believe the |
Ah yeah, good point! But yeah, in either way, the System.get_env stuff isn't needed inside this project I think. If a project wants to handle the credentials like this, they can just overwrite it in their config. |
@dvcrn updated with the empty strings. It looks like it's still failing with the same problem :{ |
Now it's failing at a different problem though
Not quite sure why this happens. I'll take a closer look later! |
@dvcrn that's the same error I've been seeing on CI. Do you mind trying with an upgraded Erlang/Elixir? |
I added OTP 20 to the travis build matrix. If you rebase master and push, it should matrix build it against 1.5, 1.6, OTP 19 and OTP 20. |
82cd710
to
b72dbcb
Compare
Thanks @dvcrn. Looks like that did the trick :) |
Now the question is why it breaks on OTP 19, and why it didn't before this PR since this doesn't seem to touch any system / time stuff... |
lib/binance.ex
Outdated
@@ -400,6 +402,40 @@ defmodule Binance do | |||
create_order(symbol, "SELL", "MARKET", quantity) | |||
end | |||
|
|||
defp parse_order_response({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you just want to parse a map into a struct, you can use exconstructor which is already a dep of this project
Add use ExConstructor
to your struct (like here
Then use .New()
to parse (like here)
@dvcrn it was untested code. OTP 19 is now a couple of years old and OTP 21 is in rc2. |
@dvcrn cool pattern with |
Looking good, thanks for the fast updates! |
😎 Fwiw OTP 21 got released this week so I added it to the travis config #16 |
Builds upon #13