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.
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 eitherquantity
orquoteOrderQty
. 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 apub fn market_buy_using_quote_quantity
which uses aOrderQuoteQuantityRequest
iso aOrderRequest
and a duplicatedself.build_quote_quantity_order(buy)
isobuild_order(buy)
. This works but duplicates a lot of code... I guess there must be a nicer way in Rust to make this.