Permalink
Browse files

update for new bitfloor order entry api

  • Loading branch information...
1 parent faedeaf commit 3896d632e340bf3ddf01134754cc882ada10282c @defunctzombie defunctzombie committed Sep 20, 2012
Showing with 6 additions and 6 deletions.
  1. +3 −6 bin/cli_trader.js
  2. +3 −0 lib/order/bitfloor_rest.js
View
9 bin/cli_trader.js
@@ -18,10 +18,6 @@ if (!process.argv[2]) {
var config = JSON.parse(fs.readFileSync(process.argv[2]));
var exchange = config.exchange;
-// for order entry
-var api_key = config.api_key;
-var sec_key = config.sec_key;
-
// order entry and market data
var host = config.host;
@@ -31,8 +27,9 @@ var trader = trader_builder.build({
protocol: 'rest',
host: host,
port: config.port,
- api_key: api_key,
- sec_key: sec_key,
+ api_key: config.api_key,
+ sec_key: config.sec_key,
+ passphrase: config.passphrase,
});
var rl = readline.createInterface(process.stdin, process.stdout);
View
3 lib/order/bitfloor_rest.js
@@ -14,6 +14,7 @@ var Trader = function(options) {
self.api_key = options.api_key;
self.host = options.host;
self.port = options.port;
+ self.passphrase = options.passphrase;
self.poll_interval = options.poll_interval || 1000;
@@ -166,6 +167,8 @@ Trader.prototype._send = function(url, payload, cb) {
headers: {
'bitfloor-key': self.api_key,
'bitfloor-sign': sign,
+ 'bitfloor-passphrase': self.passphrase,
+ 'bitfloor-version': 1,
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': body.length
}

0 comments on commit 3896d63

Please sign in to comment.