binance-exchange / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.
MIT License
528 stars 145 forks source link

specify commission asset #207

Open chriscrutt opened 4 years ago

chriscrutt commented 4 years ago

I cannot find anywhere in the API docs allowing you to specify a commission asset. For some currencies, I would like to use BNB as the commission asset in order to get lower fees while on others I would like to use the base asset for commission fees as the price of BNB might "beat" the price of the current coins which would lead to a loss.

I see that when you get a callback/response from a limit order and/or look at open orders or what have you, it states the commission as well as the commission asset. So is it possible to add the ability to define the commission asset through the API?

edit:

an example could be:

let quantity = 1, price = 11000, commission = "BNB";
binance.buy("BTCUSDT", quantity, price, commission, {type:'LIMIT'}, (error, response) => {
    console.info("Limit Buy response", response);
    console.info("order id: " + response.orderId);
});

or

let quantity = 1, commission = "baseAsset";
binance.marketBuy("ETHBTC", quantity, commission);