gferrin / bitfinex

node.js wrapper for bitfinex cryptocurrency exchange
26 stars 20 forks source link

change to new_orders to allow all the options #29

Open treidio opened 6 years ago

treidio commented 6 years ago

so if you want to do an oco order, you can get the parameters from the doco and add them in, otherwise pass {} as additional params.

:)

Bitfinex.prototype.new_order = function(symbol, amount, price, exchange, side, type, additional_params, cb) { var params; params = { symbol: symbol, amount: amount, price: price, exchange: exchange, side: side, type: type }; if (typeof additional_params === 'function') { cb = additional_params; }else { for (var key in additional_params) params[key] = additional_params[key]; } return this.make_request('order/new', params, cb); };