wisespace-io / binance-rs

Rust Library for the Binance API
Other
649 stars 295 forks source link

Using orderQuoteQty in market orders #65

Closed dorak88783 closed 3 years ago

dorak88783 commented 3 years ago

If you look at the API docs (https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#new-order--trade) for the MARKET order, one can specify either quantity or quoteOrderQty. The latter seems not to be implemented.

How can I do this in a nice way? My only way was to duplicate pub fn market_buy into a pub fn market_buy_using_quote_quantity which uses a OrderQuoteQuantityRequest iso a OrderRequest and a duplicated self.build_quote_quantity_order(buy) iso build_order(buy). This works but duplicates a lot of code... I guess there must be a nicer way in Rust to make this.

dorak88783 commented 3 years ago

Closed in https://github.com/wisespace-io/binance-rs/pull/73.