WIP
This commit is contained in:
parent
78df2f7582
commit
da88243db0
2 changed files with 12 additions and 6 deletions
|
|
@ -18,7 +18,7 @@ Error.prototype.toJSON = function () {
|
|||
};
|
||||
|
||||
var poll = function(req, res) {
|
||||
var rateRec = _trader.rate(req.params.currency);
|
||||
var rateRec = _trader.rate();
|
||||
var satoshiBalanceRec = _trader.balance;
|
||||
|
||||
// `rateRec` and `satoshiBalanceRec` are both objects, so there's no danger
|
||||
|
|
@ -40,8 +40,14 @@ var poll = function(req, res) {
|
|||
res.json({
|
||||
err: null,
|
||||
rate: rate * _trader.config.exchanges.settings.commission,
|
||||
fiat: _trader.fiatBalance(0, 0),
|
||||
currency: req.params.currency,
|
||||
fiat: _trader.fiatBalance(0, 0) + 100,
|
||||
locale: {
|
||||
currency: 'CHF',
|
||||
localeInfo: {
|
||||
primaryLocale: 'en-CA',
|
||||
primaryLocales: ['en-CA']
|
||||
}
|
||||
},
|
||||
txLimit: parseInt(_trader.config.exchanges.settings.compliance.maximum.limit, 10)
|
||||
});
|
||||
};
|
||||
|
|
@ -81,7 +87,7 @@ exports.init = function(app, config, trader, authMiddleware) {
|
|||
_lamassuConfig = config;
|
||||
_trader = trader;
|
||||
|
||||
app.get('/poll/:currency', authMiddleware, poll);
|
||||
app.get('/poll', authMiddleware, poll);
|
||||
app.post('/send', authMiddleware, send);
|
||||
app.post('/trade', authMiddleware, trade);
|
||||
app.post('/pair', pair);
|
||||
|
|
|
|||
|
|
@ -254,6 +254,6 @@ Trader.prototype.pollRate = function (callback) {
|
|||
});
|
||||
};
|
||||
|
||||
Trader.prototype.rate = function (currency) {
|
||||
return this.rates[currency];
|
||||
Trader.prototype.rate = function () {
|
||||
return this.rates[this.config.exchanges.settings.currency];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue