craysiii / binance

API Wrapper for the Binance cryptocurrency exchange written in Ruby.
MIT License
97 stars 79 forks source link

Keep Stream Alive Incorrect Parameter #14

Closed iamjohnford closed 6 years ago

iamjohnford commented 6 years ago

I'm not sure if this is changing in the 1.0 branch but it seems like the listen_key parameter suggested in the comments needs to be listenKey to work properly.

Here's an example to reproduce:

client     = Binance::Client::REST.new api_key: API_KEY, secret_key: SECRET_KEY
listen_key = client.listen_key['listenKey']

# Error case
puts client.keep_stream_alive listen_key: listen_key
# {"code"=>-1102, "msg"=>"Mandatory parameter 'listenKey' was not sent, was empty/null, or malformed."}

# Working case
puts client.keep_stream_alive listenKey: listen_key
# {}
craysiii commented 6 years ago

Hey @iamjohnford

You're right, I messed up on that one.

1.0 is going to be a major overhaul on the REST API. One of the changes I will be making is passing snake_case named-parameters to the endpoint methods and then converting them to camelCase for the user. That way we can improve consistency throughout the codebase and lessen the amount of context switching.

I will make the changes in the code comments, but am really trying to minimize the amount of time i spend on the 0.x branch, since I see it as 'feature' complete and would now like to improve performance and user experience using the gem.

craysiii commented 6 years ago

Fixed by release of 1.0 and changing from camelCase to snake_case keys for REST query option hashes.