opts.order_type is undefined when Bitfinex API is down! unable to call buy, retrying in 10s
Code
108 buy: function (opts, cb) {
109 var func_args = [].slice.call(arguments)
110 var client = authedClient()
111 if (c.bitfinex.wallet === 'exchange' && typeof opts.order_type === 'maker') {
112 opts.type = 'exchange limit'
113 }
114 else if (c.bitfinex.wallet === 'exchange' && typeof opts.order_type === 'taker') {
115 opts.type = 'exchange market'
116 }
117 if (typeof opts.post_only === 'undefined') {
118 opts.post_only = true
129 }
......
128 var params = {
129 symbol,
130 amount,
131 price,
132 exchange,
133 side,
134 type,
135 is_hidden,
136 is_postonly
137 }
138 console.error(params)
Result of
[ec2-user@ip-10-166-11-188 zen4-bit-2]$ ./zenbot.sh buy
{ symbol: 'ETCUSD',
amount: '7.55683975',
price: '19.6040',
exchange: 'bitfinex',
side: 'buy',
type: undefined,
is_hidden: false,
is_postonly: true }
Bitfinex API is down! unable to call buy, retrying in 10s
placing order...
@nedievas any chance you can take a look into this?
@nedievas Thank you I have a question err.toString('') have to be err.toString().match('')?
FYI, I testing bitfinex backfill with v2 api. it seems well. After testing , I will upload.
Your new code is err.toString(regex)
still can't buy
Bitfinex API is down! unable to call buy, retryin
g in 10s
placing order...
placing order...
placing order...
typeof opts.order_type === 'maker' to be c.order_type === 'maker'
Still it is not fixed. I will give a fix in a few seconds.
c.bitfinex.wallet === 'exchange' && c.order_type === 'maker'
err && err.match && err.match(/Error: Invalid order: not enough exchange balance$/)
pull