Skip to content

Commit 424ab7f

Browse files
committed
fixed bug in portfolioManager
1 parent 7d8c141 commit 424ab7f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

exchanges/mtgox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Trader.prototype.retry = function(method, args) {
8585
}
8686

8787
Trader.prototype.checkUnauthorized = function(err) {
88-
if(err === '[Error: Request failed with 403]')
88+
if(err.message === 'Request failed with 403')
8989
throw 'It appears your ' + this.name + ' API key and secret are incorrect';
9090
}
9191

portfolioManager.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ var events = require("events");
1515
var log = require('./log');
1616
var async = require('async');
1717
var exchangeChecker = require('./exchangeChecker.js');
18+
var exchanges = require('./exchanges.js');
1819

1920
var Manager = function(conf) {
2021
this.exchangeSlug = conf.exchange.toLowerCase();
22+
var exchange = _.find(exchanges, function(e) { return e.slug === this.exchangeSlug }, this);
2123

2224
// create an exchange
2325
var Exchange = require('./exchanges/' + this.exchangeSlug);
@@ -30,8 +32,9 @@ var Manager = function(conf) {
3032
this.order;
3133
this.action;
3234

33-
this.directExchange = conf.direct;
34-
this.infinityOrderExchange = conf.infinityOrder;
35+
this.directExchange = exchange.direct;
36+
this.infinityOrderExchange = exchange.infinityOrder;
37+
this.minimalOrder = exchange.minimalOrder;
3538

3639
this.currency = conf.currency || 'USD';
3740
this.asset = conf.asset || 'BTC';

0 commit comments

Comments
 (0)