Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Update exchange.js #340

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion extensions/exchanges/gdax/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,14 @@ module.exports = function container (get, set, clear) {
buy: function (opts, cb) {
var func_args = [].slice.call(arguments)
var client = authedClient()
opts.cancel_after = 'day' //order will cancel itself after 1 day
if (typeof opts.post_only === 'undefined') {
opts.post_only = true
}
if (opts.order_type === 'taker') {
delete opts.price
delete opts.post_only
delete opts.cancel_after
opts.type = 'market'
}
delete opts.order_type
Expand All @@ -157,12 +159,14 @@ module.exports = function container (get, set, clear) {
sell: function (opts, cb) {
var func_args = [].slice.call(arguments)
var client = authedClient()
opts.cancel_after = 'day' //order will cancel itself after 1 day
if (typeof opts.post_only === 'undefined') {
opts.post_only = true
}
if (opts.order_type === 'taker') {
delete opts.price
delete opts.post_only
delete opts.cancel_after
opts.type = 'market'
}
delete opts.order_type
Expand Down Expand Up @@ -203,4 +207,4 @@ module.exports = function container (get, set, clear) {
}
}
return exchange
}
}