bitfinexcom / bitfinex-api-node

BITFINEX NodeJS trading API - Bitcoin, Litecoin, and Ether exchange
https://www.bitfinex.com/
MIT License
462 stars 213 forks source link

TypeError: cb is not a function on new_order #28

Closed nedievas closed 7 years ago

nedievas commented 7 years ago

[bitfinex@gene bot]$ node bit.js /home/bitfinex/bot/node_modules/bitfinex-api-node/rest.js:67 return cb(new Error(result.message)); ^

TypeError: cb is not a function at Request._callback (/home/bitfinex/bot/node_modules/bitfinex-api-node/rest.js:67:20) at Request.self.callback (/home/bitfinex/bot/node_modules/request/request.js:186:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request. (/home/bitfinex/bot/node_modules/request/request.js:1081:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage. (/home/bitfinex/bot/node_modules/request/request.js:1001:12) at IncomingMessage.g (events.js:291:16) at emitNone (events.js:91:20)

Source code of bit.js:

//Bitfinex REST
var BFX = require('bitfinex-api-node')
var client
client = new BFX.APIRest('testQssd1uasdwe293saedsd4cR', 'testds5rIS5uvsdsdsad65asGkAjdsdx1jU8')

//Trade
client.new_order('btcusd', 0.01, 0.01, 'bitfinex', 'buy', 'exchange limit', false, false, 0)
nedievas commented 7 years ago

amount and price should be strings. is_hidden, ocoorder is not used.