craysiii / binance

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

new mandatory parameters "timeInForce" for certain trade types #24

Closed yawhide closed 6 years ago

yawhide commented 6 years ago

Hello,

Binance now requires timeInForm for certain trade types. Here is their chart:

Type Additional mandatory parameters
LIMIT timeInForce, quantity, price
MARKET quantity
STOP_LOSS quantity, stopPrice
STOP_LOSS_LIMIT timeInForce, quantity, price, stopPrice
TAKE_PROFIT quantity, stopPrice
TAKE_PROFIT_LIMIT timeInForce, quantity, price, stopPrice
LIMIT_MAKER quantity, price
[9] pry(#<Index>)> client.create_test_order(symbol: "ETHBTC", side: "BUY", type: "LIMIT", quantity: "1.00000000")
=> {"code"=>-1102, "msg"=>"Mandatory parameter 'timeInForce' was not sent, was empty/null, or malformed."}
craysiii commented 6 years ago

Hey there, sorry for the late response.

We don't actually validate parameters passed to methods, so you should be able to pass a time_in_force parameter and it should work. Let me know if it doesn't. This should also be reflected in the docs that I have been too lazy and busy to write. Just got back from vacation so some updates should be coming soon.

yawhide commented 6 years ago

for some reason I thought timeInForce was a timestamp thing that you auto generate for me. sorry for bothering

craysiii commented 6 years ago

No worries :)